Method, device, electronic device and storage medium for processing concurrent asynchronous operations
By grouping and timing storage of external access requests and batch processing of data access requests, the inefficiency and module coupling problems of asynchronous operation processing and high concurrency processing are solved, and efficient URL processing and sequential response are achieved.
Patent Information
- Application Number
- CN202110850140.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-07-27
AI Technical Summary
Existing asynchronous operations deal with high concurrency have problems such as inefficiency, confusion and serious coupling between modules.
By continuously receiving external access requests, the target URL is stored in order in the receiving sequence after packets, and the data access request is processed in batches, and finally the access data is output according to the receiving sequence.
It realizes efficient processing and sequential return of URLs in high concurrency, solves the problem of serious module coupling and improves response efficiency.
Smart Images

Figure CN113703992B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high-concurrency processing technology, and in particular to a method, device, electronic device and storage medium for processing concurrent asynchronous operations. Background Art
[0002] With the rapid development of science and technology, more and more technological products are coming into view, and business logic has become more complex. In order to meet the industry needs of rapid development and iteration, the synchronous mode is far from meeting people's needs. How to efficiently handle concurrent asynchronous operations has become the focus of people's attention.
[0003] Nowadays, asynchronous operations are very common in business needs, and there are many ways to implement asynchronous operations, whether traditional or popular, which is enough to show the importance of asynchrony in programs. Multiple asynchronous operations are divided into subsequent and concurrent operations. How to efficiently handle concurrent asynchronous operations can greatly improve the performance of the project, and it is imperative.
[0004] For the front-end, Javascript is a single-threaded language, which means that it can only complete one task at a time. If there are multiple tasks to be executed, they must be queued and executed according to the queue, that is, the previous task must be completed before the next task is executed. However, with the increase in demand and requests, the execution efficiency of the single-threaded mode is bound to be low. As long as one task takes a long time to execute, the subsequent tasks cannot be executed during this time. Common browser unresponsiveness (pseudo-death) is often because a certain section of Javascript code runs for a long time (such as an infinite loop), causing the entire page to be stuck in this place and other tasks cannot be executed. Seriously affecting server performance and reducing efficiency.
[0005] There are many methods of asynchronous operation, such as (1) callback function; that is, using the function method to achieve asynchrony. Although it is simple, easy to understand and deploy, it is not conducive to code reading and maintenance. The parts are highly coupled, the process will be very chaotic, and each task can only specify one callback function. (2) Event monitoring; that is, the event-driven mode is adopted. The execution of the task does not depend on the order of the code, but on whether a certain event occurs. Although it is relatively easy to understand, multiple events can be bound, and each event can specify multiple callback functions. Moreover, it can be decoupled, which is conducive to modularization, but the entire program must become event-driven, and the running process will become unclear. (3) Promise asynchronous programming solution; that is, it is used to handle asynchronous operations. If the asynchronous processing is successful, the successful operation will be executed. If the asynchronous processing fails, the error will be captured or the subsequent operation will be stopped. Compared with traditional solutions, callback functions and event monitoring are more reasonable and more powerful.
[0006] Therefore, how to avoid the inefficiency, confusion and serious coupling between modules of the existing asynchronous operation processing when high concurrency occurs is still a problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0007] The present invention provides a method, device, electronic device and storage medium for processing concurrent asynchronous operations, which are used to solve the problems of low efficiency, confusion and serious coupling between modules in the existing asynchronous operation processing when high concurrency occurs.
[0008] The present invention provides a method for processing concurrent asynchronous operations, comprising:
[0009] Continue to receive external access requests (Uniform Resource Locator, URL);
[0010] Grouping the external access requests according to preset conditions to obtain a request information queue group;
[0011] For each request information queue group, the target URLs therein are stored in sequence according to the receiving time sequence, and the access data of all the target URLs are obtained;
[0012] The access data is output according to the reception timing.
[0013] According to a method for processing concurrent asynchronous operations provided by the present invention, the external access requests are grouped according to preset conditions, specifically comprising:
[0014] The external access requests are grouped sequentially at preset time intervals.
[0015] According to a method for processing concurrent asynchronous operations provided by the present invention, the target URLs are stored sequentially in the order of reception, specifically comprising:
[0016] Use the sequential processing element function in the front-end development language to store the target URL in each request information queue group sequentially.
[0017] According to a method for processing concurrent asynchronous operations provided by the present invention, obtaining access data of all target URLs specifically includes:
[0018] Use the asynchronous call processing function in the front-end development language to obtain the access data of all the target URLs.
[0019] According to a method for processing concurrent asynchronous operations provided by the present invention, outputting the access data according to the receiving timing specifically includes:
[0020] The access data is output according to the receiving sequence based on a sequential rule written using a loop code in a front-end development language.
[0021] The present invention also provides a device for processing concurrent asynchronous operations, comprising:
[0022] A receiving unit, used for continuously receiving external access request information;
[0023] A grouping unit, used for grouping the external access requests according to preset conditions to obtain a request information queue group;
[0024] A storage access unit, used for storing the target URLs in each request information queue group in sequence according to the receiving time sequence, and obtaining access data of all the target URLs;
[0025] The response unit is used to output the access data according to the receiving timing.
[0026] According to a device for processing concurrent asynchronous operations provided by the present invention, grouping the external access requests according to preset conditions specifically includes:
[0027] The external access requests are grouped sequentially at preset time intervals.
[0028] According to a device for processing concurrent asynchronous operations provided by the present invention, the target URLs are stored sequentially in the order of reception, specifically comprising:
[0029] Use the sequential processing element function in the front-end development language to store the target URL in each request information queue group sequentially.
[0030] According to a device for processing concurrent asynchronous operations provided by the present invention, the obtaining of access data of all target URLs specifically includes:
[0031] Use the asynchronous call processing function in the front-end development language to obtain the access data of all the target URLs.
[0032] According to a device for processing concurrent asynchronous operations provided by the present invention, outputting the access data according to the receiving timing specifically includes:
[0033] The access data is output according to the receiving sequence based on a sequential rule written using a loop code in a front-end development language.
[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described methods for processing concurrent asynchronous operations are implemented.
[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for processing concurrent asynchronous operations.
[0036] The method, device, electronic device and storage medium for processing concurrent asynchronous operations provided by the present invention continuously receive external access request information; group the external access requests according to preset conditions to obtain request information queue groups; for each request information queue group, store the target URLs therein in sequence according to the receiving timing, and obtain the access data of all the target URLs; and output the access data according to the receiving timing. Since the URLs received within the preset time length are formed into request information queue groups, the data access requests in each request information queue group are batch processed, and then output in sequence according to the receiving time of each target URL in the request information queue group, so as to realize efficient processing and sequential return of URLs in high concurrency. Therefore, the method, device, electronic device and storage medium provided by the present invention solve the problem of serious coupling between various modules in concurrent processing, and realize efficient and sequential response to high-concurrency access requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A comparison chart of synchronous and asynchronous data requests provided by the prior art;
[0039] Figure 2 A schematic diagram of an asynchronous data request process provided by the prior art;
[0040] Figure 3 A schematic diagram of the principle of concurrent asynchronous data request provided by the prior art;
[0041] Figure 4 A flowchart of a method for processing concurrent asynchronous operations provided by the present invention;
[0042] Figure 5 A schematic diagram of the structure of the device for processing concurrent asynchronous operations provided by the present invention;
[0043] Figure 6 A schematic diagram of the physical structure of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] The existing asynchronous operations are generally inefficient and chaotic when processing high concurrency, and the coupling between modules is serious. Figure 1-Figure 6 A method for processing concurrent asynchronous operations of the present invention is described. First, a brief introduction is given to how the developed application program utilizes asynchronous operations to respond to access requests when dealing with high concurrent data requests. Figure 1 A comparison chart of synchronous and asynchronous data requests provided by the prior art. Figure 2 A schematic diagram of an asynchronous data request process provided by the prior art, Figure 3 A schematic diagram of the principle of concurrent asynchronous data request provided by the prior art, such as Figure 1 As shown, when synchronous operation processes requests, access data is acquired in sequence according to the order of requests. After responding to the previous request, the next request is received, and the access data of the next request is acquired and then responded. When asynchronous operation processes requests, requests can be received continuously, for example Figure 1 The asynchronous processing operation on the right first receives two requests, then obtains the access data of the two requests respectively, and then responds to the two requests. Compared with the synchronous operation that strictly processes the access requests according to the receiving sequence and responds to the previous request before receiving the next request, the asynchronous operation obviously saves more time; Figure 2 As shown, Figure 2 The commonly used steps for processing data requests using asynchronous operations are given, that is, continuously receiving request tasks in the main thread, then storing the tasks in the task queue, and then obtaining access to data processing at the same time after dividing the tasks stored in the task queue to save time; Figure 3 As shown, when concurrent access requests occur, there are primary and backup processors, and the primary processor is preferentially selected to asynchronously process requests. When the primary processor is busy, the backup processor is used to process requests.
[0046] In the daily development process, we often encounter the need to complete a set of asynchronous operations in sequence. For example, we need to read a set of URL requests from the remote in sequence, and then output the results in the order of reading. Of course, we can use the traditional callback function, promise method, or use the Generator function combined with the co-module to handle concurrent asynchronous operations, but the callback function and promise method are somewhat cumbersome and the semantics are not clear. Although the Generator function is slightly clearer, its premise is that the Generator function must be automatically executed in a task executor, and a Promise needs to be returned, which is more troublesome; therefore, concurrent operations should be handled efficiently. Compared with the above method, the async function can be used to traverse a set of URLs read remotely, and the results are returned according to the asynchronous object. Each operation after traversal will return a Promise object, which will then be put into an array in sequence; afterwards, if the reduce method is used to process each Promise object in sequence, and then all Promise objects are connected, although the results can be output in sequence, but because if all remote operations are secondary, only the previous URL returns the result before reading the next URL, this is very inefficient and very time-consuming.
[0047] Figure 4 A flowchart of a method for processing concurrent asynchronous operations provided by the present invention is shown as follows: Figure 4 As shown, the method includes:
[0048] Step 410: Continue to receive external access request information.
[0049] Specifically, the present invention limits asynchronous operation processing to processing external access requests, that is, the asynchronous operation processing is a link in a front-end application program that is being developed, and the most commonly used front-end development language is JS (Javascript). Therefore, it is assumed here that the execution of the asynchronous operation in the present invention is implemented by a concurrent processing module in a front-end application program developed by the JS language, and no redundant explanation is given hereinafter. The execution subject of the method for processing concurrent asynchronous operations provided by the present invention is a device for processing concurrent asynchronous operations, that is, a concurrent processing module in a front-end application program developed by the JS language. The device first has a receiving unit for continuously receiving external access request information, that is, the receiving unit does not need to consider whether the previous URL is responded to, but directly receives all the URLs that arrive, stores them first, for example, in the form of a queue, and then processes them.
[0050] Step 420: group the external access requests according to preset conditions to obtain a request information queue group.
[0051] Specifically, the URLs continuously received in step 410 need to be stored in the form of queue groups, and the size of the queue group is determined according to various indicators, such as the sensitivity requirements of the front-end application processing access where the concurrent asynchronous operation device is located. If the application is very sensitive to the response delay or the user requirements are very high, then the size of the queue has an appropriate upper limit, and a large number of URLs cannot be processed together to increase the delay, unless the computing power of the internal processor CPU is particularly strong and can obtain the access data of a large number of URLs belonging to the same request information queue group in a short time, then the time interval of the request information queue group can be lengthened. Therefore, grouping the external access requests at a certain time interval needs to consider the response experience index requirements of the front-end application processing access and the computing power of the internal CPU. The preset condition can also be to divide the queue according to a certain queue capacity, for example, the capacity of each queue group is set to store 50 URLs, so after each queue group receives and stores 50 URLs, it uses the next empty queue group to receive and store access requests.
[0052] Step 430: For each request information queue group, the target URLs therein are stored in sequence according to the receiving time sequence, and the access data of all the target URLs are obtained.
[0053] Specifically, for each request information queue group divided out in step 420, they are stored in sequence according to the arrival time (i.e., receiving timing) of each target URL in the request information queue group. The main purpose is to mark the receiving order of each target URL in the request information queue group so that when the response data is subsequently output, the corresponding response data can be output in sequence according to the order of receiving time; and the acquisition of access data of all the target URLs is carried out simultaneously. The amount of overlapping response data acquired at the same time depends on the computing power of the internal processor. The greater the computing power, the larger the access data acquisition that can be processed simultaneously.
[0054] Step 440: output the access data according to the receiving timing.
[0055] Specifically, since the target URLs in each request information queue group in step 430 are stored in sequence according to the receiving sequence, after obtaining the access data of all URLs in any request information queue group, the response access data is output in sequence according to the stored receiving sequence.
[0056] The method provided by the present invention continuously receives external access request information; groups the external access requests according to preset conditions to obtain a request information queue group; for each request information queue group, stores the target URLs therein in sequence according to the receiving time sequence, and obtains the access data of all the target URLs; and outputs the access data according to the receiving time sequence. Since the URLs received within the preset time length are formed into a request information queue group, the data access requests in each request information queue group are batch processed, and then sequentially output according to the receiving time of each target URL in the request information queue group, so as to realize efficient processing and sequential return of URLs under high concurrency. Therefore, the method provided by the present invention solves the problem of serious coupling between various modules in concurrent processing, and realizes efficient and sequential response to high-concurrency access requests.
[0057] Based on the above embodiment, in the method, grouping the external access requests according to preset conditions specifically includes:
[0058] The external access requests are grouped sequentially at preset time intervals.
[0059] Specifically, the preset conditions for grouping are preferably used here to group the external access requests in sequence at preset time intervals, that is, for example, the access requests received every second are stored in a request information queue group, and the length of the preset time interval can be adjusted according to the actual application scenario, such as the sensitivity requirements for processing access of the front-end application where the concurrent asynchronous operation device is located. If the application is very sensitive to the response delay or the user requirements are very high, then the queue size has an appropriate upper limit, and a large number of URLs cannot be processed together, increasing the delay, unless the computing power of the internal processor CPU is particularly strong and can obtain the access data of a large number of URLs belonging to the same request information queue group in a short time, then the time interval of the request information queue group can be lengthened.
[0060] Based on the above embodiment, in the method, storing the target URLs in sequence according to the receiving time sequence specifically includes:
[0061] Use the sequential processing element function in the front-end development language to store the target URL in each request information queue group sequentially.
[0062] Specifically, since the front-end development language used by the present invention is JS by default, the preferred function for sequentially processing elements in JS is the map() function. It should be noted here that the map() function is a specific function in the JS language for sequentially processing elements in the order of the original array elements. The map() method returns a new array, and the elements in the array are the values after the original array elements call the function for processing. It should be noted that the map method will not detect the deformity of the empty array nor change the original array, but will sequentially store the target URLs in each request information queue group in the order of receiving time, and each request information queue group is required to be not empty; relative to the asynchronous processing in the prior art, the map method added here will sequentially store the continuously received data access request URLs according to the URL arrival time, so that when the data response is performed later, it can also be sequentially output according to the storage order, and will not cause response confusion.
[0063] Based on the above embodiment, in the method, obtaining access data of all the target URLs specifically includes:
[0064] Use the asynchronous call processing function in the front-end development language to obtain the access data of all the target URLs.
[0065] Specifically, since the front-end development language used by the present invention is JS by default, the preferred asynchronous call processing function in JS is the await method. It should be noted here that the await method is an operator dedicated to asynchronous processing async. The await operator is applied to the tasks in the asynchronous method, and a suspension point is inserted in the method execution until the ongoing task being waited for is completed. The await expression does not block the thread that is executing it, but uses the compiler to register the remaining asynchronous methods as the continuation tasks of the waiting tasks. The control will then be returned to the caller of the asynchronous method. When the task is completed, it will call its continuation task, and the execution of the asynchronous method will resume at the paused position. That is, the await operator in the asynchronous processing method is used in the present invention to insert a suspension point to suspend the response processing of the access request, but first obtain all the access data of all target URLs, and then return the control to the caller of the asynchronous method to continue to complete the data response of the access request.
[0066] Based on the above embodiment, in the method, outputting the access data according to the receiving timing specifically includes:
[0067] The access data is output according to the receiving sequence based on a sequential rule written using a loop code in a front-end development language.
[0068] Specifically, since the front-end development language used by the present invention is JS by default, the preferred loop code in JS is the for...of loop traversal code. It should be noted here that the for...of loop traversal and the internal use of await to request data, although the parameter in the map method is an async function, it is executed concurrently, because only the async function is executed sequentially, and the outside is not affected; the subsequent for..of loop uses await, so the output is achieved in order.
[0069] The following is a description of an asynchronous operation device for processing concurrency provided by the present invention. The asynchronous operation device for processing concurrency described below and the asynchronous operation method for processing concurrency described above can be referred to each other.
[0070] Figure 5 A schematic diagram of the structure of the device for processing concurrent asynchronous operations provided by the present invention is shown in FIG. Figure 5 As shown, the apparatus for processing concurrent asynchronous operations includes a receiving unit 510, a grouping unit 520, a storage access unit 530 and a response unit 540, wherein:
[0071] The receiving unit 510 is used to continuously receive external access request information;
[0072] The grouping unit 520 is used to group the external access requests according to preset conditions to obtain a request information queue group;
[0073] The storage access unit 530 is used to store the target URLs in each request information queue group in sequence according to the receiving time sequence, and obtain access data of all the target URLs;
[0074] The response unit 540 is used to output the access data according to the receiving timing.
[0075] The asynchronous operation device for processing concurrency provided by the present invention continuously receives external access request information; groups the external access requests according to preset conditions to obtain request information queue groups; for each request information queue group, stores the target URLs therein in sequence according to the receiving time sequence, and obtains the access data of all the target URLs; and outputs the access data according to the receiving time sequence. Since the URLs received within the preset time length are formed into request information queue groups, the data access requests in each request information queue group are batch processed, and then sequentially output according to the receiving time of each target URL in the request information queue group, so as to realize efficient processing and sequential return of URLs under high concurrency. Therefore, the device provided by the present invention solves the problem of serious coupling between various modules in concurrent processing, and realizes efficient and sequential response to high-concurrency access requests.
[0076] Based on the above embodiment, in the device for processing concurrent asynchronous operations, grouping the external access requests according to preset conditions specifically includes:
[0077] The external access requests are grouped sequentially at preset time intervals.
[0078] Based on the above embodiment, in the device for processing concurrent asynchronous operations, the storing of the target URLs in sequence according to the receiving time sequence specifically includes:
[0079] Use the sequential processing element function in the front-end development language to store the target URL in each request information queue group sequentially.
[0080] On the basis of the above embodiment, in the device for processing concurrent asynchronous operations, the obtaining of access data of all the target URLs specifically includes:
[0081] Use the asynchronous call processing function in the front-end development language to obtain the access data of all the target URLs.
[0082] Based on the above embodiment, in the device for processing concurrent asynchronous operations, outputting the access data according to the receiving timing specifically includes:
[0083] The access data is output according to the receiving sequence based on a sequential rule written using a loop code in a front-end development language.
[0084] Figure 6 A schematic diagram of the physical structure of an electronic device provided by the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a method for processing concurrent asynchronous operations, the method comprising: continuously receiving external access request information; grouping the external access requests according to preset conditions to obtain a request information queue group; for each request information queue group, sequentially storing the target URLs therein according to the receiving timing, and obtaining access data of all the target URLs; and outputting the access data according to the receiving timing.
[0085] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0086] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the method for processing concurrent asynchronous operations provided by the above-mentioned methods, and the method includes: continuously receiving external access request information; grouping the external access requests according to preset conditions to obtain a request information queue group; for each request information queue group, storing the target URLs therein in sequence according to the receiving timing, and obtaining access data of all the target URLs; and outputting the access data according to the receiving timing.
[0087] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the asynchronous operation method for processing concurrency provided by the above-mentioned methods, the method comprising: continuously receiving external access request information; grouping the external access requests according to preset conditions to obtain a request information queue group; for each request information queue group, storing the target URLs therein in sequence according to the receiving timing, and obtaining access data of all the target URLs; and outputting the access data according to the receiving timing.
[0088] The server embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing concurrent asynchronous operations, characterized in that: include: Continuously receive external access request information in the front-end application; The external access requests are grouped in sequence at preset time intervals to obtain a request information queue group; wherein the preset time interval is determined according to the response experience index requirement of the processing access of the front-end application and the computing power of the internal CPU; For each request information queue group, the target URLs therein are stored in sequence according to the receiving time sequence, and the access data of all the target URLs are obtained; The access data is output according to the reception timing.
2. The method for processing concurrent asynchronous operations according to claim 1, characterized in that: The storing of the target URLs in sequence according to the receiving time sequence specifically includes: Use the sequential processing element function in the front-end development language to store the target URL in each request information queue group sequentially.
3. The method for processing concurrent asynchronous operations according to claim 1, characterized in that: The obtaining of access data of all target URLs specifically includes: Use the asynchronous call processing function in the front-end development language to obtain the access data of all the target URLs.
4. The method for processing concurrent asynchronous operations according to any one of claims 1 to 3, characterized in that: Outputting the access data according to the receiving timing specifically includes: The access data is output according to the receiving sequence based on a sequential rule written using a loop code in a front-end development language.
5. A device for processing concurrent asynchronous operations, characterized in that: include: A receiving unit, used for continuously receiving external access request information in a front-end application; A grouping unit, used to group the external access requests in sequence at preset time intervals to obtain a request information queue group; wherein the preset time interval is determined according to the response experience index requirement of the processing access of the front-end application and the computing power of the internal CPU; A storage access unit, used for storing the target URLs in each request information queue group in sequence according to the receiving time sequence, and obtaining access data of all the target URLs; The response unit is used to output the access data according to the receiving timing.
6. The device for processing concurrent asynchronous operations according to claim 5, characterized in that: The storing of the target URLs in sequence according to the receiving time sequence specifically includes: Use the sequential processing element function in the front-end development language to store the target URL in each request information queue group sequentially.
7. The device for processing concurrent asynchronous operations according to claim 5, characterized in that: The obtaining of access data of all target URLs specifically includes: Use the asynchronous call processing function in the front-end development language to obtain the access data of all the target URLs.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for processing concurrent asynchronous operations according to any one of claims 1 to 4 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for processing concurrent asynchronous operations as claimed in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
High concurrency data processing method and apparatus, and computer readable storage medium
CN107872398A