Task processing method and device

By working together with proxy servers and computing clusters, the number of computing nodes is dynamically adjusted to handle computationally intensive tasks, solving the problem of imbalance between computing costs and processing time in existing technologies, improving task processing efficiency and avoiding resource waste.

CN120892154APending Publication Date: 2025-11-04SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511014275.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing computing task processing methods cannot achieve a balance between computing cost and processing time when faced with computationally intensive tasks.

Method used

The proxy server receives the target task request, configures the task into the waiting queue, and sends the task to the computing cluster when the computing cluster has available resources. The computing cluster dynamically adjusts the number of computing nodes according to the queue length to speed up task processing.

Benefits of technology

It achieves a balance between computational cost and task processing time, improves task processing efficiency, and avoids excessive redundancy of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892154A_ABST
    Figure CN120892154A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task processing method and related equipment / products, and belongs to the field of distributed computing. The task processing method is used for a proxy server, and comprises the following steps: receiving a target task request of a target object; under the condition that the target object has a plurality of to-be-processed tasks, configuring the target tasks to a to-be-processed queue; taking out at least one task in the to-be-processed queue under the condition that available resources exist in the computing cluster; sending the extracted task to the computing cluster, wherein the extracted task carries the current queue length of the queue to be processed; wherein the computing cluster is used for increasing the number of computing nodes serving the target object to accelerate task processing of the to-be-processed queue under the condition that the current queue length is greater than a first threshold value. According to the technical scheme provided by the embodiment of the invention, the balance between the calculation cost and the task processing timeliness is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed computing technology, and in particular to a task processing method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] With the rapid development of distributed computing systems, the complexity of computing tasks is constantly increasing. Therefore, there is an urgent need to optimize the processing methods for distributed computing tasks. However, existing computing task processing methods are mainly suitable for I / O-intensive scenarios, and cannot achieve a balance between computing cost and processing time when facing computationally intensive tasks.

[0003] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the Invention

[0004] This application provides a task processing method, apparatus, computer device, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems mentioned above.

[0005] One aspect of this application provides a task processing method for a proxy server, the method comprising: Receive a target task request from a target object; wherein the target task request is used to request the execution of a target task; If the target object has multiple tasks to be processed, the target tasks are configured into a processing queue. If it is determined that there are available resources in the computing cluster, at least one task will be taken out from the queue to be processed. The retrieved task is sent to the computing cluster, and the retrieved task carries the current queue length of the queue to be processed; wherein, the computing cluster is used to increase the number of computing nodes serving the target object to speed up the processing of tasks in the queue to be processed when the current queue length is greater than a first threshold.

[0006] Optionally, a new computing node is added to the target object, including: Obtain the average execution time of the target object's tasks; Based on the current queue length and the average task execution time, increase the number of computing nodes serving the target object.

[0007] Optionally, the computing cluster is used for: The resource utilization rate of the target object is determined based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks. If the resource utilization rate is lower than the second threshold, the number of computing nodes serving the target object is reduced.

[0008] Optionally, the computing cluster is further used for: Based on the task volume of the target object in each time period, determine the peak task period; If the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

[0009] Optionally, the method further includes: If the target object has no pending tasks: if the computing cluster has available resources, then in response to the target task request, the target task is sent to the computing cluster so that the computing cluster can execute the target task; If there are no pending tasks for the target object: if the computing cluster has no available resources, then the target task will be configured into the pending queue.

[0010] Optionally, the method further includes: If the queue length of the queue to be processed is not less than the third threshold, a rejection message is returned to the target object; If the queue length of the pending queue is less than a third threshold, the target task is determined to be added to the pending queue.

[0011] One aspect of this application provides a task processing method for a computing cluster, the method comprising: The system receives a target task sent by a proxy server, the target task carrying the current queue length of the target object's pending tasks; wherein the current queue length represents the number of pending tasks for the target object; and If the current queue length is greater than a first threshold, increase the number of computing nodes serving the target object.

[0012] Optionally, a new computing node is added to the target object, including: Obtain the average execution time of the target object's tasks; Based on the current queue length and the average task execution time, increase the number of computing nodes serving the target object.

[0013] Optionally, the method further includes: The resource utilization rate of the target object is determined based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks. If the resource utilization rate is lower than the second threshold, the number of computing nodes serving the target object is reduced.

[0014] Optionally, the method further includes: Based on the task volume of the target object in each time period, determine the peak task period; If the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

[0015] Another aspect of this application provides a task processing apparatus for a proxy server, the apparatus comprising: A receiving module is used to receive a target task request from a target object; wherein the target task request is used to request the execution of a target task; A configuration module is used to configure the target task into a waiting queue when the target object has multiple tasks to be processed. The retrieval module is used to retrieve at least one task from the queue to be processed when it is determined that there are available resources in the computing cluster. A sending module is used to send the retrieved task to the computing cluster, wherein the retrieved task carries the current queue length of the queue to be processed; wherein the computing cluster is used to increase the number of computing nodes serving the target object to speed up the processing of tasks in the queue to be processed when the current queue length is greater than a first threshold.

[0016] Another aspect of this application provides a task processing apparatus for a computing cluster, the apparatus comprising: A receiving module is configured to receive a target task sent by a proxy server, wherein the target task carries the current queue length of the target object's pending tasks; wherein the current queue length is used to represent the number of pending tasks for the target object; and An addition module is provided to increase the number of computing nodes serving the target object when the current queue length is greater than a first threshold.

[0017] Another aspect of this application provides a computer device, including: At least one processor; and A memory that is communicatively connected to the at least one processor; Wherein: the memory stores instructions that can be executed by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0018] Another aspect of this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method described above.

[0019] Another aspect of this application provides a computer program product including a computer program that, when executed by a processor, implements the method described above.

[0020] The embodiments of this application employing the above technical solution may include the following advantages: When a target object has multiple tasks to be processed, the proxy server configures the target tasks into a processing queue; if the computing cluster has available resources, at least one task is retrieved from the processing queue and sent to the computing cluster. Since the retrieved task carries the current queue length of the processing queue, the computing cluster can determine the task waiting status of the target object accordingly, and when the current queue length is greater than a first threshold, increase the number of computing nodes serving the target object to speed up the processing of tasks in the processing queue, thereby improving task processing efficiency. This method effectively ensures the real-time performance of task processing while avoiding excessive redundancy of computing resources by sensing the task waiting status in real time and expanding the corresponding computing resources as needed, achieving a balance between computing cost and task processing timeliness. Attached Figure Description

[0021] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0022] Figure 1 This diagram schematically illustrates the operating environment of the task processing method according to Embodiment 1 of this application; Figure 2 A flowchart illustrating a task processing method according to Embodiment 1 of this application is shown schematically. Figure 3 The diagram illustrates a new flowchart of the task processing method according to Embodiment 1 of this application; Figure 4 The diagram illustrates a new flowchart of the task processing method according to Embodiment 1 of this application; Figure 5 The diagram illustrates a new flowchart of the task processing method according to Embodiment 1 of this application; Figure 6 The diagram illustrates a new flowchart of the task processing method according to Embodiment 1 of this application; Figure 7The diagram illustrates a new flowchart of the task processing method according to Embodiment 1 of this application; Figure 8 The illustration shows an example of the application of the task processing method according to Embodiment 1 of this application; Figure 9 A flowchart illustrating a task processing method according to Embodiment 2 of this application is shown schematically. Figure 10 The diagram illustrates a new addition to the task processing method according to Embodiment 2 of this application; Figure 11 The diagram illustrates a new addition to the task processing method according to Embodiment 2 of this application; Figure 12 The diagram illustrates a new addition to the task processing method according to Embodiment 2 of this application; Figure 13 A block diagram of a task processing apparatus according to Embodiment 3 of this application is shown schematically; Figure 14 A block diagram of a task processing apparatus according to Embodiment 3 of this application is schematically shown. Figure 15 A schematic diagram of the hardware architecture of a computer device according to Embodiment 5 of this application is shown. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0024] It should be noted that the descriptions involving "first," "second," etc., in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0025] It should be noted that, in any stage of this application involving the collection, storage, use, transmission, and processing of data, each stage strictly adheres to the laws, regulations, industry standards, and regulatory requirements of the data source, usage location, and relevant countries and regions to ensure the legality and compliance of data activities. In the collection stage, the purpose, method, and scope of collection are clearly communicated to the data subject in a prominent manner. Collection is conducted only after obtaining the data subject's legal authorization, ensuring that the collection process follows the "minimum necessary" principle and does not exceed the scope of data collection. In the storage stage, storage periods are limited, and data is promptly deleted or anonymized / encrypted after the storage purpose is achieved. In the usage stage, a strict data security protection mechanism is implemented, using field-level desensitization technology and processing the original data according to preset desensitization rules. For different types of data, multiple desensitization strategies, such as data generalization, data anonymization, and data encryption, are employed to effectively mitigate the risk of sensitive information leakage and ensure that all data used is securely processed and desensitized, comprehensively protecting the rights and interests of data subjects and data security. In the transmission and processing stages, the confidentiality and security of data are ensured during transmission and processing.

[0026] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order of the steps, but are only used to facilitate the description of this application and to distinguish each step, and therefore should not be construed as a limitation of this application.

[0027] First, a definition of the terminology used in this application is provided: Tenant: A core concept in the cloud computing and software services field, referring to an independent group of users or organizations that share the same system or services.

[0028] This application provides a task processing technical solution. This solution enables reasonable task caching and dynamic adjustment and predictive scheduling of computing resources serving the target object. Details are provided below.

[0029] Finally, for ease of understanding, an exemplary operating environment is provided below.

[0030] like Figure 1 As shown in the diagram, the runtime environment includes: proxy server 2, computing cluster 4, and tenant 6 (i.e., the target object). Proxy server 4 can consist of multiple computing devices. These multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as emulations of computer systems, operating systems, servers, etc. The computing devices can load virtual machines based on virtual images and / or other data that define specific software used for emulation (e.g., operating systems, dedicated applications, servers). As the demand for different types of processing services changes, different virtual machines can be loaded and / or terminated on one or more computing devices. A hypervisor can be implemented to manage the use of different virtual machines on the same computing device.

[0031] Computing cluster 4 can consist of multiple service clusters, or it can be an automatically managed cluster formed by distributing multiple containers across multiple physical or virtual computers using a container orchestration platform. Computing cluster 4 is used to provide distributed computing services. Computing cluster 4 can provide distributed computing services via a network. The network includes various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or similar devices. The network can include physical links, such as coaxial cable links, twisted-pair cable links, fiber optic links, or combinations thereof, or wireless links, such as cellular links, satellite links, and Wi-Fi links.

[0032] Tenant 6 is a user unit that shares the same system or service. For example, tenant 6 can be an enterprise organization, a school institution, a customer account of a cloud service, a company account in a software service system, a merchant or development team in an online platform, etc.

[0033] Proxy server 2 can provide proxy services for tenant 6, such as forwarding and caching computing tasks for tenant 6.

[0034] It should be noted that the number of proxy servers 2, computing clusters 4, and tenants 6 shown in the diagram is merely illustrative and is not intended to limit the scope of patent protection of this application. Depending on the actual situation, there can be any number of proxy servers 2, computing clusters 4, and tenants 6.

[0035] The technical solutions of this application are described below using proxy server 2 or computing cluster 4 as the execution entity through multiple embodiments. It should be understood that these embodiments can be implemented in many different forms and should not be construed as being limited to the embodiments described herein.

[0036] Example 1 This method embodiment can be executed in proxy server 2. Proxy server 2 will be used as the execution entity for this process below.

[0037] Figure 2 A flowchart illustrating a task processing method according to Embodiment 1 of this application is shown schematically.

[0038] like Figure 2 As shown, the task processing method may include steps S200~S206, wherein: Step S200: Receive the target task request of the target object; wherein the target task request is used to request the execution of the target task.

[0039] Step S202: If the target object has multiple tasks to be processed, configure the target tasks into the processing queue.

[0040] Step S204: If it is found that there are available resources in the computing cluster, at least one task is taken out from the queue to be processed.

[0041] Step S206: The retrieved task is sent to the computing cluster, and the retrieved task carries the current queue length of the pending queue; wherein, the computing cluster is used to increase the number of computing nodes serving the target object to speed up task processing of the pending queue when the current queue length is greater than a first threshold. The task processing method provided in this embodiment involves a proxy server configuring the target tasks into a waiting queue when the target object has multiple pending tasks. If available resources are available in the computing cluster, at least one task is retrieved from the waiting queue and sent to the computing cluster. Since the retrieved task carries the current queue length of the waiting queue, the computing cluster can determine the task waiting status of the target object based on this information. When the current queue length exceeds a first threshold, the number of computing nodes serving the target object is increased to accelerate task processing in the waiting queue, thereby improving task processing efficiency. This method effectively ensures real-time task processing while avoiding excessive redundancy of computing resources by real-time sensing of task waiting status and scaling up computing resources as needed, achieving a balance between computing cost and task processing timeliness.

[0042] The following combination Figure 2 The steps in steps S200 to S206, as well as other optional steps, are described in detail.

[0043] Step S200 , receives a target task request from the target object; wherein the target task request is used to request the execution of the target task.

[0044] The target object can be a tenant, user instance, service module, etc. The target task can be a video transcoding task or other computational task. After receiving the target task, the proxy server can choose to forward it or cache it. To implement task caching, the proxy server can build a queue of tasks to be processed based on a database. The database can provide persistence for this queue, thereby effectively avoiding task loss.

[0045] Step S202 If the target object has multiple tasks to be processed, the target tasks are configured into the processing queue.

[0046] Since the target object already has multiple pending tasks (i.e., task backlog), the proxy server cannot directly schedule the current target task for execution. Therefore, the target task can be added to a pending queue for delayed processing. Each object corresponds to an independent pending queue, and multiple pending tasks for a target object can be cached in its corresponding pending queue. The presence of pending tasks can be determined by checking if the queue length of the pending queue corresponding to the target object is zero (i.e., if the pending queue is empty).

[0047] Step S204 If it is determined that there are available resources in the computing cluster, at least one task will be taken out from the queue to be processed.

[0048] The proxy server can periodically retrieve resource topology information from the computing cluster based on the unique identifier of the target object. This information includes the resource distribution structure and corresponding resource usage status of each computing node in the cluster. The resource distribution structure can show the current computing node allocation for each object and the network topology relationships between these nodes. The resource usage status can include the memory size and GPU status of each computing node. The proxy server can use this resource topology information to determine if there are available resources in the computing cluster. If the computing node corresponding to the target object is idle, it will retrieve at least one task from the processing queue for execution.

[0049] Step S206 The retrieved task is sent to the computing cluster, and the retrieved task carries the current queue length of the queue to be processed; wherein, the computing cluster is used to increase the number of computing nodes serving the target object to speed up the processing of tasks in the queue to be processed when the current queue length is greater than a first threshold.

[0050] The retrieved tasks can be sent to the corresponding idle computing nodes in the computing cluster for execution. The computing cluster can determine whether to increase the number of computing nodes serving the target object based on the current queue length of the pending queue. When the current queue length exceeds a first threshold, it indicates that there may be a significant delay in the task processing of the target object. In this case, more computing nodes need to be allocated to speed up task processing and effectively reduce processing latency. In some embodiments, the first threshold can be set based on the total amount of resources required by the target object and the average time of the computing tasks, or it can be adjusted based on the task priority of the target object. For example, for high priority tasks, the first threshold can be set to 0.

[0051] The following will exemplarily describe the specific process of dynamically adjusting the resources allocated to a target object through a computing cluster, wherein dynamic adjustment may include resource expansion and resource reduction.

[0052] Regarding resource expansion, in an optional embodiment, adding a computing node to the target object may include: Step S300: Obtain the average task execution time of the target object.

[0053] Step S302: Increase the number of computing nodes serving the target object based on the current queue length and the average task execution time.

[0054] The average task execution time can be calculated from task execution logs, real-time monitoring data, or relevant data in a historical database. The average task execution time of the target object can be obtained periodically. In some embodiments, the number of computing nodes to be added (i.e., resource expansion) can also be determined based on the accumulated task volume (i.e., the current queue length of the pending queue) and the resource requirements of the target object's tasks. Specifically, multiplying the number of tasks of the target object by the resource requirements of each task yields the total resources required for its computing tasks; multiplying the number of computing nodes in the resource pool by the computing resources of each node yields the total resource capacity of the resource pool; and then, the number of computing nodes to be added can be determined based on the total resources required for the target object's computing tasks and the total resource capacity of the resource pool.

[0055] In this embodiment, the resource status of the target object is evaluated by the current queue length and the average task execution time, thereby realizing refined elastic scaling of resources for the target object, and thus dynamically optimizing resource utilization efficiency while ensuring service quality.

[0056] Regarding resource scaling down, in an optional embodiment, the computing cluster can be used for: Step S400: Determine the resource utilization rate of the target object based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks.

[0057] Step S402: If the resource utilization rate is lower than the second threshold, reduce the number of computing nodes serving the target object.

[0058] By using resource topology information and the unique identifier of the target object, the number of computing nodes allocated to the target object, and the number of computing nodes currently executing tasks, can be determined. The resource utilization rate of the target object can be determined by the ratio of the number of computing nodes currently executing tasks to the number of computing nodes allocated to it. This ratio can be used to assess the usage of computing resources allocated to the target object, thereby evaluating whether its resources are being used effectively. If the resource utilization rate is lower than a second threshold, it indicates that the computing nodes allocated to the target object are not being used effectively, and therefore the number of computing nodes serving the target object can be reduced (i.e., resource scaling down) to improve resource utilization efficiency.

[0059] In this embodiment, when the resource utilization rate is lower than the second threshold, the number of computing nodes allocated to the target object is actively reduced to realize an elastic resource management strategy of on-demand allocation, thereby effectively improving the resource utilization rate.

[0060] Regarding resource scaling down, in an optional embodiment, the computing cluster can also be used for: Step S500: Determine the peak task period based on the task volume of the target object in each time period.

[0061] In step S502, if the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

[0062] Statistical analysis can be performed on historical task data of the target object, and the task volume can be distributed statistically according to a preset time granularity (e.g., hourly, half-hourly). When the task volume in certain time periods is significantly higher than in other time periods, these periods are marked as peak task periods. When resource utilization falls below a second threshold, it indicates that the computing nodes allocated to the target object are not being used effectively, and resource scaling down is required. If the current time period is a peak task period, the task volume of the target object may increase in a short time. Therefore, a penalty time can be set when performing scaling down, i.e., the number of computing nodes allocated to the target object is reduced after a preset delay. In some embodiments, the preset time can be set according to the duration of the peak task period and the task priority of the target object to achieve more reasonable control over the timing of resource scaling down.

[0063] In this embodiment, by determining the peak task period and adopting a resource adjustment strategy with a preset delay time, performance fluctuations caused by frequent resource scaling down and scaling up operations can be effectively avoided.

[0064] The above content describes the specific process of dynamically adjusting resources in a computing cluster. The following will describe the specific scheduling process of tasks by the proxy server.

[0065] In an optional embodiment, the method further includes: Step S600: If the target object has no pending tasks, and if the computing cluster has available resources, then in response to the target task request, the target task is sent to the computing cluster so that the computing cluster can execute the target task.

[0066] Step S602, if the target object has no pending tasks: if the computing cluster has no available resources, then the target task is configured into the pending queue.

[0067] When the target object has no pending tasks (i.e., the corresponding processing queue is empty), it means that the target object currently has no tasks waiting to be executed. In this case, the target task can be directly sent to the computing cluster. The computing cluster can further determine whether there are any idle computing nodes corresponding to the target object: if there are idle computing nodes, the target task will be scheduled to an idle computing node for execution; if there are no idle computing nodes, the target task cannot be executed immediately and can be added to the processing queue for caching, to be scheduled for execution when an idle computing node becomes available.

[0068] In this embodiment, the appropriate scheduling of target tasks is achieved by determining whether there are pending tasks for the target object and whether the computing cluster has available resources. If the computing cluster lacks available resources, the target tasks are cached in a pending queue to effectively prevent task loss and ensure their subsequent normal execution.

[0069] In an optional embodiment, the method further includes: Step S700: If the queue length of the queue to be processed is not less than the third threshold, a rejection message is returned to the target object.

[0070] Step S702: If the queue length of the queue to be processed is less than the third threshold, determine to add the target task to the queue to be processed.

[0071] In practical applications, if the proxy server accepts tasks and adds them to the processing queue without restriction, the queue length may continue to grow. Even if the computing cluster subsequently expands its resources, it may be difficult to process tasks in a timely manner, leading to task delays or even system anomalies. Therefore, when the length of the processing queue reaches a set upper limit (i.e., the third threshold), the proxy server will no longer accept and cache new tasks, but will directly return a rejection message to the target object. Conversely, if the queue length is still below the third threshold, it is considered to still have task-handling capacity, and the target task can be added to the processing queue.

[0072] In this embodiment, a third threshold is set to determine whether the proxy server has the ability to continue receiving and caching new tasks, thereby effectively avoiding system overload caused by unlimited task reception and addition to the processing queue.

[0073] To make this application easier to understand, the following is combined with... Figure 8 Here is an example application. The specific workflow is as follows: In step S801, the target object (i.e., the tenant) sends the target task request to the proxy server.

[0074] In step S802, the proxy server determines whether the target object has any pending tasks based on the unique identifier of the target object.

[0075] If so, proceed with steps S803-S807: In step S803, the proxy server adds the target task to the pending queue (i.e., the backlog queue).

[0076] In step S804, if the queue length of the queue to be processed is not less than the third threshold (i.e., threshold 2), the proxy server returns a rejection message to the target object.

[0077] In step S805, after the proxy server determines that there are available resources in the real-time cluster, it takes at least one task from the waiting queue in sequence and sends the at least one task to the computing cluster until the waiting queue is empty.

[0078] The tasks sent to the computing cluster carry the current queue length of the corresponding pending queue.

[0079] Step S806: If the current queue length is greater than the first threshold (i.e., threshold 1), the computing cluster increases the number of computing nodes serving the target object based on the current queue length and the average task execution time.

[0080] In step S807, if the computing cluster has no available resources, wait for a period of time and then re-execute step S805.

[0081] If not, proceed to steps S808-S810: In step S808, the proxy server directly distributes the target task to the computing cluster.

[0082] In step S809, if there are no available resources in the computing cluster, the target task is added to the pending queue of the agent server, and the process jumps to step S805.

[0083] Step S810: If the resource utilization rate of the target object is less than the second threshold (i.e., threshold 3), reduce the resource size of the target object. If the current time period is not a peak task period, directly reduce the number of computing nodes serving the target object.

[0084] If the current time period is a peak task period, the preset time will be delayed, and the number of computing nodes serving the target object will be reduced after the preset time is reached.

[0085] In this exemplary application, the computing resources (number of computing nodes for the service) of the target object can be adjusted on demand, effectively ensuring the real-time performance of task processing while avoiding excessive redundancy of computing resources, thus achieving a balance between computing cost and task processing timeliness.

[0086] Example 2 This method embodiment can be executed in computing cluster 4. The proxy server 4 is used as the execution entity for this process. It should be noted that the technical details and effects of this embodiment can be found in Embodiment 1.

[0087] Figure 9 A flowchart illustrating a task processing method according to Embodiment 2 of this application is shown schematically.

[0088] like Figure 9 As shown, the task processing method may include steps S900~S902, wherein: Step S900: Receive the target task sent by the proxy server. The target task carries the current queue length of the target object's pending queue. The current queue length is used to represent the number of pending tasks for the target object.

[0089] Step S902: If the current queue length is greater than the first threshold, increase the number of computing nodes serving the target object.

[0090] In an optional embodiment, adding a computing node to the target object includes: Step S1000: Obtain the average task execution time of the target object.

[0091] Step S1002: Increase the number of computing nodes serving the target object based on the current queue length and the average task execution time.

[0092] In an optional embodiment, the method further includes: Step S1100: Determine the resource utilization rate of the target object based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks.

[0093] Step S1102: If the resource utilization rate is lower than the second threshold, reduce the number of computing nodes serving the target object.

[0094] In an optional embodiment, the method further includes: Step S1200: Determine the peak task period based on the task volume of the target object in each time period.

[0095] In step S1202, if the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the preset time is delayed, and the number of computing nodes serving the target object is reduced after the preset time is reached.

[0096] Example 3 Figure 13 The diagram schematically illustrates a task processing apparatus according to Embodiment 3 of this application. This apparatus can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiments of this application. The program module referred to in the embodiments of this application refers to a series of computer program instruction segments capable of performing a specific function. The following description will specifically introduce the function of each program module in this embodiment. For example... Figure 13 As shown, the device 1300 may include: a receiving module 1310, a configuration module 1320, an extraction module 1330, and a transmitting module 1340, wherein: The receiving module 1310 is used to receive a target task request from a target object; wherein the target task request is used to request the execution of a target task.

[0097] The configuration module 1320 is used to configure the target task into the processing queue when the target object has multiple tasks to be processed.

[0098] The retrieval module 1330 is used to retrieve at least one task from the queue to be processed when it is determined that there are available resources in the computing cluster. The sending module 1340 is used to send the retrieved task to the computing cluster, wherein the retrieved task carries the current queue length of the queue to be processed; wherein the computing cluster is used to increase the number of computing nodes serving the target object to speed up the processing of tasks in the queue to be processed when the current queue length is greater than a first threshold.

[0099] As an optional embodiment, adding a computing node to the target object includes: Obtain the average execution time of the target object's tasks; Based on the current queue length and the average task execution time, increase the number of computing nodes serving the target object.

[0100] As an optional embodiment, the computing cluster is used for: The resource utilization rate of the target object is determined based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks. If the resource utilization rate is lower than the second threshold, the number of computing nodes serving the target object is reduced.

[0101] As an optional embodiment, the computing cluster is also used for: Based on the task volume of the target object in each time period, determine the peak task period; If the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

[0102] As an optional embodiment, the sending module 1340 is further configured to: If the target object has no pending tasks: if the computing cluster has available resources, then in response to the target task request, the target task is sent to the computing cluster so that the computing cluster can execute the target task; If there are no pending tasks for the target object: if the computing cluster has no available resources, then the target task will be configured into the pending queue.

[0103] As an optional embodiment, the configuration module 1320 is also used for: If the queue length of the queue to be processed is not less than the third threshold, a rejection message is returned to the target object; If the queue length of the pending queue is less than a third threshold, the target task is determined to be added to the pending queue.

[0104] Example 4 Figure 14 The diagram schematically illustrates a task processing apparatus according to Embodiment 4 of this application. This apparatus can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiments of this application. The program module referred to in the embodiments of this application refers to a series of computer program instruction segments capable of performing a specific function. The following description will specifically introduce the function of each program module in this embodiment. For example... Figure 14 As shown, the device 1400 may include: a receiving module 1410 and an adding module 1420, wherein: The receiving module 1410 is configured to receive a target task sent by a proxy server, wherein the target task carries the current queue length of the pending tasks queue of the target object; wherein the current queue length is used to represent the number of pending tasks of the target object; and Add module 1420, used to increase the number of computing nodes serving the target object when the current queue length is greater than a first threshold.

[0105] As an optional embodiment, module 1420 is further configured to: Obtain the average execution time of the target object's tasks; Based on the current queue length and the average task execution time, increase the number of computing nodes serving the target object.

[0106] As an optional embodiment, the device 1400 further includes a reduction module, which is used for: The resource utilization rate of the target object is determined based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks. If the resource utilization rate is lower than the second threshold, the number of computing nodes serving the target object is reduced.

[0107] As an optional embodiment, the reduction module is used for: Based on the task volume of the target object in each time period, determine the peak task period; If the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

[0108] Example 5 Figure 15 This illustration schematically depicts the hardware architecture of a computer device 10000 suitable for implementing a task processing method according to Embodiment 5 of this application. In some embodiments, the computer device 10000 may be a terminal device such as a smartphone, wearable device, tablet computer, personal computer, in-vehicle terminal, game console, virtual machine, workbench, digital assistant, set-top box, or robot. In other embodiments, the computer device 10000 may be a rack server, blade server, tower server, or cabinet server (including standalone servers or server clusters composed of multiple servers), etc. Figure 15 As shown, the computer device 10000 includes, but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate and be linked with each other via a system bus. Wherein: The memory 10010 includes at least one type of computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of a computer device 10000, such as the hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 10000. Of course, the memory 10010 may also include both the internal storage module and the external storage device of the computer device 10000. In this embodiment, the memory 10010 is typically used to store the operating system and various application software installed on the computer device 10000, such as program code for task processing methods. In addition, the memory 10010 can also be used to temporarily store various types of data that have been output or will be output.

[0109] In some embodiments, processor 10020 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other chip. Processor 10020 is typically used to control the overall operation of computer device 10000, such as performing control and processing related to data interaction or communication with computer device 10000. In this embodiment, processor 10020 is used to run program code stored in memory 10010 or process data.

[0110] Network interface 10030 may include a wireless network interface or a wired network interface, which is typically used to establish a communication link between computer device 10000 and other computer devices. For example, network interface 10030 is used to connect computer device 10000 to an external terminal via a network, establishing a data transmission channel and communication link between computer device 10000 and the external terminal. The network may be an intranet, the Internet, Global System for Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or other wireless or wired networks.

[0111] It should be pointed out that, Figure 15 Only computer devices with components 10010-10030 are shown; however, it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.

[0112] In this embodiment, the task processing method stored in memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of this application.

[0113] Example 6 This application also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the task processing method in the embodiment.

[0114] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Of course, the computer-readable storage medium may include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device, such as the program code of the task processing method in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.

[0115] Example 7 This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in the above embodiments.

[0116] Obviously, those skilled in the art should understand that the modules or steps of the embodiments of this application described above can be implemented using general-purpose computer devices. They can be centralized on a single computer device or distributed across a network of multiple computer devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computer device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of this application are not limited to any particular combination of hardware and software.

[0117] It should be noted that the above are merely preferred embodiments of this application and do not limit the scope of patent protection of this application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A task processing method, characterized in that, For use with a proxy server, the method includes: Receive a target task request from a target object; wherein the target task request is used to request the execution of a target task; If the target object has multiple tasks to be processed, the target tasks are configured into a processing queue. If it is determined that there are available resources in the computing cluster, at least one task will be taken out from the queue to be processed. The retrieved task is sent to the computing cluster, and the retrieved task carries the current queue length of the queue to be processed; wherein, the computing cluster is used to increase the number of computing nodes serving the target object to speed up the processing of tasks in the queue to be processed when the current queue length is greater than a first threshold.

2. The method according to claim 1, characterized in that, Adding a computing node to the target object includes: Obtain the average execution time of the target object's tasks; Based on the current queue length and the average task execution time, increase the number of computing nodes serving the target object.

3. The method according to claim 1, characterized in that, The computing cluster is used for: The resource utilization rate of the target object is determined based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks. If the resource utilization rate is lower than the second threshold, the number of computing nodes serving the target object is reduced.

4. The method according to claim 3, characterized in that, The computing cluster is also used for: Based on the task volume of the target object in each time period, determine the peak task period; If the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

5. The method according to claim 1, characterized in that, The method further includes: If the target object has no pending tasks: if the computing cluster has available resources, then in response to the target task request, the target task is sent to the computing cluster so that the computing cluster can execute the target task; If there are no pending tasks for the target object: if the computing cluster has no available resources, then the target task will be configured into the pending queue.

6. The method according to claim 1, characterized in that, The method further includes: If the queue length of the queue to be processed is not less than the third threshold, a rejection message is returned to the target object; If the queue length of the pending queue is less than a third threshold, the target task is determined to be added to the pending queue.

7. A task processing method, characterized in that, For computing clusters, the method includes: The system receives a target task sent by a proxy server, the target task carrying the current queue length of the target object's pending tasks; wherein the current queue length represents the number of pending tasks for the target object; and If the current queue length is greater than a first threshold, increase the number of computing nodes serving the target object.

8. The method according to claim 7, characterized in that, Adding a computing node to the target object includes: Obtain the average execution time of the target object's tasks; Based on the current queue length and the average task execution time, increase the number of computing nodes serving the target object.

9. The method according to claim 8, characterized in that, The method further includes: The resource utilization rate of the target object is determined based on the number of computing nodes corresponding to the target object and the number of computing nodes currently executing tasks. If the resource utilization rate is lower than the second threshold, the number of computing nodes serving the target object is reduced.

10. The method according to claim 9, characterized in that, The method further includes: Based on the task volume of the target object in each time period, determine the peak task period; If the resource utilization rate is lower than the second threshold, and if the current time period is a peak task period, then the time is delayed by a preset time, and the number of computing nodes serving the target object is reduced after the preset time is reached.

11. A task processing device, characterized in that, For a proxy server, the apparatus includes: A receiving module is used to receive a target task request from a target object; wherein the target task request is used to request the execution of a target task; A configuration module is used to configure the target task into a waiting queue when the target object has multiple tasks to be processed. The retrieval module is used to retrieve at least one task from the queue to be processed when it is determined that there are available resources in the computing cluster. A sending module is used to send the retrieved task to the computing cluster, wherein the retrieved task carries the current queue length of the queue to be processed; wherein the computing cluster is used to increase the number of computing nodes serving the target object to speed up the processing of tasks in the queue to be processed when the current queue length is greater than a first threshold.

12. A task processing device, characterized in that, For computing clusters, the device includes: A receiving module is configured to receive a target task sent by a proxy server, wherein the target task carries the current queue length of the target object's pending tasks; wherein the current queue length is used to represent the number of pending tasks for the target object; and An addition module is provided to increase the number of computing nodes serving the target object when the current queue length is greater than a first threshold.

13. A computer device, characterized in that, include: At least one processor; and A memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 10.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in claims 1 to 10.