A task allocation method and apparatus
Patent Information
- Application Number
- CN202510531062.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2026-10-27
AI Technical Summary
但是由于云手机数量往往较多,人工管理难以覆盖所有云手机,管理效率较低,使得云手机之间存在负载不均,无法高效处理任务的问题
[0020]根据本发明实施例的再一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现本发明实施例所提供的任务分配方法。
Smart Images

Figure CN122985367A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a task allocation method and apparatus. Background Technology
[0002] Currently, in e-commerce, logistics, and other service sectors, service providers leverage community operations to better serve users and meet their deeper needs in order to maintain customer relationships. The core technology supporting these operations—cloud phone terminal nodes—is facing critical performance challenges. As the execution hub for private community management, cloud phones handle multiple high-concurrency tasks, including frequent coupon pushes, organizing viral marketing campaigns, real-time user message interaction, and attracting new users. Their operational efficiency directly determines the success rate of operational activities and the stability of user experience. Under high-load scenarios (such as centralized order processing or large-scale campaign outreach), cloud phones are prone to overheating due to excessive resource consumption, leading to response delays and significantly increasing task failure rates, such as message sending interruptions and a sharp drop in participation in viral marketing campaigns.
[0003] Currently, to avoid high device load, manual management is typically used to manage the communities managed by different cloud phones and the execution of tasks within those communities. However, due to the large number of cloud phones, manual management is insufficient to cover all of them, resulting in low management efficiency and uneven load distribution among the cloud phones, hindering efficient task processing. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a task allocation method and apparatus that can reasonably determine the mapping relationship between clusters and objects, balance the task load among objects, reduce the time consumed by task execution, and further improve task processing efficiency by dynamically allocating tasks through task information.
[0005] To achieve the above objectives, according to one aspect of the present invention, a task allocation method is provided, comprising:
[0006] Tasks to be processed are obtained from the task queue corresponding to the cluster. The cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the clusters to which each object belongs based on the working status value of each object in the task allocation system within a specified time period. Each object belongs to at least one cluster.
[0007] The target object is determined from at least one object in the cluster based on the task information of each object in the cluster.
[0008] The task to be processed is assigned to the target object.
[0009] Optionally, adjusting the cluster to which each object belongs based on the working status value of each object in the task allocation system within a specified time period includes: inputting the working status value of each object in the task allocation system within the specified time period and the current cluster to which each object belongs into a pre-constructed mixed-integer linear programming problem model. The mixed-integer linear programming problem model is constructed based on the historical working status values of each object in the task allocation system within a specified historical time period, the mapping relationship between each object and the cluster before adjustment, and the mapping relationship between each object and the cluster after adjustment; solving the mixed-integer linear programming problem model to obtain the target cluster corresponding to each object; and adjusting the cluster to which each object belongs based on the target cluster corresponding to each object.
[0010] Optionally, the mixed-integer linear programming problem model includes an objective function and constraints. The objective function is established with the goal of maximizing the minimum working state value of each object in the task allocation system. The constraints include: the number of times each object in the task allocation system belongs to the cluster, the number of objects in the cluster, the number of times the objects corresponding to the cluster enter the group, and the decision variable constraints.
[0011] Optionally, each task in the task queue has a sequence number, and obtaining the task to be processed from the task queue corresponding to the cluster includes: obtaining the task to be processed from the task queue according to the sequence number of each task in the task queue corresponding to the cluster; and the method further includes: in response to receiving a task, determining the priority of the task according to the task type; determining the first sequence number of the task among all tasks of the priority according to the generation time of the task; determining the sequence number of each task in the task queue according to the priority of the task and the first sequence number of the task among all tasks of the priority; sorting the tasks based on the sequence numbers of each task and saving them to the task queue.
[0012] Optionally, the task information includes the number of tasks to be executed and the task execution success rate. The step of determining the target object from at least one object in the cluster based on the task information of each object in the cluster includes: selecting an object that meets preset task conditions as the target object from at least one object in the cluster based on the number of tasks to be executed and the task execution success rate of each object in the cluster. The preset task conditions are related to the number of tasks to be executed and the task execution success rate.
[0013] According to another aspect of the present invention, a task allocation apparatus is provided, comprising:
[0014] The acquisition module is used to acquire tasks to be processed from the task queue corresponding to the cluster. The cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the clusters to which each object belongs based on the working status value of each object in the task allocation system within a specified time period. Each object belongs to at least one cluster.
[0015] The determination module is used to determine the target object from at least one object included in the cluster based on the task information of each object in the cluster;
[0016] The allocation module is used to allocate the task to be processed to the target object.
[0017] Optionally, the device further includes a cluster object determination module, configured to: input the working status values of each object in the task allocation system within a specified time period and the current cluster to which each object belongs into a pre-constructed mixed-integer linear programming problem model, wherein the mixed-integer linear programming problem model is constructed based on the historical working status values of each object in the task allocation system within a specified historical time period, the mapping relationship between each object and the cluster before adjustment, and the mapping relationship between each object and the cluster after adjustment; obtain the target cluster corresponding to each object by solving the mixed-integer linear programming problem model; and adjust the cluster to which each object belongs according to the target cluster corresponding to each object to obtain the objects included in the cluster.
[0018] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the task allocation method provided in the embodiments of the present invention.
[0019] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the task allocation method provided in the embodiments of the present invention.
[0020] According to another aspect of the present invention, a computer program product is provided, including a computer program that, when executed by a processor, implements the task allocation method provided in the embodiments of the present invention.
[0021] One embodiment of the above invention has the following advantages or beneficial effects: According to the task allocation method provided by the embodiments of the present invention, after obtaining the tasks to be processed from the task queue corresponding to the cluster, the target object is determined based on the task information of each object in the cluster, and the tasks to be processed are allocated to the target object. Real-time task information enables dynamic allocation of tasks to be processed and reasonable distribution to objects in the cluster, resulting in a more balanced workload among objects in the cluster, improving task processing efficiency, and preventing excessive load on individual objects from affecting task processing. Furthermore, the objects in the cluster are determined by adjusting the working status values of each object over a historical time period, which can prevent uneven task allocation from the source, achieving static adjustment of objects. Combined with the dynamic allocation method, this greatly improves the efficiency and success rate of task processing.
[0022] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0023] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0024] Figure 1 This is a schematic diagram of the main steps of the task allocation method according to an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of a cloud phone task allocation process according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the main modules of the task allocation device according to an embodiment of the present invention;
[0027] Figure 4 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0028] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0029] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0030] It should be noted that the technical solutions disclosed in this invention, regarding the collection, updating, analysis, processing, use, transmission, and storage of user personal information, all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0031] Currently, using cloud phones to maintain communities can provide better services to users and prevent user churn. However, cloud phone management relies heavily on manual intervention, which presents challenges and can lead to uneven task distribution within the community. Some cloud phones may be idle, while others are overloaded and unable to perform tasks efficiently, thus impacting overall operational efficiency. Furthermore, within the community, only the group leader's cloud phone can perform tasks, limiting the efficiency of other cloud phones and hindering task execution. Due to the uneven distribution of cloud phones and the role restrictions, task success rates are also severely affected. Currently, the success rate is only around 70%, which falls short of the expectation for efficient operation. Low success rates not only impact user experience but may also lead to the loss of potential customers, negatively affecting business growth. Therefore, there is an urgent need to find solutions to optimize cloud phone management and resource allocation.
[0032] Based on this, the present invention proposes a method for intelligently managing a large number of cloud phones. Before executing a task, the number of cloud phones in each community can be adjusted according to the working status (workload, work efficiency, etc.) of each cloud phone. During task execution, the task allocation can be dynamically adjusted according to the task execution status of the cloud phones in each community. By combining static adjustment with dynamic allocation, the execution efficiency of tasks can be greatly improved, the response time of tasks can be reduced, and the overall operational efficiency can be improved.
[0033] Figure 1 This is a schematic diagram of the main flow of the task allocation method according to an embodiment of the present invention. Figure 1 As shown, the task allocation method of the present invention mainly includes the following steps S101 to S103.
[0034] Step S101: Obtain the task to be processed from the task queue corresponding to the cluster. The cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the cluster to which each object belongs based on the working status value of each object in the task allocation system within a specified time period. Each object belongs to at least one cluster.
[0035] When a task needs to be processed, a task to be processed (hereinafter referred to as a "task") is pulled sequentially from the task queue corresponding to the cluster, that is, a task is obtained from the head of the queue, so that the task can be assigned later. The cluster, as a community of multiple users, may include at least one object for executing tasks corresponding to the cluster, such as a cloud phone, in addition to users. This object provides corresponding services by executing tasks while maintaining users.
[0036] In one embodiment, the operation of retrieving tasks from the queue is performed periodically, that is, tasks are pulled from the task queue according to a certain time period or a certain operation time. Each task retrieval operation requires pulling all tasks in the task queue sequentially, and subsequent tasks are allocated according to the retrieval order. Alternatively, the operation of retrieving tasks from the queue is triggered when an update to the tasks in the queue is detected, such as when the queue receives one or more tasks, triggering the retrieval of tasks from the queue. It should be understood that the triggered task retrieval operation will only be executed after the queue has sorted all tasks according to the received one or more tasks.
[0037] In one embodiment, the tasks in the queue are sorted according to the priority of different types of tasks. For example, the priority of type a task is 1, the priority of type b task is 2, and the priority of type c task is 3. When sorting, the task queue {a, b, c} is obtained according to the priority from 1 to 3. For tasks with the same priority, they can be further sorted according to the task generation time (or task arrival time).
[0038] In one embodiment, tasks include generating group codes, automatically replying to user questions, routine outreach, and changing group names.
[0039] In one embodiment, the mapping relationship between clusters and objects (used to determine which objects are included in a cluster) is determined based on the work status values of each object within a specified time period (which can be considered as a preset historical time period). Specifically, after obtaining the work status values of each object, the clusters to which each object belongs are adjusted according to the work status values, that is, the objects are added to other clusters, resulting in the adjusted mapping relationship between clusters and objects. The work status value can represent the workload of an object. Accordingly, during adjustment, objects with less workload can be added to the clusters containing objects with more workload to help the objects with more workload share their tasks, balance the workload of both, and improve task execution efficiency. For example, before adjustment, the workload of object 1 is 3 and the workload of object 2 is 23 within the preset historical time period. After adding object 1 to the cluster to which object 2 belongs, the workload of both may become 13, effectively balancing the workload between different objects. However, due to differences in their working capabilities, the workloads of object 1 and object 2 after adjustment may not be exactly the same, i.e., they may not both be 13, and there may be some error.
[0040] In one embodiment, the preset historical time period can be the previous day. That is, the adjustment of the cluster to which each object belongs is completed based on the working status value of each object on the previous day. Specifically, it can be the working status value from 0:00 to 24:00 on the previous day, or the working status value within the previous day's working hours (less than 24 hours). The specific value can be set according to the actual situation, and this invention does not impose any restrictions on it. Correspondingly, the execution time of the adjustment operation can be set according to the preset historical time period. For example, the execution time of the adjustment operation can be scheduled for 10:00 PM every day. The working status value can be any one or any combination of workload, working duration, or working speed. The application of working duration is similar to that of workload; objects with shorter working durations are added to the cluster to which objects with longer working durations belong. Working speed needs to be considered in conjunction with working duration or workload; objects with short working durations and fast working speeds are added to the cluster to which objects with long working durations and slow working speeds belong. The specific selection of the working status value can be set according to the actual situation, and this invention does not impose any restrictions on it.
[0041] Step S102: Determine the target object from at least one object in the cluster based on the task information of each object in the cluster.
[0042] After retrieving tasks from the task queue, they need to be assigned. First, the target objects for task assignment must be determined. Specifically, real-time task information for all objects in the cluster is obtained. This information characterizes the task execution status of each object, including the number of tasks pending, task execution success rate, and task completion status. Based on this information, target objects are selected from all objects in the cluster. For example, the object with the fewest pending tasks can be prioritized, allowing tasks to be assigned to it. Each cluster contains at least one object, and each object belongs to at least one cluster; meaning each object can be in multiple clusters simultaneously.
[0043] Step S103: Assign the task to be processed to the target object.
[0044] Once the target object is identified, the task is directly assigned to that target object. This task assignment operation is performed on the day of task execution, dynamically allocating tasks in real time based on the identified target object. This helps to dynamically allocate tasks based on the real-time task information of each object in the cluster, thereby balancing the task load among different objects and improving task execution efficiency.
[0045] According to the task allocation method provided in this embodiment of the invention, after obtaining the tasks to be processed from the task queue corresponding to the cluster, the target object is determined based on the task information of each object in the cluster, and the tasks to be processed are allocated to the target object. Real-time task information enables dynamic allocation of tasks to be processed and reasonable distribution to objects in the cluster, resulting in a more balanced workload among objects in the cluster, improving task processing efficiency, and preventing excessive load on individual objects from affecting task processing. Furthermore, the objects in the cluster are determined based on the working status values of each object over a historical period, which can prevent uneven task allocation from the source, achieving static adjustment of objects. Combined with the dynamic allocation method, this greatly improves the efficiency and success rate of task processing.
[0046] In one embodiment, adjusting the cluster to which each object belongs based on the working status value of each object in the task allocation system within a specified time period includes: inputting the working status value of each object in the task allocation system within the specified time period and the current cluster to which each object belongs into a pre-constructed mixed-integer linear programming problem model, which is constructed based on the historical working status value of each object in the task allocation system within a specified historical time period, the mapping relationship between each object and the cluster before adjustment, and the mapping relationship between each object and the cluster after adjustment; solving the mixed-integer linear programming problem model to obtain the target cluster corresponding to each object; and adjusting the cluster to which each object belongs based on the target cluster corresponding to each object.
[0047] When adjusting the clusters to which objects belong, this can be accomplished by constructing a problem model and solving it. Specifically, the problem can be modeled based on the working status values of each object in the task allocation system over a historical period, and the mapping relationship between each object and its respective cluster. The mixed-integer linear programming problem model is solved using the mip (Mixed Integer Programming) package to obtain the cloud phone allocation matrix. Based on the cloud phone allocation matrix, the clusters to which the cloud phones belong are adjusted, specifically including the joining operations of different cloud phones into clusters. After the adjustment is completed, the mapping relationship between clusters and objects is obtained, thereby determining the objects contained in each cluster.
[0048] In one embodiment, the mixed-integer linear programming problem model includes an objective function and constraints. The objective function is established with the goal of maximizing the minimum working state value of each object in the task allocation system. The constraints include: the number of times each object in the task allocation system belongs to the cluster, the number of objects in the cluster, the number of times the objects corresponding to the cluster enter the group, and the decision variable constraints.
[0049] Based on the mixed-integer linear programming problem model constructed above, according to its actual application scenario, it is necessary to set an objective function and corresponding constraints to ensure the accuracy of the solution results. Specifically, the objective function is to maximize the minimum working state value of each object (i.e., max x, where x is the minimum working state value of each object), for example, maximizing the minimum working time of each object. Taking the object as a cloud phone and the object being added to the cluster as a cloud phone joining the group operation as an example: In order to ensure the linearity of the constraints, the following restrictions are added: cloud phone leaving the group is not considered; each group can only have a maximum of one new cloud phone joining; the newly joined cloud phone undertakes the workload within the group. The constraint on the number of times each object belongs to the cluster in the task allocation system is adjusted (limiting the upper limit of the number of times it can join the group, and not adjusting too many cloud phones at one time): ∑ i ∑ j(A′ i,j -A i,j )≤n / 4, Constraints on the number of objects within the cluster (representing that there must be at least one cloud phone in the cluster): ∑ j A′ i,j ≥1, Constraints on the number of times an object can join a cluster (representing that at most one new cloud phone can join each cluster): ∑ j (A′ i,j -A i,j )<2, Decision variable constraints: A′ i,j ∈{0,1}, In addition to the constraints mentioned above, there are also constraints on the working time of each object in the cluster: Where A represents the mapping relationship between the cluster and the cloud phone before adjustment, A′ represents the mapping relationship between the cluster and the cloud phone after adjustment, T represents the task working time within the cluster, i∈{1,2,…,n} represents a certain cluster, j∈{1,2,…,m} represents a certain cloud phone, and x represents the minimum working time of the cloud phone; the first term means that if the cloud phone joining the cluster remains unchanged, the cloud phone will still undertake the working time of Ti; the second term means that if a new cloud phone joins the cluster, the newly joined cloud phone will undertake the workload within the cluster. In addition, it can also include the constraint conditions corresponding to the previously added restrictions: A′ i,j ≥A i,j , This is to ensure the linearity of the constraints.
[0050] In one embodiment, if no constraints are added, i.e., considering the outgoing operation of cloud phones, the mixed-integer linear programming problem is transformed into a mixed-integer nonlinear programming problem. The problem model constructed based on this problem is: ∑ i (A′ i,j *T i / ∑ j A′ i,j )≥x, Its objective function is also max x. Constraints include: adjusting the number of entries and exits to the group; constraint: ∑ i,j (A′ i,j -A i,j ) 2 ≤2000; Constraint on the number of objects within the cluster: ∑ j A′ i,j ≥1, Decision variable constraints: A′ i,j ∈{0,1}, The adjusted result can also be obtained by modeling and solving this problem, but the computational load is greater than that of the mixed-integer linear programming problem.
[0051] According to the task allocation method provided in the embodiments of the present invention, the objects in each cluster can be adjusted before the task is executed, and the objects with less workload are added to the cluster where the objects with more workload are located. This helps to balance the workload among the objects, so as to improve the processing efficiency of the task and avoid the problem of excessive load on individual objects.
[0052] In one embodiment, each task in the task queue has a sequence number. Retrieving a task to be processed from the task queue corresponding to the cluster includes: retrieving a task to be processed from the task queue according to the sequence number of each task in the task queue corresponding to the cluster; and the method further includes: in response to receiving a task, determining the priority of the task according to the task type; determining the first sequence number of the task among all tasks of the priority according to the task's generation time; determining the sequence number of each task in the task queue according to the task's priority and the first sequence number of the task among all tasks of the priority; and sorting the tasks based on their sequence numbers and saving them to the task queue.
[0053] Tasks in the task queue have a corresponding order and a sequence number. Specifically, upon receiving a task, its priority is determined based on its type, and its position in the task queue is also determined. Further, among all tasks of that priority in the task queue, the first sequence number of the received task is determined, and the next-ranked task after the last task of all priorities is also identified as the first sequence number. The sequence numbers of all tasks in the task queue are then determined and updated based on the first sequence number, and the tasks are stored in the task queue according to the updated sequence numbers.
[0054] In one embodiment, the task information includes the number of tasks to be executed and the task execution success rate. Determining the target object from at least one object in the cluster based on the task information of each object in the cluster includes: selecting an object that meets preset task conditions as the target object from at least one object in the cluster based on the number of tasks to be executed and the task execution success rate of each object in the cluster. The preset task conditions are related to the number of tasks to be executed and the task execution success rate.
[0055] The acquired task information includes the number of tasks to be executed and the task execution success rate. When determining the target object, selection is needed based on the task information of all objects in the cluster. Specifically, objects whose task information meets preset task conditions should be selected as target objects. These preset task conditions can be: having the fewest tasks to be executed and, given the same number of tasks, having the highest task execution success rate. The target object is selected based on these conditions. For example, object a has 2 tasks to be executed and a task execution success rate of 80%; object b has 3 tasks to be executed and a task execution success rate of 90%; and object c has 2 tasks to be executed and a task execution success rate of 85%. Based on these preset task conditions, object c can be determined as the target object.
[0056] In one embodiment, the preset task conditions can be set according to actual conditions. For example, it can be set to only consider the number of tasks to be executed, selecting the object with the fewest tasks. If the number is not unique, one of the objects is randomly selected as the target object. Alternatively, it can be set to prioritize the task execution success rate within a certain error range. That is, when the difference between the number of tasks to be executed is small, the object with the highest task execution success rate is selected first. Based on the above example, the target object is determined to be object b. The error range can be set to 2, that is, the difference in the number of tasks to be executed between the object with the highest success rate and the object with the fewest tasks to be executed is not greater than 2. In this case, an object with a higher success rate but not the fewest tasks can be selected. When considering the error range, if the difference in the number of tasks to be executed between the object with the highest success rate and the object with the fewest tasks to be executed is greater than 2, the object with the second highest success rate can be selected for comparison. If the difference is still greater than 2, the comparison operation can be repeated until the number of tasks to be executed for the selected object with a higher success rate is not greater than that for the object with the fewest tasks. At this point, the object with the fewest tasks to be executed is directly selected as the target object.
[0057] The task allocation method provided by the embodiments of the present invention can perform task allocation operations in a combination of static and dynamic methods, thereby improving the rationality of task allocation and the efficiency of task processing. Specifically, by statically adjusting the clusters where each object resides based on its workload over a historical time period, objects with smaller workloads are added to clusters where objects with larger workloads reside, helping to share the workload of objects with larger workloads and greatly improving task processing efficiency. In addition, by combining the dynamic allocation operation of real-time tasks, i.e., determining the target object for task allocation based on the real-time task information of each object, and thus completing the task allocation process, the workload of each object is balanced, avoiding the problem of unsaturated workload of objects caused by uneven task allocation. While rationally allocating tasks, the execution efficiency of tasks is greatly improved.
[0058] In one embodiment, the cloud phone task allocation process is as follows: Figure 2As shown, the cloud phone resource pool stores data on all cloud phones. The daily mapping relationship between cloud phones and clusters is obtained through the cloud phone workload adjustment module. Adjusting this mapping relationship evens out the workload of each cloud phone and controls the number of times a cloud phone joins a cluster. After determining the mapping relationship, tasks are dynamically allocated daily based on the current task generation status through the real-time task allocation module to improve task processing efficiency. The cloud phone resource pool uses a newly added field to track task execution time. The execution time of tasks for each task type is summarized to obtain a cloud phone workload table, which determines the workload of each cloud phone. Furthermore, before adjusting cloud phone cluster joining, the cloud phone startup status table needs to be obtained; cloud phones that are not currently running are not adjusted.
[0059] Figure 3 This is a schematic diagram of the main modules of the task allocation device 300 according to an embodiment of the present invention. Figure 3 As shown, the task allocation device 300 of the present invention includes an acquisition module 301, a determination module 302 and an allocation module 303.
[0060] The acquisition module 301 is used to acquire tasks to be processed from the task queue corresponding to the cluster. The cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the clusters to which each object belongs based on the working status value of each object in the task allocation system within a specified time period. Each object belongs to at least one cluster.
[0061] The determination module 302 is used to determine the target object from at least one object included in the cluster based on the task information of each object in the cluster;
[0062] The allocation module 303 is used to allocate tasks to be processed to target objects.
[0063] The task allocation device provided in this embodiment of the invention can, after obtaining the tasks to be processed from the task queue corresponding to the cluster, determine the target object based on the task information of each object in the cluster, and allocate the tasks to the target object. By using real-time task information, dynamic allocation of tasks to be processed can be achieved, and tasks can be reasonably allocated to objects in the cluster, resulting in a more balanced workload among objects in the cluster, improving task processing efficiency, and preventing excessive load on individual objects from affecting task processing. Furthermore, the objects in the cluster are determined based on the working status values of each object over a historical time period, which can prevent uneven task allocation from the source, achieving static adjustment of objects. Combined with the dynamic allocation method, this greatly improves the efficiency and success rate of task processing.
[0064] In one embodiment, the task allocation device 300 further includes a cluster object determination module, configured to: input the working status values of each object in the task allocation system within a specified time period and the current cluster to which each object belongs into a pre-constructed mixed-integer linear programming problem model, wherein the mixed-integer linear programming problem model is constructed based on the historical working status values of each object in the task allocation system within a specified historical time period, the mapping relationship between each object and the cluster before adjustment, and the mapping relationship between each object and the cluster after adjustment; obtain the target cluster corresponding to each object by solving the mixed-integer linear programming problem model; and adjust the cluster to which each object belongs according to the target cluster corresponding to each object to obtain the objects included in the cluster.
[0065] In one embodiment, the mixed-integer linear programming problem model includes an objective function and constraints. The objective function is established with the goal of maximizing the minimum working state value of each object in the task allocation system. The constraints include: the number of times each object in the task allocation system belongs to the cluster, the number of objects in the cluster, the number of times the objects corresponding to the cluster enter the group, and the decision variable constraints.
[0066] In one embodiment, each task in the task queue has a sequence number. The acquisition module 301 is further configured to acquire a task to be processed from the task queue according to the sequence number of each task in the task queue corresponding to the cluster. The determination module 302 is further configured to: in response to receiving a task, determine the priority of the task according to the task type; determine the first sequence number of the task among all tasks of the priority according to the task's generation time; determine the sequence number of each task in the task queue according to the task's priority and the first sequence number of the task among all tasks of the priority; and sort the tasks based on their sequence numbers and save them to the task queue.
[0067] In one embodiment, the task information includes the number of tasks to be executed and the task execution success rate. The determining module 302 is further configured to: select an object that meets the preset task conditions as the target object from at least one object included in the cluster, based on the number of tasks to be executed and the task execution success rate of each object in the cluster. The preset task conditions are related to the number of tasks to be executed and the task execution success rate.
[0068] The task allocation device provided by the embodiments of the present invention can perform task allocation operations in a combination of static and dynamic methods, thereby improving the rationality of task allocation and the efficiency of task processing. Specifically, by statically adjusting the clusters where each object resides based on its workload over a historical time period, objects with smaller workloads are added to clusters where objects with larger workloads reside, helping to share the workload of objects with larger workloads and greatly improving task processing efficiency. In addition, by combining real-time task dynamic allocation operations, i.e., determining the target object for task allocation based on the real-time task information of each object, and thus completing the task allocation process, the workload of each object is balanced, avoiding the problem of insufficient workload of objects caused by uneven task allocation. While rationally allocating tasks, the execution efficiency of tasks is greatly improved.
[0069] Figure 4 An exemplary system architecture 400 is shown that can be applied to the task allocation method or task allocation apparatus of the present invention.
[0070] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, and 403, a network 404, and a server 405. Network 404 serves as the medium for providing communication links between terminal devices 401, 402, and 403 and server 405. Network 404 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0071] Users can use terminal devices 401, 402, and 403 to interact with server 405 via network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, and 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0072] Terminal devices 401, 402, and 403 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0073] Server 405 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 401, 402, and 403 (for example only). The backend management server can adjust and allocate data such as received task allocation requests, and feed back the processing results (e.g., allocation results - for example only) to the terminal devices.
[0074] It should be noted that the task allocation method provided in this embodiment of the invention is generally executed by server 405, and correspondingly, the task allocation device is generally set in server 405.
[0075] It should be understood that Figure 4 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0076] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing terminal devices or servers of the present invention. Figure 5 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0077] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0078] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0079] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.
[0080] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0081] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0082] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including an acquisition module, a determination module, and an allocation module. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, an acquisition module can also be described as "a module for acquiring tasks to be processed from a task queue corresponding to a cluster."
[0083] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to: obtain tasks to be processed from a task queue corresponding to a cluster, wherein the cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the clusters to which each object belongs based on the working status values corresponding to each object in the task allocation system within a specified time period, wherein each object belongs to at least one cluster; determine a target object from at least one object included in the cluster based on the task information of each object in the cluster; and allocate the tasks to be processed to the target object.
[0084] According to the technical solution of the embodiments of the present invention, the task allocation method provided by the embodiments of the present invention can, after obtaining the tasks to be processed from the task queue corresponding to the cluster, determine the target object according to the task information of each object in the cluster, and allocate the tasks to be processed to the target object. Through real-time task information, dynamic allocation of tasks to be processed can be achieved, and the tasks can be reasonably allocated to objects in the cluster, making the task load among objects in the cluster more balanced, improving task processing efficiency, and avoiding excessive load on individual objects, which would affect task processing. Furthermore, the objects in the cluster are determined based on the working status values of each object over a historical time period, which can avoid the problem of uneven task allocation from the source, achieving static adjustment of objects. Combined with the dynamic allocation method, this greatly improves the efficiency and success rate of task processing.
[0085] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A task allocation method, characterized in that, include: Tasks to be processed are obtained from the task queue corresponding to the cluster. The cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the clusters to which each object belongs based on the working status value of each object in the task allocation system within a specified time period. Each object belongs to at least one cluster. The target object is determined from at least one object in the cluster based on the task information of each object in the cluster. The task to be processed is assigned to the target object.
2. The method according to claim 1, characterized in that, The step of adjusting the cluster to which each object belongs based on the working status value of each object in the task allocation system within a specified time period includes: Input the working status values of each object in the task allocation system within a specified time period and the current cluster to which each object belongs into a pre-built mixed integer linear programming problem model. The mixed integer linear programming problem model is constructed based on the historical working status values of each object in the task allocation system within a specified historical time period, the mapping relationship between each object and the cluster before adjustment, and the mapping relationship between each object and the cluster after adjustment. By solving the mixed-integer linear programming problem model, the target clusters corresponding to each object are obtained; The cluster to which each object belongs is adjusted according to the target cluster corresponding to each object.
3. The method according to claim 2, characterized in that, The mixed-integer linear programming problem model includes an objective function and constraints. The objective function is established with the goal of maximizing the minimum working state value of each object in the task allocation system. The constraints include: the number of times each object belongs to the cluster in the task allocation system is adjusted, the number of objects in the cluster, the number of times the objects corresponding to the cluster enter the group, and the decision variable constraints.
4. The method according to claim 1, characterized in that, Each task in the task queue has a sequence number, and the step of retrieving the task to be processed from the task queue corresponding to the cluster includes: Based on the sequence number of each task in the task queue corresponding to the cluster, retrieve the task to be processed from the task queue; Furthermore, the method also includes: In response to receiving a task, the priority of the task is determined according to the task type; The first sequence number of the task among all tasks of the given priority is determined based on the task's generation time. The sequence number of each task in the task queue is determined based on the priority of the task and the first sequence number of the task among all tasks of that priority. The tasks are sorted according to their sequence numbers and then saved to the task queue.
5. The method according to any one of claims 1-4, characterized in that, The task information includes the number of tasks to be executed and the task execution success rate. The step of determining the target object from at least one object in the cluster based on the task information of each object in the cluster includes: Based on the number of pending tasks and the task execution success rate of each object in the cluster, an object that meets the preset task conditions is selected as the target object from at least one object included in the cluster. The preset task conditions are related to the number of pending tasks and the task execution success rate.
6. A task allocation device, characterized in that, include: The acquisition module is used to acquire tasks to be processed from the task queue corresponding to the cluster. The cluster includes at least one object, and the objects included in the cluster are obtained by adjusting the clusters to which each object belongs based on the working status value of each object in the task allocation system within a specified time period. Each object belongs to at least one cluster. The determination module is used to determine the target object from at least one object included in the cluster based on the task information of each object in the cluster; The allocation module is used to allocate the task to be processed to the target object.
7. The apparatus according to claim 6, characterized in that, The device further includes a cluster object determination module, used for: Input the working status values of each object in the task allocation system within a specified time period and the current cluster to which each object belongs into a pre-built mixed integer linear programming problem model. The mixed integer linear programming problem model is constructed based on the historical working status values of each object in the task allocation system within a specified historical time period, the mapping relationship between each object and the cluster before adjustment, and the mapping relationship between each object and the cluster after adjustment. By solving the mixed-integer linear programming problem model, the target clusters corresponding to each object are obtained; The clusters to which each object belongs are adjusted according to the target clusters corresponding to each object, thus obtaining the objects included in the clusters.
8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.