CN116896587A - Processing method and device for repeated network request, computer equipment and storage medium - Google Patents

Processing method and device for repeated network request, computer equipment and storage medium Download PDF

Info

Publication number
CN116896587A
CN116896587A CN202310660976.0A CN202310660976A CN116896587A CN 116896587 A CN116896587 A CN 116896587A CN 202310660976 A CN202310660976 A CN 202310660976A CN 116896587 A CN116896587 A CN 116896587A
Authority
CN
China
Prior art keywords
request
function
target
target request
parameters
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.)
Pending
Application number
CN202310660976.0A
Other languages
Chinese (zh)
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.)
Guangzhou Sandianjiyuan Intelligent Technology Co ltd
Original Assignee
Guangzhou Sandianjiyuan Intelligent 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 Guangzhou Sandianjiyuan Intelligent Technology Co ltd filed Critical Guangzhou Sandianjiyuan Intelligent Technology Co ltd
Priority to CN202310660976.0A priority Critical patent/CN116896587A/en
Publication of CN116896587A publication Critical patent/CN116896587A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The application relates to the technical field of computers, and particularly discloses a method and a device for processing repeated network requests, computer equipment and a storage medium. According to the method, the first function and the second function are processed to obtain the target request initiating function, the first function for initiating the request and the second function for judging whether the request is repeated are enabled to be sub-functions, when whether the target request is repeated or not is judged, the target request initiating function can directly call the second function to judge, all calls of the target request initiating function can access the same cache area, when the same target request exists in the cache area, the same promise object is called, and all the same target request can be responded, so that the processing of the repeated network request is realized, and the data cache is effectively reduced.

Description

Processing method and device for repeated network request, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for processing a repeated network request, a computer device, and a storage medium.
Background
In the prior art, some additional programs are made for solving the problem of repeated requests, such as front request and data cache addition, but additional codes are generated, and the problems of untimely data update, slow page loading, blocking and the like are caused after the data cache addition. Therefore, how to reduce the data cache when the duplicate request is removed becomes a problem to be solved.
Disclosure of Invention
The application provides a method, a device, computer equipment and a storage medium for processing repeated network requests, so as to reduce data caching in the process of removing the repeated requests.
In a first aspect, the present application provides a method for processing a repeated network request, the method comprising:
when a network request is received, processing a first function and a second function to obtain a request initiating function, and generating a first target request based on the network request and the request initiating function;
when the number of the first target requests is not the same, acquiring the input parameters of the first function, calling the second function to receive the input parameters, and acquiring the output parameters;
and calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in state based on the outgoing parameter, and respectively responding to the first target request and the second target request.
Further, before determining that there is a second target request that is the same as the first target request and that is both in an in-request state based on the outgoing parameter, further comprising:
determining that the first target request is the same as the second target request when the outgoing parameters of the first target request are the same as the outgoing parameters of the second target request;
and when the key words corresponding to the outgoing parameters exist in the cache area, determining that the first target request and the second target request are in the request state in the cache area.
Further, after determining that the first target request is the same as the second target request when the outgoing parameters of the first target request are the same as the outgoing parameters of the second target request, the method further includes:
when the key words corresponding to the outgoing parameters do not exist in the cache area, calling the first function to receive the incoming parameters, and obtaining the promised object;
and creating a keyword taking the promise object as a value in the cache area.
Further, when it is determined that there is a second target request identical to the first target request and both the target requests are in an in-request state based on the outgoing parameters, invoking a promise object corresponding to the outgoing parameters in a buffer area, and after responding to the first target request and the second target request respectively, further includes:
and deleting the keyword when the state of the promised object is updated to be a successful state.
Further, the status of the commitment object includes a failure status, an in-request status, and the success status.
Further, when the network request is received, the processing the first function and the second function to obtain a request initiating function includes:
and taking the first function and the second function as parameters, and inputting the parameters into the third function to obtain the request initiating function.
Further, the outgoing parameter is a character string representing a keyword.
In a second aspect, the present application also provides a processing apparatus for repeating a network request, the apparatus comprising:
the target request generation module is used for processing the first function and the second function when the network request is received, obtaining a request initiation function, and generating a first target request based on the network request and the request initiation function;
the outgoing parameter obtaining module is used for obtaining the incoming parameters of the first function when the number of the first target requests is not the same, calling the second function to receive the incoming parameters, and obtaining the outgoing parameters;
and the request execution module is used for calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in-request state based on the outgoing parameter, and respectively responding to the first target request and the second target request.
In a third aspect, the present application also provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and implement the method for processing a repeat network request as described above when the computer program is executed.
In a fourth aspect, the present application also provides a computer readable storage medium storing a computer program, which when executed by a processor causes the processor to implement a method for processing a repeat network request as described above.
The application discloses a processing method, a device, computer equipment and a storage medium for repeated network requests, wherein when a network request is received, a first function and a second function are processed to obtain a request initiating function, and a first target request is generated based on the network request and the request initiating function; when the number of the first target requests is not the same, acquiring the input parameters of the first function, calling the second function to receive the input parameters, and acquiring the output parameters; and calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in state based on the outgoing parameter, and respectively responding to the first target request and the second target request. According to the method, the first function and the second function are processed to obtain the target request initiating function, the first function for initiating the request and the second function for judging whether the request is repeated are enabled to be sub-functions, when whether the target request is repeated or not is judged, the target request initiating function can directly call the second function to judge, all calls of the target request initiating function can access the same cache area, when the same target request exists in the cache area, the same promise object is called, and all the same target request can be responded, so that the processing of the repeated network request is realized, and the data cache is effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a first embodiment of a method for processing a repeat network request provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of generating a request initiation function for a method for processing a repeat network request according to an embodiment of the present application;
FIG. 3 is a flow chart of a second embodiment of a method for processing a repeat network request provided by an embodiment of the present application;
FIG. 4 is a schematic flow chart of a request response for repeating a network request according to an embodiment of the present application;
FIG. 5 is a flow chart of a third embodiment of a method for processing a repeat network request provided by an embodiment of the present application;
FIG. 6 is a schematic block diagram of an apparatus for processing duplicate network requests provided by an embodiment of the application;
fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are 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 flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
The embodiment of the application provides a method, a device, computer equipment and a storage medium for processing repeated network requests. The method for processing the repeated network requests can be applied to a server, and the data cache in the repeated request removal process is reduced by calling the same promise object and responding to all the same target requests. The server may be an independent server or a server cluster.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flow chart of a processing method for repeating a network request according to an embodiment of the present application. The processing method of the repeated network request can be applied to a server and used for calling the same promise object, responding to all the same target requests and reducing data caching in the repeated request removing process.
As shown in fig. 1, the processing method of the repeat network request specifically includes steps S101 to S103.
S101, when a network request is received, processing a first function and a second function to obtain a request initiating function, and generating a first target request based on the network request and the request initiating function.
When a network request is received, the first function and the second function are processed to obtain a request initiating function, which comprises the following steps: and taking the first function and the second function as parameters, and inputting the parameters into the third function to obtain the request initiating function.
In one embodiment, a function refers to a program or code that may be directly referenced by another program or code, also called a subroutine, a method.
In a specific embodiment, as shown in fig. 2, a new request initiation function is generated based on the packaged third function using the first function and the second function as parameters.
In one embodiment, the incoming parameters of the request initiation function are the same as the incoming parameters of the first function.
In one embodiment, the first function is used to initiate a network request, and the incoming parameters of the first function are not limited, and may be some ID that determines the data to be acquired by the request, or the number of pieces, pages, etc. of the data to be acquired, and the first function returns a commitment object according to the incoming parameters.
Wherein, the promise object (promise object) is an object returned by the asynchronous operation and is used for transmitting the message of the asynchronous operation; it has three states: an initial state (to-be-fixed state); fulfiled: a successful state; reject: failure state. Typically used in requests, the returned data may be obtained in the successful state. Promise objects in pending state will be honored by a value and will be rejected for a reason (error).
In one embodiment, a first target request is initiated according to a request initiation function.
S102, when the number of the first target requests is not the same, acquiring the input parameters of the first function, calling the second function to receive the input parameters, and acquiring the output parameters.
In one embodiment, the outgoing parameter is a string representing a keyword.
In one embodiment, the second function is configured to receive the incoming parameters from the first function and explicitly return a string as an outgoing parameter identifying whether the network request is a duplicate request, e.g., the first function receives a parameter as a data ID, and the second function also receives a data ID parameter, where the second function may take the data ID parameter as a return value, i.e., an outgoing parameter, indicating that the same network request exists when the same outgoing parameter is encountered.
In one embodiment, the outgoing parameters are used to determine whether the request is repeated. In the calling of the multiple target request initiation functions, a second function is executed first, at this time, the input parameters of the request initiation functions are transferred to the second function, and the second function returns a keyword character string for distinguishing whether the request is repeated or not according to the input parameters.
Wherein the key is the number of the value stored by the key, the key value: data to be stored, for example, "ID:170", key" ID ", key value" 170".
And S103, based on the outgoing parameters, when the second target requests which are the same as the first target requests exist and are in the in-request state, invoking the promise objects corresponding to the outgoing parameters in the cache area, and respectively responding to the first target requests and the second target requests.
Based on the outgoing parameters, when it is determined that there is a second target request identical to the first target request and both the second target request and the first target request are in an in-request state, invoking a promise object corresponding to the outgoing parameters in a cache area, and after responding to the first target request and the second target request respectively, further including: and deleting the keyword when the state of the promised object is updated to be a successful state.
The status of the commitment object includes a failure status, an in-request status, and the success status.
In one embodiment, according to the outgoing parameters obtained by the second function, whether the current character string has a key (key word) in the buffer area is queried in the buffer area, so as to determine whether there is an incomplete request.
In one embodiment, if the current key string has no key in the buffer, it indicates that there is no unfinished request, then the first function is called to initiate a network request, to obtain a promiscuous object, and a key is created in the buffer, where the key value of the key is a promiscuous object obtained by the first function.
In one embodiment, if the current key string already has a key in the buffer, i.e., in the request, the promiscuous corresponding to the key is returned directly. And deleting the key in the buffer area after the promise state is finished.
In one embodiment, based on the closure characteristic of JavaScript, all calls requesting to initiate a function access the same buffer, ensuring that multiple function calls employ the same buffer for obtaining the request state. Wherein, the closure is a function capable of reading other function internal variables. In javascript, only sub-functions inside a function can read local variables, so a closure can be understood as a "function defined inside one function". In essence, a closure is a bridge that connects the inside of a function to the outside of the function.
The above embodiments provide a method, an apparatus, a computer device, and a storage medium for processing a repeated network request, where when a network request is received, the first function and the second function are processed to obtain a request initiation function, and a first target request is generated based on the network request and the request initiation function; when the number of the first target requests is not the same, acquiring the input parameters of the first function, calling the second function to receive the input parameters, and acquiring the output parameters; and calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in state based on the outgoing parameter, and respectively responding to the first target request and the second target request. According to the method, the first function and the second function are processed to obtain the target request initiating function, the first function for initiating the request and the second function for judging whether the request is repeated are enabled to be sub-functions, when whether the target request is repeated or not is judged, the target request initiating function can directly call the second function to judge, all calls of the target request initiating function can access the same cache area, when the same target request exists in the cache area, the same promise object is called, and all the same target request can be responded, so that the processing of the repeated network request is realized, and the data cache is effectively reduced.
Referring to fig. 3, fig. 3 is a schematic flowchart of a processing method for repeating a network request according to an embodiment of the present application. The processing method of the repeated network request can be applied to a server and used for calling the same promise object, responding to all the same target requests and reducing data caching in the repeated request removing process.
As shown in fig. 3, the processing method of the repeat network request specifically includes steps S201 to S202.
S201, when the outgoing parameters of the first target request are the same as those of the second target request, determining that the first target request is the same as the second target request;
s202, when keywords corresponding to the outgoing parameters exist in the cache region, determining that the first target request and the second target request are in the request state in the cache region.
In one embodiment, a second function encapsulated in the first target request is called, outgoing parameters are obtained according to the incoming parameters, similarly, a second function encapsulated in the second target request is called, outgoing parameters are obtained, and when the two outgoing parameters are identical, it is determined that the first target request and the second target request are repeated requests.
In one embodiment, the outgoing parameter is a key string, and the cache is queried for the presence of a key with an outgoing parameter value, and if so, the first target request and the second target request are already in the in-request state.
For example, as shown in fig. 4, if the strings returned by the second functions of the request C1, the request C2, the request C3, the request C4, and the request C5, that is, the target request generated by the request initiation function according to the incoming parameters of the initial network request are the key1, the request C2, and the request C3 are repeated requests, and similarly, the request C4 and the request C5 are repeated requests. And searching whether key keys with character strings of key1 and key2 exist in the cache region, if so, indicating that the request is in a request state, and directly calling a promise corresponding to the key keys to realize response of the request.
Referring to fig. 5, fig. 5 is a schematic flowchart of a processing method for repeating a network request according to an embodiment of the present application. The processing method of the repeated network request can be applied to a server and used for calling the same promise object, responding to all the same target requests and reducing data caching in the repeated request removing process.
As shown in fig. 5, the processing method of the repeated network request specifically includes steps S301 to S302.
S301, when a keyword corresponding to the outgoing parameter does not exist in the cache area, calling the first function to receive the incoming parameter, and obtaining the promised object;
s302, creating a keyword taking the promised object as a value in the cache area.
In one embodiment, if a key with a value of an outgoing parameter does not exist in the buffer, it is indicated that there is no current first target request in the waiting area, a first function in a request initiation function calling the first target request generates a precursor object according to the incoming parameter, and a key is created in the buffer, where the value of the key is precursor.
For example, as shown in fig. 4, if the request C1 and the request C4 do not find a key corresponding to the key string in the cache, the first function is called to generate a promiscuous object according to the input parameter, the key is created in the cache, the request C1 and the request C4 are marked as states in the request, and further, the promiscuous corresponding to the key is called to complete the response of the request.
In one embodiment, only the first function of one of the requests need be called to obtain a promise object for repeated requests.
In one embodiment, the outgoing parameters of the repeated requests are the same, so that the repeated requests can be respectively and correspondingly multiple repeated requests only by calling the first function once and only by calling the promise once.
Referring to fig. 6, fig. 6 is a schematic block diagram of a processing apparatus for processing a repeat network request according to an embodiment of the present application, where the processing apparatus is configured to execute the foregoing processing method for a repeat network request. Wherein the processing means for repeating the network request may be configured at the server.
As shown in fig. 6, the processing apparatus 500 for repeating a network request includes:
the target request generating module 501 is configured to process the first function and the second function when a network request is received, obtain a request initiation function, and generate a first target request based on the network request and the request initiation function;
an outgoing parameter obtaining module 502, configured to obtain an incoming parameter of the first function when the number of the first target requests is not the same, call the second function to receive the incoming parameter, and obtain an outgoing parameter;
a request execution module 503, configured to invoke, in a cache, a committed object corresponding to the outgoing parameter when it is determined that there is a second target request that is the same as the first target request and is in an in-request state, based on the outgoing parameter, where the committed object is respectively responsive to the first target request and the second target request.
In one embodiment, the processing apparatus 500 for repeating network requests further includes a repeat request and request status determination module, where the repeat request and request status determination module includes:
a repeat request determining unit configured to determine that the first target request is identical to the second target request when the outgoing parameter of the first target request is identical to the outgoing parameter of the second target request;
and the request state determining unit is used for determining that the first target request and the second target request are in the request state in the cache region when the key words corresponding to the outgoing parameters exist in the cache region.
In one embodiment, the repeated request and request state determination module further includes:
an incoming parameter receiving unit, configured to invoke the first function to receive the incoming parameter when a keyword corresponding to the outgoing parameter does not exist in the buffer area, so as to obtain the promised object;
and the keyword creation unit is used for creating a keyword taking the promised object as a value in the cache area.
In one embodiment, the processing apparatus 500 for repeating a network request further includes:
and the keyword deleting unit is used for deleting the keyword when the state of the promised object is updated to be a successful state.
In one embodiment, the status of the commitment object includes a failure status, an in-request status, and the success status.
In one embodiment, the target request generation module 501 includes:
and the request initiation obtaining unit is used for inputting the first function and the second function serving as parameters into the third function to obtain the request initiation function.
In one embodiment, the outgoing parameter is a string representing a keyword.
It should be noted that, for convenience and brevity of description, the specific working process of the apparatus and each module described above may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 7.
Referring to fig. 7, fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
With reference to FIG. 7, the computer device includes a processor, memory, and a network interface connected by a system bus, where the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions that, when executed, cause the processor to perform any of a number of ways of processing repeated network requests.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by a processor, causes the processor to perform any of a number of ways of processing repeated network requests.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
when a network request is received, processing a first function and a second function to obtain a request initiating function, and generating a first target request based on the network request and the request initiating function;
when the number of the first target requests is not the same, acquiring the input parameters of the first function, calling the second function to receive the input parameters, and acquiring the output parameters;
and calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in state based on the outgoing parameter, and respectively responding to the first target request and the second target request.
In one embodiment, the processor, prior to implementing determining that there is a second target request that is the same as the first target request and that is both in an in-request state based on the outgoing parameters, is further to implement:
determining that the first target request is the same as the second target request when the outgoing parameters of the first target request are the same as the outgoing parameters of the second target request;
and when the key words corresponding to the outgoing parameters exist in the cache area, determining that the first target request and the second target request are in the request state in the cache area.
In one embodiment, the processor, after implementing that the outgoing parameters of the first target request are the same as the outgoing parameters of the second target request, is further to implement:
when the key words corresponding to the outgoing parameters do not exist in the cache area, calling the first function to receive the incoming parameters, and obtaining the promised object;
and creating a keyword taking the promise object as a value in the cache area.
In one embodiment, when the processor determines that there is a second target request identical to the first target request and both are in the in-request state based on the outgoing parameter, the processor invokes a promise object corresponding to the outgoing parameter in a cache area, and after responding to the first target request and the second target request respectively, the processor is further configured to implement:
and deleting the keyword when the state of the promised object is updated to be a successful state.
In one embodiment, the status of the commitment object includes a failure status, an in-request status, and the success status.
In one embodiment, the processor, when implementing that the first function and the second function are processed when receiving the network request, is configured to implement:
and taking the first function and the second function as parameters, and inputting the parameters into the third function to obtain the request initiating function.
In one embodiment, the outgoing parameter is a string representing a keyword.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize any method for processing the repeated network request provided by the embodiment of the application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A method for processing a repeat network request, comprising:
when a network request is received, processing a first function and a second function to obtain a request initiating function, and generating a first target request based on the network request and the request initiating function;
when the number of the first target requests is not the same, acquiring the input parameters of the first function, calling the second function to receive the input parameters, and acquiring the output parameters;
and calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in state based on the outgoing parameter, and respectively responding to the first target request and the second target request.
2. The method of claim 1, wherein the determining that there is a second target request that is identical to the first target request and that is both in an in-request state based on the outgoing parameter, further comprises:
determining that the first target request is the same as the second target request when the outgoing parameters of the first target request are the same as the outgoing parameters of the second target request;
and when the key words corresponding to the outgoing parameters exist in the cache area, determining that the first target request and the second target request are in the request state in the cache area.
3. The method according to claim 2, wherein after determining that the first target request is identical to the second target request when the outgoing parameters of the first target request are identical to the outgoing parameters of the second target request, further comprising:
when the key words corresponding to the outgoing parameters do not exist in the cache area, calling the first function to receive the incoming parameters, and obtaining the promised object;
and creating a keyword taking the promise object as a value in the cache area.
4. The method according to claim 1, wherein when determining that there is a second target request identical to the first target request and both are in an in-request state based on the outgoing parameter, invoking a commitment object corresponding to the outgoing parameter in a buffer, after responding to the first target request and the second target request, respectively, further comprises:
and deleting the keyword when the state of the promised object is updated to be a successful state.
5. The method of claim 4, wherein the status of the commitment object includes a failure status, an in-request status, and the success status.
6. The method for processing the repeated network request according to claim 1, wherein the processing the first function and the second function to obtain the request initiation function when the network request is received includes:
and taking the first function and the second function as parameters, and inputting the parameters into the third function to obtain the request initiating function.
7. The method of any of claims 1-6, wherein the outgoing parameter is a string representing a keyword.
8. A processing apparatus for repeating a network request, comprising:
the target request generation module is used for processing the first function and the second function when the network request is received, obtaining a request initiation function, and generating a first target request based on the network request and the request initiation function;
the outgoing parameter obtaining module is used for obtaining the incoming parameters of the first function when the number of the first target requests is not the same, calling the second function to receive the incoming parameters, and obtaining the outgoing parameters;
and the request execution module is used for calling a promise object corresponding to the outgoing parameter in a cache area when determining that a second target request which is the same as the first target request exists and is in a request-in-request state based on the outgoing parameter, and respectively responding to the first target request and the second target request.
9. A computer device, the computer device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor being configured to execute the computer program and to implement the method of processing repeated network requests according to any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the method of processing a repeat network request according to any one of claims 1 to 7.
CN202310660976.0A 2023-06-05 2023-06-05 Processing method and device for repeated network request, computer equipment and storage medium Pending CN116896587A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310660976.0A CN116896587A (en) 2023-06-05 2023-06-05 Processing method and device for repeated network request, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310660976.0A CN116896587A (en) 2023-06-05 2023-06-05 Processing method and device for repeated network request, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116896587A true CN116896587A (en) 2023-10-17

Family

ID=88311406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310660976.0A Pending CN116896587A (en) 2023-06-05 2023-06-05 Processing method and device for repeated network request, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116896587A (en)

Similar Documents

Publication Publication Date Title
US10698885B2 (en) Method and device for writing service data in block chain system
JP2019536153A (en) Smart contract processing method and apparatus
CN110019080B (en) Data access method and device
US20200142674A1 (en) Extracting web api endpoint data from source code
US10013249B2 (en) Identifying user managed software modules
CN113434582B (en) Service data processing method and device, computer equipment and storage medium
CN117216758B (en) Application security detection system and method
US20140207848A1 (en) Client-side aggregation of nested resource dependencies
CN111694992A (en) Data processing method and device
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
CN116896587A (en) Processing method and device for repeated network request, computer equipment and storage medium
JP2002342403A (en) Device/method for detecting false path and its program
CN107305582B (en) Metadata processing method and device
CN111476663B (en) Data processing method and device, node equipment and storage medium
CN116301758B (en) Rule editing method, device, equipment and medium based on event time points
US20090313628A1 (en) Dynamically batching remote object model commands
CN108984450B (en) Data transmission method, device and equipment
CN110427391B (en) Method, apparatus and computer program product for determining duplicate data
CN116192776A (en) Message order-preserving method and device capable of self-repairing, terminal and storage medium
CN117251419A (en) File monitoring method and device, electronic equipment and storage medium
CN117873694A (en) Heap space allocation method, heap space allocation device, electronic equipment and storage medium
CN117453739A (en) Configuration data query method, device, server and storage medium
CN116701474A (en) Request response method, request response device, electronic equipment and storage medium
CN116910809A (en) Label information processing method, device, equipment and storage medium based on Handle system
CN117785148A (en) Hook function generation method and device, electronic equipment and storage medium

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