Multi-request processing method, apparatus, system, storage medium, and product
By processing and classifying multiple query requests in batches, the problem of low efficiency in processing multiple requests in high-concurrency scenarios is solved, achieving efficient processing even with limited underlying device performance and improving network security.
Patent Information
- Application Number
- CN202410190416.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-20
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-02-20
AI Technical Summary
Existing technologies are inefficient at handling multiple requests in high-concurrency scenarios and cannot meet user needs, especially during DDoS attacks, where the underlying device interfaces do not support high concurrency, leading to increased response times.
Multiple query requests are processed in batches by calling the suppression interface of the target attack handling platform, and then classified according to the thread identification information. Finally, the classification and processing results are fed back to the corresponding target terminal.
Without changing the existing user access methods, it improves the efficiency of multi-request processing in high-concurrency scenarios and enhances network security.
Smart Images

Figure CN118827120B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network security, and in particular to a multi-request processing method, device, system, storage medium and product. BACKGROUND
[0002] DDOS network attack refers to sending requests to a server simultaneously by using a large number of terminals, so that the server cannot respond or crashes. In order to protect users from the impact of DDoS attacks, operators provide DDoS attack single IP handling capacity for users, but this handling capacity does not support high concurrency scenarios. When many users are simultaneously subjected to a large number of network attacks and need to be suppressed at the same time, it is limited by the underlying device session handling capacity and cannot support all customers at the same time. Since the concurrent situation between multiple users is generally dependent on the underlying device handling capacity, and the interface provided by the underlying device does not support high concurrency, it is still difficult to meet the needs of users. At this time, a waiting time is set to collect requests and then request a batch interface, but the result processing between the request waiting setting and the multi-threading will greatly increase the response time, ultimately resulting in low efficiency in processing multiple requests.
[0003] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0004] The main purpose of the present application is to provide a multi-request processing method, device, system, storage medium and product, which aims to solve the technical problem of low efficiency in processing multiple requests in the prior art.
[0005] To achieve the above purpose, the present application provides a multi-request processing method, which comprises the following steps:
[0006] When receiving a plurality of query requests sent by each target terminal, the plurality of query requests are processed in batches by calling a suppression interface of a target attack handling platform, and each batch processing result is obtained;
[0007] According to the identification information of each thread, the plurality of batch processing results are classified to obtain each classified processing result;
[0008] The plurality of classified processing results are fed back to the corresponding target terminal.
[0009] Optionally, when receiving a plurality of query requests sent by each target terminal, the plurality of query requests are processed in batches by calling a suppression interface of a target attack handling platform, and each batch processing result is obtained, comprising:
[0010] When receiving a plurality of query requests sent by each target terminal, the current instantaneous concurrency is calculated according to the plurality of query requests.
[0011] when the current instantaneous concurrency is greater than or equal to the maximum number supported by the single-suppression interface, dividing the multiple query requests into processable query requests and remaining query requests;
[0012] processing the processable query requests by calling the single-suppression interface of the target attack handling platform to obtain a first processing result;
[0013] processing the remaining query requests by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result;
[0014] obtaining each batch processing result according to the first processing result and the second processing result.
[0015] Optionally, the processing of the remaining query requests by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result comprises:
[0016] determining a target processing thread according to the remaining query requests, and storing the target processing thread into a packing queue;
[0017] segmenting the packing queue according to a target segmentation rule to obtain each batch package;
[0018] controlling threads of the each batch package to compete for resources;
[0019] processing the remaining query requests by threads that have competed for resources by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result.
[0020] Optionally, after the current instantaneous concurrency is calculated according to the multiple query requests sent by each target terminal, the method further comprises:
[0021] when the current instantaneous concurrency is less than the maximum number supported by the single-suppression interface, processing the multiple query requests by calling the single-suppression interface of the target attack handling platform;
[0022] after monitoring that the processing is completed, calculating a single-suppression interface call possession number;
[0023] releasing the single-suppression interface call possession number.
[0024] Optionally, the classification of each batch processing result according to the identification information of each thread to obtain each classified processing result comprises:
[0025] storing each batch processing result into a result processing container;
[0026] The each batch processing result is parsed in the result processing container to obtain each query request processing result;
[0027] A request batch of multiple query requests is obtained;
[0028] Each thread is given a unique tag according to the request batch to obtain identification information of each thread;
[0029] The each query request processing result is classified according to the identification information of each thread to obtain each classified processing result.
[0030] Optionally, the each classified processing result is fed back to the corresponding target terminal, comprising:
[0031] A mapping relationship between the request batch of each target terminal sending a query request and the identification information of each thread is determined;
[0032] The current identification information of each thread is obtained according to the each classified processing result;
[0033] The current identification information is matched with the identification information in the mapping relationship through a listening thread;
[0034] According to the matching result, each request batch is determined, and the target terminal corresponding to the each request batch is queried;
[0035] The each classified processing result is fed back to the corresponding target terminal.
[0036] In addition, in order to achieve the above object, the application further provides a multi-request processing device, which comprises:
[0037] A batch processing module is configured to perform batch processing on multiple query requests sent by each target terminal by calling a suppression interface of a target attack disposal platform to obtain each batch processing result when the multiple query requests are received;
[0038] A classification module is configured to classify the each batch processing result according to the identification information of each thread to obtain each classified processing result;
[0039] A feedback module is configured to feed back the each classified processing result to the corresponding target terminal.
[0040] In addition, in order to achieve the above object, the application further provides a multi-request processing system, which comprises a memory, a processor and a multi-request processing program stored in the memory and capable of running on the processor, and the multi-request processing program is configured to implement the multi-request processing method as described above.
[0041] In addition, in order to achieve the above object, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a multi-request processing program, and the multi-request processing program is executed by a processor to implement the multi-request processing method.
[0042] In addition, in order to achieve the above object, the application further provides a computer program product, wherein the computer program product comprises a multi-request processing program, and the multi-request processing program is executed by a processor to implement the multi-request processing method.
[0043] The multi-request processing method provided by the application, by calling the suppression interface of the target attack handling platform to process the multiple query requests in batches when receiving the multiple query requests sent by the target terminals, obtaining each batch processing result; according to the identification information of each thread, classifying the batch processing results to obtain each classified processing result; and feeding back the classified processing results to the corresponding target terminals, in the above manner, when receiving the multiple query requests sent by the target terminals, it is indicated that it is a high concurrency scenario, at this time, without changing the existing user ability access mode, the single suppression interface and the multiple batch suppression interface of the target attack handling platform are called by using the packing algorithm to process the multiple query requests in batches, so that the multiple query requests in the high concurrency scenario can still be processed under the condition that the performance of the underlying equipment is limited, and after the processing is completed, the classified processing results are fed back to the corresponding target terminals, thereby effectively improving the efficiency of processing multiple requests and improving the network security. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 is a structural schematic diagram of a multi-request processing system of a hardware running environment related to an embodiment scheme of the application;
[0045] Figure 2 is a flowchart of a first embodiment of the multi-request processing method of the application;
[0046] Figure 3 is a whole result feedback schematic diagram of an embodiment of the multi-request processing method of the application;
[0047] Figure 4 is a flowchart of a second embodiment of the multi-request processing method of the application;
[0048] Figure 5 is a whole flowchart of an embodiment of the multi-request processing method of the application;
[0049] Figure 6 is a functional module schematic diagram of a first embodiment of the multi-request processing device of the application.
[0050] The objectives, functional characteristics and advantages of the present application will be further illustrated in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
[0052] Reference Figure 1 , Figure 1 The present application relates to a multi-request processing system structure diagram of a hardware operating environment involved in an embodiment of the present application.
[0053] As Figure 1 shown, the multi-request processing system can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (Wi-Fi) interface). The memory 1005 can be a high-speed random access memory (RAM), and can also be a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0054] Those skilled in the art can understand Figure 1 that the structure shown in the foregoing is not a limitation on the multi-request processing system, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.
[0055] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and a multi-request processing program.
[0056] In Figure 1The multi-request processing system shown in the figure, the network interface 1004 is mainly used for data communication with the network integration platform workstation; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the multi-request processing system of the application can be arranged in the multi-request processing system, the multi-request processing system calls the multi-request processing program stored in the memory 1005 through the processor 1001, and executes the multi-request processing method provided by the embodiment of the application.
[0057] Based on the above hardware structure, the multi-request processing method embodiment of the application is proposed.
[0058] Reference Figure 2 , Figure 2 The flowchart of the first embodiment of the multi-request processing method of the application.
[0059] In the first embodiment, the multi-request processing method comprises the following steps:
[0060] Step S10, when receiving the plurality of query requests sent by each target terminal, the plurality of query requests are processed in batches by calling the suppression interface of the target attack disposal platform, and each batch processing result is obtained.
[0061] It should be noted that the execution subject of the embodiment is a multi-request processing system, which can also be other devices that can realize the same or similar functions, such as servers, etc., and the embodiment does not limit this. In this embodiment, a server is taken as an example for description.
[0062] It should be understood that the target attack disposal platform can be a DDoS attack disposal platform, the suppression interface of the target attack disposal platform includes a single suppression interface and a multi-batch suppression interface, the single suppression interface supports a maximum of 4 concurrent, and each batch processing result refers to the result of processing the plurality of query requests in batches, which includes success and failure.
[0063] Step S20, according to the identification information of each thread, the plurality of batch processing results are classified to obtain each classification processing result.
[0064] It can be understood that the identification information of each thread can be determined by a unique tag assigned, and the identification information of each thread can be an ID, that is, the identification information of each thread is used to classify each batch processing result, for example, the ID of thread 1 is 1, the ID of thread 2 is 2, the ID of thread 3 is 3, the classification processing result of thread 1 is success, the classification processing result of thread 2 is failure, and the classification processing result of thread 3 is success, then the final classification result is {ID:1, code:200, msg:success, ID:2, code:400, msg:failure, ID:3, code:200, msg:success}.
[0065] Further, step S20 comprises: storing each batch processing result to a result processing container; parsing each batch processing result in the result processing container to obtain each query request processing result; obtaining a request batch of multiple query requests; assigning a unique tag to each thread according to the request batch to obtain identification information of each thread; and classifying each query request processing result according to the identification information of each thread to obtain each classified processing result.
[0066] It should be understood that the result processing container refers to a container for storing and processing results, and the result processing container has the characteristic of thread co-line. The form of each batch processing result stored in the result processing container can be a data packet. Therefore, each batch processing result needs to be parsed before processing to obtain each query request processing result. The request batch refers to a batch of multiple query requests sent by different users through a target terminal to a server. Then, a unique tag is assigned to each thread according to the request batch. For example, the request batch is 1, the unique tag of the thread processing the query request is 1, that is, the identification information of the thread is 1, the request batch is 2, the unique tag of the thread processing the query request is 2, that is, the identification information of the thread is 2, the request batch is 3, the unique tag of the thread processing the query request is 3, that is, the identification information of the thread is 3. The unique tag can be used for listening and matching of the result processing container. Then, each query request processing result is classified according to the identification information of each thread. The essence of the classification is to generate a k-v structure, that is, the identification information of each thread is k, and each query request processing result is v. Then, the k-v structure is encapsulated as the corresponding classified processing result.
[0067] Step S30, feeding back each classified processing result to the corresponding target terminal.
[0068] It should be understood that the target terminal refers to a terminal corresponding to the classified processing result that needs to be fed back, that is, feeding back the corresponding classified processing result to the target terminal sending the query request. For example, the query request sent by the target terminal A is a, and the classified processing result is a'. The query request sent by the target terminal B is b, and the classified processing result is b'. Then, the classified processing result a' needs to be fed back to the target terminal A, and the classified processing result b' needs to be fed back to the target terminal B.
[0069] Further, step S30 comprises: determining a mapping relationship between each target terminal sending a query request and the identification information of each thread; obtaining the current identification information of each thread according to the classification processing result; matching the current identification information with the identification information in the mapping relationship through the monitoring thread; determining each request batch according to the matching result, querying the target terminal corresponding to each request batch; and feeding back the classification processing result to the corresponding target terminal.
[0070] It can be understood that the request batch and the identification information of each thread have a one-to-one relationship, i.e., a mapping relationship, and then the current identification information is matched with the identification information in the mapping relationship through the monitoring thread. After the same identification information is matched, each request batch is determined, and the target terminal corresponding to each request batch is queried. Then, the classification processing result belonging to itself is queried and fed back to the target terminal. For example, request batch 1 corresponds to target terminal A, request batch 2 corresponds to target terminal B, then the classification processing result a' is fed back to target terminal A, and the classification processing result b' is fed back to target terminal B.
[0071] It should be understood that reference Figure 3 , Figure 3 is a whole result feedback schematic diagram. Specifically, when different users initiate multiple query requests through their respective target terminals, the current instantaneous concurrency is calculated. When the current instantaneous concurrency is greater than or equal to the maximum number supported by the single suppression interface, it indicates that batch packaging calling is needed, i.e., multiple query requests are divided into processable query requests and remaining query requests. Then, the remaining query requests are processed through the multi-batch suppression interface of the target attack handling platform, and the processable query requests are processed through the single suppression interface of the target attack handling platform. In addition, during the batch packaging calling process, each thread is also assigned a unique tag according to the request batch of the multiple query requests, for example, request batch 1 is assigned a unique tag of 1 for the thread processing the query request, request batch 2 is assigned a unique tag of 2 for the thread processing the query request, and request batch 3 is assigned a unique tag of 3 for the thread processing the query request. Each batch processing result is stored in the result processing container, and then the result processing container is parsed and matched, and the respective processing result is fed back to the corresponding target terminal, i.e., the processing result fed back to target terminal A is: ID: 1, code: 200, msg: success, the processing result fed back to target terminal B is: ID: 2, code: 400, msg: failure, and the processing result fed back to target terminal C is: ID: 3, code: 200, msg: success.
[0072] The embodiment is characterized in that when multiple query requests sent by each target terminal are received, the multiple query requests are processed in batches by calling a suppression interface of a target attack handling platform to obtain each batch processing result; the batch processing results are classified according to the identification information of each thread to obtain each classified processing result; and the classified processing results are fed back to the corresponding target terminal. In this way, when multiple query requests sent by each target terminal are received, it is indicated that it is a high concurrency scenario. In this case, without changing the existing user capability access mode, the single suppression interface and the multiple batch suppression interface of the target attack handling platform are called by using the packing algorithm to process the multiple query requests in batches, so that the multiple query requests in the high concurrency scenario can be processed under the condition that the performance of the underlying device is limited, and the classified processing results are fed back to the corresponding target terminal after processing, thereby effectively improving the efficiency of processing multiple requests and improving network security.
[0073] In an embodiment, as shown in Figure 4 the second embodiment of the multi-request processing method is proposed based on the first embodiment, and the step S10 comprises:
[0074] Step S101, when multiple query requests sent by each target terminal are received, the current instantaneous concurrency is calculated according to the multiple query requests.
[0075] It should be understood that the current instantaneous concurrency refers to the concurrency at the moment when the server receives multiple query requests, and the multiple query requests can be initiated by different target terminals at the same time. When multiple query requests sent by each target terminal are received, it is indicated that it is a concurrency scenario, which includes a low concurrency scenario and a high concurrency scenario.
[0076] Further, after step S101, it further comprises: when the current instantaneous concurrency is less than the maximum number supported by the single suppression interface, processing the multiple query requests by calling the single suppression interface of the target attack handling platform; after monitoring that the processing is completed, calculating the single suppression interface call possession number; and releasing the single suppression interface call possession number.
[0077] It can be understood that when it is determined that the current instantaneous concurrency is less than the maximum number supported by the single suppression interface, it is indicated that it is a low concurrency scenario. At this time, the thread processing the query request can obtain the call right of the single suppression interface, and the single suppression interface can be a single IP suppression interface. At this time, p 单 =P 单 (max)-1, and then the single suppression interface call possession number is calculated after the single suppression interface of the target attack handling platform is called to process the multiple query requests, that is, p 单 ˋ=P 单+1, and immediately releasing the single-press interface call possession number so that the subsequently incoming process can reacquire the single-press interface call right.
[0078] Step S102, when the current instantaneous concurrency is greater than or equal to the maximum number supported by the single-press interface, the plurality of query requests are divided into processable query requests and remaining query requests.
[0079] It can be understood that after obtaining the current instantaneous concurrency, it is judged whether the current instantaneous concurrency is greater than or equal to the maximum number supported by the single-press interface. If yes, it indicates a high concurrency scenario, i.e., p(count)>p 单 (max), at this time, the plurality of query requests need to be divided into processable query requests p 单 (max) and remaining query requests p(count)-p 单 (max), and the corresponding threads are also divided into two parts. The concurrency threads processing the remaining query requests need to be stored in the packing queue.
[0080] Step S103, processing the processable query requests by calling the single-press interface of the target attack handling platform to obtain a first processing result.
[0081] It should be understood that the first processing result refers to the result of processing the query requests by calling the single-press interface. After obtaining the processable query requests, the thread processing the processable query requests immediately calls the single-press interface of the target attack handling platform to respond to the target terminal, and releases the single-press interface call possession number after the response is completed.
[0082] Step S104, processing the remaining query requests by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result.
[0083] It can be understood that the second processing result refers to the result of processing the query requests by calling the multi-batch suppression interface. After obtaining the remaining query requests, the multi-batch suppression interface of the target attack handling platform is called to process the remaining query requests.
[0084] Further, step S104 includes: determining a target processing thread according to the remaining query requests, and storing the target processing thread in a packing queue; dividing the packing queue by a target segmentation rule to obtain each batch package; controlling the threads of the each batch package to compete for resources; and processing the remaining query requests by calling the multi-batch suppression interface of the target attack handling platform through the threads that have competed for the resources to obtain the second processing result.
[0085] It should be understood that after determining the target processing flow, the packaging logic is triggered, that is, the target processing thread is stored in the packaging queue by using the dynamic packaging algorithm. Since the DDoS attack disposal platform has a limit on the amount of data processed by the interface at a time, the packaging queue needs to be segmented at this time. The target segmentation rule can be generated by the underlying processing amount and the number of remaining query requests, for example, packaging queue = batch package 1 (p(cont) <= 50) + batch package 2 (p(count) <= 50) + batch package 3 (p(count) <= 50) … After segmentation is completed, the threads of each batch package compete for resources, and the thread that obtains the resource will take all the data amount in the batch package to call the batch suppression processing interface of the DDoS attack disposal platform once, such as: batch package n (p(cont) <= 50) - p(x competes for resources) -> calls the multi-batch suppression interface, and the thread will put the processing results of all threads in the batch package into the result container.
[0086] Step S105, obtaining each batch processing result according to the first processing result and the second processing result.
[0087] It should be understood that after obtaining the second processing result, the first processing result is combined to obtain each batch processing result.
[0088] It can be understood that, with reference to Figure 5 , Figure 5 is a schematic diagram of the overall process, specifically: when receiving a plurality of query requests sent by each target terminal, the current instantaneous concurrency is calculated, and then in the case that the current instantaneous concurrency is less than the maximum number supported by the single IP suppression interface, that is, p1 + p2 + p3 … < P 单 (max), the thread can obtain the call right of the single IP suppression interface, that is, the single suppression interface is called to dispose the DDoS attack caused by the plurality of query requests, and the single suppression interface call possession number is released immediately after the disposal is completed. If the current instantaneous concurrency is greater than or equal to the maximum number supported by the single suppression interface, it indicates that the call right acquisition fails, at this time the target processing process needs to be stored in the packaging queue, then the packaging queue is segmented, and a batch processing request is initiated. The remaining query requests are processed by calling the multi-batch suppression interface of the target attack disposal platform, and the processable query requests are processed by calling the single suppression interface of the target attack disposal platform, and then each batch processing result is stored in the result processing container.
[0089] The embodiment calculates current instantaneous concurrency according to the multiple query requests when receiving the multiple query requests sent by each target terminal; when the current instantaneous concurrency is greater than or equal to the maximum number supported by the single suppression interface, the multiple query requests are divided into processable query requests and remaining query requests; the processable query requests are processed by calling the single suppression interface of the target attack handling platform to obtain a first processing result; the remaining query requests are processed by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result; each batch processing result is obtained according to the first processing result and the second processing result; in the above manner, the current instantaneous concurrency is calculated according to the received multiple query requests, and it is judged whether the current instantaneous concurrency is greater than or equal to the maximum number supported by the single suppression interface; if yes, the processable query requests are processed by calling the single suppression interface, and the processable query requests are processed by calling the multi-batch suppression interface, and then each batch processing result is obtained according to the first processing result and the second processing result, so that the efficiency of obtaining the batch processing result can be effectively improved, and the timeliness of response is ensured.
[0090] In addition, the embodiment of the present application further provides a storage medium, and the storage medium stores a multi-request processing program, and the multi-request processing program is executed by a processor to implement the steps of the multi-request processing method described above.
[0091] Since the storage medium adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be repeated here.
[0092] In addition, with reference to Figure 6 , the embodiment of the present application further provides a multi-request processing device, and the multi-request processing device comprises:
[0093] The batch processing module 10 is configured to, when receiving the multiple query requests sent by each target terminal, process the multiple query requests in batches by calling the suppression interface of the target attack handling platform to obtain each batch processing result.
[0094] The classification module 20 is configured to classify each batch processing result according to the identification information of each thread to obtain each classification processing result.
[0095] The feedback module 30 is configured to feed back each classification processing result to the corresponding target terminal.
[0096] The embodiment is achieved by the following method: when receiving multiple query requests sent by each target terminal, the multiple query requests are processed in batches by calling the suppression interface of the target attack handling platform to obtain each batch processing result; the batch processing results are classified according to the identification information of each thread to obtain each classified processing result; and the classified processing results are fed back to the corresponding target terminal. In this way, when receiving multiple query requests sent by each target terminal, it is indicated that it is a high concurrency scenario. In this case, without changing the existing user capability access mode, the single suppression interface and the multiple batch suppression interface of the target attack handling platform are called by using the packing algorithm to process multiple query requests in batches, so that multiple query requests in a high concurrency scenario can be processed under the condition that the performance of the underlying device is limited, and the classified processing results are fed back to the corresponding target terminal after processing, thereby effectively improving the efficiency of processing multiple requests and improving network security.
[0097] It should be noted that the above-described workflow is only illustrative and does not limit the scope of protection of the present application. In actual application, a person skilled in the art can select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited here.
[0098] In addition, technical details not described in detail in the embodiment can be referred to the multi-request processing method provided by any embodiment of the present application, which will not be described here.
[0099] In an embodiment, the batch processing module 10 is further configured to, when receiving multiple query requests sent by each target terminal, calculate a current instantaneous concurrency according to the multiple query requests; when the current instantaneous concurrency is greater than or equal to the maximum number supported by the single suppression interface, divide the multiple query requests into processable query requests and remaining query requests; process the processable query requests by calling the single suppression interface of the target attack handling platform to obtain a first processing result; process the remaining query requests by calling the multiple batch suppression interface of the target attack handling platform to obtain a second processing result; and obtain each batch processing result according to the first processing result and the second processing result.
[0100] In an embodiment, the batch processing module 10 is further configured to determine a target processing thread according to the remaining query requests, and store the target processing thread in a packing queue; divide the packing queue by a target segmentation rule to obtain each batch package; control the threads of each batch package to compete for resources; and process the remaining query requests by calling the multiple batch suppression interface of the target attack handling platform through the threads that have competed for resources to obtain a second processing result.
[0101] In an embodiment, the batch processing module 10 is further configured to process the plurality of query requests by calling a single suppression interface of a target attack handling platform when the current instantaneous concurrency is less than a maximum number supported by the single suppression interface; and release a number of single suppression interface calls after monitoring that the processing is completed.
[0102] In an embodiment, the classification module 20 is further configured to store each batch processing result to a result processing container; parse the each batch processing result in the result processing container to obtain each query request processing result; obtain a request batch of the plurality of query requests; assign a unique tag to each thread according to the request batch to obtain identification information of each thread; and classify the each query request processing result according to the identification information of each thread to obtain each classification processing result.
[0103] In an embodiment, the feedback module 30 is further configured to determine a mapping relationship between a request batch in which each target terminal sends a query request and the identification information of each thread; obtain current identification information of each thread according to the each classification processing result; match the current identification information with the identification information in the mapping relationship through a listening thread; determine each request batch according to a matching result; query a target terminal corresponding to the each request batch; and feed back the each classification processing result to the corresponding target terminal.
[0104] Other embodiments of the multi-request processing device or the implementation method of the present application can refer to the above-mentioned method embodiments, which will not be described here.
[0105] It should be understood that, although each step in the flowchart in the embodiments of the present application is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps has no strict sequence limitation, and they can be executed in other orders. Moreover, at least part of the steps in the figure can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with other steps or sub-steps or stages of other steps.
[0106] Moreover, it is to be understood that the phraseology and terminology used herein is for the purpose of description and should not be regarded as limiting. The use of "including" "comprising" or "having" and variations thereof herein is intended to encompass the presence of one or more recited elements or steps and not the exclusion of any other integers or steps. The use of "including", "comprising", "having" and "with" and variations thereof herein is intended to encompass the presence of one or more recited elements or steps and not the exclusion of any other integers or steps.
[0107] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0108] Those skilled in the art can clearly understand the above-mentioned embodiment methods by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk), and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, an integrated platform workstation, or a network device) execute the methods described in the embodiments of the present application.
[0109] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made by using the content of the specification and drawings of the present application, is also included in the patent protection scope of the present application.
Claims
1. A multi-request processing method, characterized in that, The multi-request processing method includes the following steps: Upon receiving multiple query requests from various target terminals, the current instantaneous concurrency is calculated based on the multiple query requests; When the current instantaneous concurrency is greater than or equal to the maximum number supported by a single suppression interface, the multiple query requests are divided into processable query requests and remaining query requests. The processable query request is processed by calling the single suppression interface of the target attack handling platform to obtain the first processing result; The remaining query requests are processed by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result; The batch processing results are obtained based on the first processing result and the second processing result; The batch processing results are classified according to the identification information of each thread to obtain the processing results of each category; The results of each classification process are fed back to the corresponding target terminal.
2. The multi-request processing method as described in claim 1, characterized in that, The process of processing the remaining query requests by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result includes: The target processing thread is determined based on the remaining query requests, and the target processing thread is stored in the packaging queue; The packaging queue is divided into batches of packages by using target segmentation rules; Control the threads of each batch package to compete for resources; The thread that wins the resource competition calls the multi-batch suppression interface of the target attack handling platform to process the remaining query requests and obtain the second processing result.
3. The multi-request processing method as described in claim 1, characterized in that, Upon receiving multiple query requests from each target terminal, after calculating the current instantaneous concurrency based on the multiple query requests, the method further includes: When the current instantaneous concurrency is less than the maximum number supported by a single suppression interface, the multiple query requests are processed by calling the single suppression interface of the target attack handling platform. After the processing is completed, the number of single-suppression interface calls is calculated; Release the occupied number of the single suppression interface call.
4. The multi-request processing method as described in claim 1, characterized in that, The step of classifying the batch processing results according to the identification information of each thread to obtain each classified processing result includes: Store the results of each batch of processing into the result processing container; The batch processing results are parsed in the result processing container to obtain the processing results of each query request; Retrieve request batches from multiple query requests; Each thread is assigned a unique label based on the requested batch, thus obtaining the identification information of each thread; The processing results of each query request are classified according to the identification information of each thread to obtain the processing results of each classification.
5. The multi-request processing method as described in any one of claims 1 to 4, characterized in that, The step of feeding back the classification processing results to the corresponding target terminal includes: Determine the mapping relationship between the request batches sent by each target terminal and the identification information of each thread; The current identification information of each thread is obtained based on the results of each classification process; The current identification information is matched with the identification information in the mapping relationship by a listening thread; Determine each request batch based on the matching results, and query the target terminal corresponding to each request batch; The results of each classification process are fed back to the corresponding target terminal.
6. A multi-request processing apparatus, characterized in that, The multi-request processing device includes: The batch processing module is used to calculate the current instantaneous concurrency based on the multiple query requests received from various target terminals; when the current instantaneous concurrency is greater than or equal to the maximum number supported by a single suppression interface, the multiple query requests are divided into processable query requests and remaining query requests; the processable query requests are processed by calling the single suppression interface of the target attack handling platform to obtain a first processing result; the remaining query requests are processed by calling the multi-batch suppression interface of the target attack handling platform to obtain a second processing result; and each batch processing result is obtained based on the first processing result and the second processing result. The classification module is used to classify the batch processing results according to the identification information of each thread, and obtain the classification processing results. The feedback module is used to send the results of each classification process back to the corresponding target terminal.
7. A multi-request processing system, characterized in that, The multi-request processing system includes: a memory, a processor, and a multi-request processing program stored in the memory and executable on the processor, wherein the multi-request processing program is configured to implement the multi-request processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a multi-request handler, which, when executed by a processor, implements the multi-request processing method as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, The computer program product includes a multi-request handler, which, when executed by a processor, implements the multi-request processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Request processing method and device, electronic equipment and storage medium
CN112104731A
Method and device for processing high-concurrency data requests
CN112748855A