Delivery optimization method, device and equipment based on segment tree and dichotomy and medium
Through the dispatch optimization method based on line segment tree and dichotomy, the problem of low efficiency in work task allocation is solved, fast and reasonable task allocation is achieved, and system performance and response speed are improved.
Patent Information
- Application Number
- CN202510583858.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
Smart Images

Figure CN120450346A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to a method, device, equipment and medium for optimizing work dispatching based on a segment tree and a bisection method. Background Art
[0002] In the insurance renewal business, in order to improve the efficiency of reinstatement of inactive policies, after identifying inactive policies that are easy to reinstate through the easy-to-reinstate model, supervisory staff need to follow up, which involves how to assign work, that is, which inactive policies are assigned to which staff members.
[0003] However, in traditional dispatching methods, each dispatch request requires searching for eligible workers and staff members one by one. This requires searching all workers and staff members, which results in high time complexity. This can be particularly time-consuming when there are a large number of workers or when dispatch requests are frequent, impacting the overall performance and responsiveness of the system. As data volume increases, the system's processing capacity can decline significantly, resulting in delays, a poor user experience, and low dispatch efficiency.
[0004] In the healthcare sector, work dispatching is often used to assign medical staff, nurses, or other medical personnel to different tasks or wards. This process is particularly time-consuming and error-prone in hospitals or clinics with large staff sizes and frequent work dispatch requests. This can lead to inappropriate work arrangements for medical staff and hinder timely patient treatment and care. Furthermore, over-reliance on manual work dispatching can increase management pressure on the healthcare system and reduce the overall responsiveness and quality of healthcare services.
[0005] In the fintech sector, dispatching is often used to assign tasks such as customer service requests, risk assessments, and financial product recommendations to appropriate staff members. When the volume of customer requests is high or the tasks are complex, searching individually is not only time-consuming but can also lead to incorrect assignments, delayed responses, and a negative impact on the customer experience. Furthermore, frequent manual inquiries increase management costs and can slow system responses, impacting the timeliness and accuracy of financial services and reducing business operational efficiency.
[0006] Therefore, there is a problem of low efficiency in allocating work tasks in current technologies. Summary of the Invention
[0007] The present invention provides a method, device, equipment and medium for optimizing work assignment based on segment tree and bisection method, the main purpose of which is to solve the problem of low efficiency in allocating work tasks.
[0008] In a first aspect, to achieve the above-mentioned objectives, the present invention provides a method for optimizing work assignment based on a segment tree and a bisection method, comprising:
[0009] Obtaining historical work behaviors of initial staff members, prioritizing the initial staff members according to the historical work behaviors, and obtaining staff members to be assigned;
[0010] Obtaining the number of assigned tasks for each of the to-be-assigned workers, and constructing a segment tree according to the to-be-assigned workers and the number of assigned tasks;
[0011] Obtaining the work tasks to be assigned, and performing a binary search and matching on the work tasks to be assigned and the staff members to be assigned according to the segment tree to obtain a matching result;
[0012] If the matching result is that the work task to be assigned and the staff member to be assigned are successfully matched, the work task to be assigned is assigned to the corresponding matched staff member to be assigned, and a target work assignment result is obtained;
[0013] If the matching result is that the work task to be assigned and the staff member to be assigned fail to match, screening the staff members to be assigned to obtain the assignable staff members;
[0014] Allocate the work tasks to be assigned to the assignable personnel to obtain the target assignment result.
[0015] In a second aspect, the present invention further provides a work dispatch optimization device based on a segment tree and a bisection method, comprising:
[0016] A staff ranking module is used to obtain the historical work behavior of the initial staff members, prioritize the initial staff members according to the historical work behavior, and obtain the staff members to be assigned;
[0017] A segment tree construction module is used to obtain the number of assigned tasks of each worker to be assigned, and to construct a segment tree according to the worker to be assigned and the number of assigned tasks;
[0018] A task matching module to be assigned is used to obtain the work tasks to be assigned, and perform a binary search and matching between the work tasks to be assigned and the staff to be assigned according to the segment tree to obtain a matching result;
[0019] A first matching result module is configured to assign the work task to the corresponding matching staff member to be assigned if the matching result shows that the work task to be assigned and the staff member to be assigned are successfully matched, thereby obtaining a target work assignment result;
[0020] a second matching result module configured to, if the matching result indicates that the work task to be assigned and the staff member to be assigned fail to match, screen each staff member to be assigned to obtain the staff members who can be assigned;
[0021] The work task assignment module is used to assign the work tasks to be assigned to the assignable personnel to obtain target assignment results.
[0022] In a third aspect, the present invention further provides an electronic device, comprising:
[0023] at least one processor; and,
[0024] a memory communicatively connected to the at least one processor; wherein,
[0025] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned work dispatch optimization method based on segment tree and bisection method.
[0026] In a fourth aspect, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned work dispatch optimization method based on segment tree and bisection method.
[0027] The present invention obtains the historical work behavior of the initial staff, prioritizes the initial staff according to the historical work behavior, obtains the staff to be assigned, obtains the number of assigned tasks for each of the staff to be assigned, and constructs a segment tree according to the staff to be assigned and the number of assigned tasks. By constructing the segment tree and combining the minimum assigned number, the total assigned number and the target query number, the efficiency of task assignment can be significantly improved. The work tasks to be assigned are obtained, and a binary search is performed on the work tasks to be assigned and the staff to be assigned according to the segment tree to obtain a matching result. If the matching result is the work tasks to be assigned, the matching result is the number of the staff to be assigned. If the work task and the staff to be assigned are successfully matched, the work task to be assigned will be assigned to the corresponding matching staff to be assigned to obtain the target work assignment result. The task assignment and staff status are efficiently managed through the segment tree, so that when facing large-scale task assignment, it can be queried and updated quickly, reducing the calculation complexity. If the matching result is that the work task to be assigned and the staff to be assigned fail to match, each staff to be assigned will be screened for possible assignment to obtain the assignable staff, and the work task to be assigned will be assigned to the assignable staff to obtain the target work assignment result, which can effectively improve the efficiency of work task assignment. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0029] Figure 1 A schematic diagram of an application environment of a work dispatch optimization method based on a segment tree and a bisection method according to an embodiment of the present invention;
[0030] Figure 2 A schematic diagram of a flow chart of a method for optimizing work dispatch based on a segment tree and a bisection method according to an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of a process for constructing a segment tree in a method for optimizing work dispatching based on a segment tree and a bisection method according to an embodiment of the present invention;
[0032] Figure 4 A schematic diagram of a module of a work dispatch optimization device based on a segment tree and a binary search method provided by one embodiment of the present invention;
[0033] Figure 5 A schematic structural diagram of an electronic device for implementing a work dispatch optimization method based on a segment tree and a bisection method, provided in one embodiment of the present invention;
[0034] Figure 6 Another structural diagram of an electronic device for implementing a work dispatch optimization method based on a segment tree and a bisection method provided by an embodiment of the present invention.
[0035] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, and to fully understand and implement how the present disclosure applies technical means to solve technical problems and achieve the corresponding technical effects, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The embodiments of the present disclosure and the various features in the embodiments can be combined with each other without conflict, and the technical solutions formed are all within the scope of protection of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present disclosure.
[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, apparatus, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] The embodiment of the present application provides a method for optimizing work dispatch based on a segment tree and a bisection method, and the execution subject of the method for optimizing work dispatch based on a segment tree and a bisection method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the device provided by the embodiment of the present application. In other words, the method for optimizing work dispatch based on a segment tree and a bisection method can be executed by software or hardware installed on a terminal device or a server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0039] The present invention provides a method for optimizing work assignment based on segment tree and bisection method, which can be applied in the following situations: Figure 1In the application environment of . Among them, the client communicates with the server through the network. The server can obtain the historical work behavior of the initial staff through the client, prioritize the initial staff according to the historical work behavior, obtain the staff to be assigned, obtain the number of assigned tasks for each staff to be assigned, and construct a segment tree according to the staff to be assigned and the number of assigned tasks. By constructing a segment tree and combining the minimum assigned number, the total assigned number and the target query number, the efficiency of task assignment can be significantly improved, and the work task to be assigned is obtained. According to the segment tree, a binary search is performed on the work task to be assigned and the staff to be assigned to obtain a matching result. If the matching result is the work task to be assigned and the staff to be assigned, the server can obtain the historical work behavior of the initial staff according to the historical work behavior, prioritize the initial staff according to the historical work behavior, obtain the staff to be assigned, obtain the number of assigned tasks, and construct a segment tree according to the staff to be assigned and the number of assigned tasks. If the assigned staff is successfully matched, the work task to be assigned will be assigned to the corresponding matched staff to be assigned, and the target assignment result will be obtained. The task assignment and staff status will be efficiently managed through the segment tree, so that when facing large-scale task assignment, it can be quickly queried and updated, reducing the computational complexity. If the matching result is that the work task to be assigned and the staff to be assigned fail to match, each staff to be assigned will be screened for possible assignments to obtain the assignable staff, and the work task to be assigned will be assigned to the assignable staff to obtain the target assignment result, which can effectively improve the efficiency of work task assignment, and finally the target assignment result will be output and fed back to the user client. Among them, the client can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.
[0040] The following is an explanation of the specification of the present invention. The present invention uses a segment tree to display the status of the staff to be assigned or the tasks to be assigned, so that the reasonable allocation of each task becomes efficient. The binary method quickly finds the appropriate assignment result by continuously narrowing the search scope, thereby improving the efficiency of allocation.
[0041] Reference Figure 2 FIG. 1 is a flow chart of a method for optimizing work dispatching based on a segment tree and a binary search method according to an embodiment of the present invention. In this embodiment, the method for optimizing work dispatching based on a segment tree and a binary search method includes:
[0042] S1. Obtain historical work behaviors of initial staff members, prioritize the initial staff members according to the historical work behaviors, and obtain staff members to be assigned.
[0043] In an embodiment of the present invention, behavioral data of initial staff members in their past work are collected, including indicators such as work completion status, response speed, and execution efficiency. Then, based on these historical behaviors, the comprehensive performance of the staff members is evaluated and ranked to determine their priority. The ranked results are used to give priority to personnel with better performance when assigning subsequent tasks, thereby improving the overall task execution efficiency and quality.
[0044] In specific healthcare scenarios, different types of medical workers, such as doctors, nurses, and technical support personnel, may have different priorities based on their professional skills and experience. For example, when dealing with emergency patients, emergency doctors have a higher priority than doctors in general departments because they need to respond quickly and treat life-threatening conditions; among operating room nurses, experienced nurses have a higher priority when scheduling surgeries because they can cooperate with the surgical team more efficiently; and intensive care unit (ICU) medical staff face patients with complex and rapidly changing conditions, so their priority is higher than other departments when allocating resources. In addition, when responding to public health emergencies (such as epidemics), the priority of frontline medical staff (such as infectious disease doctors, nurses, etc.) will be significantly increased because they are the key force in preventing and controlling the epidemic.
[0045] In specific FinTech scenarios, traders or risk managers will be prioritized during periods of significant market volatility, with those who need to respond quickly to market changes receiving priority. For example, data analysts will receive higher priority when they need to quickly access market data and analytical reports, as they can provide data support for decision-making. Compliance personnel will also receive higher priority when regulatory policies change or unusual market trading occurs, ensuring that business operations comply with regulatory requirements.
[0046] In an embodiment of the present invention, the prioritizing of the initial staff members according to the historical work behaviors to obtain the staff members to be assigned includes:
[0047] Normalizing the historical work behavior to obtain behavior indicator data;
[0048] Performing weighted summation on the behavioral indicator data of each initial staff member to obtain a historical work score;
[0049] generating a priority of the initial worker based on the historical work score;
[0050] The initial staff members are sorted in descending order of priority to obtain staff members to be assigned.
[0051] Specifically, data from different historical work behaviors is normalized to ensure they are within the same measurement range or scale. Behavioral indicator data is obtained by subtracting the mean of the historical work behaviors and dividing by their standard deviation. This normalization process makes comparisons between different historical behaviors or events more intuitive and avoids bias caused by differences in data size or units.
[0052] The behavioral indicator data of each initial staff member is weighted and summed. The calculation formula is as follows:
[0053] score=∑(A1*w1+A2*w2+...+A n *w n )
[0054] Among them, A1, A2, ..., A n Represents behavioral indicator data, w1, w2, ..., w n Indicates the weight corresponding to each behavioral indicator data.
[0055] Each staff member is scored based on their behavioral indicator data in historical work to obtain their historical work score. These staff members are sorted from high to low according to their historical work scores. The higher the historical work score, the higher the priority. The staff members with higher priority are ranked in front, and the staff members with lower priority are ranked in the back. The staff members to be assigned are arranged in order of priority, which facilitates the reasonable allocation and management of subsequent tasks.
[0056] By normalizing the behavioral indicator data, the dimensional differences between different indicators are eliminated, making the scoring more fair and consistent. Combined with the weighted summation method, various behavioral performances are comprehensively considered to ensure that the scoring is more representative and accurate. Priorities are generated based on the historical work scores obtained, and then tasks are assigned to staff members according to priority through sorting. This helps to assign work tasks to staff members with outstanding performance, thereby improving overall work efficiency and task completion quality, and reducing the complexity of allocation.
[0057] S2. Obtain the number of assigned tasks for each of the to-be-assigned workers, and construct a segment tree according to the to-be-assigned workers and the number of assigned tasks.
[0058] In this embodiment of the present invention, the set of work tasks currently requiring assignment is obtained, along with the number of tasks already assigned to each worker to be assigned. A segment tree is then constructed, with the worker as a leaf node and the minimum number of assigned tasks and the total number of completed tasks as node capacity information. This segment tree is used to efficiently query and update allocable task capacity, enabling rapid identification of workers with available assignment space during the task assignment process.
[0059] In healthcare scenarios, each worker's assigned task count needs to be updated in real time, especially during emergencies when workloads can fluctuate at any time. Segment trees can efficiently query a worker's assigned task count and quickly update it based on task changes. They can also query the assigned task count for all workers over a specific period of time, helping schedulers allocate tasks efficiently.
[0060] In specific FinTech scenarios, such as on financial platforms, where the workload of multiple traders needs to be optimized within a specific time period, segment trees can help quickly query the total workload of traders within a specific time period, enabling appropriate scheduling. For example, if the system detects a sharp increase in trading volume within a certain time period, it can dynamically adjust the worker's task allocation by querying and updating the segment tree.
[0061] Figure 3 A schematic diagram of a process for constructing a segment tree in a work dispatch optimization method based on a segment tree and a bisection method is provided in one embodiment of the present invention.
[0062] In an embodiment of the present invention, obtaining the number of assigned tasks for each worker to be assigned, and constructing a segment tree according to the worker to be assigned and the number of assigned tasks, includes:
[0063] Sort the number of assigned tasks of each worker to be assigned in ascending order to obtain the minimum number of assigned tasks;
[0064] Adding up the number of assigned tasks of all the staff members to be assigned to obtain a total assigned number;
[0065] generating node information according to the minimum allocated quantity and the total allocated quantity;
[0066] The target query quantity of the staff to be assigned is obtained, and a segment tree is generated according to the target query quantity and the node information.
[0067] Specifically, a segment tree is an efficient data structure that supports interval queries and updates, helping to quickly find qualified workers, thereby improving the efficiency of task assignment and querying. A segment tree node contains the following information: the left endpoint L of the interval, the right endpoint R of the interval, the minimum allocated quantity minFree in the current interval, and the total allocated quantity totalFree completed by all workers in the current interval.
[0068] By comparing the number of assigned tasks for each worker to be assigned, the minimum number of assigned tasks is determined, which serves as a benchmark for measuring task imbalance. The minimum number of assigned tasks reflects that the current workload of a worker to be assigned is relatively light.
[0069] By adding up the number of assigned tasks for all workers to be assigned, the total assigned number can be obtained, which reflects the total number of tasks currently undertaken by all workers to be assigned. This provides an overall perspective for the reasonable allocation of subsequent tasks, helps to analyze the current workload distribution, ensures the balance and coordination of tasks among the workers to be assigned, and avoids some workers being too busy while others have lighter tasks.
[0070] The node information in the segment tree is constructed based on the task allocation of each worker to be assigned, and the nodes reflect the task load of the worker to be assigned in different intervals. For example, the minimum assigned quantity can be used to determine which intervals have relatively few task assignments, while the total assigned quantity provides a global perspective, ensuring that the segment tree can effectively represent the distribution of tasks. In this way, the segment tree supports fast query and update, helping to quickly identify areas where tasks can be assigned.
[0071] The target query count typically refers to the number of tasks to be queried or processed within a specific range, perhaps based on a condition or the total number of tasks in a range. Using these query counts and previously generated node information, a segment tree is constructed into an efficient data structure, where each node represents the load information for a specific task range.
[0072] By constructing a segment tree and combining the minimum assigned quantity, total assigned quantity, and target query quantity, we can significantly improve the efficiency of task allocation. The minimum assigned quantity helps identify workers with lighter workloads, while the total assigned quantity provides a comprehensive view of task allocation. Generating segment tree node information and combining it with the target query quantity enables fast interval queries and dynamic updates, thus optimizing the task allocation process, flexibly adjusting task allocation, and ensuring workload balance.
[0073] S3. Obtain the work tasks to be assigned, and perform binary search and matching on the work tasks to be assigned and the staff members to be assigned according to the segment tree to obtain matching results.
[0074] In an embodiment of the present invention, a segment tree is an advanced data structure that can be queried and updated within an interval range. A binary search is used to match tasks and workers. The binary search can efficiently find the most suitable matching method.
[0075] In healthcare scenarios, segment trees can be used to store and quickly query doctors' available time slots. Each time slot node represents a doctor's free time interval. When a patient makes an appointment, the segment tree can be used to search for matching free time slots. For example, on a healthcare platform, a patient can enter their appointment time, and the system uses a binary search to find doctors available during that time.
[0076] In FinTech scenarios, segment trees can help maintain investment quotas for each project. When an investor submits an investment request, the segment tree can be used to quickly find projects that meet their investment requirements. For example, if investor A offers an investment of 1 million yuan, the system will use a binary search across all investment quotas to find projects that can accommodate 1 million yuan and assign them a suitable project.
[0077] In an embodiment of the present invention, performing a binary search and matching on the to-be-assigned work tasks and the to-be-assigned staff members according to the segment tree to obtain a matching result includes:
[0078] Obtaining the maximum number of tasks for each of the to-be-assigned workers and the number of tasks to be assigned for the to-be-assigned work tasks;
[0079] Generate an allocatable value according to the maximum number of tasks and the number of tasks to be assigned;
[0080] Obtaining a query interval of the segment tree, comparing the allocatable value with a minimum allocated quantity of the query interval, and obtaining a comparison result;
[0081] If the comparison result is that the minimum allocated quantity of the query interval is greater than the allocable value, the matching result between the to-be-allocated work task and the to-be-allocated staff member is a matching failure;
[0082] If the comparison result is that the minimum allocated quantity of the query interval is less than or equal to the allocatable value, the matching result of the to-be-allocated work task and the to-be-allocated staff member is a successful match.
[0083] Specifically, the maximum number of tasks M for each worker to be assigned and the number of tasks to be assigned K for each work task to be assigned are obtained, and the allocable value is calculated based on the maximum number of tasks and the number of tasks to be assigned. The calculation formula is as follows:
[0084] Assignable value = MK
[0085] Among them, M represents the maximum number of tasks to be assigned to each worker, and K represents the number of tasks to be assigned.
[0086] Within the specified query interval, find the worker who can assign K unassigned tasks, for example, unassigned workers for expired policies, and has the minimum allocated quantity. Compare the allocatable value with the minimum allocated quantity in the query interval. Then, find the worker whose minimum allocated quantity minFree in the query interval [1, i] is less than or equal to the allocatable value.
[0087] If the comparison result shows that the minimum allocated number in the query interval is greater than the allocatable value, it means that the allocation demand of the current task exceeds the available work resources, and the matching result between the work task to be allocated and the staff to be allocated is a matching failure. Execute S6 and screen the available work for each staff to be allocated to determine which staff can bear the additional task load and ensure that the selected staff can receive new tasks within their work capabilities.
[0088] If the comparison result shows that the minimum allocated number in the query interval is less than or equal to the allocable value, it means that the current task allocation demand is within the acceptable load range, and the matching result of the work tasks to be assigned and the staff to be assigned is a successful match. It is necessary to further determine the staff to be assigned corresponding to the minimum allocated number.
[0089] By comparing each worker's maximum number of tasks with the number of tasks to be assigned, an allocatable value is generated and compared with the minimum allocated value in the query interval to ensure the rationality and fairness of task allocation. If the minimum allocated value is less than or equal to the allocatable value, the match is successful; if the minimum allocated value is greater than the allocatable value, the match fails. This approach improves task allocation efficiency, optimizes the resource allocation process, and ensures a balanced distribution of workload among workers.
[0090] S4. Determine whether the matching result is a successful match. If the matching result is that the work task to be assigned and the staff to be assigned are successfully matched, then S5. Assign the work task to be assigned to the corresponding matched staff to be assigned to obtain a target work assignment result.
[0091] In an embodiment of the present invention, after binary search matching, it is determined whether the matching result is successful. If the matching between the work task to be assigned and the staff to be assigned is successful, the work task to be assigned is assigned to a suitable staff to be assigned.
[0092] In healthcare scenarios, tasks might include patient appointments, examinations, or medication delivery, while the staff members might include doctors, nurses, and pharmacists. If the intelligent matching system determines that the task matches the staff member's skills, experience, and schedule, the system automatically assigns the task to the most suitable staff member. This process improves healthcare service efficiency and patient satisfaction.
[0093] In specific FinTech scenarios, tasks to be assigned might include loan approvals, risk assessments, and bill processing, while the staff members to be assigned might be credit managers, risk analysts, or customer service representatives. By matching staff members' expertise, experience, and task requirements, the intelligent matching system can pair suitable staff members with relevant tasks, thereby improving workflow efficiency.
[0094] In an embodiment of the present invention, the step of assigning the to-be-assigned work task to a corresponding matching to-be-assigned worker to obtain a target work assignment result includes:
[0095] Obtaining a preset node area of the segment tree where the staff member to be assigned corresponding to the minimum assigned number is located;
[0096] Returning the preset node area to a query interval for obtaining the segment tree, and comparing the allocatable value with the minimum allocated number of the query interval to obtain a comparison result;
[0097] When the query finds the staff member to be assigned corresponding to the minimum assigned number, stop returning;
[0098] Updating the node information of the segment tree to obtain an updated tree;
[0099] The to-be-assigned workers corresponding to the minimum assigned number are used as the target assignment result of the updated tree.
[0100] Specifically, within the specified query interval, find the to-be-assigned workers who can assign K unassigned work tasks, for example, to-be-assigned workers for inactive policies, and who have the minimum allocated quantity. Compare the allocatable value with the minimum allocated quantity in the query interval. Then, you only need to find the to-be-assigned workers whose minimum allocated quantity minFree in the query interval [1, i] is less than or equal to the allocatable value.
[0101] The node regions of the segment tree are divided according to the interval structure of task assignments, enabling efficient mapping and querying of the load of each worker waiting to be assigned. By obtaining the node region corresponding to the minimum number of assigned workers, it is possible to accurately identify those workers who are not overloaded and, based on this, rationally allocate tasks to ensure balanced resource utilization and smooth task completion.
[0102] By performing a binary search strategy on the preset node area, the minimum index of the to-be-assigned worker that meets the conditions is found. If the minimum number of assigned workers in the left interval of the node in the preset node area is less than or equal to the allocable value, it means that there are to-be-assigned workers in the left interval of the node in the preset node area who can still be assigned K tasks. Then continue searching in the left interval. Otherwise, search the right interval of the node in the preset node area until a to-be-assigned worker that meets the conditions is found.
[0103] In an embodiment of the present invention, updating the node information of the segment tree to obtain an updated tree includes:
[0104] Obtain a target interval of workers to be assigned corresponding to the minimum assigned number;
[0105] Obtaining a storage array of the segment tree, and generating a target array of the target interval according to the storage array;
[0106] Update the node information of the target array according to the number of tasks to be assigned to obtain an updated array;
[0107] The segment tree is updated from bottom to top using the update array to obtain an updated tree.
[0108] In detail, find the target interval of the to-be-assigned workers corresponding to the minimum allocated number, obtain the target array of the target interval, increase the value of the target array by the number of tasks to be assigned K, indicating that K to-be-assigned work tasks have been assigned, and at the same time update the minimum allocated number minFree in the current interval of the interval node in the segment tree from bottom to top, and the total allocated number totalFree completed by all workers in the current interval.
[0109] First, obtain the target interval for the minimum assigned number of workers to be assigned. This target interval refers to the set of workers that meet the minimum assigned number criteria within the specified query interval. Then, obtain the segment tree's storage array, which contains the current task assignment status and related statistics for all nodes. Based on this storage array, generate the target array for the target interval. The target array extracts and represents the detailed task assignment status for the workers within the target interval.
[0110] Based on the number of pending tasks, the node information in the target array is updated. This indicates that the number of pending tasks modifies the task allocation status of the worker represented by each node in the target array, reflecting changes in the number of tasks, such as an increase in the number of assigned tasks. The bottom-up update method starts at the leaf nodes of the segment tree and gradually passes the updated information to the parent nodes, updating the relevant statistics of each node, such as the minimum allocated quantity minFree and the total allocated quantity totalFree. After this update, the structure and data of the entire segment tree will reflect the latest task allocation status, resulting in a new, updated tree structure.
[0111] First, the worker with the minimum assigned number is located and relevant information is obtained by querying the segment tree to ensure that the task assignment matches the worker's load. Once a suitable worker is found, the query is immediately stopped and the node status of the segment tree is updated, ultimately resulting in an updated task assignment result. This not only improves the accuracy of the assignment, but also effectively avoids duplicate task assignments and waste of resources, thereby improving overall work efficiency.
[0112] If the matching result is that the work task to be assigned and the staff to be assigned fail to match, then S6 , screening is performed on each staff to be assigned to obtain the assignable staff.
[0113] In an embodiment of the present invention, each staff member to be assigned is sorted according to priority. When screening each staff member to be assigned for work, it is only necessary to confirm which staff members to be assigned have sufficient capabilities to complete the work tasks to be assigned, and list the qualified staff members to be assigned as staff members who can be assigned.
[0114] In the healthcare scenario, by analyzing the number of assigned tasks for each staff member to be assigned, the system can filter out those staff members with fewer tasks. These staff members may have more free time or available resources and are therefore more likely to take on new tasks.
[0115] In specific fintech scenarios, if the initial personnel matching fails, it may be because there are no suitable staff with relevant skills or the current workload is too heavy. By screening idle staff, the system can ensure that more resources are reasonably utilized and prevent too many tasks from piling up on certain employees.
[0116] In the embodiment of the present invention, screening each of the to-be-assigned staff members for available work to obtain available staff members includes:
[0117] Obtaining the number of queries for staff to be assigned within the query interval;
[0118] Generate a dispatchable work screening value according to the query quantity, the maximum task quantity and the number of tasks to be assigned;
[0119] Obtain the total number of all staff members to be assigned within the query interval;
[0120] Determining whether the total allocated quantity is less than or equal to the available work screening value;
[0121] If the total allocated quantity is greater than the available work screening value, a screening failure message is sent to a preset user terminal;
[0122] If the total number of assigned tasks is less than or equal to the assignable task screening value, then the number of assigned tasks of each to-be-assigned worker is compared with the maximum number of tasks one by one, and the first to-be-assigned worker whose number of assigned tasks is less than the maximum number of tasks within the query interval is screened out;
[0123] The query interval is screened according to the first screened staff member to be assigned to obtain the assignable staff members.
[0124] Specifically, the number of queries for workers to be assigned within the query interval is obtained, and the dispatchable worker filter value is generated based on the number of queries, the maximum number of tasks, and the number of tasks to be assigned. The calculation formula is as follows:
[0125] Dispatching screening value = i*MK
[0126] Among them, i represents the number of personnel to be assigned, M represents the maximum number of tasks for each staff member to be assigned, and K represents the number of tasks to be assigned.
[0127] In the query interval [1, i], to determine whether K pending work tasks can be assigned, you only need to find the available workers whose total allocation quantity totalFree in the query interval [1, i] is less than or equal to the available work filter value. If the number of available work tasks of the first i pending workers is less than K, the message False indicating that the screening failed is returned.
[0128] Since the workers to be assigned are sorted by priority, the number of tasks assigned to the previous workers to be assigned may have reached the maximum. If we start judging from the first worker to be assigned, it will be a redundant operation. Therefore, we first need to find the first worker to be assigned in the query interval [1,i] whose number of assigned tasks is less than the maximum number of tasks M, and find the target worker whose minimum assigned number minFree is less than or equal to M-1.
[0129] When the total assigned quantity is less than or equal to the available task filter value, the system checks the assigned task count of each worker to be assigned and compares it with the worker's maximum task count. This comparison identifies the first worker whose assigned task count is less than the maximum task count. This worker has remaining task capacity and is suitable for accepting new tasks. The first selected worker is then selected as the target worker. Based on this selected target worker, the query range is further filtered to determine all eligible available workers.
[0130] By calculating the number of worker queries, the maximum number of tasks, and the number of pending tasks within the query interval, we generate a dispatchable filter value, providing a reasonable standard for task allocation. Comparing the total number of assigned tasks with the dispatchable filter value allows real-time assessment of the rationality of task allocation, preventing staff overload. If the task load is too heavy, the system will send a screening failure notification in advance to prevent incorrect assignments. At the same time, by comparing each worker's assigned task count against their maximum task count, we can identify suitable target personnel, ensure balanced task distribution, and improve task allocation efficiency.
[0131] S7: Allocate the work task to be assigned to the assignable personnel to obtain a target assignment result.
[0132] In this embodiment of the present invention, starting with the target employee, the work assignment information for the pending employees is updated. Each assignment is performed by updating the maximum idle workload and the total number of assignments within the query interval. For the currently pending employee, if the number of tasks already assigned to them is less than the maximum number of available tasks, the assignment process continues, assigning the pending tasks to the available employees until the number of pending tasks reaches zero and all tasks have been successfully assigned, resulting in the target assignment result.
[0133] In healthcare scenarios, the segment tree can be used to identify doctors, nurses, and other medical staff with free time and assign tasks to them. This improves the efficiency and safety of patient visits, reduces waste of medical resources, ensures medical quality, and optimizes the overall operational efficiency of the hospital.
[0134] In specific financial technology scenarios, segment trees are used to screen out staff with free time to meet customer needs, assign tasks to the most suitable financial staff, and automatically optimize task priorities to improve the efficiency of loan approval, reduce human errors, optimize customer experience, reduce waiting time, and improve the quality of customer service.
[0135] In the embodiment of the present invention, allocating the to-be-assigned work task to the available personnel to obtain a target assignment result includes:
[0136] Obtain the number of assigned tasks and the maximum number of tasks for each of the assignable workers;
[0137] Subtract the maximum number of tasks from the number of assigned tasks to obtain the remaining number of tasks that can be assigned to each of the assignable workers;
[0138] Compare the remaining number of dispatchable workers with the number of tasks to be assigned, and select the minimum value between the remaining number of dispatchable workers and the number of tasks to be assigned to obtain the target number of assigned workers;
[0139] The target allocation quantity is allocated to the assignable personnel, and when the target allocation quantity is equal to the number of tasks to be assigned, a target assignment result is obtained.
[0140] Specifically, the remaining number of tasks available for each dispatchable worker is obtained by subtracting the maximum number of tasks from the number of assigned tasks. The calculation formula is as follows:
[0141] Remaining number of workers available for dispatch = M′-num
[0142] Where M′ represents the maximum number of tasks for each dispatchable worker, and num represents the number of assigned tasks for each dispatchable worker.
[0143] Compare the remaining available number of tasks with the number of tasks to be assigned, and select the smaller value. This minimum value is defined as the target allocation quantity. The target allocation quantity represents the number of tasks that can be assigned to the available workers, ensuring that it does not exceed the worker's remaining task capacity and the total number of tasks to be assigned. The target allocation quantity is then allocated to the available workers. If the target allocation quantity is exactly equal to the number of tasks to be assigned, it means that all tasks have been successfully assigned, achieving the desired dispatch result.
[0144] By calculating each assignable worker's remaining available work and combining it with the total number of tasks to be assigned, the system automatically determines the number of tasks each assignable worker should undertake, preventing overload. By comparing the remaining available work with the minimum number of tasks to be assigned, the system ensures a balanced and efficient distribution of tasks among personnel, preventing backlogs or overburdening certain personnel. This improves task allocation efficiency, reduces its difficulty, and ensures balanced and efficient task allocation.
[0145] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0146] like Figure 4, which is a functional module diagram of a work dispatch optimization device based on segment tree and bisection method provided by one embodiment of the present invention.
[0147] In the embodiment of the present disclosure, a device for optimizing work dispatch based on segment tree and bisection is provided. The device for optimizing work dispatch based on segment tree and bisection corresponds to the method for optimizing work dispatch based on segment tree and bisection in the above embodiment. Figure 4 As shown, the work dispatch optimization device 100 based on the segment tree and the bisection method can be installed in an electronic device. According to the functions to be implemented, the work dispatch optimization device 100 based on the segment tree and the bisection method includes a worker sorting module 101, a segment tree construction module 102, a task matching module 103, a first matching result module 104, a second matching result module 105, and a work task assignment module 106. The functional modules are described in detail as follows:
[0148] A staff ranking module 101 is used to obtain historical work behaviors of initial staff members, prioritize the initial staff members according to the historical work behaviors, and obtain staff members to be assigned;
[0149] A segment tree construction module 102 is configured to obtain the number of assigned tasks for each worker to be assigned, and to construct a segment tree according to the worker to be assigned and the number of assigned tasks;
[0150] The task matching module 103 is used to obtain the work tasks to be assigned, and perform a binary search and matching between the work tasks to be assigned and the staff members to be assigned according to the segment tree to obtain a matching result;
[0151] A first matching result module 104 is configured to assign the work task to the corresponding matching worker to be assigned if the matching result indicates that the work task to be assigned and the worker to be assigned are successfully matched, thereby obtaining a target work assignment result;
[0152] The second matching result module 105 is configured to, if the matching result indicates that the work task to be assigned and the staff member to be assigned fail to match, screen each staff member to be assigned to obtain the staff members who can be assigned;
[0153] The work task assignment module 106 is used to assign the to-be-assigned work tasks to the assignable personnel to obtain a target work assignment result.
[0154] In one embodiment, when the staff ranking module 101 prioritizes the initial staff according to the historical work behavior to obtain the staff to be assigned, it is configured to:
[0155] Normalizing the historical work behavior to obtain behavior indicator data;
[0156] Performing weighted summation on the behavioral indicator data of each initial staff member to obtain a historical work score;
[0157] generating a priority of the initial worker based on the historical work score;
[0158] The initial staff members are sorted in descending order of priority to obtain staff members to be assigned.
[0159] In one embodiment, when the segment tree construction module 102 obtains the number of assigned tasks of each worker to be assigned and constructs a segment tree according to the worker to be assigned and the number of assigned tasks, it is configured to:
[0160] Sort the number of assigned tasks of each worker to be assigned in ascending order to obtain the minimum assigned number;
[0161] Adding up the number of assigned tasks of all the staff members to be assigned to obtain a total assigned number;
[0162] generating node information according to the minimum allocated quantity and the total allocated quantity;
[0163] The target query quantity of the staff to be assigned is obtained, and a segment tree is generated according to the target query quantity and the node information.
[0164] In one embodiment, when the task-to-be-assigned matching module 103 performs a binary search and matching on the task-to-be-assigned and the worker-to-be-assigned according to the segment tree to obtain a matching result, it is configured to:
[0165] Obtaining the maximum number of tasks for each of the to-be-assigned workers and the number of tasks to be assigned for the to-be-assigned work tasks;
[0166] Generate an allocatable value according to the maximum number of tasks and the number of tasks to be assigned;
[0167] Obtaining a query interval of the segment tree, comparing the allocatable value with a minimum allocated quantity of the query interval, and obtaining a comparison result;
[0168] If the comparison result is that the minimum allocated quantity of the query interval is greater than the allocable value, the matching result between the to-be-allocated work task and the to-be-allocated staff member is a matching failure;
[0169] If the comparison result is that the minimum allocated quantity of the query interval is less than or equal to the allocatable value, the matching result of the to-be-allocated work task and the to-be-allocated staff member is a successful match.
[0170] In one embodiment, when the first matching result module 104 assigns the to-be-assigned work task to the corresponding matched to-be-assigned worker and obtains the target work assignment result, it is configured to:
[0171] Obtaining a preset node area of the segment tree where the staff member to be assigned corresponding to the minimum assigned number is located;
[0172] Returning the preset node area to a query interval for obtaining the segment tree, and comparing the allocatable value with the minimum allocated number of the query interval to obtain a comparison result;
[0173] When the query finds the staff member to be assigned corresponding to the minimum assigned number, stop returning;
[0174] Updating the node information of the segment tree to obtain an updated tree;
[0175] The to-be-assigned workers corresponding to the minimum assigned number are used as the target assignment result of the updated tree.
[0176] In one embodiment, when the second matching result module 105 performs the screening of available workers for each of the to-be-assigned workers to obtain available workers, it is configured to:
[0177] Obtaining the number of queries for staff to be assigned within the query interval;
[0178] Generate a dispatchable work screening value according to the query quantity, the maximum task quantity and the number of tasks to be assigned;
[0179] Obtain the total number of all staff members to be assigned within the query interval;
[0180] Determining whether the total allocated quantity is less than or equal to the available work screening value;
[0181] If the total allocated quantity is greater than the available work screening value, a screening failure message is sent to a preset user terminal;
[0182] If the total number of assigned tasks is less than or equal to the assignable task screening value, then the number of assigned tasks of each to-be-assigned worker is compared with the maximum number of tasks one by one, and the first to-be-assigned worker whose number of assigned tasks is less than the maximum number of tasks within the query interval is screened out;
[0183] The query interval is screened according to the first screened staff member to be assigned to obtain the assignable staff members.
[0184] In one embodiment, when the work task assignment module 106 assigns the to-be-assigned work task to the assignable personnel and obtains a target assignment result, it is configured to:
[0185] Obtain the number of assigned tasks and the maximum number of tasks for each of the assignable workers;
[0186] Subtract the maximum number of tasks from the number of assigned tasks to obtain the remaining number of tasks that can be assigned to each of the assignable workers;
[0187] Compare the remaining number of dispatchable workers with the number of tasks to be assigned, and select the minimum value between the remaining number of dispatchable workers and the number of tasks to be assigned to obtain the target number of assigned workers;
[0188] The target allocation quantity is allocated to the assignable personnel, and when the target allocation quantity is equal to the number of tasks to be assigned, a target assignment result is obtained.
[0189] In the present invention, a work dispatch optimization device based on segment tree and binary search method is provided. First, the present invention obtains the historical work behavior of the initial staff, prioritizes the initial staff according to the historical work behavior, obtains the staff to be assigned, obtains the number of assigned tasks for each of the staff to be assigned, and constructs a segment tree according to the staff to be assigned and the number of assigned tasks. By constructing the segment tree and combining the minimum assigned number, the total assigned number and the target query number, the efficiency of task assignment can be significantly improved. The work tasks to be assigned are obtained, and a binary search matching is performed on the work tasks to be assigned and the staff to be assigned according to the segment tree to obtain a matching result. If the matching result is that the work task to be assigned and the staff to be assigned are successfully matched, the work task to be assigned is assigned to the corresponding matched staff to be assigned, and the target work assignment result is obtained. The task assignment and the staff status are efficiently managed through the segment tree, so that when facing large-scale task assignment, it can be quickly queried and updated, reducing the computational complexity. If the matching result is that the work task to be assigned and the staff to be assigned fail to match, each staff to be assigned is screened for possible assignments to obtain assignable staff, and the work task to be assigned is assigned to the assignable staff to obtain the target work assignment result, which can effectively improve the efficiency of work task assignment. For the specific definition of a work assignment optimization device based on segment tree and bisection method, please refer to the definition of a work assignment optimization method based on segment tree and bisection method above, which will not be repeated here. Each module in the above-mentioned work assignment optimization device based on segment tree and bisection method can be fully or partially implemented by software, hardware and a combination thereof. The above modules may be embedded in or independent of the processor in the computer device in the form of hardware, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0190] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of a work dispatch optimization method based on a segment tree and a bisection method.
[0191] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the client-side functions or steps of a work dispatch optimization method based on a segment tree and a bisection method.
[0192] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0193] Obtaining historical work behaviors of initial staff members, prioritizing the initial staff members according to the historical work behaviors, and obtaining staff members to be assigned;
[0194] Obtaining the number of assigned tasks for each of the to-be-assigned workers, and constructing a segment tree according to the to-be-assigned workers and the number of assigned tasks;
[0195] Obtaining the work tasks to be assigned, and performing a binary search and matching on the work tasks to be assigned and the staff members to be assigned according to the segment tree to obtain a matching result;
[0196] If the matching result is that the work task to be assigned and the staff member to be assigned are successfully matched, the work task to be assigned is assigned to the corresponding matched staff member to be assigned, and a target work assignment result is obtained;
[0197] If the matching result is that the work task to be assigned and the staff member to be assigned fail to match, screening the staff members to be assigned to obtain the staff members who can be assigned;
[0198] Allocate the work tasks to be assigned to the assignable personnel to obtain the target assignment result.
[0199] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and apparatuses can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the module division is merely a logical function division, and actual implementation may employ other division methods.
[0200] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.
[0201] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.
[0202] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0203] In some implementations of this embodiment, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the method described in the above embodiment are implemented.
[0204] The readable storage medium of the present invention stores a computer program, which, when executed by a processor of an electronic device, can implement:
[0205] Obtaining historical work behaviors of initial staff members, prioritizing the initial staff members according to the historical work behaviors, and obtaining staff members to be assigned;
[0206] Obtaining the number of assigned tasks for each of the to-be-assigned workers, and constructing a segment tree according to the to-be-assigned workers and the number of assigned tasks;
[0207] Obtaining the work tasks to be assigned, and performing a binary search and matching on the work tasks to be assigned and the staff members to be assigned according to the segment tree to obtain a matching result;
[0208] If the matching result is that the work task to be assigned and the staff member to be assigned are successfully matched, the work task to be assigned is assigned to the corresponding matched staff member to be assigned, and a target work assignment result is obtained;
[0209] If the matching result is that the work task to be assigned and the staff member to be assigned fail to match, screening the staff members to be assigned to obtain the staff members who can be assigned;
[0210] Allocate the work tasks to be assigned to the assignable personnel to obtain the target assignment result.
[0211] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can be found in the relevant descriptions of the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0212] The computer-readable storage medium may also store at least one computer-executable program / instruction, such as a computer-readable instruction. Computer-readable storage media include, but are not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Computer-readable storage media may include, for example, read-only memory (ROM), a hard disk, a flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above may be performed.
[0213] In addition, the computer device may also include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (eg, keyboard, mouse, speaker, etc.).
[0214] The processor can communicate with external devices via an I / O bus via a wired or wireless network.
[0215] In one embodiment, the at least one computer executable instruction may also be compiled into or constitute a software product / computer program product, wherein one or more computer executable instructions are executed by a processor to perform the various functions and / or method steps in the embodiments described in the present technology.
[0216] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0217] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0218] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a portion of code, and the above-mentioned module, program segment or a portion of code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0219] It should be noted that, in this disclosure, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element limited by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0220] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
[0221] It should be noted that if software tools or components other than those of our company appear in the embodiments of this application, they are only used for illustration and do not represent actual use.
Claims
1. A method for optimizing work assignment based on segment tree and bisection method, characterized in that: The method comprises: Obtaining historical work behaviors of initial staff members, prioritizing the initial staff members according to the historical work behaviors, and obtaining staff members to be assigned; Obtaining the number of assigned tasks for each of the to-be-assigned workers, and constructing a segment tree according to the to-be-assigned workers and the number of assigned tasks; Obtaining the work tasks to be assigned, and performing a binary search and matching on the work tasks to be assigned and the staff members to be assigned according to the segment tree to obtain a matching result; If the matching result is that the work task to be assigned and the staff member to be assigned are successfully matched, the work task to be assigned is assigned to the corresponding matched staff member to be assigned, and a target work assignment result is obtained; If the matching result is that the work task to be assigned and the staff member to be assigned fail to match, screening the staff members to be assigned to obtain the staff members who can be assigned; Allocate the work tasks to be assigned to the assignable personnel to obtain the target assignment result.
2. The method for optimizing work dispatch based on segment tree and bisection method according to claim 1, characterized in that: Prioritizing the initial staff members according to the historical work behaviors to obtain staff members to be assigned includes: Normalizing the historical work behavior to obtain behavior indicator data; Performing weighted summation on the behavioral indicator data of each initial staff member to obtain a historical work score; generating a priority of the initial worker based on the historical work score; The initial staff members are sorted in descending order of priority to obtain staff members to be assigned.
3. The method for optimizing work dispatch based on segment tree and bisection method according to claim 1, characterized in that: The obtaining of the number of assigned tasks of each worker to be assigned, and constructing a segment tree according to the worker to be assigned and the number of assigned tasks, includes: Sort the number of assigned tasks of each worker to be assigned in ascending order to obtain the minimum assigned number; Adding up the number of assigned tasks of all the staff members to be assigned to obtain a total assigned number; generating node information according to the minimum allocated quantity and the total allocated quantity; The target query quantity of the staff to be assigned is obtained, and a segment tree is generated according to the target query quantity and the node information.
4. The method for optimizing work dispatch based on segment tree and bisection method according to claim 3, characterized in that: The performing binary search and matching on the to-be-assigned work tasks and the to-be-assigned staff members according to the segment tree to obtain a matching result includes: Obtaining the maximum number of tasks for each of the to-be-assigned workers and the number of tasks to be assigned for the to-be-assigned work tasks; Generate an allocatable value according to the maximum number of tasks and the number of tasks to be assigned; Obtaining a query interval of the segment tree, comparing the allocatable value with a minimum allocated quantity of the query interval, and obtaining a comparison result; If the comparison result is that the minimum allocated quantity of the query interval is greater than the allocable value, the matching result between the to-be-allocated work task and the to-be-allocated staff member is a matching failure; If the comparison result is that the minimum allocated quantity of the query interval is less than or equal to the allocatable value, the matching result of the to-be-allocated work task and the to-be-allocated staff member is a successful match.
5. The method for optimizing work dispatch based on segment tree and bisection method according to claim 4, characterized in that: The step of assigning the to-be-assigned work tasks to the corresponding matching to-be-assigned staff members to obtain a target work assignment result includes: Obtaining a preset node area of the segment tree where the staff member to be assigned corresponding to the minimum assigned number is located; Returning the preset node area to a query interval for obtaining the segment tree, and comparing the allocatable value with the minimum allocated number of the query interval to obtain a comparison result; When the query finds the staff member to be assigned corresponding to the minimum assigned number, stop returning; Updating the node information of the segment tree to obtain an updated tree; The to-be-assigned workers corresponding to the minimum assigned number are used as the target assignment result of the updated tree.
6. The method for optimizing work dispatch based on segment tree and bisection method according to claim 4, characterized in that: The screening of each of the to-be-assigned staff members to obtain the assignable staff members includes: Obtaining the number of queries for staff to be assigned within the query interval; Generate a dispatchable work screening value according to the query quantity, the maximum task quantity and the number of tasks to be assigned; Obtain the total number of all staff members to be assigned within the query interval; Determining whether the total allocated quantity is less than or equal to the available work screening value; If the total allocated quantity is greater than the available work screening value, a screening failure message is sent to a preset user terminal; If the total number of assigned tasks is less than or equal to the assignable task screening value, then the number of assigned tasks of each to-be-assigned worker is compared with the maximum number of tasks one by one, and the first to-be-assigned worker whose number of assigned tasks is less than the maximum number of tasks within the query interval is screened out; The query interval is screened according to the first screened staff member to be assigned to obtain the assignable staff members.
7. The method for optimizing work dispatch based on segment tree and bisection method according to claim 1, characterized in that: The step of allocating the to-be-allocated work tasks to the available personnel to obtain a target work assignment result includes: Obtain the number of assigned tasks and the maximum number of tasks for each of the assignable workers; Subtract the maximum number of tasks from the number of assigned tasks to obtain the remaining number of tasks that can be assigned to each of the assignable workers; Compare the remaining number of dispatchable workers with the number of tasks to be assigned, and select the minimum value between the remaining number of dispatchable workers and the number of tasks to be assigned to obtain the target number of assigned workers; The target allocation quantity is allocated to the assignable personnel, and when the target allocation quantity is equal to the number of tasks to be assigned, a target assignment result is obtained.
8. A work dispatch optimization device based on segment tree and bisection method, characterized in that: The device comprises: A staff ranking module is used to obtain the historical work behavior of the initial staff members, prioritize the initial staff members according to the historical work behavior, and obtain the staff members to be assigned; A segment tree construction module is used to obtain the number of assigned tasks of each worker to be assigned, and to construct a segment tree according to the worker to be assigned and the number of assigned tasks; A task matching module to be assigned is used to obtain the work tasks to be assigned, and perform a binary search and matching between the work tasks to be assigned and the staff to be assigned according to the segment tree to obtain a matching result; A first matching result module is configured to assign the work task to the corresponding matching staff member to be assigned if the matching result shows that the work task to be assigned and the staff member to be assigned are successfully matched, thereby obtaining a target work assignment result; a second matching result module configured to, if the matching result indicates that the work task to be assigned and the staff member to be assigned fail to match, screen each staff member to be assigned to obtain the staff members who can be assigned; The work task assignment module is used to assign the work tasks to be assigned to the assignable personnel to obtain target assignment results.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the work dispatch optimization method based on segment tree and bisection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for optimizing work dispatching based on a segment tree and a bisection method as claimed in any one of claims 1 to 7 is implemented.