Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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

Active Publication Date: 2021-12-03
CITY CLOUD TECH HANGZHOU CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, there are many disadvantages in this method. First of all, this method will undoubtedly increase the workload of front-end developers. Secondly, when there are multiple nested components, the nesting logic between the parent component and the child component will be very complicated. Manual processing The method is not only inefficient but also prone to nesting errors

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Network request merging method and device, electronic device and computer program product
  • Network request merging method and device, electronic device and computer program product
  • Network request merging method and device, electronic device and computer program product

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a network request merging method and device, an electronic device and a computer program product, and the method comprises the steps: obtaining a plurality of to-be-merged requests, and extracting corresponding request identifiers from the to-be-merged requests; placing the to-be-merged requests with the same request identifier in the same request group in a request queue, wherein the request group comprises a request representation, a request data object and one or more callback method groups; and sending the request data objects in all the request groups. The network requests requesting the same data are prevented from being repeatedly sent, a large amount of network resources and server resources are saved, a large amount of repeated work of front-end developers is relieved, and the efficiency of front-end modularization programming is improved.

Description

technical field [0001] The present application relates to the field of data interaction, in particular to a network request merging method, device, electronic device, and computer program product. Background technique [0002] Front-end component programming is prevalent. Multiple identical components or multiple different components requesting the same data may be displayed on a web page at the same time. When there are network requests in this component, the current practice of front-end developers is to artificially combine multiple The network requests of the subcomponents are extracted to the common parent component to ensure that the corresponding subcomponents no longer contain network requests. The purpose of this is to avoid multiple subcomponents requesting the same data in a parent component. Multiple identical network requests will be initiated at the same time, resulting in a waste of network resources and server resources. [0003] Exemplarily, if there are mu...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08
CPCH04L67/02H04L67/60
Inventor 李开民谢淼烽毛云青杨恒飞王泽宇
Owner CITY CLOUD TECH HANGZHOU CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products