Service request processing method, system and equipment and storage medium

Through Nginx mirror replication and dynamic task type recognition, the service system can select appropriate processing logic based on different task types, solving the performance bottlenecks caused by a single processing solution and improving processing efficiency and overall performance.

CN119166349APending Publication Date: 2024-12-20NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411277207.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Existing service systems usually only adopt a single business request processing solution and cannot optimize all types of requests, resulting in performance bottlenecks and overall system performance degradation.

Method used

The client uses Nginx to mirror the service request, obtains the characteristics and performance indicators of the image request, dynamically determines the task type, and sends the non-target task type to the server, so that the server can process the request according to the corresponding processing logic.

Benefits of technology

It improves the efficiency and flexibility of the service system for business requests, optimizes resource allocation, reduces processing delays and resource competition, and improves overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166349A_ABST
    Figure CN119166349A_ABST
Patent Text Reader

Abstract

The invention discloses a service request processing method, system and device and a storage medium. When a client receives a service request of a target interface, firstly, mirror image copying is carried out through Nginx to generate a mirror image request, and the mirror image request is sent to a service request processing system. And the service request processing system judges whether the task type is a target task type according to the feature index of the mirror image request. If the task type is not the target task type, calculating the performance index of the task type, and determining the corresponding non-target task type. And finally, sending the non-target task type of the mirroring request to the server, so that the server distributes corresponding processing logic for the service request according to the type. According to the method and the device, relatively appropriate processing logics are dynamically selected for different task types, so that the service processing efficiency of the server side is improved. And meanwhile, the processing delay increased when the service request waits for calculating the task type at the server side is avoided, the resource distribution of the server side is effectively optimized, and the burden of the server side is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, system, device and storage medium for processing a business request. Background Art

[0002] In the service-providing system, there are many different processing schemes for business requests, such as first-come-first-served, shortest job priority, highest response ratio priority, time slice rotation, earliest deadline priority, semaphore-based service queuing, priority-based service queuing, and intelligent load balancing, etc. Each processing scheme has its own principles, functions, advantages and disadvantages, and is suitable for different scenarios and needs.

[0003] Although there are a variety of processing options, in actual applications, service systems usually only set up a single processing solution to handle received business requests. However, the system may not be able to optimize all types of requests by using only one processing solution, because some solutions may perform well for certain types of requests but are less efficient for other types. The use of such a single solution may lead to performance bottlenecks, which in turn affects the overall system performance. Summary of the invention

[0004] Based on the above problems, the present application provides a method, system, device and storage medium for processing business requests, with the aim of selecting relatively appropriate processing logic for business requests of different task types to improve the processing efficiency of the service system for business requests.

[0005] The embodiments of the present application disclose the following technical solutions:

[0006] A method for processing a service request, when a client receives a service request of a target interface, the client uses an engine xNginx to mirror the service request to obtain a mirror request, sends the mirror request to a service request processing system, and applies the mirror request to the service request processing system, the method comprising:

[0007] Acquire a characteristic indicator of the mirroring request, and determine whether a task type of the mirroring request is a target task type based on the characteristic indicator of the mirroring request;

[0008] If the task type of the mirroring request is not the target task type, calculating the performance index of the mirroring request;

[0009] Determining a non-target task type corresponding to the mirror request based on a performance indicator of the mirror request;

[0010] Sending the non-target task type of the mirroring request to the server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type,

[0011] Wherein, the server is pre-configured with corresponding processing logic for each target task type and non-target task type.

[0012] In a possible implementation, the non-target task types include one or more of general tasks, batch processing tasks, real-time tasks, and large data volume tasks with execution priorities decreasing in sequence.

[0013] In a possible implementation, determining the non-target task type corresponding to the mirror request based on the performance indicator of the mirror request includes:

[0014] Calculate the call volume per unit time, response time and response body size of the mirror request;

[0015] If the calling amount per unit time of the mirror request is less than the first calling threshold, determining that the non-target task type of the mirror request is a general task;

[0016] If the calling amount per unit time of the mirror request is greater than the second calling threshold, determining that the non-target task type of the mirror request is a batch processing task;

[0017] If the response time of the mirroring request is less than the time threshold, determining that the non-target task type of the mirroring request is a real-time task;

[0018] If the response body size of the mirroring request is greater than the data volume threshold, determining that the non-target task type of the mirroring request is a large data volume task;

[0019] The second call threshold is greater than the first call threshold.

[0020] In a possible implementation, sending the non-target task type of the mirroring request to the server includes:

[0021] If the non-target task types include multiple tasks among the general situation tasks, the batch processing tasks, the real-time tasks and the large data volume tasks, the task with the highest execution priority is sent to the client as the non-target task type of the mirror request.

[0022] In a possible implementation, the target task type includes one or more of a suspended task, a critical task, a multi-threaded task, and a distributed task in descending order of execution priority.

[0023] In a possible implementation, the determining, based on the characteristic indicator of the mirroring request, whether the task type of the mirroring request is a target task type includes:

[0024] Based on the interrupt status indicator of the mirroring request, determining whether the task type of the mirroring request is the aborted task;

[0025] Based on the importance index of the mirror request, determining whether the task type of the mirror request is the critical task;

[0026] Based on the thread usage of the mirroring request, determining whether the task type of the mirroring request is the multi-threaded task;

[0027] Based on the task distribution of the mirroring request, it is determined whether the task type of the mirroring request is the distributed task.

[0028] In a possible implementation, the method includes:

[0029] If the task type of the mirror request is the target task type and the target task type includes the terminated task, the critical task, the multi-threaded task and multiple tasks in the distributed task, the task with the highest execution priority is sent to the server as the target task type of the mirror request, so that the server allocates corresponding processing logic to the business request of the target interface according to the target task type.

[0030] A system for processing a business request, the system comprising:

[0031] An acquisition unit, used to acquire characteristic indicators of a mirror request; the mirror request is obtained by the client using Nginx to mirror the service request, and the service request is a service request of a target interface;

[0032] A first determining unit, configured to determine whether a task type of the mirroring request is a target task type based on a characteristic indicator of the mirroring request;

[0033] A first calculation unit, for calculating a performance indicator of the mirroring request if the task type of the mirroring request is not a target task type;

[0034] A second determining unit, configured to determine a non-target task type corresponding to the mirroring request based on a performance indicator of the mirroring request;

[0035] A first sending unit, configured to send the non-target task type of the mirroring request to a server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type;

[0036] Wherein, the server is pre-configured with corresponding processing logic for each target task type and non-target task type.

[0037] A service request processing device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the service request processing method as described above is implemented.

[0038] A computer-readable storage medium stores instructions, and when the instructions are executed on an identity authentication platform, the identity authentication platform executes the method for processing a business request as described above.

[0039] Compared with the prior art, this application has the following beneficial effects:

[0040] In the embodiment of the present application, when the client receives a service request of the target interface, the client will use Nginx to mirror the service request to obtain a mirror request, and send the mirror request to the service request processing system. The service request processing system obtains the characteristic index of the mirror request, and determines whether the task type of the mirror request is the target task type based on the characteristic index of the mirror request. If the task type of the mirror request is not the target task type, the performance index of the mirror request is calculated, and the non-target task type corresponding to the mirror request is determined based on the performance index of the mirror request. The non-target task type of the mirror request is then sent to the server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type.

[0041] This application can classify and process mirror requests according to their actual task types by identifying characteristic indicators of mirror requests. This dynamic adaptation capability enables the system to select relatively appropriate processing logic according to different task types, improving the flexibility and efficiency of the server in processing business requests. And after determining the task type of the mirror request, if it is a non-target task type, the system will calculate the performance indicators of the mirror request and identify the corresponding non-target task type accordingly. Through judgment based on performance indicators, appropriate processing logic can also be assigned to each request to improve the efficiency of the server in processing business requests and the overall performance of the server.

[0042] In addition, this application uses Nginx to replicate business requests and generate mirror requests. Before these requests reach the server, the system will pre-analyze their task types and performance indicators. If it is detected that the task type of the mirror request does not meet the expected goal, the system will calculate its performance indicators to confirm that it is a non-target task type. Subsequently, the information of these non-target tasks will be transmitted to the server to assist the server in allocating appropriate processing logic to the request based on actual conditions. In this way, the system analyzes and pre-processes the request before it enters the server for processing, avoiding the situation where each request needs to wait in the queue for task type confirmation, thereby reducing processing delays, optimizing resource allocation, reducing the burden on the server, and effectively alleviating the problems caused by resource competition. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0044] Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;

[0045] Figure 2 A flowchart of an implementation method for processing a business request provided in an embodiment of the present application;

[0046] Figure 3 A schematic diagram of the structure of a system for processing business requests provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] As described above, there are various requests in the service system, so there are also various processing solutions, such as:

[0048] (1) First Come First Served (FCFS)

[0049] Principle: Process requests in the order they arrive, and the first requests that arrive are served first. Effect: Simple and easy to implement, suitable for scenarios where task priority is not obvious. Advantages: Simple to implement, easy to understand and implement. No starvation problem, every request will be processed. Disadvantages: May lead to long average waiting time (especially when some tasks are particularly time-consuming). Does not consider the urgency or resource requirements of the task.

[0050] (2) Shortest Job Next (SJN)

[0051] Principle: Prioritize the task with the shortest execution time. Effect: Reduce the average waiting time and improve system efficiency. Advantages: Can significantly reduce the average waiting time. Very effective when the task length is known. Disadvantages: Need to know the execution time of each task, which may be difficult to achieve in practical applications. May cause starvation problem for long-duration tasks.

[0052] (3) Highest Response Ratio Next (HRRN)

[0053] Principle: Calculate the response ratio of each task (response ratio = (waiting time + service time) / service time), and give priority to tasks with high response ratios. Function: Comprehensively consider waiting time and service time, with better fairness. Advantages: It can balance the priorities of short tasks and long tasks and reduce starvation. Improve the responsiveness of the system and user satisfaction. Disadvantages: Calculating the response ratio increases the complexity of scheduling. Waiting time and service time need to be updated in real time.

[0054] (4) Round Robin (RR)

[0055] Principle: Each task is assigned a fixed time slice, and the task is requeued after the time slice is used up until it is completed. Function: Used in time-sharing systems to ensure that each task has a chance to run. Advantages: Good fairness, each task can get CPU time. Suitable for interactive systems, the response time is predictable. Disadvantages: It is difficult to choose the time slice size. If the time slice is too large, the performance will decrease, and if it is too small, the switching overhead will be large. It is not suitable for long-term computing-intensive tasks.

[0056] (5) Earliest Deadline First (EDF)

[0057] Principle: Prioritize tasks with the earliest deadlines. Function: Applicable to real-time systems to ensure that tasks are completed before the deadline. Advantages: Can ensure that tasks are completed within the deadline (under load conditions that are not too high). Dynamic adjustment and strong adaptability. Disadvantages: May not meet the deadlines of all tasks under high load. High scheduling overhead for the system, requiring frequent calculations and sorting.

[0058] (6) Service Queuing Based on Semaphore

[0059] Principle: Use semaphores to control access to resources, and queue up to wait for the release of semaphores. Function: Control concurrent access, prevent resource competition and deadlock. Advantages: Effectively manage resources and avoid race conditions. Simple implementation, widely used in multi-threaded programming. Disadvantages: Improper use of semaphores may cause deadlock. Unable to handle priorities, all waiting processes are treated equally.

[0060] (7) Priority-based service queuing

[0061] Principle: Queue and schedule tasks according to their priorities, and process high-priority tasks first. Function: Ensure that important tasks are processed first. Advantages: Able to respond quickly to high-priority tasks, suitable for critical task scheduling. High flexibility, priority can be adjusted dynamically according to demand. Disadvantages: Low-priority tasks may suffer from starvation. Need to correctly set and manage task priorities, which increases complexity.

[0062] (8) Intelligent load balancing

[0063] Principle: Use various algorithms (such as hashing, consistent hashing, minimum number of connections, etc.) to dynamically assign tasks to each server to balance the load. Function: Improve the overall performance and reliability of the system and prevent single point overload. Advantages: Improve resource utilization and reduce server overload. Improve the fault tolerance and scalability of the system. Disadvantages: Complex implementation, need to maintain and monitor the load balancer. May introduce additional network delay and overhead. Etc.

[0064] Although the service system has many processing schemes for business requests, the service system generally only sets a single processing scheme to process received business requests. Different types of requests may require different processing methods to more effectively meet the needs. If only one processing scheme is used, it may not be possible to optimally process various types of requests. In addition, a processing scheme may perform well for a certain type of request, but be less efficient for other types of requests. Therefore, a single processing scheme may cause performance bottlenecks and affect the overall system performance.

[0065] Based on this, the embodiment of the present application provides a method, system and processor for processing a business request. When the client receives the business request of the target interface, it will mirror the request through Nginx and send the mirror request to the processing system. The processing system analyzes the characteristic index of the mirror request to determine whether its task type is the target task type. If it is not the target task type, its performance index is calculated and its non-target task type is determined, and then the information is sent to the server so that the server can allocate appropriate processing logic for the target business request. The present application improves the flexibility and efficiency of the server by identifying the characteristic index of the mirror request, dynamically classifying and processing according to different task types. At the same time, the non-target task type is determined by using the performance index, and appropriate processing logic is allocated to each request, thereby improving the overall performance and efficiency of the server. In addition, Nginx is used to mirror the business request to generate a mirror request, and the characteristic index of the mirror request is obtained. The system can judge the task type of the request before the request reaches the server. If the task type of the mirror request is not the target task type, the performance index is calculated to determine the corresponding non-target task type. Then, the non-target task type information is sent to the server, thereby helping the server to allocate corresponding processing logic according to the non-target task type. This method avoids the server from directly processing all requests. By analyzing and preprocessing requests in advance, it optimizes resource allocation and reduces the burden on the server, thereby effectively solving the problem of resource competition on the server.

[0066] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0067] See also Figure 1 , Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application.

[0068] The client receives the business request of the target interface, and mirrors the business request through the engine x (Nginx) to obtain the mirror request. The client will send the mirror request to a processing system for business requests independent of the server. The target interface refers to the interface in the business system or application that is set to ultimately process the business request. Nginx is a high-performance open source World Wide Web (Web) server software that can also be used as a reverse proxy, load balancing, and Hypertext Transfer Protocol (HTTP) cache. The client is a program or device that sends requests to the server and receives responses. For example, a web browser is a client that sends requests to a web server to obtain web page content. The server is a program or device that processes client requests and returns responses. For example, a web server receives requests from a browser, processes these requests, and returns web page content to the browser.

[0069] The processing system of the business request will obtain the characteristic indicators of the mirror request, and then determine whether the task type of the mirror request meets the target task type based on these indicators. The characteristic indicators of the mirror request refer to the data points used to describe and evaluate various performance and behaviors in the mirror request processing process. These indicators help monitor and optimize the system's responsiveness, load balancing, and resource utilization. The characteristic indicators of the mirror request specifically include but are not limited to interrupt status indicators, importance indicators, thread usage, and task distribution. The interrupt status indicator can indicate whether the task type of the mirror request is a suspended task, the importance indicator can indicate whether the task type of the mirror request is a critical task, the thread usage can indicate whether the task type of the mirror request is a multi-threaded task, and the task distribution can indicate whether the task type of the mirror request is a distributed task. The task types of suspended tasks, critical tasks, multi-threaded tasks, and distributed tasks are all target task types.

[0070] If the task type of the mirror request matches the target task type, the processing system will send the target task type corresponding to the mirror request to the server through the message queue middleware. The message queue middleware is a system component used to asynchronously process messages and tasks. The message queue middleware can pass the task type generated by the processing system of the business request to the server.

[0071] If the task type of the mirror request does not match the target task type, the processing system will calculate the performance indicators of the mirror request, such as the call volume per unit time, response time, and response body size, to determine which non-target task type the mirror request matches based on these performance indicators. The processing system will send the unique non-target task type corresponding to the mirror request to the server through the message queue middleware.

[0072] If the mirror request's call volume per unit time is less than the first call threshold, then the mirror request's non-target task type will be determined as a general situation task; if the mirror request's call volume per unit time is greater than the second call threshold, then the mirror request's non-target task type will be determined as a batch processing task; if the mirror request's response time is less than the time threshold, then the mirror request's non-target task type will be determined as a real-time task; if the mirror request's response body size is greater than the data volume threshold, then the mirror request's non-target task type will be determined as a large data volume task, and the data volume threshold is greater than the second call threshold and the first call threshold in turn. General situation tasks, batch processing tasks, real-time tasks, and large data volume tasks are all non-target task types.

[0073] In the server system, each task has a corresponding processing logic. The server will assign the corresponding processing logic to the business request of the target interface according to the target task type or non-target task type sent by the processing system.

[0074] Those skilled in the art will understand that Figure 1 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.

[0075] To facilitate understanding of the present application, a method for processing a service request provided in an embodiment of the present application is described below with reference to the accompanying drawings.

[0076] See also Figure 2 As shown in FIG. 1 , the figure is a flow chart of a method for processing a service request provided in an embodiment of the present application, such as Figure 2 As shown, the method may include S201-S204:

[0077] S201: Acquire a characteristic indicator of a mirroring request, and determine whether a task type of the mirroring request is a target task type based on the characteristic indicator of the mirroring request.

[0078] When the client receives a service request from the target interface, it generates a corresponding mirror request by mirroring the service request using Nginx, and then passes the mirror request to the service request processing system. Inside the service request processing system, the characteristic indicators of the obtained mirror request are extracted and analyzed to confirm whether the task type of the mirror request meets the preset target task type. This process usually involves identifying and comparing key features in the request, such as interrupt status indicators, importance indicators, thread usage, and task distribution, and then determining the specific task type corresponding to the request based on these data. If it is found that the task type of the mirror request does not meet the target requirements after the characteristic indicator analysis, the system will further calculate performance indicators or other indicators to assist in confirming its true type and decide how to further process the request accordingly.

[0079] In a possible implementation, the characteristic indicators of the mirror request include, but are not limited to, indicators such as an interrupt status indicator, an importance indicator, thread usage, and task distribution.

[0080] In a possible implementation, the target task type includes one or more of a suspended task, a critical task, a multi-threaded task, and a distributed task in descending order of execution priority.

[0081] Among them, aborted tasks: Aborted tasks refer to tasks with lower priority in the entire task flow or process. These tasks can be interrupted or paused in the overall task execution because their execution will not have a significant impact on the completion time of the overall task. Usually, aborted tasks are those that are not urgent or can be postponed.

[0082] Critical tasks: Critical tasks are tasks that are critical to the entire task process and must be completed on time. These tasks play a vital role in the successful completion of the overall task. Delays or failures may cause the entire task to fail to proceed as planned or have a significant impact.

[0083] Multithreaded tasks: Multithreaded tasks are tasks that can run multiple threads simultaneously to improve system performance and efficiency. By executing multiple threads concurrently, you can take full advantage of multi-core processors or multiple processing units, speed up task processing, and improve system throughput and responsiveness.

[0084] Distributed tasks: Distributed tasks are tasks that are processed by multiple nodes or computing resources. In a distributed system, tasks can be distributed on different computing nodes and completed through network communication. Distributed tasks can usually improve the scalability, fault tolerance and performance of the system.

[0085] In a possible implementation, determining whether the target task type of the mirror request is a suspended task, a critical task, a multi-threaded task, or a distributed task can be implemented based on an interrupt status indicator, an importance indicator, thread usage, and task distribution.

[0086] The interrupt status indicator involves tracking the number and type of interrupt requests for the mirror request. By checking the interrupt status indicator, you can determine whether the mirror request is an aborted task, that is, the processing process was unexpectedly interrupted or terminated;

[0087] Importance index is used to measure the priority and importance of different task types. By analyzing the importance index, it can be determined whether the image request is a critical task, that is, a task that has a significant impact on system functions or performance;

[0088] The thread usage indicator is used to monitor the number, status, and resource usage of threads in the system. By observing the thread usage, you can determine whether the image request is a multi-threaded task, that is, a task that needs to be completed in parallel using multiple threads;

[0089] Task distribution indicators involve monitoring the distribution and load ratio of different task types in the system. By evaluating the task distribution, you can confirm whether the image request is a distributed task, that is, a task that needs to be completed collaboratively on multiple nodes. These indicators combined provide comprehensive information to help determine the task type of the image request and provide important reference for system optimization and resource allocation.

[0090] Specifically, to determine the task type based on various indicators of the image request, analysis can be performed according to the following steps:

[0091] (1) The interruption status indicator determines the termination task:

[0092] Analyze interruption frequency: Monitor the number of times the image request is interrupted during processing. If the interruptions are frequent and cause the request to fail to complete, it may indicate that the request is an aborted task.

[0093] Evaluate the cause of the interruption: Check the cause of the interruption (such as insufficient resources, priority change, etc.). If the interruption is due to the system actively terminating or pausing the task, it can be confirmed as an aborted task.

[0094] (2) Importance indicators determine key tasks:

[0095] Priority Assessment: The priority of the request is assessed by importance indicators. High priority requests are usually considered mission-critical.

[0096] Business impact analysis: Consider the impact of the request on the business, such as whether it is related to core business processes. Requests with high importance are mission-critical.

[0097] (3) Thread usage determines multi-threaded tasks:

[0098] Thread count monitoring: Counts the number of threads used by a request during processing. If a request involves multiple threads executing simultaneously, it can be classified as a multi-threaded task.

[0099] Resource allocation analysis: observe the resource usage of threads (such as CPU and memory). Multithreaded tasks usually require higher resource scheduling and management.

[0100] (4) Task distribution determines the distributed tasks:

[0101] Node distribution view: Analyze the distribution of requests on different computing nodes. If a request is processed in parallel on multiple nodes, it can be considered a distributed task.

[0102] Load balancing analysis: Evaluate the request load to ensure efficient use of resources in a distributed environment.

[0103] Through the above steps, combined with specific data and system behavior, the task type of the image request can be effectively identified, so as to perform reasonable scheduling and optimization.

[0104] It should also be noted that the execution priorities of target task types such as suspended tasks, critical tasks, multi-threaded tasks, and distributed tasks are in descending order, with suspended tasks having the highest execution priority and distributed tasks having the lowest execution priority. When a mirror request includes two or more target task types, the one with the highest execution priority is determined as the only target task type of the mirror request.

[0105] Exemplarily, assuming that the mirroring request belongs to both target task types, namely, a critical task and a distributed task, it is determined that the only target task type of the mirroring request is a critical task.

[0106] In a possible implementation, the method includes:

[0107] If the task type of the mirror request is the target task type and the target task type includes the terminated task, the critical task, the multi-threaded task and multiple tasks in the distributed task, the task with the highest execution priority is sent to the server as the target task type of the mirror request, so that the server allocates corresponding processing logic to the business request of the target interface according to the target task type.

[0108] Specifically, if the task type of a mirror request meets the predetermined target task type, and these target task types contain multiple different tasks (such as aborted tasks, critical tasks, multi-threaded tasks, and distributed tasks), the system will select the task type with the highest execution priority and send it to the server as the target task type of the mirror request. If the task type of a mirror request meets the predetermined target task type, and these target task types only contain different tasks, the system will send the only target task type of the mirror request to the server.

[0109] After receiving the target task type of the image request, the server will assign the corresponding processing logic to the business request according to this type. This means that the system will give priority to the most important or urgent tasks to ensure the effective use of resources and the smooth progress of business.

[0110] S202: If the task type of the mirroring request is not the target task type, calculate the performance index of the mirroring request.

[0111] If the task type of the image request does not match the expected target task type, the system will calculate the performance index of the image request. This can assess the load or impact it may have on the system so that appropriate processing measures can be taken.

[0112] In a possible implementation, the performance index of the mirror request includes the call volume per unit time, the response time, and the response body size of the mirror request.

[0113] Request Rate refers to the number of requests that the system can handle within a specific time window. For mirror requests, this metric measures the system's ability to handle mirror requests within a certain period of time (e.g., per second, per minute). If the system handles 6,000 identical mirror requests within 1 minute, the system's request rate for the mirror request is 100 requests per second. This metric reflects the system's throughput, which directly affects the system's load capacity and performance.

[0114] Response time refers to the time interval from when the system receives a request to when it returns a response. In an image request, the response time reflects how quickly the system processes the image request and generates or provides the image. The response time includes the request receiving time, processing time, and return time. If an image request arrives at 10:00:00 and the system returns a response at 10:00:05, the response time is 5 seconds. A shorter response time indicates that the system can process and respond to requests quickly, improving the user experience, which is especially important in scenarios that require real-time or near real-time image updates.

[0115] Response size refers to the amount of data returned by the system to the client, usually in bytes. In an image request, the response size indicates the actual amount of data in the image file. If an image file is 10 megabytes (MB), when the system returns this file, the response size is 10,000,000 bytes. The response size directly affects the bandwidth requirements and transmission time of data transmission. Larger response bodies require more network bandwidth and time to transmit, which may cause higher latency and network congestion.

[0116] In addition, when there are multiple mirror requests at the same time, it is necessary to calculate the average response time and average response body size, rather than simply adding the response time and response body size. By calculating the average, the overall performance can be more accurately reflected, avoiding individual outliers from having too much impact on the results. Therefore, for multiple mirror requests, statistical average response time and average response body size can provide more comprehensive and accurate performance indicators.

[0117] S203: Determine a non-target task type corresponding to the mirror request based on the performance indicator of the mirror request.

[0118] Based on the performance data and indicators of a given image request, it is determined whether the task type represented by the request meets the specified criteria. By analyzing the performance data of the image request, the request can be classified into different types of tasks, such as general tasks, batch processing tasks, real-time tasks, or large data volume tasks.

[0119] In a possible implementation, the non-target task types include one or more of general tasks, batch processing tasks, real-time tasks, and large data volume tasks with execution priorities decreasing in sequence.

[0120] Among them, general tasks refer to tasks that are run when the request load is stable and the call frequency is low. These tasks will not cause high load or performance fluctuations in the system, so their processing will not cause resource shortages under normal system operation. Due to their stability, giving these tasks high priority can ensure that the system can respond quickly when the load is stable, thereby improving user experience and avoiding response delays. Such tasks are usually common requests in daily system operations that have little impact on performance.

[0121] Batch processing tasks: Batch processing tasks usually involve a large number of requests, which may cause increased system load and performance fluctuations. In order to handle these high-request tasks, they are classified as batch processing tasks so that they can be processed or optimized in a centralized manner to avoid affecting the overall performance and response speed of the system.

[0122] Real-time tasks: Real-time tasks are time-sensitive tasks that require rapid response and processing in real time or near real time. Real-time tasks require the system to react to events almost immediately to ensure timely feedback or action. This is usually applicable to applications with high requirements for speed and immediacy, such as online transactions, real-time data processing, or instant messaging, to ensure accurate and fast responses at the moment an event occurs.

[0123] Large-scale data tasks: Large-scale data tasks involve processing and analyzing large data sets, which are usually completed efficiently through parallel computing or distributed processing. Parallel computing divides data and processes it simultaneously on multiple processing units, while distributed processing uses multiple servers or nodes to process data together. These technologies ensure that the system can process large amounts of data in a reasonable time, meeting high requirements for speed and efficiency.

[0124] In a possible implementation, the determining, based on the performance indicator of the mirroring request, the non-target task type corresponding to the mirroring request may be implemented in the following manner:

[0125] General task: If the mirror request's call volume per unit time (e.g., 1 second) is less than the first call threshold (e.g., 100 times), the mirror request is classified as a general task. General tasks usually indicate that the requested load is relatively stable and will not cause high load or performance fluctuations in the system. Setting a higher priority for these requests helps ensure that the system can respond quickly under normal load conditions and provide a good user experience.

[0126] Batch processing task: When the mirror request call volume per unit time (e.g., 1 second) is greater than the second call threshold (e.g., 200 times), the mirror request can be positioned as a batch processing task. This type of task involves the centralized processing of a large amount of data or requests, aiming to improve the efficiency of the operation. The second call threshold is greater than the first call threshold.

[0127] Real-time task: If the response time of the mirror request is lower than the set time threshold (such as 50 milliseconds), the mirror request can be identified as a real-time task. Real-time tasks require rapid response and processing at or near the same time as the actual event occurs.

[0128] Large data volume tasks: When the size of the response body of a mirror request exceeds the data volume threshold (such as 500 megabytes), the mirror request can be marked as a large data volume task. This type of task requires processing requests containing large amounts of data, and usually requires the use of parallel computing or distributed processing to effectively process large data sets.

[0129] In addition, when there are multiple mirror requests at the same time, it is necessary to determine the non-target task type corresponding to the mirror request based on the average response time and the average response body size. In other words, when the average response time of the mirror request is less than the time threshold, the non-target task type of the mirror request can be determined as a real-time task; when the average response body size of the mirror request is greater than the data volume threshold, the non-target task type of the mirror request can be determined as a large data volume task.

[0130] It should also be noted that the execution priorities of these non-target task types, such as general situation tasks, batch processing tasks, real-time tasks, and large data volume tasks, are in descending order, with general situation tasks having the highest execution priority and large data volume tasks having the lowest execution priority. When a mirror request includes two or more non-target task types, the one with the highest execution priority is determined as the only non-target task type of the mirror request.

[0131] Exemplarily, assuming that the mirror request belongs to both general case tasks and real-time tasks, it is determined that the only non-target task type of the mirror request is the general case task.

[0132] S204: Send the non-target task type of the mirroring request to the server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type.

[0133] The non-target task types of the mirroring request are sent to the server so that the server can allocate corresponding processing logic to the service requests of the target interface according to these non-target task types.

[0134] Specifically, in this case, by identifying the non-target task type (such as general task, batch processing task, real-time task or large data volume task) of the mirror request, the corresponding information can be sent to the server. The server will decide how to handle the request according to the non-target task type received, and adopt appropriate processing logic and operations to ensure correct response and processing of different types of tasks.

[0135] In this way, the server can understand and process different types of image requests more effectively, provide targeted services, and allocate appropriate processing strategies and resources according to the task type to meet the needs of different types of tasks.

[0136] In a possible implementation, the method includes:

[0137] If the non-target task types include multiple tasks among the general situation tasks, the batch processing tasks, the real-time tasks and the large data volume tasks, the task with the highest execution priority is sent to the client as the non-target task type of the mirror request.

[0138] Specifically, if the task type of a mirror request meets the predetermined non-target task type, and these non-target task types include multiple different tasks (such as general situation tasks, batch processing tasks, real-time tasks, and large data volume tasks), the system will select the task type with the highest execution priority and send it to the server as the non-target task type of the mirror request. If the task type of a mirror request meets the predetermined non-target task type, and these non-target task types only include different tasks, the system will send the only non-target task type of the mirror request to the server.

[0139] After receiving the non-target task type of the image request, the server will assign the corresponding processing logic to the business request according to this type. This means that the system will give priority to the most important or urgent tasks to ensure the effective use of resources and the smooth progress of business.

[0140] It should also be noted that the server has pre-configured corresponding processing logic for each target task type and non-target task type. This configuration ensures that the system can quickly adapt and process different types of requests, thereby improving overall processing efficiency and system responsiveness.

[0141] For example, general tasks correspond to the processing logic of "first come, first served": simple processing, no special priority required.

[0142] Batch processing tasks correspond to the processing logic of "short jobs first": tasks with shorter execution time are prioritized to improve overall efficiency.

[0143] Real-time tasks correspond to the processing logic of "earliest deadline first": ensuring that the task is completed before the deadline, which is suitable for real-time systems.

[0144] Large data volume tasks correspond to the processing logic of "priority-based service queuing": assigning priorities based on the importance or demand of the task.

[0145] The termination task corresponds to the processing logic of "semaphore-based service queuing": controlling task execution and termination to avoid resource contention.

[0146] Critical tasks correspond to the processing logic of "highest response ratio priority": ensuring that critical tasks are given priority and improving the response ratio.

[0147] Multi-threaded tasks correspond to the processing logic of "time slice rotation": fair distribution of processing time, suitable for multi-threaded concurrent execution.

[0148] Distributed tasks correspond to the processing logic of "intelligent load balancing": dynamically assigning tasks to different nodes to improve the performance and reliability of distributed systems.

[0149] In addition, the present application does not limit the specific processing logic corresponding to the target task type and the non-target task type, and the user can adjust the specific processing logic corresponding to the target task type and the non-target task type according to the actual situation.

[0150] Based on the description of S201-S204, after the client of the embodiment of the present application receives the service request of the target interface, it generates a mirror request through Nginx for mirror copying and sends it to the service request processing system. The processing system obtains the characteristic index of the mirror request and confirms whether the task type is the target task type; if not, the performance index is calculated and the non-target task type is determined. Subsequently, the non-target task type information is sent to the server to help the server allocate appropriate processing logic for the service request. The present application realizes the dynamic classification and processing of the request task type by identifying the characteristic index of the mirror request. This method improves the flexibility and efficiency of the server, and allocates relatively suitable processing logic to each request through the calculation and determination of the performance index, thereby optimizing the overall performance of the server. In addition, Nginx is used to copy the service request to generate a mirror request, and the task type and performance index are pre-evaluated before the service request arrives at the server. When it is identified that the task type of the mirror request does not meet the target requirements, the system will calculate the performance index to confirm the non-target task type, and transmit this information to the server to assist the server in allocating appropriate processing logic for the service request. By analyzing and processing requests in advance, it is possible to avoid the situation where each request must wait for its task type calculation processing on the server side, reducing potential processing delays, optimizing resource allocation, and reducing the burden on the server side. At the same time, it also reduces the problem of resource competition on the server side, making the processing logic more intelligent and efficient.

[0151] Based on the method for processing a service request provided by the above method embodiment, the embodiment of the present application also provides a system for processing a service request, which will be described below in conjunction with the accompanying drawings.

[0152] See also Figure 3 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a service request processing system provided in an embodiment of the present application. Figure 3 As shown, the system for processing the business request includes:

[0153] The acquisition unit 301 is used to acquire characteristic indicators of a mirror request; the mirror request is obtained by the client using Nginx to mirror the service request, and the service request is a service request of a target interface;

[0154] A first determining unit 302 is used to determine whether the task type of the mirroring request is a target task type based on the characteristic indicator of the mirroring request;

[0155] A first calculation unit 303, for calculating a performance index of the mirroring request if the task type of the mirroring request is not a target task type;

[0156] A second determining unit 304 is used to determine a non-target task type corresponding to the mirroring request based on the performance indicator of the mirroring request;

[0157] A first sending unit 305, configured to send the non-target task type of the mirroring request to the server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type;

[0158] Wherein, the server is pre-configured with corresponding processing logic for each target task type and non-target task type.

[0159] In a possible implementation, the non-target task types include one or more of general tasks, batch processing tasks, real-time tasks, and large data volume tasks with execution priorities decreasing in sequence.

[0160] In a possible implementation manner, the second determining unit 304 specifically includes:

[0161] A calculation unit, used to calculate the call volume per unit time, the response time and the response body size of the mirror request;

[0162] A general situation task determination unit, for determining that the non-target task type of the mirror request is a general situation task if the call amount per unit time of the mirror request is less than a first call threshold;

[0163] a batch processing task determination unit, for determining that the non-target task type of the mirroring request is a batch processing task if the call amount per unit time of the mirroring request is greater than a second call threshold;

[0164] a real-time task determination unit, for determining that the non-target task type of the mirror request is a real-time task if the response time of the mirror request is less than a time threshold;

[0165] a large data volume task determination unit, for determining that the non-target task type of the mirroring request is a large data volume task if the response body size of the mirroring request is greater than a data volume threshold;

[0166] The second call threshold is greater than the first call threshold.

[0167] In a possible implementation, the first sending unit 305 specifically includes:

[0168] If the non-target task type includes multiple tasks among the general task, the batch processing task, the real-time task and the large data volume task, the task with the highest execution priority is sent to the client as the non-target task type of the mirror request.

[0169] In a possible implementation, the target task type includes one or more of a suspended task, a critical task, a multi-threaded task, and a distributed task in descending order of execution priority.

[0170] In a possible implementation manner, the first determining unit 302 specifically includes:

[0171] A suspended task determining unit, configured to determine whether the task type of the mirroring request is the suspended task based on the interruption status indicator of the mirroring request;

[0172] A critical task determining unit, configured to determine whether the task type of the mirroring request is the critical task based on the importance index of the mirroring request;

[0173] A multi-threaded task determination unit, configured to determine whether the task type of the mirroring request is the multi-threaded task based on the thread usage of the mirroring request;

[0174] The distributed task determination unit is used to determine whether the task type of the mirroring request is the distributed task based on the task distribution of the mirroring request.

[0175] In a possible implementation, the system further includes:

[0176] The second sending unit is used to send the task with the highest execution priority to the server as the target task type of the mirror request if the task type of the mirror request is the target task type and the target task type includes the terminated task, the critical task, the multi-threaded task and multiple tasks in the distributed task, so that the server allocates corresponding processing logic to the business request of the target interface according to the target task type.

[0177] In addition, an embodiment of the present application also provides a service request processing device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the service request processing method described above is implemented.

[0178] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an identity authentication platform, the identity authentication platform executes the method for processing a business request as described above.

[0179] The embodiment of the present application provides a system for processing business requests, first using an acquisition unit 301 to acquire characteristic indicators of a mirror request, wherein the mirror request is obtained by the client using Nginx to mirror the business request, and the business request is a business request of a target interface, and using a first determination unit 302 to determine whether the task type of the mirror request is a target task type based on the characteristic indicators of the mirror request. If the task type of the mirror request is not the target task type, the performance indicator of the mirror request is calculated by the first calculation unit 303. Then, the second determination unit 304 is used to determine the non-target task type corresponding to the mirror request based on the performance indicator of the mirror request, so that the first sending unit 305 sends the non-target task type of the mirror request to the server, and the server can allocate corresponding processing logic to the business request of the target interface according to the non-target task type.

[0180] This application identifies the characteristic indicators of mirror requests, dynamically classifies and processes different task types, thereby selecting the most suitable processing logic for business requests, improving system flexibility and the processing efficiency of business requests on the server side. After the system determines the task type, if it finds that the request is not the target task type, it will identify the corresponding non-target task according to the performance indicators, and assign appropriate processing logic to each request to optimize the overall performance and efficiency of the server when processing business requests. In addition, this application replicates the business request through Nginx, generates a mirror request, and pre-analyzes its task type and performance indicators before the request reaches the server. If it is found that the task type of the mirror request does not meet the target requirements, the system will calculate its performance indicators to identify it as a non-target task type. Subsequently, the information of these non-target task types will be sent to the server side to help the server side allocate appropriate processing logic according to the specific situation. This method avoids the need for each request on the server side to queue up for task type acquisition processing by analyzing and pre-processing the request in advance, thereby reducing processing delays, optimizing resource allocation, reducing the burden on the server side, and effectively solving the problem of resource competition.

[0181] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system embodiment described above is merely schematic, in which the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, 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. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0182] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing a service request, characterized in that: When the client receives a service request of the target interface, the client uses the engine xNginx to mirror the service request to obtain a mirror request, sends the mirror request to the service request processing system, and applies it to the service request processing system. The method includes: Acquire a characteristic indicator of the mirroring request, and determine whether a task type of the mirroring request is a target task type based on the characteristic indicator of the mirroring request; If the task type of the mirroring request is not the target task type, calculating the performance index of the mirroring request; Determining a non-target task type corresponding to the mirror request based on a performance indicator of the mirror request; Sending the non-target task type of the mirroring request to the server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type, Wherein, the server is pre-configured with corresponding processing logic for each target task type and non-target task type.

2. The method according to claim 1, characterized in that The non-target task types include one or more of general situation tasks, batch processing tasks, real-time tasks and large data volume tasks with execution priorities decreasing in sequence.

3. The method according to claim 2, characterized in that The determining, based on the performance indicator of the mirror request, a non-target task type corresponding to the mirror request includes: Calculate the call volume per unit time, response time and response body size of the mirror request; If the calling amount per unit time of the mirror request is less than the first calling threshold, determining that the non-target task type of the mirror request is a general task; If the calling amount per unit time of the mirror request is greater than the second calling threshold, determining that the non-target task type of the mirror request is a batch processing task; If the response time of the mirroring request is less than the time threshold, determining that the non-target task type of the mirroring request is a real-time task; If the response body size of the mirroring request is greater than the data volume threshold, determining that the non-target task type of the mirroring request is a large data volume task; The second call threshold is greater than the first call threshold.

4. The method according to claim 2, characterized in that: The sending of the non-target task type of the mirroring request to the server includes: If the non-target task types include multiple tasks among the general situation tasks, the batch processing tasks, the real-time tasks and the large data volume tasks, the task with the highest execution priority is sent to the client as the non-target task type of the mirror request.

5. The method according to claim 1, characterized in that The target task type includes one or more of a suspended task, a critical task, a multi-threaded task, and a distributed task with execution priorities decreasing in sequence.

6. The method according to claim 5, characterized in that The determining, based on the characteristic indicator of the mirroring request, whether the task type of the mirroring request is a target task type includes: Based on the interrupt status indicator of the mirroring request, determining whether the task type of the mirroring request is the aborted task; Based on the importance index of the mirror request, determining whether the task type of the mirror request is the critical task; Based on the thread usage of the mirroring request, determining whether the task type of the mirroring request is the multi-threaded task; Based on the task distribution of the mirroring request, it is determined whether the task type of the mirroring request is the distributed task.

7. The method according to claim 5, characterized in that The method comprises: If the task type of the mirror request is the target task type and the target task type includes the terminated task, the critical task, the multi-threaded task and multiple tasks in the distributed task, the task with the highest execution priority is sent to the server as the target task type of the mirror request, so that the server allocates corresponding processing logic to the business request of the target interface according to the target task type.

8. A system for processing a service request, the system comprising: An acquisition unit, used to acquire characteristic indicators of an image request; The mirror request is obtained by the client using Nginx to mirror the service request, and the service request is a service request of the target interface; A first determining unit, configured to determine whether a task type of the mirroring request is a target task type based on a characteristic indicator of the mirroring request; A first calculation unit, for calculating a performance indicator of the mirroring request if the task type of the mirroring request is not a target task type; A second determining unit, configured to determine a non-target task type corresponding to the mirroring request based on a performance indicator of the mirroring request; A first sending unit, configured to send the non-target task type of the mirroring request to a server, so that the server allocates corresponding processing logic to the service request of the target interface according to the non-target task type; Wherein, the server is pre-configured with corresponding processing logic for each target task type and non-target task type.

9. A service request processing device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for processing a service request according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on the identity authentication platform, the identity authentication platform executes the method for processing a business request according to any one of claims 1 to 7.