CN117176807A - Method and device for merging network requests by using request fingerprints - Google Patents

Method and device for merging network requests by using request fingerprints Download PDF

Info

Publication number
CN117176807A
CN117176807A CN202311421807.8A CN202311421807A CN117176807A CN 117176807 A CN117176807 A CN 117176807A CN 202311421807 A CN202311421807 A CN 202311421807A CN 117176807 A CN117176807 A CN 117176807A
Authority
CN
China
Prior art keywords
request
network
requests
component
merging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311421807.8A
Other languages
Chinese (zh)
Other versions
CN117176807B (en
Inventor
刘培
方奕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhou Lingcloud Beijing Technology Co ltd
Original Assignee
Shenzhou Lingcloud Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhou Lingcloud Beijing Technology Co ltd filed Critical Shenzhou Lingcloud Beijing Technology Co ltd
Priority to CN202311421807.8A priority Critical patent/CN117176807B/en
Publication of CN117176807A publication Critical patent/CN117176807A/en
Application granted granted Critical
Publication of CN117176807B publication Critical patent/CN117176807B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a method and a device for merging network requests by using request fingerprints, wherein the method comprises the steps of connecting a request header, a request body and common request parameters of the network requests as request character strings, wherein the network requests are requests sent by components of web pages, and the common request parameters are the same parameters contained in a plurality of network requests; carrying out hash calculation on the request character string to obtain fingerprint information; combining network requests with the same fingerprint information into one network request, and sending the network request to a server; and receiving a return result of the network request, matching corresponding components according to fingerprint information contained in the return result, and rendering the components by using data contained in the return result. The scheme reduces the limit of the number of the simultaneous network requests and increases the number of the simultaneous network requests by combining the network requests, thereby realizing the effects of high concurrency and low delay of the network requests on a large screen.

Description

Method and device for merging network requests by using request fingerprints
Technical Field
The present application relates to the field of computer data processing, and in particular, to a method, apparatus, computer device, and medium for merging network requests using request fingerprints.
Background
In recent years, web-wide screens have been a visualization tool for exposing large amounts of data. The network large screen typically contains many different components, each of which needs to make a request to the server side to retrieve data. The network large screen is generally responsible for presenting data by a browser, and currently, the main current browsers comprise google browser chrome, firefox browser firefox and Microsoft browser edge, the maximum number of concurrent requests is 6, and the requests are processed one by one in a queue mode. Since each component needs to submit one or more requests to the server side, a large number of requests are generated at the same time from the perspective of the whole large screen. The result is thus: increasing network request delay, namely, a large number of requests can cause the delay of the network request to be increased due to the limited maximum concurrent request number of the browser; increasing network traffic, i.e., a large number of requests may cause an increase in network traffic, which may bring processing pressure to the network server; display data inconsistencies, i.e., due to request delays and increased network traffic, may result.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method and apparatus for merging network requests using request fingerprints, to implement merging processing of multiple requests of multiple components, and to return processing results to the component sending the request, render the component, and display processing result data.
In a first aspect, the present application provides a method of merging network requests using a request fingerprint, the method comprising:
in one embodiment, a request header, a request body and a shared request parameter of a network request are connected into a request character string, wherein the network request is a request sent by a component of a webpage, and the shared request parameter is the same parameter contained in a plurality of network requests;
carrying out hash calculation on the request character string to obtain fingerprint information;
combining network requests with the same fingerprint information into one network request, and sending the network request to a server;
and receiving a return result of the network request, matching corresponding components according to fingerprint information contained in the return result, and rendering the components by using data contained in the return result.
In one embodiment, after performing hash calculation on the request string to obtain fingerprint information, the method includes the following steps:
before the component initiates a network request, the fingerprint attribute of the component is null;
after the component initiates the network request, the generated fingerprint information is stored in the fingerprint attribute of the component.
In one embodiment, merging network requests having the same fingerprint information into one network request includes the steps of:
comparing fingerprint information of network requests, and determining the network requests with the same fingerprint information;
placing the network requests with the same fingerprint information in the same network request queue;
acquiring indexes of a network request return result from the network request queue one by one, merging the indexes, and acquiring an index union;
and merging network request parameters according to the index union of the returned result of the network request to obtain a merged network request.
In one embodiment, generating fingerprint information includes the steps of:
when the network request parameters in the network request queue comprise time parameters, extracting the time parameters from the request parameters;
connecting the request header, the request body and the shared request parameter with the time parameter to generate a request character string;
and carrying out hash calculation on the request character string to obtain fingerprint information.
In one embodiment, after merging the network request parameters according to the index union of the returned result of the network request, the method further comprises the following steps:
acquiring the uplink network speed and the downlink network speed of a network;
obtaining response delay time of a server;
when the uplink network speed, the downlink network speed and the response delay time of the server are larger than a preset threshold value, the merging quantity of network request parameters in the network request queue is increased; and when the uplink network speed, the downlink network speed and the response delay time of the server of the network are smaller than a preset threshold value, reducing the merging quantity of network request parameters in the network request queue.
In one embodiment, the network request is sent to a server, and the method further comprises the following steps:
setting a priority according to a data display mode of the component, wherein the data display mode comprises but is not limited to current display, non-display and non-display background processing, and the priority is sequentially from high to low current display, non-display and non-display background processing;
and sending the network requests in turn according to the priority level.
In one embodiment, the network request is sent to a server, and the method further comprises the following steps:
learning the time sequence of the network application of the past component by using a machine learning algorithm to obtain a predicted value of the time sequence of the network application of the component;
determining the ordering of the component initiating requests according to the predicted value of the time sequence of the network application of the component;
and initiating network requests according to the ordering of the component initiation requests.
In one embodiment, matching the corresponding component according to the fingerprint information contained in the returned result includes the following steps:
receiving a return result of the network request;
and comparing the fingerprint in the returned result with the fingerprints stored in the components, and determining the target component of the returned result under the condition that the fingerprints are consistent.
And the target component analyzes the returned result to generate data required by the component.
In a second aspect, an embodiment of the present application provides an apparatus for merging network requests using a request fingerprint, including a fingerprint processing module, a request parameter merging module, and a network request scheduling module;
the fingerprint processing module is used for connecting a request header, a request body and a shared request parameter of a network request as a request character string, wherein the network request is a request sent by a component of a webpage, and the shared request parameter is the same parameter contained in a plurality of network requests; carrying out hash calculation on the request character string to obtain fingerprint information;
the request parameter merging module merges network requests with the same fingerprint information into one network request, and sends the network request to a server;
the network request scheduling module sets a priority level according to a data display mode of the component and/or sends a network request according to a predicted value of a time sequence of network application of the component.
In a third aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program, characterized in that the program is executed by a processor to implement the steps of the method provided by any of the embodiments of the first aspect described above.
In a fourth aspect, an embodiment of the present application provides a computer device, including a memory, a processor and a computer program stored in the memory and executable by the processor, where the processor executes the computer program to implement the steps of the method provided in any of the embodiments of the first aspect.
The above at least one technical scheme adopted by the embodiment of the application can achieve the following beneficial effects: first, the network request of each component of the large screen is subjected to hash calculation to generate fingerprint information, and the fingerprint information is recorded in the attribute of the component. And combining the network requests with the same fingerprint information into one network request, and sending the network request to the server. Then, receiving a network request return result, matching fingerprint information contained in the return result with fingerprint information in the component, and displaying data of the return result by the component. When the network request is merged, the parameters required to be merged can be adjusted according to the preset index of the returned result. And when the network request is sent, the sending of the network request can be adjusted according to the priority, the network transmission condition and the sequence of past network request sending. Therefore, the number limit of simultaneous network requests is reduced by combining network requests, the number of simultaneous network requests is increased, and the network data delay is reduced by sequencing the network requests, so that the effects of high concurrency and low delay of the network requests are realized on a large screen.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a diagram of a network request merge using request fingerprints according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for merging network requests using request fingerprints according to an embodiment of the present application;
FIG. 3 is a flowchart of processing fingerprint information of a network request according to an embodiment of the present application;
FIG. 4 is a flow chart of merging network request parameters according to an embodiment of the present application;
FIG. 5 is a flow chart of network request adjustment provided by an embodiment of the present application;
FIG. 6 is a flow chart of component data rendering provided by an embodiment of the present application;
FIG. 7 is a block diagram of a request for merging network request devices using request fingerprints according to an embodiment of the present application;
fig. 8 is a block diagram of a computer device in accordance with an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a diagram of a configuration of a request for merging network requests using a request fingerprint, which is provided in an embodiment of the present application, and includes a large-screen client 100, a WEB server 120, and a database 130, where the large-screen client includes components, and connects the large-screen client 100 and the WEB server 120 through a communication network 110 for wired or wireless communication.
The large-screen client 100 is a chrome, firefox, edge browser, etc., and the WEB server is a computer server, optionally, the server may also be a cloud server, the client may also be a mobile phone or a browser of a vehicle-mounted computing, etc., and the type of the computer device is not specifically limited in the embodiment of the present application.
Fig. 2 is a flowchart of a method for merging network requests using request fingerprints according to an embodiment of the present application, including steps 210 to 240:
step 210, connecting a request header, a request body and a shared request parameter of a network request as a request character string, wherein the network request is a request sent by a component of a webpage, and the shared request parameter is the same parameter contained in a plurality of network requests;
the network request may be, but is not limited to, HTTP-based, or HTTPs-based.
The request header may be, but is not limited to, HTTP, or the request header part of HTTPs.
The requestor may be, but is not limited to, HTTP, or the requestor BODY part of HTTPs.
The network request parameters may be, but are not limited to, GET, or POST variable parameters.
In this embodiment, the request header, the request body and the shared request parameter of the network request are connected as one request string, and are used as input parameters for hash calculation.
That is, when there are multiple network requests, in the case where the request header, the request body, and the common request parameters are the same, the request strings are the same, thereby facilitating categorization of network requests having the same request string.
And 220, carrying out hash calculation on the request character string to obtain fingerprint information.
In this embodiment, the request string is used as the input parameter for hash calculation, and the hash value is used as the fingerprint information of the network request of the component.
That is, network requests initiated by different components may have the same fingerprint information when the request header, the request body, and the common request parameters are the same, thereby facilitating merging network requests initiated by different components.
Step 230, merging the network requests with the same fingerprint information into one network request, and sending the network request to a server;
in this embodiment, parameters of network requests having the same fingerprint information are integrated, and a plurality of network requests are combined into one.
That is, since there is a limitation in the number of requests for concurrent network requests, the number of concurrent network requests can be enlarged by combining a plurality of network requests into one network request by integrating parameters for network requests having the same fingerprint and different parameters.
Step 240, receiving a return result of the network request, matching corresponding components according to fingerprint information contained in the return result, and rendering the components by using data contained in the return result;
in this embodiment, the returned result includes fingerprint information of the network request, and by matching the fingerprint information of the returned result with the fingerprint information of the network request, the corresponding component can be matched.
That is, the component may obtain the returned result by matching the fingerprint information when the component sends the network request with the fingerprint information of the returned result of the network request. Multiple components with the same fingerprint information obtain the same return result, thereby realizing that one return result is used by multiple components.
Fig. 3 is a flowchart of processing fingerprint information of a network request according to an embodiment of the present application, including steps 310 to 360:
step 310, before the component initiates a network request, the fingerprint attribute of the component is null;
in this embodiment, the component has a fingerprint information attribute whose value is null before the component sends the network request.
Step 320, when the network request parameter in the network request queue includes a time parameter, extracting the time parameter from the request parameter, and executing step 330, otherwise, executing step 340;
in this embodiment, when the network request issued by the component includes a time parameter in the network request queue, the time data to be acquired is the same, and therefore, the time parameter is extracted from the request parameter and used to calculate fingerprint information.
That is, in the network request queue, when the plurality of network requests have the same parameters, the same parameters can be extracted for calculating fingerprint information, thereby reducing the number of network request parameters.
Step 330, connecting the request header, the request body and the shared request parameter with the time parameter to generate a request character string;
in this embodiment, when the network request sent by the component has a time parameter, the request header, the request body, the shared request parameter, and the time parameter of the network request are connected to generate a request string.
Step 340, connecting the request header, the request body and the shared request parameters to generate a request character string;
step 350, hash calculation is carried out on the request character string to obtain fingerprint information;
in this embodiment, hash calculation is performed on the request string to obtain fingerprint information.
And 360, after the component initiates a network request, the generated fingerprint information is stored in the fingerprint attribute of the component.
In this embodiment, fingerprint information is stored in the attributes of the component.
That is, when the component sends the network request, the fingerprint information associated with the network request parameter is stored in the attribute of the component, so that the identifier is set for the component, and the returned result of the network request also contains the fingerprint information, so that the returned result of the network request is convenient to match with the component.
Fig. 4 is a flowchart of combining network request parameters according to an embodiment of the present application, including steps 410 to 440:
step 410, comparing the fingerprint information of the network requests, and determining the network requests with the same fingerprint information;
step 420, placing the network requests with the same fingerprint information in the same network request queue;
step 430, acquiring indexes of a network request return result from the network request queue one by one, merging indexes, and acquiring an index union;
in this embodiment, the return indexes of all network requests are obtained, and the union calculation is performed on all the return indexes, so as to cover all the return results.
That is, all the returned results are subjected to union calculation to obtain returned results including all the network requests, whereby all the network requests are satisfied. For example, one component queries subject test achievements, and returns the results as the subject test achievements. The other component queries the average examination results, and the index of the returned result is the average examination results. Queries of 2 components may be consolidated into query test achievements.
Step 440, merging network request parameters according to the index union of the return result of the network request to obtain a merged network request.
In this embodiment, the network requests are merged according to the index union of the returned results.
That is, in the case where all network requests are satisfied, a part of the limiting parameters of the network requests are removed. For example: one inquiry returns a network request with the result index of being the boy's result, the height and the examination result, and the other inquiry returns a network request with the result index of being the boy's result and the average result, and because the average result of the index is included in the index examination result and the height of the index is not in the other inquiry sentence, 2 inquiries can be combined into one inquiry with the parameter of being the boy's result and the examination result.
Fig. 5 is a flowchart of network request adjustment provided in an embodiment of the present application, including steps 510 to 590:
step 510, selecting a network adjustment request mode, selecting a network state adjustment execution step 520, selecting a priority adjustment execution step 550, and selecting an intelligent adjustment execution step 570;
step 520, obtaining the uplink network speed and the downlink network speed of the network;
step 530, obtaining server response delay time;
step 540, increasing the merging quantity of network request parameters in the network request queue when the uplink network speed, the downlink network speed and the server response delay time are greater than a preset threshold; when the uplink network speed, the downlink network speed and the server response delay time of the network are smaller than a preset threshold value, reducing the merging quantity of network request parameters in the network request queue;
in this embodiment, the merging amount of the network request parameters in the network request queue may be adjusted according to the network condition.
That is, the higher the degree of merging network requests, the greater the amount of network data transfer that results. Therefore, when the network speed is high, the merging quantity of the network request parameters in the network request queue can be increased. Conversely, when the network speed is low, the merging quantity of the network request parameters in the network request queue can be reduced. Thus, smooth display of data on a large screen can be maintained.
Step 550, setting a priority according to a data display mode of the component, wherein the data display mode comprises but is not limited to current display, non-display and non-display background processing, and the priority is sequentially from high to low current display, non-display and non-display background processing;
step 560, sequentially sending network requests according to the priority level;
in this embodiment, the order of network requests in the network request queue may be adjusted according to the priority level of data display.
That is, when the network request is a component that currently needs to be rendered, priority is given to processing, such as: the component is a table of the current page. When the network request is a non-displayed component, it may be processed after priority processing, such as: a table of next pages. When the network request is non-display background data of the webpage, the processing is finally performed.
Step 570, learning the time sequence of the network application of the past component by using a machine learning algorithm, and obtaining a predicted value of the time sequence of the network application of the component;
step 580, determining the ordering of the component initiating requests according to the predicted value of the time sequence of the network application of the component;
step 590, initiating a network request according to the ordering of the component initiation requests.
In this embodiment, the predicted value of the component data display may be set by a machine learning algorithm.
That is, the network request of the past component is learned by the machine learning, and the component to be rendered in the future is known from the predicted value, and the network request can be performed in advance, whereby the network load and the server delay can be reduced. Machine learning methods include, but are not limited to, neural networks, support vector machines.
Fig. 6 is a flowchart of component data rendering according to an embodiment of the present application, including steps 610 to 630:
step 610, receiving a return result of the network request;
step 620, comparing the fingerprint in the returned result with the fingerprint stored in the component, and determining the target component of the returned result when the fingerprints are consistent;
step 630, the target component analyzes the returned result to generate data required by the component;
in this embodiment, the component receives the return result, parses the return result, obtains the required data, and renders the display.
That is, the returned result received by the component is the result of all network requests with the same fingerprint information, and after the component receives the returned result, the component needs to acquire the data required by the component and display the data, for example: when the component is a component for displaying average achievements, the component only needs to acquire the average achievements, and does not need to acquire subject achievements. Thus, the correctness of the display data of the component is ensured.
Fig. 7 is a block diagram of a network request device using request fingerprint combination according to an embodiment of the present application, where:
the network request module 710 sends a request to the WEB server and receives the return result from the WEB server;
the fingerprint processing module 720 connects a request header, a request body and a shared request parameter of a network request as a request character string, wherein the network request is a request sent by a component of a webpage, and the shared request parameter is the same parameter contained in a plurality of network requests; and carrying out hash calculation on the request character string to obtain fingerprint information.
The fingerprint storage unit is used for enabling fingerprint attributes of the component to be null before the component initiates a network request; after the component initiates the network request, the generated fingerprint information is stored in the fingerprint attribute of the component.
The request parameter merging module 730 merges the network requests with the same fingerprint information into one network request, and sends the network request to the server;
the first merging parameter unit is used for comparing fingerprint information of the network requests and determining the network requests with the same fingerprint information; placing the network requests with the same fingerprint information in the same network request queue; acquiring indexes of a network request return result from the network request queue one by one, merging the indexes, and acquiring an index union; and merging network request parameters according to the index union of the returned result of the network request to obtain a merged network request.
The second merging parameter unit is used for extracting the time parameter from the request parameter when the network request parameter in the network request queue comprises the time parameter; connecting the request header, the request body and the shared request parameter with the time parameter to generate a request character string; and carrying out hash calculation on the request character string to obtain fingerprint information.
The network request scheduling module 740 predicts the sending network request according to the network data transmission status, or the priority of the component display data, or the network request of the component.
A network state request scheduling unit for acquiring the uplink network speed and the downlink network speed of the network; obtaining response delay time of a server; when the uplink network speed, the downlink network speed and the response delay time of the server are larger than a preset threshold value, the merging quantity of network request parameters in the network request queue is increased; and when the uplink network speed, the downlink network speed and the response delay time of the server of the network are smaller than a preset threshold value, reducing the merging quantity of network request parameters in the network request queue.
The priority request scheduling unit sets priority according to a data display mode of the component, wherein the data display mode comprises but is not limited to current display, non-display and non-display background processing, and the priority is sequentially from high to low in the current display, non-display and non-display background processing; and sending the network requests in turn according to the priority level.
The intelligent request scheduling unit learns the time sequence of the network application of the past component by using a machine learning algorithm, and obtains a predicted value of the time sequence of the network application of the component; determining the ordering of the component initiating requests according to the predicted value of the time sequence of the network application of the component; and initiating network requests according to the ordering of the component initiation requests.
The component rendering module 750 receives a return result of the network request, matches corresponding components according to fingerprint information contained in the return result, and renders components with data contained in the return result.
The return result processing unit receives a return result of the network request; comparing the fingerprint in the returned result with the fingerprints stored in the components, and determining a target component of the returned result under the condition that the fingerprints are consistent; and the target component analyzes the returned result to generate data required by the component.
The data interaction module 760 receives the request from the large-screen client and returns the request result.
The data acquisition module 770 retrieves data from the database based on the client request.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application therefore also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a method according to any of the embodiments of the application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Fig. 8 is a block diagram of a computer device in accordance with an embodiment of the present application. Further, the present application also proposes a computer device (or computing device) comprising a memory, a processor and a computer program stored on the memory and executable by the processor, said processor implementing a method according to any of the embodiments of the present application when said computer program is executed.
As shown in fig. 8, the electronic device 800 includes a processor 820, a storage device 810, an input device 830, and an output device 840; the number of processors 820 in the electronic device may be one or more, one processor 820 being taken as an example in fig. 8; the processor 820, the memory device 810, the input device 830, and the output device 840 in the electronic device may be connected by a bus or other means, as exemplified in fig. 8 by the bus 850.
The storage device 810 is a computer readable storage medium, and can be used to store a software program, a computer executable program, and a module unit, such as program instructions corresponding to a method for determining a cloud bottom height in an embodiment of the present application.
The storage device 810 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, storage 810 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, storage 810 may further include memory located remotely from processor 820, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 830 may be used to receive input numeric, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 840 may include an electronic device such as a display screen, speaker, etc.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (11)

1. A method for merging network requests using request fingerprints, comprising:
connecting a request header, a request body and a shared request parameter of a network request as a request character string, wherein the network request is a request sent by a component of a webpage, and the shared request parameter is the same parameter contained in a plurality of network requests;
carrying out hash calculation on the request character string to obtain fingerprint information;
combining network requests with the same fingerprint information into one network request, and sending the network request to a server;
and receiving a return result of the network request, matching corresponding components according to fingerprint information contained in the return result, and rendering the components by using data contained in the return result.
2. A method for merging network requests using request fingerprints according to claim 1, characterized in that after hashing the request string to obtain fingerprint information, it comprises the steps of:
before the component initiates a network request, the fingerprint attribute of the component is null;
after the component initiates the network request, the generated fingerprint information is stored in the fingerprint attribute of the component.
3. A method for merging network requests using request fingerprints according to claim 1, wherein the merging network requests having the same fingerprint information into one network request comprises the steps of:
comparing fingerprint information of network requests, and determining the network requests with the same fingerprint information;
placing the network requests with the same fingerprint information in the same network request queue;
acquiring indexes of a network request return result from the network request queue one by one, merging the indexes, and acquiring an index union;
and merging network request parameters according to the index union of the returned result of the network request to obtain a merged network request.
4. A method of merging network requests using a request fingerprint according to claim 2, wherein generating the fingerprint information further comprises the steps of:
when the network request parameters in the network request queue comprise time parameters, extracting the time parameters from the request parameters;
and connecting the request header, the request body and the shared request parameter with the time parameter to generate a request character string.
5. A method of merging network requests using request fingerprints according to claim 3, further comprising the steps of, after merging network request parameters, returning an index union of results according to the network request:
acquiring the uplink network speed and the downlink network speed of a network;
obtaining response delay time of a server;
when the uplink network speed, the downlink network speed and the response delay time of the server are larger than a preset threshold value, the merging quantity of network request parameters in the network request queue is increased; and when the uplink network speed, the downlink network speed and the response delay time of the server of the network are smaller than a preset threshold value, reducing the merging quantity of network request parameters in the network request queue.
6. A method of merging network requests using a request fingerprint according to claim 1, wherein said issuing said network request to a server further comprises the steps of:
setting a priority according to a data display mode of the component, wherein the data display mode comprises but is not limited to current display, non-display and non-display background processing, and the priority is sequentially from high to low current display, non-display and non-display background processing;
and sending the network requests in turn according to the priority level.
7. A method of merging network requests using a request fingerprint according to claim 1, wherein said issuing said network request to a server further comprises the steps of:
learning the time sequence of the network application of the past component by using a machine learning algorithm to obtain a predicted value of the time sequence of the network application of the component;
determining the ordering of the component initiating requests according to the predicted value of the time sequence of the network application of the component;
and initiating network requests according to the ordering of the component initiation requests.
8. A method of merging network requests using request fingerprints according to claim 1, wherein said matching corresponding components based on fingerprint information contained in said returned result comprises the steps of:
receiving a return result of the network request;
comparing the fingerprint in the returned result with the fingerprints stored in the components, and determining a target component of the returned result under the condition that the fingerprints are consistent;
and the target component analyzes the returned result to generate data required by the component.
9. An apparatus for merging network requests using request fingerprints, for implementing the method of any one of claims 1-8, comprising a fingerprint processing module, a request parameter merging module, and a network request scheduling module;
the fingerprint processing module is used for connecting a request header, a request body and a shared request parameter of a network request as a request character string, wherein the network request is a request sent by a component of a webpage, and the shared request parameter is the same parameter contained in a plurality of network requests; carrying out hash calculation on the request character string to obtain fingerprint information;
the request parameter merging module merges network requests with the same fingerprint information into one network request, and sends the network request to a server;
the network request scheduling module sets a priority level according to a data display mode of the component and/or sends a network request according to a predicted value of a time sequence of network application of the component.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-8.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-8 when executing the computer program.
CN202311421807.8A 2023-10-31 2023-10-31 Method and device for merging network requests by using request fingerprints Active CN117176807B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311421807.8A CN117176807B (en) 2023-10-31 2023-10-31 Method and device for merging network requests by using request fingerprints

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311421807.8A CN117176807B (en) 2023-10-31 2023-10-31 Method and device for merging network requests by using request fingerprints

Publications (2)

Publication Number Publication Date
CN117176807A true CN117176807A (en) 2023-12-05
CN117176807B CN117176807B (en) 2024-01-26

Family

ID=88943439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311421807.8A Active CN117176807B (en) 2023-10-31 2023-10-31 Method and device for merging network requests by using request fingerprints

Country Status (1)

Country Link
CN (1) CN117176807B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140281919A1 (en) * 2013-03-15 2014-09-18 Webroot Inc. Detecting a change to the content of information displayed to a user of a website
CN109145080A (en) * 2018-07-26 2019-01-04 新华三信息安全技术有限公司 A kind of text fingerprints preparation method and device
US20200279010A1 (en) * 2019-03-01 2020-09-03 Salesforce.Com, Inc. Rule-based content caching
CN113746932A (en) * 2021-09-10 2021-12-03 城云科技(中国)有限公司 Network request merging method and device, electronic device and computer program product
CN115017441A (en) * 2022-06-02 2022-09-06 深信服科技股份有限公司 Asset classification method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140281919A1 (en) * 2013-03-15 2014-09-18 Webroot Inc. Detecting a change to the content of information displayed to a user of a website
CN109145080A (en) * 2018-07-26 2019-01-04 新华三信息安全技术有限公司 A kind of text fingerprints preparation method and device
US20200279010A1 (en) * 2019-03-01 2020-09-03 Salesforce.Com, Inc. Rule-based content caching
CN113746932A (en) * 2021-09-10 2021-12-03 城云科技(中国)有限公司 Network request merging method and device, electronic device and computer program product
CN115017441A (en) * 2022-06-02 2022-09-06 深信服科技股份有限公司 Asset classification method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN117176807B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
CN107145496B (en) Method for matching image with content item based on keyword
JP5984917B2 (en) Method and apparatus for providing suggested words
US20110231784A1 (en) System and method for desktop application migration
CN104408159B (en) A kind of data correlation, loading, querying method and device
CN110968824A (en) Page data processing method and device
KR102361112B1 (en) Extracting similar group elements
CN105224554A (en) Search word is recommended to carry out method, system, server and the intelligent terminal searched for
JP2022543180A (en) Visualization method and related device
CN109661662A (en) Query result is subjected to ranking for correlation using external context
US20140337326A1 (en) Topical Mapping
US20200394448A1 (en) Methods for more effectively moderating one or more images and devices thereof
CN110020236B (en) Webpage parsing method, device, storage medium, processor and equipment
CN106933817B (en) Content query method, device and system based on B/S structure
US11782888B2 (en) Dynamic multi-platform model generation and deployment system
CN115827084A (en) Data processing method, device, equipment and storage medium
CN113946399A (en) Spatial data loading method and device
CN114329281A (en) Rendering server, webpage rendering method and webpage rendering device
CN106294417A (en) A kind of data reordering method, device and electronic equipment
CN117176807B (en) Method and device for merging network requests by using request fingerprints
CN112882890A (en) Log collection method and device
CN111125087B (en) Data storage method and device
CN106886546B (en) Construction method and equipment of data website
CN114186148A (en) Page loading method and device, electronic equipment and storage medium
JP2018120576A (en) Method and device for generating web page
CN106682221B (en) Question-answer interaction response method and device and question-answer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant