Personnel scheduling planning method, device and computer storage medium
By combining saving algorithms, genetic algorithms and particle swarm algorithms, the personnel scheduling route is optimized, and the problems of low scheduling efficiency and high service costs in the existing technology are solved, achieving lower errors and more efficient scheduling effects.
Patent Information
- Application Number
- CN202011001867.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2040-09-22
AI Technical Summary
In the personnel scheduling, the existing technology has low efficiency due to the large amount of information processing and the randomness of path planning. Traditional methods are difficult to meet the needs of business growth and the service cost increases.
Combining the saving algorithm, genetic algorithm and particle swarm algorithm, by obtaining the shortest path, initial line optimization, iterative processing and allocating route planning, the calculation amount and error are reduced and scheduling efficiency is improved.
Through the combination of multiple algorithms, the errors of genetic algorithms and particle swarm algorithms are reduced, the route of personnel scheduling is optimized, the scheduling efficiency is improved, and the total service cost is reduced.
Smart Images

Figure CN112163754B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of route planning, and in particular to a method, a device and a computer storage medium for personnel dispatch planning. Background Art
[0002] With the development of the times, more and more door-to-door services are being provided. At present, due to unreasonable personnel allocation and unreasonable route planning, the total service cost of door-to-door services has increased dramatically. Although the efficiency of personnel scheduling can be improved by adopting NP-hard solutions to slow down the growth rate of total service costs. However, with the increase in business volume, more and more information is processed in NP-hard, and traditional methods, such as artificial experience, linear programming, dynamic programming, etc., gradually fail to meet the needs of the problem. Although the path can be simply optimized by the saving algorithm and then used as the input of the genetic algorithm for planning, the amount of calculation of the genetic algorithm can be reduced. However, the route allocated by the genetic algorithm is random, resulting in the route obtained being not ideal after the number of iterations meets the conditions. At this time, scheduling according to the route will still lead to low efficiency of personnel scheduling. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, in a first aspect, the present invention provides a method for personnel scheduling planning, which can improve the efficiency of personnel scheduling; in a second aspect, the present invention provides a device for personnel scheduling planning; in a third aspect, the present invention provides a computer storage medium.
[0004] In some embodiments of the first aspect of the present invention, the method for personnel scheduling planning comprises the following steps:
[0005] Get the shortest path set between any two destinations in the destination set;
[0006] Processing each path in the shortest path set by a conservation algorithm, and obtaining an initial route according to each processed path;
[0007] Processing the initial route by a genetic algorithm to obtain a second route;
[0008] The second route is processed by a particle swarm algorithm to obtain a distribution route.
[0009] According to the above embodiment of the present invention, at least the following beneficial effects are achieved: by combining the saving algorithm, the amount of calculation for path planning in the genetic algorithm and the particle swarm algorithm can be reduced. However, since both the genetic algorithm and the particle swarm algorithm perform iterative solutions through probability, a single algorithm is used for multi-objective planning, and the final distribution route is random and has large errors. Therefore, by combining the saving algorithm, the genetic algorithm and the particle swarm algorithm to obtain the distribution route of personnel, the error caused by the genetic algorithm and the particle swarm algorithm performing route planning through probability can be reduced, thereby obtaining a distribution route solution with the lowest total service cost, thereby improving the efficiency of personnel scheduling.
[0010] In some embodiments of the first aspect of the present invention, the step of obtaining a set of shortest paths between any two destinations in the set of destinations comprises the following steps:
[0011] Acquire public transportation route data for each destination according to the destination set;
[0012] Acquire a public transportation path and path time between any two destinations in the destination set according to the public transportation route data, wherein the path time is the time required for the public transportation path;
[0013] The path with the shortest path time among all the public transportation paths is set as the shortest path, and the set of all the shortest paths is used as the shortest path set.
[0014] By setting the route travel mode to public transportation, you can obtain a plan for scheduling people using public transportation.
[0015] In some embodiments of the first aspect of the present invention, the obtaining of a set of shortest paths between any two destinations in the set of destinations further includes the following steps:
[0016] The routes operating during peak hours are removed from the public transportation route data.
[0017] By removing the routes that run during peak hours, it is possible to avoid the situation where the total route time for the entire destination set becomes longer due to the selected route only running during peak hours.
[0018] In some embodiments of the first aspect of the present invention, the processing of the initial route by a genetic algorithm to obtain a second route comprises the following steps:
[0019] Initializing the initial circuit to obtain an initial circuit set, and using each circuit in the initial circuit set as a gene individual of the genetic algorithm;
[0020] Iteratively process all the gene individuals by the genetic algorithm, and obtain the first fitness value of each gene individual after each iterative process by the genetic algorithm;
[0021] Matching the first fitness value, the current number of iterations of the genetic algorithm and a preset condition, and stopping the iterative processing of the genetic algorithm according to the matching result;
[0022] A target gene individual having the largest first fitness value among all the gene individuals after the genetic algorithm stops iterative processing is obtained, and the target gene individual is used as the second line.
[0023] By setting preset conditions, the iterative processing of the genetic algorithm can be controlled more flexibly, thereby adapting to path planning in different scenarios.
[0024] In some embodiments of the first aspect of the present invention, the processing of the second line by a particle swarm algorithm to obtain a distribution line comprises the following steps:
[0025] Obtaining personnel information in the set of personnel to be assigned, wherein the personnel information includes the number of personnel;
[0026] Initializing the second route according to the personnel information to obtain a second route set, and using the second route set as a particle swarm of the particle swarm algorithm;
[0027] Matching each particle of the particle group with the person to be assigned one by one;
[0028] The particle swarm is processed by the particle swarm algorithm to obtain a first position of each particle in the particle swarm, and an allocation route of the to-be-allocated personnel is obtained according to the first position.
[0029] Therefore, by assigning each assigned person to each particle of the particle swarm, the particle swarm algorithm can simultaneously perform path planning for all assigned persons, and obtain the total service cost after each iterative processing of the particle swarm, so that the assigned routes corresponding to the personnel on each particle can be obtained when the total service cost is optimal.
[0030] In some embodiments of the first aspect of the present invention, the method for personnel scheduling planning further includes the following steps:
[0031] Processing the particle swarm by the genetic algorithm to obtain an updated particle swarm;
[0032] The updated particle swarm is processed by the particle swarm algorithm to obtain the allocation route of the personnel to be allocated.
[0033] By adding genetic algorithm to particle swarm algorithm, the search range of particles can be expanded, so as to select the optimal allocation route under more path choices.
[0034] In some embodiments of the first aspect of the present invention, the processing of the particle swarm by the genetic algorithm to obtain an updated particle swarm comprises the following steps:
[0035] randomly obtaining a first particle and a second particle from the particle population;
[0036] acquiring a first position of the first particle;
[0037] Performing crossover and mutation processing on a first path segment corresponding to a first position of the first particle and a second path segment randomly selected from the second particle by using the genetic algorithm to obtain an updated first particle and an updated second particle;
[0038] The particle group is updated according to the updated first particle and the updated second particle.
[0039] By crossover and mutation of the first particle and the second particle, the allocation route corresponding to the first position with a lower total service cost can be obtained, thereby improving the efficiency of personnel scheduling.
[0040] In some embodiments of the first aspect of the present invention, the processing of the particle swarm by a genetic algorithm to obtain an updated particle swarm further comprises the following steps:
[0041] Acquire a second position of the particle group;
[0042] Acquire a third particle corresponding to the second position in the particle group, and randomly acquire a fourth particle in the particle group;
[0043] Performing crossover and mutation processing on the third path segment and the fourth path segment through a genetic algorithm to obtain an updated third particle and an updated fourth particle, wherein the third path segment corresponds to the second position of the third particle, and the fourth path segment is a path segment randomly selected from the fourth particle;
[0044] The particle group is updated according to the updated third particle and the updated fourth particle.
[0045] By performing crossover and mutation processing on the third and fourth particles, the search range of the particle swarm algorithm can be expanded to avoid the situation where the local optimum is not the global optimum; thus, in the next particle swarm algorithm, the total service cost of the particle swarm is the lowest, thereby improving the efficiency of personnel scheduling.
[0046] According to some embodiments of the second aspect of the present invention, the device for personnel scheduling planning includes:
[0047] An input module, the input module is used to obtain a set of destinations to be assigned and personnel to be assigned; a map module, the map module is used to obtain a shortest path set based on the destination set; a first processing module, the first processing module performs a conservation algorithm processing based on the shortest path set to obtain an initial route; a second processing module, the second processing module is used to perform a genetic algorithm processing on the initial route to obtain a second route; a third processing module, the third processing module is used to process the second route through a particle swarm algorithm to obtain an allocation route for the personnel to be assigned.
[0048] Since the device for personnel scheduling planning in the embodiment of the present invention executes the method for personnel scheduling planning as described in any one of the first aspect of the present invention, it has all the beneficial effects of the first aspect of the present invention.
[0049] According to some embodiments of the third aspect of the present invention, the computer storage medium stores computer executable instructions, and the computer executable instructions are used to enable a computer to execute the personnel scheduling planning method as described in any one of the first aspects.
[0050] Since the computer storage medium of the embodiment of the present invention executes the method for personnel scheduling planning as described in any one of the first aspect of the present invention, it has all the beneficial effects of the first aspect of the present invention.
[0051] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0053] Figure 1 A step diagram of a method for personnel scheduling planning according to an embodiment of the present invention;
[0054] Figure 2 A diagram showing the steps of obtaining a shortest path set in a method for personnel scheduling planning according to an embodiment of the present invention;
[0055] Figure 3 A particle swarm algorithm step diagram of the method for personnel scheduling planning according to an embodiment of the present invention;
[0056] Figure 4 A structural diagram of a device for personnel scheduling and planning according to an embodiment of the present invention.
[0057] Reference numerals:
[0058] Input module 410 , map module 420 , first processing module 430 , second processing module 440 , and third processing module 450 . DETAILED DESCRIPTION
[0059] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0060] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0061] Reference below Figures 1 to 4 A method, device and computer storage medium for personnel scheduling planning according to an embodiment of the present invention are described.
[0062] like Figure 1 As shown, the method for personnel scheduling planning includes the following steps:
[0063] Step S100: Obtain a set of shortest paths between any two destinations in the destination set.
[0064] It should be understood that the shortest path set represents the lowest service cost between each two destinations. In some embodiments, the service cost is the time cost, i.e., the time required to travel from one destination to another. In other embodiments, the service cost is the distance cost, i.e., the distance from one destination to another.
[0065] Step S200: Process each path in the shortest path set by using a conservation algorithm, and obtain an initial route according to each processed path.
[0066] It should be understood that the saving algorithm can merge two loops in the path, so as to minimize the total service cost after the merger. It should be understood that since the shortest path between any two destinations is obtained in S100, loops may be formed. In actual application, each destination only needs to be served once, so minimizing the visits to the destination can obtain a path with a better service cost.
[0067] It should be understood that after processing each path in the shortest path set by the saving algorithm, multiple paths will be obtained. Assume that each path obtained by the saving algorithm is S1, S2, and S3, where S1, S2, and S3 are respectively represented as follows: S1 = (a, b, c); S2 = (d, e, g); S3 = (a, k, u); then the initial line S = (0, a, b, c, 0, d, e, g, 0, a, k, u); where 0 represents the beginning of another path. It should be noted that since the saving algorithm is an existing algorithm, the steps for obtaining S1, S2, and S3 are not described in detail here.
[0068] Step S300: Process the initial line by using a genetic algorithm to obtain a second line.
[0069] It should be understood that the genetic algorithm continuously optimizes individual genes through probability to obtain the individual genes with the highest value among all individual genes in the genetic algorithm. The initial route is the route that has been preliminarily optimized, reducing some invalid paths. Therefore, the amount of calculation in the iterative process of the genetic algorithm can be reduced, and the efficiency is higher.
[0070] Step S400: Process the second line by using a particle swarm algorithm to obtain an allocation line.
[0071] It should be understood that due to the low local search efficiency of the genetic algorithm, the search efficiency becomes low after the number of iterations reaches a certain level. At this time, due to the influence of the number of iterations, the total service cost of the second route obtained is not optimal; therefore, the particle swarm algorithm is added to further obtain a better allocation route.
[0072] Therefore, by combining the conservation algorithm, the amount of calculation for path planning in the genetic algorithm and particle swarm algorithm can be reduced. However, since both the genetic algorithm and the particle swarm algorithm perform iterative solutions through probability, a single algorithm is used for multi-objective planning, and the final distribution route is random and has large errors. Therefore, by combining the conservation algorithm, the genetic algorithm and the particle swarm algorithm to obtain the distribution route of personnel, the error caused by the probability of route planning by the genetic algorithm and the particle swarm algorithm can be reduced, thereby obtaining the distribution route with the lowest total service cost, thereby improving the efficiency of personnel scheduling.
[0073] In some embodiments of the first aspect of the present invention, Figure 2 As shown, step S100 includes the following steps:
[0074] Step S101: Acquire public transportation route data for each destination according to the destination set.
[0075] It should be understood that the public transportation route data can be obtained from the public transportation operation official website or by entering the address information of the destination in the map. It should be understood that in some embodiments, there are some transportation routes that only operate on weekdays, so the public transportation route data is the actual bus route that the person to be assigned works on that day.
[0076] Step S102: Obtain a public transportation route and several route times between any two destinations according to the public transportation route data, where the route time is the time required for the public transportation route.
[0077] Step S103: setting the path with the shortest path time among all public transportation paths as the shortest path, and taking the set of all shortest paths as the shortest path set.
[0078] By setting the route travel mode to public transportation, you can obtain a plan for scheduling people using public transportation.
[0079] In some embodiments of the first aspect of the present invention, S100, obtaining a set of shortest paths between any two destinations in a set of destinations, further includes the following steps:
[0080] Remove peak-hour routes from public transportation route data.
[0081] By removing the routes that run during peak hours, it is possible to avoid the situation where the total route time for the entire destination set becomes longer due to the selected route only running during peak hours.
[0082] In some embodiments of the first aspect of the present invention, step S300 includes the following steps:
[0083] The initial circuit is initialized to obtain an initial circuit set, and each circuit in the initial circuit set is used as a gene individual of the genetic algorithm.
[0084] All gene individuals are iteratively processed by the genetic algorithm to obtain the first fitness value of each gene individual after each iterative processing of the genetic algorithm.
[0085] It should be understood that the first fitness value corresponds to the total service cost. In some embodiments, a first value judgment parameter is also provided, and the first value judgment parameter is set to congestion cost and distance; it is used to weigh the loss of more time caused by traffic jams when traveling at different time periods, so as to obtain a total service cost that is more in line with the actual situation. In other embodiments, the first value judgment parameter is distance. In this case, the service cost is obtained according to the first value judgment parameter. In other embodiments, the service cost is set to the sum of the time spent on each path on the gene individual.
[0086] The first fitness value, the current number of iterations of the genetic algorithm and the preset conditions are matched, and the iterative processing of the genetic algorithm is stopped according to the matching result.
[0087] It should be understood that the preset condition is used to stop the iterative processing of the genetic algorithm. The preset condition can be set manually, and the preset condition includes the number of iterations and the expected total service cost.
[0088] Obtain a target gene individual with the largest first fitness value among all gene individuals after the genetic algorithm stops iterative processing, and use the target gene individual as the second line.
[0089] It should be understood that there are cases where the genetic algorithm stops iteration due to meeting the number of iterations, and therefore the optimal gene individual is not found. Therefore, it is necessary to obtain the first fitness of all gene individuals and select the maximum value as the second line. When the genetic algorithm stops iteration due to reaching the expected total service cost, the first fitness value of the target gene individual is the largest and the total service cost is the lowest.
[0090] By setting preset conditions, the iterative processing of the genetic algorithm can be controlled more flexibly, thereby adapting to path planning in different scenarios.
[0091] In some embodiments of the first aspect of the present invention, Figure 3 As shown, step S400 includes the following steps:
[0092] Step S410: Obtain personnel information in the set of personnel to be assigned, where the personnel information includes the number of personnel.
[0093] It should be understood that, when the staff is determined, it is necessary to make full use of the staff so as to achieve the optimal total service cost.
[0094] Step S420: Initialize the second route according to the personnel information to obtain a second route set, and use the second route set as a particle swarm of the particle swarm algorithm.
[0095] It should be understood that the initialization process includes duplicating the second line to obtain a plurality of second lines equal to the number of personnel.
[0096] Step S430: correspond each particle of the particle group to the personnel to be assigned one by one.
[0097] Step S440: Process the particle swarm by using a particle swarm algorithm to obtain a first position of each particle in the particle swarm and a second position of the particle swarm, and obtain an allocation route of the to-be-allocated personnel according to the first position.
[0098] It should be understood that the first position and the second position correspond to the position pbest in the particle swarm algorithm and the global position gbest respectively. The second fitness value in the particle swarm algorithm is the total service cost of the allocated route.
[0099] It should be understood that, since each path has directionality, the path information that a person to be assigned will take can be obtained by taking the first position as the starting point. It should be noted that the judgment of the second fitness value in the particle swarm algorithm is based on the total service cost of all particles. When the second fitness value of the entire particle swarm is the historical optimal, the current first position of each particle is updated. The first position of the fifth particle when the service cost of all particles in the particle swarm is the lowest is obtained, and the current second position is updated to the first position of the fifth particle.
[0100] It should be understood that in some embodiments, the personnel information also includes the allocation area information and the cost value. In actual application, a city will be divided into districts, and a certain number of personnel will be fixedly allocated in each district to respond to business more efficiently. When personnel from different districts are processed across districts, there is a time cost, so the cost value and the allocation area information are added to calculate the total service cost so that the obtained allocation route is more optimal.
[0101] Therefore, by assigning each assigned person to each particle of the particle swarm, and using the particle swarm algorithm to simultaneously plan the paths of all assigned persons, and obtaining the total service cost after each iterative processing of the particle swarm, the assigned routes corresponding to the persons on each particle can be obtained when the total service cost is relatively optimal.
[0102] In some embodiments of the first aspect of the present invention, Figure 2 As shown, the method for personnel scheduling planning also includes the following steps:
[0103] Step S450: Process the particle swarm through a genetic algorithm to obtain an updated particle swarm.
[0104] It should be understood that since the influence of personnel attributes on the total service cost is not included in the second route, there is a situation where the total service cost is not optimal. Therefore, after adding the genetic algorithm, the paths in the second route are recombined to obtain a better total service cost with a certain probability.
[0105] It should be understood that when the total service cost of the particle swarm obtained after the genetic algorithm processing is higher than the total service cost of the original particle swarm, at this time, the particle swarm update operation is not performed.
[0106] Step S460: Process the updated particle swarm through the particle swarm algorithm to obtain the allocation route of the personnel to be allocated.
[0107] It should be understood that the genetic algorithm will update the information of each path in the second route, so it is necessary to continue to process the updated particle swarm through the particle swarm algorithm, and update the first position and second position of each particle in the particle swarm until a distribution route with a lower total service cost than the expected total service cost can be obtained or the number of iterations preset in the particle swarm algorithm is reached. The expected total service cost can be set according to human experience, and the expected total service cost can be set to be consistent with the expected total service cost in the genetic algorithm.
[0108] By adding genetic algorithm to particle swarm algorithm, the search range of particles can be expanded, so that the relatively optimal allocation route can be selected under more path choices.
[0109] In some embodiments of the first aspect of the present invention, step S450, processing the particle swarm by a genetic algorithm to obtain an updated particle swarm, comprises the following steps:
[0110] The first particle and the second particle are randomly obtained from the particle group.
[0111] Get the first position of the first particle.
[0112] A genetic algorithm is used to perform crossover and mutation processing on a first path segment corresponding to a first position of a first particle and a second path segment randomly selected from a second particle to obtain an updated first particle and an updated second particle.
[0113] The particle group is updated according to the updated first particle and the updated second particle.
[0114] By crossover and mutation of the first particle and the second particle, the allocation route corresponding to the first position with a lower total service cost can be obtained, thereby improving the efficiency of personnel scheduling.
[0115] In some embodiments of the first aspect of the present invention, S460, processing the particle swarm by a genetic algorithm to obtain an updated particle swarm further comprises the following steps:
[0116] Get the second position of the particle group.
[0117] The third particle corresponding to the second position in the particle swarm is obtained, and a fourth particle is randomly obtained in the particle swarm.
[0118] The third path segment and the fourth path segment are crossovered and mutated by a genetic algorithm to obtain an updated third particle and an updated fourth particle, wherein the third path segment corresponds to the second position of the third particle, and the fourth path segment is a path segment randomly selected from the fourth particle.
[0119] The particle group is updated according to the updated third particle and the updated fourth particle.
[0120] By performing crossover and mutation processing on the third and fourth particles, the search range of the particle swarm algorithm can be expanded to avoid the situation where the local optimum is not the global optimum; thus, in the next particle swarm algorithm, the total service cost of the particle swarm is the lowest, thereby improving the efficiency of personnel scheduling.
[0121] It should be noted that crossover and mutation are existing execution steps in the genetic algorithm, so they are not described in detail here.
[0122] According to some embodiments of the second aspect of the present invention, Figure 4 As shown, the device for personnel scheduling planning includes:
[0123] An input module 410, the input module 410 is used to obtain a set of destinations to be assigned and personnel to be assigned;
[0124] A map module 420, the map module 420 is used to obtain a shortest path set according to a destination set;
[0125] A first processing module 430, the first processing module 430 performs a conservation algorithm processing according to the shortest path set to obtain an initial route;
[0126] A second processing module 440, the second processing module 440 is used to perform genetic algorithm processing on the initial line to obtain a second line;
[0127] The third processing module 450 is used to process the second route by using a particle swarm algorithm to obtain a distribution route for the personnel to be distributed.
[0128] Since a device for personnel scheduling planning in an embodiment of the present invention executes a method for personnel scheduling planning as described in any one of the first aspects of the present invention, it has all the beneficial effects of the first aspect of the present invention.
[0129] It should be understood that the input module can be a terminal device, a mobile phone, a web page, etc.; the first processing module, the second processing module, and the third processing module can be separate processors, or execution units therein.
[0130] According to some embodiments of the third aspect of the present invention, a computer storage medium stores computer executable instructions, and the computer executable instructions are used to enable a computer to execute the personnel scheduling planning method as described in any one of the first aspects.
[0131] Since the computer storage medium of the embodiment of the present invention executes the method for personnel scheduling planning as any one of the first aspect of the present invention, it has all the beneficial effects of the first aspect of the present invention.
[0132] It should be understood that the storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0133] Reference below Figures 1 to 4 The method for allocating personnel through a personnel scheduling and planning device in an embodiment of the present invention is described in detail. It is worth noting that the following description is merely an exemplary description and not a specific limitation of the invention.
[0134] like Figure 1 As shown, step S100, obtaining a set of shortest paths between any two destinations in a set of destinations.
[0135] Specifically, 100 destinations and business personnel are input into the personnel scheduling and planning device, and the input module 410 sends the destination information to the map module 420. After receiving the corresponding destination, the map module 420 performs the following steps: Figure 2 The operations shown are:
[0136] Step S101: Acquire public transportation route data for each destination according to the destination set.
[0137] Specifically, public transportation route data to each destination is obtained from the map, and routes running during peak hours are removed from the public transportation route data.
[0138] Further, in step S102, a public transportation route and a route time between any two destinations in the destination set are obtained according to the announced traffic route data, where the route time is the time required for the public transportation route.
[0139] Further, in step S103, the path with the shortest path time among all public transportation paths is set as the shortest path, and the set of all shortest paths is used as the shortest path set.
[0140] At this time, the map module 420 outputs the shortest path set and the public transportation route data to the first processing module 430, and the first processing module 430 receives the shortest path set and the public transportation route data and continues to execute as follows: Figure 1 Steps shown:
[0141] Step S200: Process each path in the shortest path set by using a conservation algorithm, and obtain an initial route according to each processed path.
[0142] At this time, each path obtained after processing by the saving algorithm is S1, S2, S3...Sn, where S1, S2, S3 are respectively represented as follows: S1 = (a, b, c); S2 = (d, e, g); S3 = (a, k, u)....S n =(h,y,i); then the initial line S =(0,a,b,c,0,d,e,g,0,a,k,u,......,0,h,y,i); where 0 indicates the beginning of another path.
[0143] At this time, the first processing module 430 sends the initial route to the second processing module 440, and the second processing module 440 processes as follows:
[0144] Step S300: Process the initial line by using a genetic algorithm to obtain a second line.
[0145] Specifically, obtaining the second line includes the following steps:
[0146] First, the initial circuit is initialized to obtain an initial circuit set, and each circuit in the initial circuit set is used as a gene individual of the genetic algorithm.
[0147] Specifically, the second processing module 440 receives the initial route obtained by the first processing module 430, and copies the initial route to obtain a plurality of identical initial routes.
[0148] Secondly, all gene individuals are iteratively processed by the genetic algorithm to obtain the first fitness value of each gene individual after each iterative processing of the genetic algorithm.
[0149] Specifically, the total service cost corresponding to the first fitness value is the sum of the time spent on each path through the gene individual.
[0150] Furthermore, the first fitness value and the current number of iterations of the genetic algorithm are matched with preset conditions, and the iteration of the genetic algorithm is stopped according to the matching result.
[0151] Specifically, the preset condition is used to stop the iterative processing of the genetic algorithm. The preset condition includes the genetic algorithm stop condition, specifically, the number of iterations reaches 500 or the first fitness value satisfies A. Where A is the expected total service cost. The total service cost is input in the input module.
[0152] At this time, the second processing module 440 obtains the target gene individual with the largest first fitness value among the gene individuals after the genetic algorithm stops iterative processing, and sets the target gene individual as the second line.
[0153] Further, the second processing module 440 sends the second line to the third processing module 450, and the third processing module 450 performs the following steps: Figure 1 The steps to get the assigned route are:
[0154] S400: Process the second line by using a particle swarm algorithm to obtain an allocation line.
[0155] Specifically, Figure 3 As shown, S410, obtaining personnel information in the set of personnel to be assigned, the personnel information including the number of personnel.
[0156] Specifically, the third processing module 450 obtains the personnel information in the input module 410 .
[0157] S420: Initialize the second line according to the personnel information to obtain a second line set, and use the second line set as a particle swarm of the particle swarm algorithm.
[0158] Specifically, the third processing module 450 copies the second route to obtain a plurality of second routes whose number is the same as the number of personnel, and the set of all second routes is a second route set.
[0159] S430, each particle of the particle group is matched with the personnel to be assigned one by one.
[0160] Specifically, the personnel to be assigned are numbered, and their numbers are kept consistent with the indexes of the particles in the particle swarm.
[0161] S440, processing the particle swarm by using a particle swarm algorithm to obtain a first position of each particle in the particle swarm, and obtaining an allocation route of the to-be-allocated personnel according to the first position.
[0162] Further, if Figure 1 As shown, the third processing module 450 further processes the following steps:
[0163] S450, processing the particle swarm through a genetic algorithm to obtain an updated particle swarm.
[0164] Specifically, a first particle and a second particle are randomly obtained from a particle group.
[0165] Further, a first position of the first particle is obtained.
[0166] Furthermore, a genetic algorithm is used to perform crossover and mutation processing on a first path segment corresponding to a first position of the first particle and a second path segment randomly selected from the second particle to obtain an updated first particle and an updated second particle.
[0167] It should be noted that, since the path is directional, the allocation route of the personnel to be allocated can be obtained by taking the first position as the starting point of the allocation route, wherein the allocation route is the first path segment.
[0168] Furthermore, the particle group is updated according to the updated first particle and the updated second particle.
[0169] Further, a second position of the particle group is obtained.
[0170] Further, a third particle corresponding to the second position in the particle swarm is obtained, and a fourth particle is randomly obtained in the particle swarm.
[0171] Furthermore, the third path segment and the fourth path segment are crossover and mutation processed by a genetic algorithm to obtain an updated third particle and an updated fourth particle; wherein the third path segment corresponds to the second position of the third particle, and the fourth path segment is a path segment randomly selected from the fourth particle.
[0172] Furthermore, the particle group is updated according to the updated third particle and the updated fourth particle.
[0173] S460: Process the updated particle swarm using a particle swarm algorithm to obtain a distribution route for the personnel to be distributed.
[0174] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0175] The embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present invention.
Claims
1. A method for personnel scheduling planning, characterized in that: The steps include: Get the shortest path set between any two destinations in the destination set; Processing each path in the shortest path set by a conservation algorithm, and obtaining an initial route according to each processed path; Processing the initial route by a genetic algorithm to obtain a second route; Processing the second line by a particle swarm algorithm to obtain a distribution line; The step of processing the initial line by a genetic algorithm to obtain a second line comprises the following steps: Initializing the initial circuit to obtain an initial circuit set, and using each circuit in the initial circuit set as a gene individual of the genetic algorithm; Iteratively process all the gene individuals by the genetic algorithm, and obtain the first fitness value of each gene individual after each iterative process by the genetic algorithm; Matching the first fitness value, the current number of iterations of the genetic algorithm and a preset condition, and stopping the iterative processing of the genetic algorithm according to the matching result; Obtaining a target gene individual having the largest first fitness value among all the gene individuals after the genetic algorithm stops iterative processing, and using the target gene individual as the second line; The step of processing the second line by using a particle swarm algorithm to obtain a distribution line comprises the following steps: Obtaining personnel information in the set of personnel to be assigned, the personnel information including the number of personnel, assignment area information and cost value; the assignment area information and cost value are used to calculate the total service cost; Initializing the second route according to the personnel information to obtain a second route set, and using the second route set as a particle swarm of the particle swarm algorithm; the initialization process includes duplicating the second route to obtain a plurality of second routes having the same number as the number of personnel; Matching each particle of the particle group with the person to be assigned one by one; The particle swarm is processed by the particle swarm algorithm to obtain the first position and the second position of each particle in the particle swarm, and the allocation route of the personnel to be allocated is obtained according to the first position; the first position and the second position correspond to the position pbest and the global position gbest in the particle swarm algorithm respectively; the second fitness value in the particle algorithm is the total service cost of the allocation route; Processing the particle swarm by the genetic algorithm to obtain an updated particle swarm; The updated particle swarm is processed by the particle swarm algorithm to obtain the allocation route of the personnel to be allocated.
2. The method for personnel scheduling planning according to claim 1, characterized in that: The step of obtaining the shortest path set between any two destinations in the destination set comprises the following steps: Acquire public transportation route data for each destination according to the destination set; Acquire a public transportation path and path time between any two destinations in the destination set according to the public transportation route data, wherein the path time is the time required for the public transportation path; The path with the shortest path time among all the public transportation paths is set as the shortest path, and the set of all the shortest paths is used as the shortest path set.
3. The method for personnel scheduling planning according to claim 2, characterized in that: The step of obtaining the shortest path set between any two destinations in the destination set also includes the following steps: The routes operating during peak hours are removed from the public transportation route data.
4. The method for personnel scheduling planning according to claim 1, characterized in that: The step of processing the particle swarm by the genetic algorithm to obtain an updated particle swarm comprises the following steps: randomly obtaining a first particle and a second particle from the particle population; acquiring a first position of the first particle; Performing crossover and mutation processing on a first path segment corresponding to a first position of the first particle and a second path segment randomly selected from the second particle by using the genetic algorithm to obtain an updated first particle and an updated second particle; The particle group is updated according to the updated first particle and the updated second particle.
5. The method for personnel scheduling planning according to claim 1, characterized in that: The method of processing the particle swarm by a genetic algorithm to obtain an updated particle swarm also includes the following steps: Acquire a second position of the particle group; Acquire a third particle corresponding to the second position in the particle group, and randomly acquire a fourth particle in the particle group; Performing crossover and mutation processing on the third path segment and the fourth path segment through a genetic algorithm to obtain an updated third particle and an updated fourth particle, wherein the third path segment corresponds to the second position of the third particle, and the fourth path segment is a path segment randomly selected from the fourth particle; The particle group is updated according to the updated third particle and the updated fourth particle.
6. A device for personnel scheduling planning, characterized in that: include: An input module (410), the input module (410) is used to obtain a set of destinations to be assigned and personnel to be assigned; A map module (420), the map module (420) being used to obtain a shortest path set according to the destination set; A first processing module (430), wherein the first processing module (430) performs a conservation algorithm process according to the shortest path set to obtain an initial route; A second processing module (440), the second processing module (440) is used to perform genetic algorithm processing on the initial circuit to obtain a second circuit; A third processing module (450), the third processing module (450) is used to process the second route by using a particle swarm algorithm to obtain an allocation route for the personnel to be allocated; The step of processing the initial line by a genetic algorithm to obtain a second line comprises the following steps: Initializing the initial circuit to obtain an initial circuit set, and using each circuit in the initial circuit set as a gene individual of the genetic algorithm; Iteratively process all the gene individuals by the genetic algorithm, and obtain the first fitness value of each gene individual after each iterative process by the genetic algorithm; Matching the first fitness value, the current number of iterations of the genetic algorithm and a preset condition, and stopping the iterative processing of the genetic algorithm according to the matching result; Obtaining a target gene individual having the largest first fitness value among all the gene individuals after the genetic algorithm stops iterative processing, and using the target gene individual as the second line; The step of processing the second line by using a particle swarm algorithm to obtain a distribution line comprises the following steps: Obtaining personnel information in the set of personnel to be assigned, wherein the personnel information includes the number of personnel; Initializing the second route according to the personnel information to obtain a second route set, and using the second route set as a particle swarm of the particle swarm algorithm; Matching each particle of the particle group with the person to be assigned one by one; The particle swarm is processed by the particle swarm algorithm to obtain a first position and a second position of each particle in the particle swarm, and an allocation route of the personnel to be allocated is obtained according to the first position; the first position and the second position correspond to a position pbest in the particle swarm algorithm and a global position gbest respectively; Processing the particle swarm by the genetic algorithm to obtain an updated particle swarm; The updated particle swarm is processed by the particle swarm algorithm to obtain the allocation route of the personnel to be allocated.
7. A computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, and the computer executable instructions are used to enable a computer to execute the method for personnel scheduling planning as described in any one of claims 1 to 5.
