Business processing method and device

By introducing event pools and task queues in OBS, business requests are processed asynchronously, solving the problem of low efficiency in business request processing under the hierarchical architecture, and achieving more efficient business request processing.

CN119922148APending Publication Date: 2025-05-02HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311435990.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

OBS is less efficient when processing user business requests through a hierarchical architecture.

Method used

By receiving business requests, storing them in the event pool, and scheduling business requests in the event pool to the task queue, the consumer threads used for processing from the consumer thread pool is scheduled from each subtask of the business requests in the task queue to complete the processing of business requests in the task queue.

Benefits of technology

It realizes the processing of business requests through asynchronous means, and improves the efficiency of service nodes in processing business requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922148A_ABST
    Figure CN119922148A_ABST
Patent Text Reader

Abstract

The invention discloses a service processing method and device, and belongs to the technical field of network services. The method is applied to a first service node, and comprises the following steps: receiving a service request; storing the received service request in an event pool; scheduling the service requests in the event pool to a task queue; and scheduling a consumption thread for processing each sub-task for each sub-task of the service request in the task queue from a consumption thread pool so as to complete processing of the service request in the task queue. Through the method, the service processing efficiency of the service node can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network service technology, and in particular to a service processing method and device. Background Art

[0002] With the rapid development of the Internet, object storage technology based on the hypertext transfer protocol (HTTP) is widely used in a large number of Internet scenarios, and provides users with massive, secure, low-cost and highly reliable unstructured cloud storage services, such as object storage service (OBS).

[0003] Currently, OBS generally uses a layered architecture solution including a business layer and a status layer to process user service requests. Specifically, the business layer of OBS first parses the user's service request to decompose the service request into multiple calls that the status layer can understand. Then, the status layer executes the call to obtain the result and returns the result to the user.

[0004] However, OBS is inefficient in processing user service requests through a layered architecture. Summary of the invention

[0005] The present application provides a service processing method and device, which can improve the efficiency of service node processing services.

[0006] In a first aspect, the present application provides a business processing method, which is applied to a first service node, and the method includes: receiving a business request; storing the received business request in an event pool; scheduling the business request in the event pool to a task queue; and scheduling a consumer thread for processing each subtask of the business request in the task queue from a consumer thread pool to complete the processing of the business request in the task queue.

[0007] Through the method provided by the present application, it is possible to process each subtask in a service request through different consumer threads, and each consumer thread can be released after processing its own subtask, and the released consumer thread can be used to execute tasks of other service requests. In this way, the service node achieves the purpose of processing service requests in an asynchronous manner, thereby improving the efficiency of the service node in processing service requests.

[0008] In one possible design, the first service node is configured with multiple task queues, and the above method also includes: collecting service performance parameters in the process of processing business requests, the service performance parameters including at least one of the following parameters: processing delay, processing frequency or processing success rate of business requests; the service performance parameters are used to determine the target number of consumer threads configured for each task queue in the multiple task queues in the consumer thread pool; obtain the target number; and configure consumer threads for each task queue in the multiple task queues in the consumer thread pool according to the obtained target number.

[0009] Through this possible design method, the service node can configure the number of consumer threads configured for each task queue in the consumer thread pool according to the service performance parameters in the process of processing business requests. Since the change in the number of consumer threads can directly affect the speed at which the first service node processes the business requests in the task queue, through this method, the speed of processing business can be adjusted based on the runtime performance parameters of the service node in the process of processing business, so that overload can be avoided.

[0010] In another possible design, the multiple task queues configured by the first service node are used to store different types of service requests, and one task queue among the multiple task queues is used to store the same type of service requests.

[0011] In another possible design, the type of business request includes at least two of the following types: disk input / output (I / O) type, network I / O type, central processing unit (CPU) computing type or graphics processing unit (GPU) computing type.

[0012] Among them, the disk I / O type, network I / O type, CPU computing type, and GPU computing type are the result of classifying business requests according to the types of resources required to process business requests. Therefore, through the above two possible designs, it is possible to associate business requests with the resources required to process business requests through task queues. In this way, the size of the task queue and the rate of scheduling consumer threads can be adjusted according to the resource capacity of the service node, which can avoid overloading of the service node.

[0013] In another possible design, the above-mentioned dispatching of the service request in the event pool to the task queue includes: dispatching the service request in the event pool to the event queue; for the first service request dispatched to the event queue, converting the first service request from the first format to the second format; identifying the type of the first service request expressed in the second format; and dispatching the first service request to a task queue in a plurality of task queues for storing service requests of corresponding types according to the type of the first service request. The first service request is any service request dispatched to the event queue, the first format is the data format used when the first service request is transmitted in the network, and the second format is the format corresponding to the data transmission protocol used by the service provided by the first service node.

[0014] Through this possible design method, an event queue is introduced in the process of scheduling business requests to the task queue, and after multiple threads perform operations such as format conversion and type identification on business requests in the event queue, the business requests are scheduled to the task queue according to type. Therefore, when multiple threads concurrently process business requests in the event queue, the scheduling efficiency of scheduling business requests to the task queue can be improved.

[0015] In another possible design, the above-mentioned identifying the type of the first business request expressed in the second format includes: identifying the target task of the first business request expressed in the second format; splitting the first business request into multiple sub-requests for implementing multiple sub-tasks in the target task; and determining the type of each sub-request in the multiple sub-requests. The above-mentioned scheduling of the first business request to a task queue in multiple task queues for storing business requests of corresponding types according to the type of the first business request includes: scheduling each sub-request to a task queue in multiple task queues for storing business requests of corresponding types according to the type of each sub-request in the aforementioned multiple sub-requests.

[0016] Through this possible design, a business request can be split into sub-requests that implement multiple sub-tasks. Therefore, when processing a business request, the smaller the granularity of the business request split, the more consumer threads the service node can call when processing the business request. By processing business requests concurrently through multiple consumer threads, the processing efficiency of business requests can be improved.

[0017] In another possible design, before obtaining the target number, the method further includes: obtaining service performance parameters collected by other service nodes except the first service node in the service cluster where the first service node is located; determining the fitness of each service node in the service cluster according to the service performance parameters collected by other service nodes and the service performance parameters collected by the first service node; when there is a service node in the service cluster whose fitness exceeds a threshold, determining the service node with the highest fitness in the service cluster as the target service node; and determining the number of consumer threads configured by the target service node for each task queue in the target task node as the target number. The fitness is characterized by latency and / or data transmission bandwidth. For example, the latency is the P99 latency.

[0018] In another possible design, the method further includes: when there is no service node whose fitness exceeds a threshold in the service cluster where the first service node is located, multiple initial target service nodes are determined in the service cluster according to the fitness of each service node; the genes of the multiple initial target service nodes are crossed and / or mutated; and the target quantity is determined according to the current genes of the third service node. The value of the gene of the initial target service node is used to characterize the number of consumer threads currently configured by the initial target service node for each task queue. The third service node is any one of the multiple initial target service nodes after the genes are crossed and / or mutated.

[0019] In another possible design, when the multiple task queues configured by the first service node include a network I / O task queue for storing network I / O type business requests, the above method further includes: obtaining the maximum concurrency number allowed to be called by the second service node; determining the target number of consumer threads configured for the network I / O task queue in the first service node according to the maximum concurrency number and the number of consumer threads configured for the network I / O task queue indicated by the current gene of the third service node; and determining the number of consumer threads configured for other task queues indicated by the current gene of the third service node as the target number of consumer threads configured for the corresponding task queue in the first service node. The other task queue is a task queue other than the network I / O task queue among the multiple task queues, and the second service node is used to provide the service called by the business request in the network I / O task queue.

[0020] Through the above-mentioned possible design methods, it is possible to use genetic algorithms to find the optimal solution for the number of consumer threads that the service node needs to configure for each task queue, and this optimal solution can make the service node have high adaptability in the process of processing business requests, that is, the performance of the service node is excellent.

[0021] In another possible design, for a second service request with a first quality of service (QoS) level in the event pool, scheduling the service request in the event pool to the task queue includes: inserting the second service request into the task queue before the third service request. The third service request is a service request with a second QoS level that has been scheduled to the task queue, and the first QoS level is higher than the second QoS level.

[0022] Through this possible design, it is possible to schedule a service request with a high QoS level to the front of the task queue, so that the service request can be processed with priority. For example, assuming that the QoS level of the sub-request for requesting to obtain the first batch of bytes of data is set to high, the service node can quickly execute the service request and return the first batch of bytes to the user, which can improve the user's experience of using network services.

[0023] In another possible design, the first service node is an object storage service (OBS) node. Through this possible design, the method provided by the present application can be applied to OBS.

[0024] In a second aspect, the present application provides a service processing device.

[0025] In one possible design, the business processing device is used to execute any one of the methods provided in the first aspect above. The present application may divide the business processing device into functional modules according to any one of the methods provided in the first aspect above. For example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. Exemplarily, the present application may divide the business processing device into a receiving unit and a processing unit, etc. according to the function. The description of the possible technical solutions and beneficial effects executed by the above-mentioned divided functional modules can refer to the technical solutions provided by the above-mentioned first aspect or its corresponding possible design, and will not be repeated here.

[0026] In another possible design, the business processing device includes: one or more processors, a memory, and a communication interface, the one or more processors receiving or sending data through the communication interface, and the one or more processors being configured to call program instructions stored in the memory so that the business processing device executes any method provided by the first aspect and any possible design thereof.

[0027] In a third aspect, the present application provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium, and the computer-readable storage medium includes program instructions. When the program instructions are executed on a computing device, the computing device executes the method provided in the first aspect of the present application and any possible implementation thereof.

[0028] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device, enables the computing device to execute the method provided in the first aspect of the present application and any possible implementation thereof.

[0029] It can be understood that any of the above-mentioned devices, computer storage media or computer program products can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.

[0030] In this application, the name of the above-mentioned business processing device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they belong to the scope of this application and its equivalent technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a structural diagram of an implementation environment of the business processing method provided in an embodiment of the present application;

[0032] Figure 2 This is a flowchart of a business processing method provided by an embodiment of the present application;

[0033] Figure 3 is a schematic diagram of a task queue provided in an embodiment of the present application;

[0034] Figure 4 This is another flowchart of the service processing method provided in the embodiment of the present application;

[0035] Figure 5 This is another flowchart of the service processing method provided in the embodiment of the present application;

[0036] Figure 6 This is a schematic diagram of writing a service request to a task queue provided by an embodiment of the present application;

[0037] Figure 7 It is a schematic diagram of a process for determining the number of consumer threads that need to be configured for each task queue provided by an embodiment of the present application;

[0038] Figure 8This is a schematic diagram of obtaining the maximum number of concurrent calls allowed by the second service node provided in an embodiment of the present application;

[0039] Fig. 9 It is a structural diagram of a service processing device provided in an embodiment of the present application;

[0040] Fig.10 It is a structural diagram of a service node provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0042] To facilitate understanding, the technology and background involved in the embodiments of the present application are first explained below.

[0043] 1) Object Storage

[0044] Object storage is also called "object-based storage". Many cloud vendors also directly call object storage "cloud storage", such as object storage service (OBS).

[0045] Object storage stores and manages data as objects. An object includes an object identifier, data (data) and metadata (Metadata). Among them, the object identifier is an identifier that uniquely identifies the object globally and is used to retrieve the object. Data refers to the data itself to be stored by the user. Metadata is generally descriptive information of the data. For example, when the data is a photo, the metadata is the name, gender, age, photo shooting time, shooting location and other information of the person in the photo. For the sake of ease of description, the object data described below in the embodiments of the present application refers to the data itself stored based on object storage technology.

[0046] In some examples, OBS uses a distributed microservice architecture to provide object storage services for users. Multiple service nodes in the microservice architecture provide multiple microservices of OBS. For example, in the microservice architecture of OBS, it includes an entry service node and a metadata service node. Among them, the entry service node is used to provide users with microservices for accessing OBS, and the metadata service node is used to provide users with microservices for querying object metadata. In addition, after receiving a business request from a user, the entry service node splits the business request into at least one microservice request according to the task requested by the business request, and sends the split microservice request to the service node that provides the corresponding microservice. For example, a microservice request for requesting to query object data metadata is sent to a metadata service node.

[0047] Since OBS is essentially a network service and is usually accessed by a large number of users, the nodes that provide each microservice in OBS are generally configured in a cluster. Optionally, in a service cluster that provides any microservice, the service nodes in the service cluster usually have the same or similar software and hardware configurations.

[0048] 2) Blocking call

[0049] A blocking call means that before the result is returned, the current thread is suspended and cannot perform other processing until the calculation result is obtained, and the thread can be called again.

[0050] 3) P99 delay

[0051] The 99 in P99 latency refers to the 99th percentile. When 99% of the requests have a lower latency than the given latency, that is, 1% of the requests have a higher latency than the given latency. In this case, the given latency is recorded as the P99 latency. Therefore, the P99 latency can be represented by the average latency of the slowest 1% of requests over a period of time. As an example, P99 1.403 means that the average latency of the slowest 1% of requests in the past 10 seconds is 1.403 seconds.

[0052] 4) Genetic algorithm (GA)

[0053] Genetic algorithms are designed and proposed based on the laws of evolution of organisms in nature. They are computational models of biological evolution processes that simulate the natural selection and genetic mechanisms of biological evolution. Genetic algorithms search for optimal solutions by simulating the natural evolution process. The algorithm uses mathematical methods and computer simulation operations to convert the problem-solving process into processes similar to the crossover and mutation of chromosome genes (hereinafter referred to as genes) in biological evolution. When solving more complex combinatorial optimization problems, it can usually obtain better optimization results faster than some conventional optimization algorithms. Genetic algorithms have been widely used in combinatorial optimization, machine learning, signal processing, adaptive control, artificial life and other fields.

[0054] The algorithm flow of genetic algorithm generally includes the following steps:

[0055] S1. Initialization: All individuals of the initial population are randomly generated based on the characteristics of each individual in the population, and each individual includes multiple genes.

[0056] S2. Calculate fitness: Calculate the fitness of each individual in the initial population. Here, the fitness of an individual refers to the measure of the degree of advantage of the individual in the population, which is used to distinguish the "good" and "bad" individuals.

[0057] S3. Selection process: Based on certain selection criteria, a number of excellent individuals are selected to participate in crossover and mutation operations.

[0058] S4, crossover process: among the individuals selected in S3, some genes in different individuals are exchanged to complete the crossover operation.

[0059] S5, mutation process: among the individuals selected in S3, some genes in at least one individual are changed to realize the mutation operation, thereby obtaining a new generation of population.

[0060] S6, termination judgment: If the new generation population meets the termination condition, the algorithm iteration is stopped, and the solution at this time is determined as the optimal solution to the problem. If the new generation population does not meet the termination condition, the number of iterations is increased by 1, and the process returns to step S2.

[0061] 5) Greedy algorithm, annealing algorithm

[0062] Greedy algorithm refers to the process of making the best choice at the moment by formulating a greedy strategy when solving a problem. In other words, the algorithm does not consider the overall optimal solution, and the solution obtained by the algorithm is a local optimal solution in a certain sense.

[0063] Annealing algorithm is also called simulated annealing (SA). Annealing algorithm can also be understood as a greedy algorithm, but annealing algorithm can jump out of the local optimal solution and reach the global optimal solution. The starting point of annealing algorithm is based on the similarity between the annealing process of solid materials in physics and general combinatorial optimization problems. Annealing algorithm starts from a relatively high initial temperature, and with the continuous decrease of temperature parameters, combined with the probability jump characteristics, it randomly searches for the global optimal solution of the objective function in the solution space, that is, it can probabilistically jump out of the local optimal solution and eventually tend to the global optimal solution.

[0064] 6) Roulette wheel selection

[0065] Roulette selection is a relatively simple and commonly used selection method. In this method, the selection probability of each individual is proportional to the fitness value of the individual. In other words, the greater the fitness of the individual, the greater the probability of being selected. However, in actual roulette selection, the selection of individuals cannot be based on the individual selection probability absolutely, but on the cumulative probability. The cumulative probability refers to the sum of the probabilities of all possible values.

[0066] When processing business requests from users, OBS generally adopts a layered architecture solution including a business layer and a state layer. As an example, the business layer of OBS first parses the business request of the user to decompose the business request into multiple calls that can be understood by the state layer. Then, the state layer executes the call to obtain the result and returns the result to the user. Among them, before parsing the business request of the user, the business layer can also split the business request into multiple microservice requests according to the business requested by the business request. This process is also called microservice-based business requests. In this way, each microservice request can be processed by a service node that provides the corresponding microservice. Therefore, at the business layer, there may also be calls between the multiple microservice requests obtained after the business request is split. Since the calls generated by the business request during the processing process in the current technology are all blocking calls, the efficiency of OBS in processing the user's business request using a layered architecture is low.

[0067] Based on this, an embodiment of the present application provides a business processing method, which is applied to a first service node. The method includes: the first service node stores the received business request in an event pool, and then dispatches the business request in the event pool to a task queue, and dispatches a consumer thread for processing each subtask of the business request from a consumer thread pool, thereby completing the processing of the business request. Through this method, the subtasks in the business request are processed by different consumer threads, and each consumer thread can be released after processing its own subtask, and the released consumer thread can be used to execute tasks of other business requests. In this way, the service node achieves the purpose of processing business requests in an asynchronous manner, thereby improving the efficiency of the service node in processing business requests.

[0068] Figure 1 Schematic diagram of the implementation environment of the business processing method provided in the embodiment of the present application. Figure 1 As shown, after receiving the service request, the first service node uses the service processing method provided in the embodiment of the present application to process the service request, and returns the request result of the service request to the node that sent the service request.

[0069] The first service node may be a service node that provides any network service, and the service request is a request for requesting the first service node to provide a network service. As an example, the network service is OBS, order service, etc., which is not limited to this.

[0070] Optionally, the service request received by the first service node is the original service request from the user terminal. As an example, the service request is a request sent by the user terminal to obtain a short video. Alternatively, the service request received by the first service node is also a microservice request obtained after the original service request from the user terminal is split by a network device. As an example, when the first service node is a service node that provides a metadata query microservice in the OBS system, the service request received by the first service node is a microservice request for requesting metadata query obtained after the entry service node of the OBS system splits the original service request from the user terminal.

[0071] It should be understood that the above content is an illustrative description of the implementation scenario of the method provided in the embodiment of the present application, and does not constitute a limitation on the application scenario of the method. A person of ordinary skill in the art can know that as business needs change, the application scenario can be adjusted according to application needs, and the embodiment of the present application does not list them one by one.

[0072] The embodiment of the present application also provides a business processing device, which is used to execute the business processing method provided in the embodiment of the present application. The device can be a service node, or a functional module in a service node, which is not limited to this. As an example, the service node can be a server, cloud platform, cloud device, etc. that provides any network service (such as providing OBS service), which is not limited to this.

[0073] The following describes the implementation process of the business processing method provided in the embodiment of the present application.

[0074] refer to Figure 2 , Figure 2 A schematic diagram of a process flow of a business processing method provided by an embodiment of the present application is shown. The method is applied to Figure 1 The first service node shown. Figure 2 As shown, the method includes the following steps.

[0075] Step 101: Receive a service request.

[0076] The first service node receives the service request through its own communication interface (such as a network card). The description of the service request received by the first service node can refer to the above description, which will not be repeated here.

[0077] Step 102: Store the received service request in an event pool.

[0078] After receiving each service request, the first service node stores the service request in a pre-configured event pool.

[0079] The event pool is a storage space pre-allocated by the first service node in the memory, and the storage space is used to store the service requests received by the first service node. Here, the memory can be a volatile memory (such as a memory) or a non-volatile memory (such as a hard disk) in the first service node, and this is not limited.

[0080] In some examples, after the first service node divides the storage space as the event pool, it registers the address of the storage space to its own communication interface. In this way, after receiving the service request, the communication interface of the first service node stores the received service request in the storage space.

[0081] Step 103: dispatch the business requests in the event pool to the task queue.

[0082] The first service node is configured with one or more task queues, and the one or more task queues are used to store service requests to be processed.

[0083] Optionally, the pending business request stored in the task queue of the first service node may be a business request in the event pool, or may be a plurality of sub-requests obtained by splitting the business request in the event pool according to the target task to be achieved, and this is not limited. Among them, a sub-request of a business request is used to achieve a sub-task of the target task achieved by the business request, so that the plurality of sub-requests obtained by splitting according to the target task achieved by the business request can achieve the target task corresponding to the business request. It should be understood that a sub-request is also a kind of business request.

[0084] When the first service node is configured with multiple task queues, the multiple task queues are used to store different types of business requests, and one of the multiple task queues is used to store the same type of business requests. When the task queue stores the above sub-requests, the multiple task queues of the first service node are used to store different types of sub-requests, and one of the multiple task queues is used to store the same type of sub-requests.

[0085] It should be understood that when the types of business requests / sub-requests are divided according to the resources required to execute the business requests, the types of business requests / sub-requests include but are not limited to one or more of the following types: disk input / output (I / O) type, network I / O type, computing type, etc. Here, the computing type can also be divided into central processing unit (CPU) computing type, graphics processing unit (GPU) computing type, etc. according to the unit that performs the calculation, but is not limited to this. Among them, the resources required to execute the business request include but are not limited to: disk resources, network resources, CPU resources, GPU resources, etc.

[0086] In this case, refer to Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of a task queue provided by an embodiment of the present application. Figure 3 As shown, three task queues are set in the first service node, namely: a disk I / O task queue for storing disk I / O type business requests, a network I / O task queue for storing network I / O type business requests, and a computing task queue for storing computing type business requests.

[0087] For detailed instructions on how the first service node dispatches the business request in the event pool to the task queue, please refer to the following description, which will not be repeated here.

[0088] Step 104: Schedule a consumer thread for processing each subtask of the business request in the task queue from the consumer thread pool to complete the processing of the business request in the task queue.

[0089] The first service node pre-establishes a plurality of consumer threads for executing service requests, and the plurality of consumer threads constitute a consumer thread pool of the first service node. The consumer threads in the consumer thread pool include consumer threads for executing multiple types of service requests.

[0090] As an example, the consumer threads in the consumer thread pool of the first service node include but are not limited to at least one of the following types of consumer threads: consumer threads for executing disk I / O type business requests (referred to as disk I / O consumer threads), consumer threads for executing network I / O type business requests (referred to as network I / O consumer threads), or consumer threads for executing computing type (including but not limited to CPU computing or GPU computing, etc.) business requests (referred to as computing consumer threads). Among them, the disk I / O consumer thread can realize the reading and writing of disk data. The network I / O consumer thread can realize the sending of data through the network. The computing consumer thread can realize the processing and calculation of data (including but not limited to CPU calculation or GPU calculation).

[0091] Optionally, the first service node includes a management thread, and the management thread in the first service node is used to manage the consumer threads in the consumer thread pool. As an example, when the control thread of any task queue of the first server determines that there is a business request or sub-request in the task queue, the control thread of the task queue first determines the type of the business request / sub-request located at the head of the task queue, and sends a first application instruction to the management thread of the first service node according to the type of the business request / sub-request located at the head of the task queue, and the first application instruction is used to indicate the application of the consumer thread corresponding to the type of the business request / sub-request. In response to the received first application instruction, the management thread of the first service node allocates the consumer thread that is idle in the consumer thread pool and corresponds to the type of the business request / sub-request to the business request / sub-request. In this way, the first service node reads the business request / sub-request from the head of the task queue through the consumption thread, and processes the business request / sub-request. Then, the control thread of the task queue applies for the consumer thread for processing the business request / sub-request for the next business request / sub-request located at the head of the task queue (the previous request located at the head has been read out).

[0092] Wherein, the control thread of task queue determines the type of business request / sub-request by identifying the task implemented by business request / sub-request. For example, for business request 1 in task queue 1, when the controller of task queue 1 identifies that the task to be implemented by business request 1 is to read disk data, the controller of task queue 1 determines that the type of business request 1 is disk I / O type. Optionally, the control thread of task queue determines the type stored in the business request / sub-request by the configuration of the task queue. It should be understood that the configuration of task queue refers to the configuration of the task queue by the first service node. For example, the first service node configures task queue 2 to: be used to store business request / sub-request of disk I / O type. Like this, for task queue 2, the control thread of task queue 2 determines that the types of business request / sub-request stored in task queue 2 are all disk I / O types.

[0093] It is understandable that, for a consumer thread that the control thread of the task queue applies for scheduling for a certain business request / sub-request, the consumer thread is updated to an idle state after executing the business request / sub-request. In this way, the consumer thread can be scheduled again by the control thread of the task queue.

[0094] As an example, when the control thread of task queue 1 in the first service node determines that the type of business request 1 located at the head of task queue 1 is a disk I / O type, the control thread of task queue 1 sends an application instruction 1 to the management thread of the first service node for business request 1, indicating the application for a disk I / O consumer thread. In response to the application instruction 1, the management thread of the first service node allocates the idle disk I / O consumer thread 1 in the consumer thread pool to business request 1. In this way, the first service node reads business request 1 from the head of task queue 1 through disk I / O consumer thread 1, processes business request 1, and updates its own status to idle after processing business request 1. Subsequently, the control thread of task queue 1 applies for a consumer thread for processing business request 2 for the next business request 2 located at the head in the task queue, so as to process the business request 2.

[0095] Furthermore, after the first service node completes processing of a certain service request in the task queue through the consumer thread and obtains the request result of the service request, the request result of the service request is returned to the node that sent the service request.

[0096] In this way, through the above method, the first service node implements the scheduling of a consumption thread for processing each business request from the consumption thread pool for each business request in the task queue. And, the first service node implements the scheduling of a consumption thread for processing each sub-request of the business request in the task queue from the consumption thread pool. Since the sub-request of the business request is used to implement the sub-task of the target task implemented by the business request, it can also be understood that the first service node implements the scheduling of a consumption thread for processing each sub-task of the business request in the task queue from the consumption thread pool.

[0097] It is understandable that when the service request dispatched to the task queue is split into multiple sub-requests, and there is no call relationship between the multiple sub-requests, the method provided by the embodiment of the present application can realize the processing of multiple sub-requests of the service request by multiple consumer threads concurrently, thereby improving the efficiency of the service node processing the service request. For example, when the service request 1 is to read 1 megabyte of data, by the method described in the embodiment of the present application, when the first service node dispatches the service request 1 to the task queue, the service request 1 is split into 4 sub-requests that read 256 bits (bit) of data and then writes to the task queue. In this way, the first service node task queue applies for scheduling 4 disk I / O consumer threads for the 4 sub-requests to process the 4 sub-requests, thereby realizing the purpose of processing the service request 1 concurrently by 4 consumer threads, so that the efficiency of the first service node processing the service request 1 can be improved, and then the data requested to be read can be returned to the user terminal faster, improving the user experience. It should be understood that the smaller the granularity of splitting the service request into multiple sub-requests, the higher the concurrency of the service request processed by the concurrent processing of multiple services.

[0098] It can also be understood that when the business request dispatched to the task queue is split into multiple sub-requests, and there is a calling relationship between the multiple sub-requests, through the method provided by the embodiment of the present application, the called sub-request can be dispatched to the task queue first, and the consumer thread is requested to process the sub-request to obtain the result, and then another sub-request that calls the sub-request is dispatched to the task queue, and the consumer thread is requested to process the other sub-request to obtain the result, until the last sub-request that calls other sub-requests in the multiple sub-requests is dispatched to the task queue according to the calling relationship between the multiple sub-requests, and the consumer thread is requested to process the last sub-request, so that the request result of the aforementioned business request can be obtained. In this process, the consumer thread that executes each sub-request in the business request only needs to process the corresponding sub-request before it can be released, so that it can be applied by the task queue to dispatch and process other business requests / sub-requests. That is to say, the consumer threads that execute each sub-request in the business request are asynchronous. In this way, for the service node, the consumer thread of the service node does not need to be suspended and waited in the process of executing the business request, so that the consumer thread of the service node can continue to be in a working state when the number of business requests is large, and there is no need to suspend and wait for the call result when processing a certain business request. Therefore, the method provided in the embodiment of the present application can improve the efficiency of the service node in processing business requests.

[0099] As an example, when the business request received by the first service node is business request 1 for reading encrypted object data 1, that is, the target task of business request 1 is to read encrypted object data 1. In this case, the first service node splits the target task into three subtasks: subtask 1 for reading the metadata of object data 1, subtask 2 for reading the data of object data 1 itself, and subtask 3 for decrypting the read data. Therefore, business request 1 is split into subrequest 1 for implementing subtask 1, subrequest 2 for implementing subtask 2, and subrequest 3 for implementing subtask 3. It can be seen that subrequest 3 needs to call the request results of subrequest 1 and subrequest 2. Therefore, the first service node first schedules subrequest 1 and subrequest 2 to the task queue. In this way, the control thread of the task queue applies to the management thread of the first service node for subrequest 1 and subrequest 2 to call the consumer thread in the consumer thread pool respectively to implement the processing of subrequest 1 and subrequest 2. After obtaining the results of sub-request 1 and sub-request 2, the first service node dispatches sub-request 3 to the task queue, and the control thread of the task queue applies to the management thread of the first service node for calling the consumer thread in the consumer thread pool for sub-request 3 to realize the processing of sub-request 3. After obtaining the result of sub-request 3, the request result of business request 1 is also obtained. In this process, the 3 consumer threads for processing sub-request 1, sub-request 2 and sub-request 3 are asynchronous and independent. These 3 consumer threads are released after processing their respective sub-requests and writing the obtained results into the corresponding storage space, so that the control thread of the task queue applies for scheduling and processing the business request. In this way, when the load of the first service node is large, the consumer thread can continue to work, and there is no need to suspend and wait for obtaining the call result when processing a certain business request. Therefore, the method provided by the embodiment of the present application can provide the efficiency of service node processing business.

[0100] It should be understood that in the above example, when multiple task queues are configured in the first service node, and the multiple task queues are used to store different types of business requests, since the above sub-request 1 is used to implement the sub-task of querying metadata, sub-request 1 is a network I / O type business request that calls the query metadata server. Since sub-request 2 is used to implement the sub-task of reading the object data 1 data itself, sub-request 2 is a disk I / O type business request that reads data from the disk. And, since sub-request 3 is used to implement the sub-task of decrypting the read data, sub-request 3 is a computing type business request. In this case, the first service node first schedules sub-request 1 to task queue 1 for storing network I / O type business requests, and schedules sub-request 2 to task queue 2 for storing disk I / O type business requests. In this way, the control thread of task queue 1 applies to the management thread of the first service node for sub-request 1 to call the network I / O consumer thread in the consumer thread pool to implement the processing of sub-request 1, and the control thread of task queue 2 applies to the management thread of the first service node for sub-request 2 to call the disk I / O consumer thread in the consumer thread pool to implement the processing of sub-request 2. After obtaining the results of sub-request 1 and sub-request 2, the first service node dispatches sub-request 3 to task queue 3 for storing computing type business requests, and the control thread of task queue 3 applies to the management thread of the first service node for calling the computing consumption thread in the consumption thread pool for sub-request 3 to realize the processing of sub-request 3. After obtaining the result of sub-request 3, the request result of business request 1 is also obtained. Among them, task queue 1, task queue 2 and task queue 3 can each correspond to a control thread, or can correspond to the same control thread, which is not limited in the embodiment of the present application.

[0101] In this way, through the method described in steps 101 to 104, the purpose of asynchronously processing business requests by the service node can be achieved, and the concurrency rate of the service node processing business requests can be improved when the business requests are split into small enough pieces. Therefore, the method provided in the embodiment of the present application can improve the efficiency of the service node in processing business.

[0102] The process of "the first service node dispatching the service request in the event pool to the task queue" is described below. In the following, the embodiment of the present application is described by taking the first service node being configured with a task queue for storing different types of service requests as an example.

[0103] In the first possible implementation, refer to Figure 4 , Figure 4 Another flow chart of the service processing method provided by the embodiment of the present application is shown. Figure 2 ,like Figure 4 As shown, the above step 103 can be implemented through the following steps 1031 to 1034.

[0104] Step 1031: Schedule the service requests in the event pool to the event queue.

[0105] The event queue is a queue pre-set in the memory by the first service node for storing pending service requests. Here, the memory may be a volatile memory (such as a memory) or a non-volatile memory (such as a hard disk) in the first service node, and this is not limited.

[0106] It should be understood that the size of the event queue is generally set based on the resource capabilities of the first service node to process business requests. The resource capabilities of the first service node generally include the computing power of the CPU and GPU, network capabilities, disk read and write capabilities, etc. As an example, when the resource capabilities of the first service node are sufficient to process a large number of business requests concurrently, the first service node sets a larger event queue. For another example, when the resource capabilities of the first service node are relatively scarce and it is difficult to support the concurrent processing of a large number of business requests, the first service node sets a smaller event queue. Therefore, by setting an event queue in the first service node, the first service node can process business requests within its own resource capabilities, thereby avoiding overload and collapse of the first service node.

[0107] In general, the storage space occupied by the event pool described above is larger than the storage space occupied by the event queue. That is, compared with the event queue, the storage space occupied by the event pool described above can store more business requests.

[0108] Optionally, the first service node includes a scheduling thread, which is used to read the service request from the event pool and write the read service request into the event queue. As an example, the first service node reads the service request stored in the event pool first and writes the read service request into the event queue, and then reads the service request stored in the event pool later and writes the read service request into the event queue, according to the time sequence in which the service requests are stored in the event pool.

[0109] In some possible situations, when the first service node writes a service request to the event queue through the scheduling thread, the event queue returns an indication that the current queue is full, indicating that the event queue is full at the current moment. In this case, the scheduling thread writes the service request to the event queue again after a preset time, or the scheduling thread discards the service request and writes the next service request to the event queue after a preset time, without limitation. Among them, the embodiment of the present application does not specifically limit the value of the preset time, for example, it can be 1 second, 2 seconds, etc., but is not limited to this.

[0110] Step 1032: Convert the format of the service request in the event queue.

[0111] It should be understood that since the service requests in the event queue are service requests received by the first service node from the network link through the communication interface, generally, the format of these service requests is binary format. Therefore, the first service node needs to convert the format of the service request received from the network link into the format of the data transmission protocol adopted by the network service provided by the first service node. In this way, the consumer thread for processing the service request in the first service node can identify the task requested to be executed by the service request and process the service request accordingly.

[0112] The data transmission protocol used by the network service provided by the service node includes, but is not limited to, HTTP, transmission control protocol (TCP), user datagram protocol (UDP), or transport layer security (TSL), etc. For example, when the network service provided by the first service node is OBS, the data transmission protocol used by OBS is generally HTTP.

[0113] In the embodiment of the present application, the format of the service request received from the network link is referred to as the first format, and the data transmission protocol adopted by the network service provided by the first service node is referred to as the second format.

[0114] Optionally, the first service node converts the format of the service request in the event queue through the protocol consumption thread. For any service request scheduled to the event queue, such as the first task request, the first service node converts the first service request from the first format to the second format through the protocol consumption thread.

[0115] Among them, the protocol consumer thread can also be a consumer thread preset in the consumer thread pool mentioned above. In this case, when the control thread of the event queue determines that there is a business request in the event queue, it sends a second application instruction to the management thread of the first service node for each business request at the head of the event queue in turn, and the second application instruction is used to apply for a protocol consumer thread in the consumer thread pool for converting the business request from the first format to the second format. In response, after receiving the second application instruction, the management thread of the first service node allocates a protocol consumer thread to the business request (such as the first business request) at the head of the event queue. Then, the protocol consumer thread reads the first business request from the event queue and converts the first business request from the first format to the second format.

[0116] Step 1033: Identify the type of the service request expressed in the second format.

[0117] Still taking the first service request as an example, the first service node identifies the type of the service request according to the type of resources required to process the service request. As an example, when the first service node determines that the first service request is a request to query the metadata of the object data, it determines that it is necessary to access the metadata server of the object data through its own network resources to query the metadata of the object data. Therefore, the first service node determines that the type of the first service request is a network I / O type service request.

[0118] In some possible cases, the target task implemented by the first service request may need to be implemented through multiple subtasks. In this case, the first service node first identifies the target task to be implemented by the first service request expressed in the second format, and then splits the first service request into multiple sub-requests that implement multiple sub-tasks in the target task, and determines the type of each sub-request according to each sub-task.

[0119] As an example, when the first business request is business request 1 to read encrypted object data 1, that is, the target task of business request 1 is to read encrypted object data 1. In this case, the first service node splits the target task into three subtasks: subtask 1 to read the metadata of object data 1, subtask 2 to read the data of object data 1 itself, and subtask 3 to decrypt the read data. In this way, the first service node splits business request 1 into subrequest 1 to implement subtask 1, subrequest 2 to implement subtask 2, and subrequest 3 to implement subtask 3. Since processing subrequest 1 requires the use of network I / O resources, the first service node determines that the type of subrequest 1 is a network I / O type. Since processing subrequest 2 requires the use of disk I / O resources, the first service node determines that the type of subrequest 2 is a disk I / O type. And, since processing subrequest 3 requires the use of computing resources, the first service node determines that the type of subrequest 3 is a computing type.

[0120] Optionally, the first service node identifies the type of the first service request expressed in the second format through a protocol consumption thread for converting the first service request format. Optionally, the first service node identifies the type of the first service request expressed in the second format through a control thread of a task queue.

[0121] Step 1034: dispatch the service request to a task queue for storing service requests of the corresponding type according to the type of the service request.

[0122] Still taking the first service request as an example, as an example, when the first service node determines that the type of the first service request is a network I / O type service request, the first service node writes the first service request into a task queue for storing network I / O type service requests.

[0123] In some possible situations, the first business request is used to implement a target task, and the first service node splits the first business request into multiple sub-requests for implementing multiple sub-tasks in the target task, and determines the type of each sub-request. The first service node writes each of the multiple sub-requests into a task queue for storing business requests of the corresponding type.

[0124] As an example, when the first service node splits business request 1 into sub-request 1, sub-request 2, and request 3, and determines that the type of sub-request 1 is a network I / O type, the type of sub-request 2 is a disk I / O type, and the type of sub-request 3 is a computing type, the first service node writes sub-request 1 into task queue 1 for storing network I / O type business requests, writes sub-request 2 into task queue 2 for storing disk I / O type business requests, and writes sub-request 3 into task queue 3 for storing computing type business requests.

[0125] Optionally, when the first service node identifies the type of the first service request through the protocol consumption thread used to convert the format of the first service request, the first service node writes the first service request into a task queue used to store service requests of the corresponding type based on the type of the first service request and through the protocol consumption thread or the control thread of the task queue. Optionally, when the first service node identifies the type of the first service request through the control thread of the task queue, the first service node writes the first service request into a task queue used to store service requests of the corresponding type based on the type of the first service request and through the control thread.

[0126] In this way, the purpose of scheduling the business request of the event pool to the task queue is achieved through steps 1031 to 1034.

[0127] In a second possible implementation, the first service node directly executes steps 1032 to 1033 on the service requests in the event pool through a scheduling thread, so as to schedule the service requests in the event pool to the task queue.

[0128] In this implementation mode, since in an embodiment of the present application, the first service node concurrently processes business requests in the task queue through multiple consumer threads, the first service node initiates multiple scheduling threads in parallel to execute steps 1032 to 1033 to improve the scheduling efficiency of scheduling business requests in the event pool to the task queue.

[0129] So far, through the above two implementation methods, the purpose of scheduling the business requests of the event pool to the task queue can be achieved.

[0130] It should be understood that when the first service node is configured with only one task queue, the first service node can write the format-converted service request into the task queue after executing step 1032 in the above two possible implementations.

[0131] In other embodiments, different service requests generally have different quality of service (QoS) levels. For example, a service request from a user with a high QoS level has a high QoS level. For another example, for a service request requesting to obtain data (such as multimedia data), the sub-request for requesting to obtain the first batch of bytes in the data obtained after the service request is split is generally also configured as a high QoS level. This is because after the user initiates a service request to obtain data through a terminal device, the service node returns the first batch of bytes in the data to the user as quickly as possible to improve the user's experience of using network services. Therefore, the sub-request for requesting to obtain the first batch of bytes in the data obtained after the service request is split can usually be set to a high QoS level. It should be understood that a service request with a high QoS level can also be a service request with a high processing priority level.

[0132] To prioritize service requests with high QoS levels, refer to Figure 5 , Figure 5 Another flow chart of the service processing method provided by the embodiment of the present application is shown. Figure 4 ,refer to Figure 5 , the method can replace step 1034 described above with 2034.

[0133] Step 2034: According to the type and QoS level of the service request, the service request is dispatched to a task queue for storing service requests of the corresponding type.

[0134] The first service node determines the QoS level of the service request before, after or simultaneously with determining the type of the service request.

[0135] In some examples, the first node may determine the QoS level of the service request by reading the QoS level carried in the service request. In other examples, when the first service node splits the service request into multiple sub-requests as described in step 1033, the first service node determines the QoS level read from the service request as the QoS level of each of the multiple sub-requests obtained after the service request is split.

[0136] In this way, when the first service node writes the service request into the task queue for storing service requests of the corresponding type according to the type of the service request, it also writes the service request into the position in the task queue for storing service requests of the corresponding type that matches the QoS level of the service request according to the QoS level of the service request.

[0137] It should be understood that when the first service node writes the service request into the task queue, the service request with a higher QoS level is written before the service request with a lower QoS level. For example, for the second service request with a first QoS level in the event pool / event queue, the first service node inserts the second service request into the task queue before the third service request according to the first QoS level of the second service request, and the third service request is a service request with a second QoS level that has been scheduled to (or understood as written into) the task queue. Among them, the first QoS level is higher than the second QoS level.

[0138] In actual application, the first service node provides multiple interfaces for inserting service requests into different positions of the task queue for the task queue, so as to realize the purpose of inserting service requests of high QoS level before service requests of low QoS level. Wherein, multiple interfaces for inserting service requests into different positions of the task queue correspond to different QoS levels. For example, the interface for inserting service requests into the 1 / 3 position of the task queue corresponds to the highest QoS level, that is, the interface is used to insert service requests with the highest QoS level into the task queue. For another example, the interface for inserting service requests into the 2 / 3 position of the task queue corresponds to the second highest QoS level, that is, the interface is used to insert service requests with the second highest QoS level into the task queue. For another example, the interface for writing service requests into the tail position of the task queue corresponds to the lowest QoS level, that is, the interface is used to write service requests with the lowest QoS level into the task queue.

[0139] As an example, refer to Figure 6 , Figure 6 FIG. 1 shows a schematic diagram of writing a service request to a task queue provided by an embodiment of the present application. Figure 6 As shown, when the first service node determines that the service request 601 needs to be written into the task queue 60 based on the type of the service request 601, and determines that the service request 601 has the highest QoS level, the first service node inserts the service request 601 into position 3 of the task queue 60 through an interface for inserting the highest QoS level into the 30% position of the task queue 60.

[0140] In this way, through Figure 5 With the method shown, the first service node can preferentially process service requests with a high QoS level, thereby ensuring the experience of users with a high QoS level when using network services.

[0141] In some other embodiments, in order to stabilize the delay of the service node in processing business requests, the first service node needs to configure an appropriate number of consumer threads for each task queue in the consumer thread pool, so as to ensure that the first service node processes the business requests in each task queue to the greatest extent under the condition of its own maximum resource capacity. Optionally, the first service node also needs to configure an appropriate number of protocol consumer threads for the event queue in the consumer thread pool, so as to ensure that the first service node processes the business requests in the event queue to the greatest extent under the condition of its own maximum resource capacity and without causing excessive load to the task queue.

[0142] To achieve this purpose, the first service node Figure 2 , Figure 4 or Figure 5 In the process of processing the business request, the method also collects service performance parameters, which are used to determine the number of consumer threads configured for each task queue in the consumer thread pool of the first service node. Optionally, the service performance parameters are also used to determine the number of consumer threads configured for the event queue in the consumer thread pool of the first service node.

[0143] It should be understood that the process of determining the number of consumer threads configured for each task queue in the consumer thread pool of the first service node according to the service performance parameters can be performed by the first service node, or by any other service node in the service cluster where the first service node is located, or by the management node of the service cluster, without limitation. The embodiments of the present application are described below by taking the process of the first service node executing "determining the number of consumer threads configured for each task queue in the consumer thread pool of the first service node according to the service performance parameters" as an example.

[0144] Optionally, the first service node determines the number of consumer threads that need to be configured for each task queue in the consumer thread pool of the first service node through a preset algorithm and the collected service performance parameters. The budget method can be any algorithm for finding the optimal solution, for example, the preset algorithm is a genetic algorithm, a greedy algorithm, or an annealing algorithm.

[0145] In the following embodiments of the present application, a genetic algorithm is used as an example to describe a process in which the first service node determines the number of consumer threads that need to be configured for each task queue in the consumer thread pool of the first service node based on the collected service performance parameters.

[0146] It should be understood that when a genetic algorithm is used to determine the number of consumer threads that need to be configured for each task queue in the consumer thread pool of the first service node, multiple service nodes in the service cluster where the first service node is located (referred to as the first service cluster) can be used as individuals in the population of the genetic algorithm. Among them, the first service cluster includes multiple service nodes for providing the same network service. As an example, when the first service node is an access server that provides OBS access microservices, the first service cluster is a service cluster including multiple access servers for providing OBS access microservices. For another example, when the first service node is a metadata server that provides a metadata query microservice in OBS, the first service cluster is a service cluster including multiple metadata servers for providing metadata query microservices in OBS.

[0147] Taking each service node in the first service cluster as an individual in the population of the genetic algorithm, and the service nodes in the first service cluster are configured with three task queues, namely the first task queue (denoted as Qa), the second task queue (denoted as Qb) and the third task queue (denoted as Qc) as an example, the three task queues in each service node in the first service cluster are the genes of the individuals in the population, and the values ​​of the genes Qa, Qb and Qc are characterized by the number of consumer threads configured for the task queue. That is to say, for any service node in the first service cluster, such as the first service node, the first service node is an individual in the population, and the individual includes three genes, namely Qa, Qb and Qc in the first service node. Then at the initial moment, within the resource capacity of each service node in the first service cluster, a random number or a preset number of consumer threads are configured for each task queue of each service node in the first service cluster, and the service request is started to be processed. Similarly, each service node in the first service cluster configures the corresponding number of threads for its three task queues with the aforementioned random number or preset number, and starts to process the service request. Thus, in the first service cluster, each task queue is configured with the aforementioned random number or preset number of service nodes of consumer threads, all of which serve as individuals of the initial generation population in the genetic algorithm.

[0148] Based on this, the first service node encodes the genes of the individuals of the first generation population. Optionally, assuming that Ca represents the number of consumer threads configured for Qa, Cb represents the number of consumer threads configured for Qb, and Cc represents the number of consumer threads configured for Qc, the first service node encodes the values ​​of Ca, Cb, and Cc of each service node in the first service cluster as an individual of the first generation population with a preset number of bits. Taking the first service node's Ca value of 20, Cb value of 10, and Cc value of 12, and encoding the values ​​of Ca, Cb, and Cc with 4 bits as an example, the first service node can encode the values ​​of Ca, Cb, and Cc of its genes when it is an individual of the first generation population as 0020 0010 0012.

[0149] Next, take the OBS service provided by the first service cluster as an example, Figure 7 , Figure 7 The schematic diagram of the process of determining the number of consumer threads to be configured for each task queue provided by the embodiment of the present application is shown. The process is a single iteration process based on the genetic algorithm. Figure 1 Taking the execution of the first service node as an example, the process includes the following steps.

[0150] Step 301: Collect service performance parameters during the process of processing a business request.

[0151] Among them, the service performance parameters include but are not limited to at least one of the following parameters: processing delay, processing frequency or processing success rate of the service request. Here, the processing delay of the service request includes the time used to process a single service request in the event queue, and also includes the time used to process a single service request in each task queue. The processing frequency includes the time interval between two adjacent service requests in the processing event queue, and also includes the time interval between two adjacent service requests in the processing task queue. The processing success rate includes the success rate of processing service requests in the event queue, and includes the success rate of processing service requests in the task queue.

[0152] Optionally, the first service node collects service performance parameters through the management thread described above in the process of processing the service request. Optionally, the first service node continuously or periodically collects service performance parameters through the management thread described above in the process of processing the service request, and this is not limited. Among them, the embodiment of the present application does not limit the specific value of the cycle duration. As an example, the cycle duration can be 1 hour.

[0153] Step 302: Obtain service performance parameters collected by other service nodes in the first service cluster except the first service node.

[0154] It should be understood that other service nodes in the first service cluster except the first service node may also adopt the method provided in the embodiment of the present application (for example Figure 2 , Figure 4 or Figure 5 The other service nodes process the service request using the method shown in FIG. 1 and collect their own service performance parameters during the process of processing the service request. The other service nodes send their collected service performance parameters to the first service node.

[0155] In response, the first service node obtains service performance parameters collected by other service nodes in the first service cluster except the first service node.

[0156] Step 303: Determine the fitness of each service node in the first service cluster according to the service performance parameters collected by the other service nodes and the service performance parameters collected by the first service node.

[0157] Determining the fitness of each service node in the first service cluster is to determine the fitness of each individual in the initial population.

[0158] Since the fitness of an individual refers to a measure of the degree of advantage of the individual in surviving in a population, it is used to distinguish between "good and bad" individuals. Taking the network service provided by the first service cluster as an OBS service as an example, the fitness of individuals in the first service cluster can be characterized by P99 latency and / or data transmission bandwidth. Among them, the P99 latency is the P99 latency of the service node in the first service cluster to process the business request. The data transmission bandwidth is the bandwidth of the service node in the first service cluster to transmit data. It should be understood that the smaller the P99 latency, the higher the corresponding fitness. The larger the data transmission bandwidth, the higher the corresponding fitness.

[0159] For OBS, the first service node classifies the service requests into small requests, medium requests, and large requests according to the number of reads and / or writes requested by the service requests. Among them, small requests, medium requests, and large requests are distinguished according to the amount of data requested by the service requests. For example, the first service node determines a service request whose requested data amount is greater than a first threshold as a large request, a service request whose requested data amount is less than the first threshold but greater than a second threshold as a medium request, and a service request whose requested data amount is less than the second threshold as a small request. Here, the first threshold is greater than the second threshold, and the embodiment of the present application does not limit the specific values ​​of the first threshold and the second threshold.

[0160] Based on this, in order to provide user experience, small requests generally focus on P99 latency, while medium and large requests generally focus on stable data transmission bandwidth. Therefore, for a single small request, the latency of the service node processing the small request can be calculated by the service performance parameters collected above. Furthermore, based on the latency of multiple small requests processed by the service node over a period of time, the P99 latency of the service node processing the small request can be calculated. In addition, the bandwidth of the service node transmitting data can be calculated by the amount of data read and written by the service node per unit time based on the received medium and large requests.

[0161] Step 304: When there is a service node whose fitness exceeds the threshold in the first service cluster, the service node with the highest fitness in the first service cluster is determined as the target service node, and the number of consumer threads configured by the target service node for each task queue of the target service node is determined as the target number.

[0162] Among them, the individual fitness value is the threshold, which is used to indicate the performance threshold of the individual when currently processing business requests. When the fitness of an individual in the first service cluster exceeds the threshold, it means that the performance of the individual when currently processing business requests exceeds the performance threshold, which is a good performance embodiment. Therefore, the first service node determines the service node with the highest fitness in the first service cluster as the target service node, and determines the number of consumer threads configured by the target service node for each of its own task queues as the target number. This is equivalent to the first service node determining the service node with the best performance in the first service cluster as the target service node, and determining the number of consumer threads configured by the target service node for each of its own task queues as the target number.

[0163] Here, the target number is the number of consumer threads that the first service node needs to configure in its own consumer thread pool for each of its own task queues, specifically including the target number of consumer threads configured for its first task queue, the target number of consumer threads configured for its second task queue, and the target number of consumer threads configured for its third task queue.

[0164] In some possible situations, even after executing steps 301 to 303 on the initial population, when there are service nodes in the first service cluster whose fitness exceeds the threshold, because the number of iterations of the genetic algorithm has not reached the preset number, or the iteration termination time has arrived, in order to improve the stability of the latency and data transmission bandwidth of the service nodes in the first service cluster when processing business requests, the first service node may not execute step 304, but execute steps 305 to 308, so as to find the appropriate number of consumer threads configured for each task queue of the service nodes in the first service cluster in the process of multiple iterations while ensuring stable latency and data transmission bandwidth. The detailed description of multiple iterations is referred to the description below and will not be repeated.

[0165] Step 305: When there is no service node whose fitness exceeds the threshold in the first service cluster, multiple initial target service nodes are determined in the first service cluster according to the fitness of each service node in the first service cluster.

[0166] When there is no service node (i.e., an individual in the first generation population) whose fitness exceeds the threshold in the first service cluster, it means that the performance of all service nodes in the first service cluster is poor. In this case, it is necessary to select better individuals in the first service cluster as second generation population individuals. Therefore, the first service node determines multiple initial target service nodes in the first service cluster according to the fitness of each service node in the first service cluster. The embodiment of the present application does not limit the specific number of initial target service nodes.

[0167] Optionally, the first service node determines multiple initial target service nodes in the first service cluster using a preset algorithm according to the fitness of each service node in the first service cluster. The preset algorithm may be a roulette wheel selection method. It should be understood that in most cases, the roulette wheel selection method can select individuals with high fitness values, but cannot completely sort and select individuals with low fitness values.

[0168] Optionally, the first service node sorts the fitness of the service nodes in the first service cluster from high to low according to the fitness of each service node in the first service cluster, and selects the service nodes with the top k fitness values ​​as the initial target service nodes. That is, the first service node selects k initial target service nodes in the first service cluster according to the fitness of each service node in the first service cluster. Wherein, k is an integer greater than 1 and less than the number of service nodes in the first service cluster. The specific value of k is not limited in the embodiment of the present application.

[0169] Step 306: Crossover and / or mutation of the genes of the multiple initial target service nodes.

[0170] Optionally, the first service node first crosses the genes of the multiple initial target service nodes determined above, and then mutates them. Alternatively, the first service node first mutates the genes of the multiple initial target service nodes determined above, and then crosses them. Alternatively, the first service node only crosses the genes of the multiple initial target service nodes determined above. Alternatively, the first service node only mutates the genes of the multiple initial target service nodes determined above, which is not limited in the embodiments of the present application.

[0171] The first service node may cross the genes of the service nodes as population individuals by two-point crossover or average crossover, which is not limited. Here, two-point crossover refers to randomly setting two individuals whose genes are to be crossed in the individual code, and then exchanging genes at some positions of the two individuals. Even crossover means that each gene of the two paired individuals is exchanged with the same crossover probability, thereby forming two new individuals.

[0172] As an example, take the first service node determining that service node 1 and service node 2 as individuals in the first service cluster are two service nodes among the multiple initial target service nodes that need to exchange genes, and determining that the genes at the first position of service node 1 and service node 2 need to be exchanged. Assuming that the gene values ​​of service node 1 in the primary population include Ca1, Cb1 and Cc1, and the gene values ​​of service node 2 in the primary population include Ca2, Cb2 and Cc2, the first service node can exchange the first gene value of service node 1 and service node 2, that is, exchange Ca1 and Ca2.

[0173] It can be understood that the first service node can randomly select two individuals of the gene to be crossed from multiple initial target service nodes, or select two service nodes with high fitness from multiple initial target service nodes as individuals of the gene to be crossed. The embodiment of the present application does not specifically limit this implementation method.

[0174] The first service node mutates the gene of the service node as an individual of the population, which means that the first service node exchanges two genes among the multiple genes of a single service node. For example, the first service node determines that service node 1 as an individual in the first service cluster is the service node whose gene needs to be mutated among the multiple initial target service nodes, and determines that the gene at the first position and the gene at the second position of service node 1 need to be exchanged. Assuming that the values ​​of the genes of service node 1 in the initial population include Ca1, Cb1 and Cc1, the first service node can exchange the first gene value and the second gene value in service node 1, that is, exchange Ca1 and Cb1.

[0175] It can be understood that the first service node can randomly determine the individuals whose genes need to be mutated from multiple initial target service nodes, or select service nodes with high fitness from multiple initial target service nodes as the individuals whose genes need to be mutated. The embodiment of the present application does not specifically limit this implementation method.

[0176] Through step 306, the first service node performs crossover and / or mutation operations on the gene values ​​of the above-mentioned multiple initial target service nodes to obtain a second generation population including genes with new values ​​(ie, values ​​after crossover and / or mutation).

[0177] Step 307: Determine the target quantity according to the current gene of the third service node, wherein the third service node is any one of the multiple initial target service nodes after the crossover and / or gene mutation.

[0178] The first service node selects the value of the gene of any individual in the second generation population obtained in step 306 as the value of the target quantity. Taking the case where any of the multiple initial target service nodes after crossover and / or gene mutation in step 306 is the third service node as an example, the first service node determines the target quantity described above according to the current gene of the third service node.

[0179] In a possible implementation, the first service node determines the value of the current gene of the third service node as the target number described above. That is, the first service node determines the number of consumer threads configured for each task queue (i.e., Qa, Qb, and Qc) represented by the current gene value of the third service node as the target number described above. For example, when the value of the current gene of the third service node is Ca3, Cb3, and Cc3, the first service node determines Ca3, Cb3, and Cc3 as the above-mentioned target number, that is, the first service node determines the number of consumer threads configured for its own Qa to be Ca3, the number of consumer threads configured for its own Qb to be Cb3, and the number of consumer threads configured for its own Qc to be Cc3.

[0180] In other possible implementations, when a network I / O task queue for storing network I / O type business requests is configured in the service node of the first service cluster (that is, when a network I / O task queue exists in Qa, Qb, and Qc), taking into account the impact of the service nodes in the first service cluster on the upstream nodes, the service nodes in the first service cluster also obtain the maximum concurrent number of calls allowed by their own upstream nodes.

[0181] For the first service node, each time the first service node schedules a consumer thread for a service request in the network I / O task queue, the first service node sends an acquisition instruction to the called second service node to instruct the acquisition of the maximum number of concurrent calls allowed by the second service node. As an example, the acquisition instruction may be a get capacity instruction. The second service node is used to provide the service called by the service request in the network I / O task queue, and therefore may also be referred to as the upstream node of the first service node.

[0182] As an example, refer to Figure 8 , Figure 8 A schematic diagram of obtaining the maximum number of concurrent calls allowed by the second service node provided by an embodiment of the present application is shown. Figure 8 As shown, taking the request 1 for querying the metadata of the object data as an example, the current pending service request in the network I / O task queue of the first service node is a request. In this case, it means that the first service node calls the metadata server of the OBS system through request 1, and the metadata server is recorded as Figure 8 The second service node shown. Therefore, after the first service node schedules the consumer thread 1 for processing request 1 for request 1 through the management thread, the first service node sends an acquisition instruction to the second service node through the management thread to instruct the acquisition of the maximum number of concurrent calls allowed by the second service node. In addition, the first service node completes the processing of request 1 by calling the second service node through the consumer thread 1 scheduled for request 1 through the management thread.

[0183] In the network system where the first service node is located, since the upstream node of the first service node does not change often. Therefore, the first service node can also periodically send an acquisition instruction to each of its upstream nodes, and the acquisition instruction is used to indicate the maximum number of concurrent calls allowed by the upstream node. In this way, the purpose of periodically obtaining the maximum number of concurrent calls allowed by the upstream node can be achieved. Among them, the embodiment of the present application does not specifically limit the periodic duration of the first service node sending the acquisition instruction to the upstream node. For example, the periodic duration is 1 hour, but it is not limited to this.

[0184] It should be understood that the second service node can also process business requests through the business processing method provided in the embodiment of the present application, and the embodiment of the present application does not limit this. The management thread of the second service node can collect and process the performance parameters such as the delay of the business request, the data transmission bandwidth, and the number of unprocessed business requests in real time or periodically during the process of processing the business request. In addition, the management thread of the second service node calculates the number of business requests that it can currently undertake through the collected performance parameters and its own resource capabilities. The number of business requests that the second service node can still undertake is the maximum number of concurrent calls allowed by the second service node, or it can be understood as the load that the second service node can still bear. Furthermore, after the second service node receives the acquisition indication of the first service node, it returns the maximum number of concurrent calls allowed by itself to the first service node.

[0185] Further, the first service node determines the target number of consumer threads configured for the network I / O task queue in the first service node according to the maximum concurrency obtained and the number of consumer threads configured for the network I / O task queue indicated by the current gene of the third service node. And, the first service node determines the number of consumer threads configured for other task queues indicated by the current gene of the third service node as the target number of consumer threads configured for the corresponding task queue in the first service node. Here, other task queues are task queues other than the network I / O task queue among the multiple task queues.

[0186] Among them, the first service node can perform weighted summation on the number of consumer threads configured for the network I / O task queue indicated by the current gene of the third service node and the maximum number of concurrency obtained, and determine the result after weighted summation as the target number of consumer threads configured for the network I / O task queue in the first service node. Here, the embodiment of the present application does not specifically limit the weight coefficient during weighted summation. Through this processing method, when the first service node configures consumer threads for its own network I / O task queue, it takes into account its own impact on the upstream node processing business, thereby being able to avoid the problem of overloading the upstream node due to its own business processing too fast.

[0187] Step 308: Obtain a target number, and configure a consumer thread for each of the multiple task queues according to the obtained target number.

[0188] After the first service node determines the target number, it obtains the target number. Then, the first service node configures a corresponding number of consumer threads for each of its task queues in the consumer thread pool according to the target number.

[0189] It should be understood that after the first service node determines the second generation population, in addition to determining its own target quantity based on the genes of an individual in the second generation population, it also sends a configuration instruction to each other service node in the first service cluster, and one configuration instruction carries the gene of an individual in the second generation population. In this way, after receiving the configuration instruction, each other service node in the first service cluster determines the number of consumer lines configured for each of its own task queues according to the method for determining the target quantity described in step 307 and the genes carried by the configuration instruction.

[0190] In some embodiments, the node executing steps 302 to 306 above is a node other than the first service node. The first service node receives a configuration instruction carrying individual genes sent by the other node, determines a target number based on the genes carried by the configuration instruction, and configures a corresponding number of consumer threads for each of its own task queues in the consumer thread pool based on the determined target number.

[0191] In this way, through steps 301 to 308, an iterative process of using genetic algorithm to calculate the service nodes of the first service cluster is completed. By executing the iterative process multiple times, and taking the value of the individual gene with the highest fitness and / or stability in the process, the number of consumer threads finally configured for each task queue of the service node in the first service cluster is determined. It should be understood that steps 301 and 302 are steps for collecting data, and the data collection can be performed in real time or periodically, so the steps that essentially need to be executed in a loop are steps 303 to 308.

[0192] In addition, since for the service nodes in the first service cluster, different combinations of Ca, Cb and Cc have different corresponding service performance parameters, and thus the corresponding P99 delays are also different, and the corresponding data transmission bandwidths are also different, the P99 delay that characterizes the fitness can be expressed as f1(Ca, Cb, Cc), and the data transmission bandwidth can be expressed as f2(Ca, Cb, Cc). In this way, by controlling (by selecting, crossing and mutating) the values ​​of the variables Ca, Cb, Cc in the above-mentioned multiple iterations, the lowest and / or stable P99 delay and the maximum and / or stable data transmission bandwidth can be found. The values ​​of a group of Ca, Cb, and Cc corresponding to the lowest and / or stable P99 delay and the maximum and / or stable data transmission bandwidth can be determined as the number of consumer threads that are finally configured for each task queue of the service nodes in the first service cluster, and this number can also be understood as the optimal solution found by the genetic algorithm.

[0193] It should be understood that the above-mentioned iterative process can be executed periodically to achieve the purpose of multiple iterations, and there is no limitation on this. In addition, the number of iterations of the above-mentioned iterative process can be limited to a preset number, or the number of iterations can be unlimited, but the above-mentioned iterative process is periodically executed between the release times of two versions of the product to which the method described in the embodiment of the present application is applied, that is, the next release time of the product is the iteration termination time of the multiple iterative process, and there is no limitation on this.

[0194] Since the service nodes in the first service cluster are generally distributed in different regions, the loads of different service nodes at the same time are generally different, and the loads of service nodes at different times are also different. Therefore, the method of configuring the number of consumer threads for the task queue based on the genetic algorithm can be applied in different scenarios, and the optimal solution in different scenarios can be calculated. In addition, the optimal solution is applied to the service node after it reaches the set threshold. Among them, the optimal solution reaches the set threshold, which means that the fitness of the optimal solution exceeds the threshold and is stable.

[0195] It should be noted that the sequence of steps of the method provided in the embodiment of the present application can be adjusted appropriately, and the steps can be increased or decreased accordingly according to the situation. Any person skilled in the art who is familiar with the technical field can easily think of a method of variation within the technical scope disclosed in the present application, which should be included in the protection scope of the present application, so it will not be repeated.

[0196] The above mainly introduces the solution provided in the embodiment of the present application from the perspective of method.

[0197] In order to achieve the above functions, Fig. 9 As shown, Fig. 9 FIG. 9 is a schematic diagram showing the structure of a service processing device 900 provided in an embodiment of the present application. The service processing device 900 is applied to a first service node and is used to execute the above service processing method, for example, to execute Figure 2 , Figure 4 , Figure 5 or Figure 7 The service processing device 900 may include a receiving unit 901 and a processing unit 902 .

[0198] The receiving unit 901 is used to receive a business request. The processing unit 902 is used to store the received business request in an event pool, schedule the business request in the event pool to a task queue, and schedule a consumer thread for processing each subtask of the business request in the task queue from a consumer thread pool to complete the processing of the business request in the task queue.

[0199] As an example, combining Figure 2The receiving unit 901 can be used to execute step 101, and the processing unit 902 can be used to execute steps 102 to 104.

[0200] Optionally, the first service node is configured with multiple task queues. The processing unit 902 is also used to collect service performance parameters in the process of processing business requests. The business processing device 900 also includes an acquisition unit 903, which is used to obtain a target number. The processing unit 902 is also used to configure a consumer thread for each task queue of the multiple task queues in the consumer thread pool according to the acquired target number. Among them, the service performance parameter includes at least one of the following parameters: the processing delay, processing frequency or processing success rate of the business request, and the service performance parameter is used to determine the target number of consumer threads configured for each task queue in the multiple task queues in the consumer thread pool.

[0201] As an example, combining Figure 7 , the processing unit 902 can be used to execute step 301, and the obtaining unit 903 and the processing unit 902 can be used to execute step 308.

[0202] Optionally, the multiple task queues configured by the first service node are used to store different types of service requests, and one task queue among the multiple task queues is used to store the same type of service requests.

[0203] Optionally, the type of the service request includes at least two of the following types: a disk I / O type, a network I / O type, a CPU computing type, or a GPU computing type.

[0204] Optionally, the processing unit 902 is further used to: schedule the service request in the event pool to the event queue; for the first service request scheduled to the event queue, convert the first service request from the first format to the second format; identify the type of the first service request expressed in the second format; and schedule the first service request to a task queue in a plurality of task queues for storing service requests of corresponding types according to the type of the first service request. The first service request is any service request scheduled to the event queue, the first format is the data format used when the first service request is transmitted in the network, and the second format is the format corresponding to the data transmission protocol used by the service provided by the first service node.

[0205] As an example, combining Figure 4 , the processing unit 902 can be used to execute steps 1031 to 1034.

[0206] Optionally, the processing unit 902 is specifically used to: identify a target task of a first business request expressed in a second format; split the first business request into multiple sub-requests for implementing multiple sub-tasks in the target task; determine the type of each sub-request in the multiple sub-requests; and according to the type of each sub-request in the multiple sub-requests, schedule each sub-request to a task queue in multiple task queues for storing business requests of corresponding types.

[0207] As an example, combining Figure 4 , the processing unit 902 can be used to execute steps 1033 to 1034.

[0208] Optionally, the acquisition unit 903 is further used to obtain service performance parameters collected by other service nodes in the service cluster where the first service node is located, except for the first service node, before obtaining the target number. The processing unit 902 is also used to determine the fitness of each service node in the service cluster based on the service performance parameters collected by the other service nodes and the service performance parameters collected by the first service node; and when there are service nodes in the service cluster whose fitness exceeds a threshold, determine the service node with the highest fitness in the service cluster as the target service node; and determine the number of consumer threads configured by the target service node for each task queue in the target task node as the target number. The fitness is characterized by latency and / or data transmission bandwidth.

[0209] As an example, combining Figure 7 The acquisition unit 903 can be used to execute step 302, and the processing unit 902 can be used to execute steps 303 to 304.

[0210] Optionally, the processing unit 902 is also used to: when there is no service node whose fitness exceeds a threshold in the service cluster where the first service node is located, determine multiple initial target service nodes in the service cluster according to the fitness of each service node; cross and / or mutate the genes of the multiple initial target service nodes, and determine the target quantity according to the current gene of the third service node. The value of the gene of the initial target service node is used to characterize the number of consumer threads currently configured by the initial target service node for each task queue, and the third service node is any one of the multiple initial target service nodes after the cross and / or mutated genes.

[0211] As an example, combining Figure 7 , the processing unit 902 can be used to execute steps 305 to 307.

[0212] Optionally, the acquisition unit 903 is also used to obtain the maximum concurrency number allowed to be called by the second service node when multiple task queues include a network I / O task queue for storing network I / O type business requests. The processing unit 902 is specifically used to determine the target number of consumer threads configured for the network I / O task queue in the first service node according to the maximum concurrency number and the number of consumer threads configured for the network I / O task queue indicated by the current gene of the third service node; and, the number of consumer threads configured for other task queues indicated by the current gene of the third service node is determined as the target number of consumer threads configured for the corresponding task queue in the first service node. Among them, the other task queue is a task queue other than the network I / O task queue in the multiple task queues. The second service node is used to provide services called by business requests in the network I / O task queue.

[0213] Optionally, for a second service request with a first QoS level in the event pool, the processing unit 902 is further configured to: insert the second service request into a position before a third service request in the task queue. The third service request is a service request with a second QoS level that has been scheduled to the task queue, and the first QoS level is higher than the second QoS level.

[0214] As an example, combining Figure 5 , processing unit 902 can be used to execute step 2034.

[0215] Optionally, the first service node is an OBS node.

[0216] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation and description of the beneficial effects of any of the above service processing devices 900 can refer to the above corresponding method embodiments, which will not be repeated here.

[0217] As an example, combining Fig.10 The function implemented by the receiving unit 901 in the service processing device 900 can be realized by Fig.10 The functions implemented by the processing unit 902 can be realized by Fig.10 Processor 1001 in the Fig.10 The function implemented by the acquisition unit 903 can be realized by Fig.10 The communication interface 1003 shown is implemented, or by Fig.10 Processor 1001 in the Fig.10 The program code in the memory 1002 is implemented, and there is no limitation on this.

[0218] Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0219] It should be noted that Fig. 9 The division of modules in the example is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or software function modules.

[0220] The embodiment of the present application provides a service node. The service node is used to implement part or all of the functions of the method provided in the embodiment of the present application. Fig.10 Schematic diagram of a service node structure provided by an embodiment of the present application. Fig.10 As shown, the service node 1000 includes a processor 1001, a memory 1002, a communication interface 1003 and a bus 1004. The processor 1001, the memory 1002 and the communication interface 1003 are connected to each other through the bus 1004.

[0221] Processor 1001 may include a general processor and / or a dedicated hardware chip. A general processor may include: a central processing unit (CPU) (or referred to as a central processing unit), a microprocessor or a graphics processing unit (GPU). The CPU is, for example, a single-core processor (single-CPU), or a multi-core processor (multi-CPU). A dedicated hardware chip is a hardware module for high-performance processing. A dedicated hardware chip includes at least one of a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or a network processor (NP). Processor 1001 may also be an integrated circuit chip having signal processing capabilities. In the implementation process, some or all of the functions of the method provided in the embodiment of the present application may be completed by an integrated logic circuit of hardware in processor 1001 or instructions in software form.

[0222] The memory 1002 is used to store computer programs, which include an operating system 1002a and executable code (i.e., program instructions) 1002b. The memory 1002 is, for example, a read-only memory or other types of static storage devices that can store static information and instructions, or a random access memory or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory, a read-only optical disc or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired executable code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. For example, the memory 1002 is used to store the collected service performance parameters, etc. The memory 1002 is, for example, independent and connected to the processor 1001 via a bus 1004. Or the memory 1002 and the processor 1001 are integrated together. The memory 1002 can store executable code. When the executable code stored in the memory 1002 is executed by the processor 1001, the processor 1001 is used to perform part or all of the functions of the business processing method provided in the embodiment of the present application. For the implementation of the processor 1001 to execute the process, please refer to the relevant description in the aforementioned embodiment. The memory 1002 may also include software modules and data required for other running processes such as an operating system.

[0223] The communication interface 1003 uses a transceiver module such as, but not limited to, a transceiver to achieve communication with other devices or communication networks. For example, the communication interface 1003 can be any one or any combination of the following devices: a network interface (such as an Ethernet interface), a wireless network card, and other devices with network access functions.

[0224] The bus 1004 is any type of communication bus for interconnecting the internal devices of the service node (e.g., the memory 1002, the processor 1001, and the communication interface 1003). For example, a system bus. The embodiment of the present application takes the interconnection of the above-mentioned devices inside the service node through the bus 1004 as an example. Optionally, the above-mentioned devices inside the service node 1000 can also be connected to each other in communication with each other using other connection methods other than the bus 1004. For example, the above-mentioned devices inside the service node 1000 are interconnected through an internal logical interface.

[0225] It should be noted that the above-mentioned multiple devices can be respectively arranged on independent chips, or at least partially or completely arranged on the same chip. Whether to independently arrange each device on different chips or to integrate and arrange it on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation form of the above-mentioned devices. The descriptions of the processes corresponding to the above-mentioned figures have different focuses. For the parts not described in detail in a certain process, please refer to the relevant descriptions of other processes.

[0226] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product providing a program development platform includes one or more computer instructions, and when these computer program instructions are loaded and executed on a service node, all or part of the functions of the business processing method provided in the embodiments of the present application are implemented in whole or in part.

[0227] Furthermore, computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium stores computer program instructions that provide a program development platform.

[0228] An embodiment of the present application also provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium. The computer-readable storage medium includes program instructions. When the program instructions are executed on a computing device, the computing device implements the method provided in the embodiment of the present application.

[0229] The embodiment of the present application also provides a computer program product including instructions, and when the computer program product is executed on a computer, the computer implements the method provided by the embodiment of the present application.

[0230] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0231] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the image information and executable code involved in this application are all obtained with full authorization.

[0232] In the embodiments of the present application, the terms "first", "second" and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "plurality" means a plurality, unless otherwise expressly defined.

[0233] The term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0234] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0235] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0236] It should also be understood that the references to "one embodiment", "an embodiment", or "a possible implementation" throughout the specification mean that specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment", or "a possible implementation" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0237] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A business processing method, characterized in that: Applied to a first service node, the method includes: Receive business requests; Store the received business requests in the event pool; Dispatching the business requests in the event pool to a task queue; A consumer thread for processing each subtask of the business request in the task queue is scheduled from a consumer thread pool to complete the processing of the business request in the task queue.

2. The method according to claim 1, characterized in that The first service node is configured with a plurality of task queues, and the method further comprises: In the process of processing the business request, a service performance parameter is collected, wherein the service performance parameter includes at least one of the following parameters: a processing delay, a processing frequency or a processing success rate of the business request; the service performance parameter is used to determine a target number of consumer threads configured for each of the multiple task queues in the consumer thread pool; obtaining the target quantity; A consumer thread is configured for each of the multiple task queues in the consumer thread pool according to the acquired target quantity.

3. The method according to claim 2, characterized in that The multiple task queues are used to store different types of service requests, and one task queue among the multiple task queues is used to store the same type of service requests.

4. The method according to claim 3, characterized in that The type of the service request includes at least two of the following types: a disk input / output I / O type, a network I / O type, a central processing unit CPU computing type, or a graphics processing unit GPU computing type.

5. The method according to any one of claims 2 to 4, characterized in that The dispatching of the service requests in the event pool to the task queue comprises: Dispatching the service requests in the event pool to an event queue; For a first service request scheduled to the event queue, convert the first service request from a first format to a second format, wherein the first service request is any service request scheduled to the event queue, the first format is a data format used when the first service request is transmitted in the network, and the second format is a format corresponding to a data transmission protocol used by a service provided by the first service node; identifying a type of the first service request expressed in the second format; According to the type of the first service request, the first service request is dispatched to a task queue among the multiple task queues for storing service requests of corresponding types.

6. The method according to claim 5, characterized in that The identifying the type of the first service request expressed in the second format comprises: identifying a target task of the first service request expressed in the second format; Splitting the first business request into multiple sub-requests for implementing multiple sub-tasks in the target task; determining a type of each sub-request in the plurality of sub-requests; The step of scheduling the first service request to a task queue among the plurality of task queues for storing service requests of corresponding types according to the type of the first service request includes: According to the type of each sub-request in the multiple sub-requests, each sub-request is dispatched to a task queue in the multiple task queues for storing business requests of a corresponding type.

7. The method according to any one of claims 2 to 6, characterized in that Before obtaining the target quantity, the method further includes: Obtaining service performance parameters collected by other service nodes in the service cluster except the first service node; Determine the fitness of each service node in the service cluster according to the service performance parameters collected by the other service nodes and the service performance parameters collected by the first service node, where the fitness is characterized by latency and / or data transmission bandwidth; When there is a service node in the service cluster whose fitness exceeds a threshold, determining the service node with the highest fitness in the service cluster as a target service node; The number of consumer threads configured by the target service node for each task queue in the target task node is determined as the target number.

8. The method according to claim 7, characterized in that The method further comprises: When there is no service node whose fitness exceeds a threshold in the service cluster, determining a plurality of initial target service nodes in the service cluster according to the fitness of each service node; Crossing and / or mutating the genes of the multiple initial target service nodes, wherein the values ​​of the genes of the initial target service nodes are used to represent the number of consumer threads currently configured by the initial target service nodes for each task queue; The target number is determined according to the current gene of the third service node, and the third service node is any one of the multiple initial target service nodes after the crossover and / or gene mutation.

9. The method according to claim 8, characterized in that When the multiple task queues include a network I / O task queue for storing network I / O type service requests, the method further includes: Obtaining a maximum number of concurrent calls allowed by a second service node, where the second service node is used to provide a service called by a business request in the network I / O task queue; The determining the target number according to the current gene of the third service node includes: The target number of consumer threads configured for the network I / O task queue in the first service node is determined according to the maximum concurrency number and the number of consumer threads configured for the network I / O task queue indicated by the current gene of the third service node; and the number of consumer threads configured for other task queues indicated by the current gene of the third service node is determined as the target number of consumer threads configured for the corresponding task queues in the first service node, wherein the other task queues are task queues other than the network I / O task queue among the multiple task queues.

10. The method according to any one of claims 1 to 9, characterized in that For a second service request with a first quality of service QoS level in the event pool, scheduling the service request in the event pool to a task queue includes: The second service request is inserted into the task queue at a position before a third service request, where the third service request is a service request with a second QoS level that has been scheduled into the task queue, and the first QoS level is higher than the second QoS level.

11. The method according to any one of claims 1 to 10, characterized in that The first service node is an object storage service OBS node.

12. A service processing device, characterized in that: Applied to a first service node, the device includes: A receiving unit, used for receiving a service request; A processing unit is used to store received business requests in an event pool; schedule the business requests in the event pool to a task queue; and schedule a consumer thread for processing each subtask of the business request in the task queue from a consumer thread pool to complete the processing of the business requests in the task queue.

13. The device according to claim 12, characterized in that The first service node is configured with a plurality of task queues; The processing unit is further used to collect service performance parameters in the process of processing the service request, and the service performance parameters include at least one of the following parameters: processing delay, processing frequency or processing success rate of the service request; The service performance parameter is used to determine the target number of consumer threads configured for each of the multiple task queues in the consumer thread pool; The device also includes: An acquisition unit, used for acquiring the target quantity; The processing unit is further used to configure a consumer thread for each of the multiple task queues in the consumer thread pool according to the acquired target quantity.

14. The device according to claim 13, characterized in that The multiple task queues are used to store different types of service requests, and one task queue among the multiple task queues is used to store the same type of service requests.

15. The device according to claim 14, characterized in that The type of the service request includes at least two of the following types: a disk input / output I / O type, a network I / O type, a central processing unit CPU computing type, or a graphics processing unit GPU computing type.

16. The device according to any one of claims 13 to 15, characterized in that The processing unit is also used for: Dispatching the service requests in the event pool to an event queue; For a first service request scheduled to the event queue, convert the first service request from a first format to a second format, wherein the first service request is any service request scheduled to the event queue, the first format is a data format used when the first service request is transmitted in the network, and the second format is a format corresponding to a data transmission protocol used by a service provided by the first service node; identifying a type of the first service request expressed in the second format; According to the type of the first service request, the first service request is dispatched to a task queue among the multiple task queues for storing service requests of corresponding types.

17. The device according to claim 16, characterized in that The processing unit is specifically used for: identifying a target task of the first service request expressed in the second format; Splitting the first business request into multiple sub-requests for implementing multiple sub-tasks in the target task; determining a type of each sub-request in the plurality of sub-requests; According to the type of each sub-request in the multiple sub-requests, each sub-request is dispatched to a task queue in the multiple task queues for storing business requests of a corresponding type.

18. The device according to any one of claims 13 to 17, characterized in that The acquisition unit is further configured to acquire service performance parameters collected by other service nodes in the service cluster except the first service node before acquiring the target number; The processing unit is further used to determine the fitness of each service node in the service cluster based on the service performance parameters collected by the other service nodes and the service performance parameters collected by the first service node, wherein the fitness is characterized by latency and / or data transmission bandwidth; when there is a service node in the service cluster whose fitness exceeds a threshold, the service node with the highest fitness in the service cluster is determined as the target service node; and the number of consumer threads configured by the target service node for each task queue in the target task node is determined as the target number.

19. The device according to claim 18, characterized in that The processing unit is also used for: When there is no service node whose fitness exceeds a threshold in the service cluster, determining a plurality of initial target service nodes in the service cluster according to the fitness of each service node; Crossing and / or mutating the genes of the multiple initial target service nodes, wherein the values ​​of the genes of the initial target service nodes are used to represent the number of consumer threads currently configured by the initial target service nodes for each task queue; The target number is determined according to the current gene of the third service node, and the third service node is any one of the multiple initial target service nodes after the crossover and / or gene mutation.

20. The device according to claim 19, characterized in that The acquisition unit is further configured to, when the plurality of task queues include a network I / O task queue for storing network I / O type service requests, acquire a maximum number of concurrent calls allowed for a second service node, the second service node being configured to provide services called by the service requests in the network I / O task queue; The processing unit is specifically used to determine the target number of consumer threads configured for the network I / O task queue in the first service node according to the maximum concurrency number and the number of consumer threads configured for the network I / O task queue indicated by the current gene of the third service node; and determine the number of consumer threads configured for other task queues indicated by the current gene of the third service node as the target number of consumer threads configured for the corresponding task queue in the first service node, wherein the other task queue is a task queue other than the network I / O task queue among the multiple task queues.

21. The device according to any one of claims 12 to 20, characterized in that For a second service request with a first quality of service QoS level in the event pool, the processing unit is further configured to: The second service request is inserted into the task queue at a position before a third service request, where the third service request is a service request with a second QoS level that has been scheduled into the task queue, and the first QoS level is higher than the second QoS level.

22. The device according to any one of claims 12 to 21, characterized in that The first service node is an object storage service OBS node.

23. A service processing device, characterized in that: include: One or more processors, a memory, and a communication interface, wherein the one or more processors receive or send data through the communication interface, and the one or more processors are configured to call program instructions stored in the memory so that the device executes the method as described in any one of claims 1 to 11.

24. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 11.

25. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, which, when executed by a computing device, perform the method according to any one of claims 1 to 11.