Network request merging method and device, electronic device and computer program product
A computer program and network request technology, applied in the field of data interaction, can solve the problems of increasing the workload of front-end developers, inefficient manual processing, complex nesting logic, etc., to save network resources and server resources, reduce waste, avoid The effect of repeated sending
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] This embodiment provides a network request merging method. In this embodiment, the method extracts the key information in the network request as the request identifier, and classifies the network requests with the same request identifier, because the network requests with the same request identifier The request data object of the request is the same, but the callback method group of each network request is different, so only one copy of the request data object needs to be kept in each request group, but the callback method group of each network request needs to be kept. When sending at the end, you only need to send one copy of the request data object in each request group to the server, and after the server returns the corresponding request data, call the corresponding callback method in the request group for processing. It should be noted that the callback method group includes the callback method for successfully processing the request data and the callback method for...
Embodiment 2
[0054] Based on the same idea, this embodiment also provides a device for merging network requests, which is used to implement the method for merging network requests described in Embodiment 1. For details, refer to image 3 , image 3 is a structural block diagram of a device for merging network requests according to an embodiment of the present application, such as image 3 As shown, the device includes the following modules:
[0055] The first acquiring module: used to acquire multiple requests to be merged, and extract corresponding request identifiers from the requests to be merged;
[0056] The first merging module: for placing the requests to be merged with the same request ID into the same request group in the request queue, wherein the request group includes a request representation, a request data object, and one or more callback method groups ;
[0057] The first sending module: used to send the request data objects in all the request groups.
Embodiment 3
[0059] This embodiment also provides an electronic device, refer to Figure 4 , including a memory 404 and a processor 402, where a computer program is stored in the memory 404, and the processor 402 is configured to run the computer program to execute the steps of any network request merging method in the first embodiment above.
[0060] Specifically, the processor 402 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC for short), or may be configured to implement one or more integrated circuits in the embodiments of the present application.
[0061]Wherein, the memory 404 may include a mass memory 404 for data or instructions. By way of example and not limitation, the memory 404 may include a hard disk drive (Hard Disk Drive, referred to as HDD), a floppy disk drive, a solid state drive (Solid State Drive, referred to as SSD), flash memory, optical disk, magneto-optical disk, magnetic tape or general serial A bus (UniversalSeria...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com