Route generation method and system for community pension service center
Through the improved particle swarm algorithm, the nursing staff paths are generated, which solves the problem of nursing staff arrangements in community elderly care service centers under the needs of large-scale elderly care, improves path planning efficiency and work stability, and reduces operating costs.
Patent Information
- Application Number
- CN202410988988.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-05
AI Technical Summary
When facing a large number of elderly care needs, community elderly care service centers are difficult to effectively arrange nursing staff through manual scheduling, resulting in long working hours, high labor intensity, inflexible work, difficult to guarantee fairness, and face unstable nursing staff team. , problems of large liquidity and shortage.
Using the improved particle swarm algorithm, the constraints are constructed by obtaining the attribute information of the node to be served, the position and speed of the particles are initialized, the fitness level is calculated, the speed and position are updated, the fitness level is performed, and the optimal position of individuals and groups is determined. , generate the optimal route and realize efficient scheduling of nursing staff paths.
It improves the efficiency of nursing staff path planning, realizes efficient scheduling of nursing staff work progress, reduces the operating costs of community elderly care service centers, and improves work fairness and personnel stability.
Smart Images

Figure CN118896627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and in particular to a route generation method and system for a community elderly care service center. Background Art
[0002] With the miniaturization of family structure, the increase in the number of elderly people, empty-nesters, and disabled and semi-disabled elderly people, simple family care is unsustainable. Elderly care institutions charge high fees and ordinary families cannot afford it. Most elderly people prefer to receive elderly care services at home. Therefore, relying on community service centers to provide home medical and door-to-door care services for elderly people at home has become the current development trend of elderly care services. With the increasing demand for home-based elderly care services in the community, community elderly care service centers are facing huge pressure on family health and care services. In this case, a large number of qualified nursing staff are required to provide home life care and medical services for the elderly. Generally, this type of problem is called the family health care path and scheduling problem. At present, the community elderly care service center still relies on experienced staff to manually compile and schedule shifts to solve this problem. However, when the scale of elderly care needs is large and there are many uncertain factors, it is impossible to effectively take into account various influencing factors and give the best arrangement within a limited time. This also leads to the dilemma of unstable teams, high mobility, and shortage of nursing staff for elderly care workers due to long working hours, high labor intensity, inflexible work, and difficulty in ensuring work fairness. Therefore, it is necessary to carry out reasonable route planning and scheduling of nursing staff in community elderly care service centers through scientific and systematic means. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a route generation method and system for a community elderly care service center, which can improve the efficiency of route planning.
[0004] In order to achieve the above object, an embodiment of the present invention provides a route generation method for a community elderly care service center, comprising:
[0005] Obtain the attribute information of the node to be served;
[0006] constructing constraint conditions according to the attribute information;
[0007] Initializing the position and velocity of each particle according to the constraint conditions using a preset path search method;
[0008] Determine whether the end condition is currently met;
[0009] When it is determined that the end condition is not met, the fitness of each particle is calculated;
[0010] Update the velocity and position of each particle;
[0011] Perform local search operations;
[0012] Update the fitness of each particle;
[0013] Determine the individual historical optimal position and the group historical optimal position of each particle according to the updated fitness;
[0014] Update the inertia weight and number of iterations, and return to the step of judging whether the end condition is currently met;
[0015] When it is determined that the constraint conditions are currently satisfied, the particle corresponding to the optimal historical position of the group is output as the optimal solution;
[0016] Generate routes based on the output particles.
[0017] Optionally, constructing a constraint condition according to the attribute information includes:
[0018] The constraint conditions are determined according to formula (1) to formula (19),
[0019]
[0020] in, is an indicator variable used to indicate whether the k-th caregiver arrives at the j-th node from the community elderly care service center, It means that the kth caregiver arrives at the jth node from the community elderly care service center. It means that the k-th caregiver has not arrived at the th node from the community elderly care service center, V is the node set in the connected graph including all nodes to be served, and K is the set of caregivers;
[0021]
[0022] in, is an indicator variable used to indicate whether the k-th caregiver arrives at the community elderly care service center from the ,th node, It means that the kth caregiver arrives at the community elderly care service center from the ,th node, It means that the k-th caregiver has not arrived at the community elderly care service center from the ,th node;
[0023]
[0024] in, is an indicator variable used to indicate whether the k-th caregiver reaches the ,th node from the ith node, is an indicator variable used to indicate whether the k-th caregiver reaches the i-th node from the ,th node, and N is a set of nodes that does not include the community elderly care service center;
[0025]
[0026] in, is an indicator variable used to indicate whether the k-th basic nursing staff serves the i-th node, Indicates that the kth basic nursing staff serves the ith node, Indicates that the kth basic care worker does not serve the ith node, K B A collection of basic nursing staff, K A A collection for senior caregivers, is an indicator variable indicating whether the k-th senior caregiver serves the i-th node, indicates that the kth senior caregiver serves the ith node, It means that the kth senior caregiver does not serve the ith node, and NB is the set of nodes that the basic caregiver can serve;
[0027]
[0028] Among them, N A It is a collection of nodes that basic care workers can serve;
[0029]
[0030] in, is the departure time of the kth caregiver from the community elderly care service center, and α is the starting time of the preset community elderly care service center operation time window;
[0031]
[0032] in, is the time when the kth nursing staff returns to the community elderly care service center, and β is the end time of the preset community elderly care service center operation time window;
[0033]
[0034] Among them, τ is the rated working time of the nursing staff;
[0035]
[0036] in, The time for the kth caregiver to serve the jth node, The time for the kth caregiver to serve the i-th node, e i is the starting time of the reservation time window of the i-th node, d i is the demand time of the ith node, t ijis the travel time from the i-th node to the j-th node, M is a preset integer greater than 0;
[0037]
[0038] in, is the waiting time required for the nurse to reach the i-th node;
[0039]
[0040]
[0041] Among them, u i is a variable that is either 0 or 1. If the demand at point i is urgent, it is 1; otherwise, it is 0. i is the end time of the reservation time window of the i-th node;
[0042]
[0043] Where p is the maximum number of times that the senior nursing staff downgrades the basic service demand node;
[0044]
[0045] Among them, L k is the cumulative service time of the kth caregiver;
[0046]
[0047] Among them, D is the balance degree of the scheduling scheme, is the indicator variable of whether the k1th caregiver reaches the jth node from the i-th node, is the indicator variable of whether the k2th caregiver reaches the jth node from the i-th node, is the accumulated service time of the k1th caregiver;
[0048]
[0049] Among them, γ i is the resource demand of the ith node, R is the maximum resource carrying capacity of a single nursing staff;
[0050]
[0051]
[0052]
[0053] Optionally, the path search method includes:
[0054] randomly selecting an unselected vehicle, wherein the vehicle is used to transport the caregiver;
[0055] Initialize the selected node;
[0056] Calculate the demand tags of the remaining nodes according to the selected node, wherein the demand tags include the change of the service time window, the change of the amount of resources that can continue to be served, the consumption time and the time to return to the starting point after the vehicle goes to the node;
[0057] Filter each of the remaining nodes according to the constraint condition to obtain a feasible node set;
[0058] Determine whether the feasible node set is empty;
[0059] When it is determined that the feasible node set is not empty, selecting the optimal point from the feasible node set according to the relationship between the consumed time;
[0060] The optimal point is used as a new selected node, and the step of calculating the required labels of the remaining nodes according to the selected node is returned to be executed;
[0061] In the case where it is determined that the feasible node set is empty, determining whether there is currently an unselected vehicle;
[0062] In the case where it is determined that there is currently an unselected vehicle, returning to execute the step of randomly selecting an unselected vehicle;
[0063] When it is determined that there is no unselected vehicle currently, all selected nodes are connected in series to obtain the route.
[0064] Optionally, calculating the fitness of each particle and updating the fitness of each particle include:
[0065] The fitness is calculated according to formula (20) to formula (24),
[0066]
[0067]
[0068]
[0069] min z4=D,(23)
[0070] Z=λ1min z1+λ2min z2+λ3min z3+λ4min z4(24)
[0071] Among them, Z is the fitness, λ1, λ2, λ3, and λ4 are correction weights, C1 is the basic income of basic nursing staff, C2 is the basic income of senior nursing staff, SC1 is the cumulative income of basic nursing staff, SC2 is the cumulative income of senior nursing staff, D is the difference in the cumulative service time of each nursing staff in one day, and A is the path set of nursing staff.
[0072] Optionally, update the velocity and position of each particle, including:
[0073] Randomly generate a random number;
[0074] Determine whether the random number is less than a preset value;
[0075] When it is determined that the random number is less than the preset value, the speed is updated according to formula (25) and formula (26),
[0076]
[0077] Among them, v i (t+1) is the updated speed, v i (t) is the speed before updating, c1 and c2 are learning factors, r1(t) and r2(t) are random numbers uniformly distributed in the range [0,1]. is the individual's historical optimal position, is the historical optimal position of the group, x i (t) is the position interval of the particle;
[0078]
[0079] Among them, ω min ,ω max is the minimum and maximum value of the inertia weight, max_iterations is the maximum number of iterations, and r is the preset initial seed value;
[0080] When it is determined that the random number is greater than or equal to the preset value, the speed is updated according to formula (27):
[0081]
[0082] Update the position according to formula (28),
[0083] x i (t+1)=x i (t)+v i (t+1), (28)
[0084] Among them, x i (t+1) is the updated position, x i(t) is the position before updating.
[0085] Optionally, perform a local search operation, including:
[0086] At least one of a preset insertion operation, a swap operation, and a reversal operation is randomly performed, wherein:
[0087] The insert operation includes: randomly deleting a node from the route corresponding to the particle, and inserting the deleted node into another position of the particle;
[0088] The exchange operation includes: randomly selecting one of the nodes from the first half and the second half of the particle and exchanging them;
[0089] The reversal operation includes: randomly selecting two of the nodes from the particles, and reversing the order of all nodes between the two selected nodes, including the selected nodes.
[0090] Optionally, perform a local search operation, including:
[0091] Randomly use at least one of the following first removal operator, second removal operator, third removal operator, fourth removal operator, fifth removal operator and sixth removal operator to perform a deletion operation on the particle, wherein:
[0092] The first removal operator comprises: randomly removing a plurality of the nodes from the particle;
[0093] The second removal operator includes:
[0094] Calculate the difference of the fixed loss value before and after removing each node in the particle respectively;
[0095] Arrange the nodes in descending order according to the difference of the fixed loss values;
[0096] Select the first plurality of nodes in the arranged sequence to remove;
[0097] The third removal operator comprises:
[0098] respectively calculating the difference in feasibility evaluation value before and after removing each node in the particle;
[0099] Arrange the nodes in descending order according to the differences in the feasibility evaluation values;
[0100] Select the first plurality of nodes in the arranged sequence to remove;
[0101] The fourth removal operator comprises:
[0102] Calculate the difference in distance consumption before and after removing each of the nodes in the particle respectively;
[0103] Arrange the nodes in descending order according to the difference in distance consumption;
[0104] Select the first plurality of nodes in the arranged sequence to remove;
[0105] The fifth removal operator comprises:
[0106] Calculating the difference in balance degree before and after removing each node in the particle respectively;
[0107] Arrange the nodes in descending order according to the difference in the degree of balance;
[0108] Select the first plurality of nodes in the arranged sequence to remove;
[0109] The sixth removal operator comprises:
[0110] The similarity between each two nodes is calculated according to formula (29):
[0111] R(i, j) = χd ij +η|l i -l j |+δ|r i -r j |+ζ|label i -label j |, (29)
[0112] Among them, R(i, j) is the similarity between the i-th node and the j-th node, X, η, δ, ζ are weights, d ij For service time, i , l j are the relative distances between the i-th node and the j-th node, τ i 、r j are the service resource requirements of the i-th node and the j-th node, respectively, label i 、label j are the service demand levels of the i-th node and the j-th node respectively;
[0113] Pairing the nodes in pairs according to the similarities;
[0114] Randomly remove one of the nodes from the paired two nodes.
[0115] Optionally, a local search operation is performed, including:
[0116] Randomly use at least one of the following first repair operator, second repair operator, third repair operator, fourth repair operator, fifth repair operator and sixth repair operator to perform a deletion operation on the particle, wherein:
[0117] The first repair operator includes: randomly inserting the removed operator into the particle;
[0118] The second repair operator includes:
[0119] Calculate the difference of the fixed loss value before and after the removed node is inserted into each position of the particle;
[0120] Inserting the node into the position corresponding to the minimum difference;
[0121] The third repair operator comprises:
[0122] Calculate the difference in distance consumed before and after the removed node is inserted into each position of the particle;
[0123] Inserting the node into the position corresponding to the minimum difference;
[0124] The fourth repair operator comprises:
[0125] Calculate the difference in balance between the removed node and each position of the particle before and after the node is inserted;
[0126] Inserting the node into the position corresponding to the maximum difference;
[0127] The fifth repair operator comprises:
[0128] Calculate the fitness differences of the removed nodes before and after they are inserted into each position of the particle respectively;
[0129] Determining the optimal insertion point and the suboptimal insertion point of the removed node according to the difference in fitness;
[0130] Calculate the difference after inserting the removed node according to the optimal insertion point and the suboptimal insertion point;
[0131] The node is inserted at the position where the sum of the differences is the largest.
[0132] On the other hand, the present invention also provides a route generation system for a community elderly care service center, the route generation system comprising a processor, and the processor is configured to execute any of the route generation methods described above.
[0133] Through the above technical scheme, the present invention provides a route generation method and system for a community elderly care service center. The route generation method and system combines the location and demand characteristics of the community elderly care service center, and then generates the path through an improved particle swarm algorithm, so that the generated path can achieve efficient scheduling of the work progress of nursing staff.
[0134] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0135] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0136] Figure 1 is a flow chart of a route generation method for a community elderly care service center according to an embodiment of the present invention;
[0137] Figure 2 is a flow chart of a path search method according to an embodiment of the present invention;
[0138] Figure 3 is a flowchart of a method for updating the velocity and position of each particle according to one embodiment of the present invention. DETAILED DESCRIPTION
[0139] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0140] like Figure 1 FIG. 1 is a flow chart of a method for generating a route for a community elderly care service center according to an embodiment of the present invention. Figure 1 In the method for generating a route, the route may include the following steps:
[0141] In step S10, the attribute information of the node to be served is obtained;
[0142] In step S11, a constraint condition is constructed according to the attribute information;
[0143] In step S12, the position and velocity of each particle are initialized according to the constraint conditions using a preset path search method;
[0144] In step S13, it is determined whether the end condition is currently met;
[0145] In step S14, when it is determined that the termination condition is not met, the fitness of each particle is calculated;
[0146] In step S15, the speed and position of each particle are updated;
[0147] In step S16, a local search operation is performed;
[0148] In step S17, the fitness of each particle is updated;
[0149] In step S18, the individual historical optimal position and the group historical optimal position of each particle are determined according to the updated fitness;
[0150] In step S19, the inertia weight and the number of iterations are updated, and the process returns to the step of determining whether the end condition is currently met;
[0151] In step S20, when it is determined that the constraint condition is currently satisfied, the particle corresponding to the optimal historical position of the group is output as the optimal solution;
[0152] In step S21, a route is generated according to the output particles.
[0153] In this Figure 1 In the route generation method shown, step S10 can be used to obtain attribute information of the node to be served, wherein the attribute information may include the location of each person to be cared for, the demand for the care service, and the time of the care service.
[0154] Step S11 can be used to construct constraint conditions based on attribute information. Among them, for the constraint conditions, the constraint conditions can be in various forms known to those skilled in the art. In this embodiment, considering that there are several nursing staff of different levels in the community elderly care service center and elderly people with different needs within the coverage of its elderly care services, the elderly or their families make an appointment for a service order with the elderly care service complex. The service order includes the service appointment time window, service demand level, consumed service resource amount and geographical location. The nursing staff provides services to the elderly at home according to the order requirements. Finally, the elderly care service complex assigns appropriate service orders (starting service time) to the nursing staff and arranges the visit route for the day.
[0155] Every day, the nursing staff departs from the community elderly care service center, serves the customers on the planned route, and then returns to the community elderly care service center. Due to the influence of the actual situation, the travel time and service time of the nursing staff are usually uncertain. The working time of the nursing staff cannot exceed the rated working time and must be within the operating time window of the community elderly care service center. According to the urgency of the elderly care service demand, it is divided into emergency events and daily events. For emergency events, the nursing staff must arrive before the time window opens, and for daily events, they can arrive within the service time window. Each nursing staff must start the service within the appointment time window of the elderly. If it is earlier than the upper limit of the appointment time, waiting time will be generated. The service is not allowed to start until the appointment time window opens. The nursing staff is not allowed to visit the elderly later than the lower limit of the appointment, so as to ensure the service quality of the nursing staff. Since the salary of the nursing staff consists of basic salary and performance salary, the basic salary can be obtained by attendance on the same day, and the performance salary is calculated based on the total service time of each nursing staff's orders on the same day. Therefore, in order to stimulate the enthusiasm of the nursing staff and improve the efficiency of guiding the work of the nursing staff, the cumulative service time of each nursing staff visiting customers in one day should be as balanced as possible. In addition, the transportation loss (fuel consumption) of the vehicles transporting the caregivers must also be considered. Basic caregivers can only provide basic care services (such as meal assistance and cleaning), and senior caregivers can provide basic care services and senior care services (such as providing professional medical services, psychological comfort, etc.). Since in most cases basic care is more than senior care, when the number of basic caregivers is insufficient, senior caregivers can be appropriately allowed to be responsible for basic care needs, but the number of downgraded services is limited. At the same time, the sum of the resources consumed in serving all the elderly in one day shall not exceed the maximum number of service resources that a caregiver can carry at a time. Each caregiver can serve multiple elderly people, but each elderly person can receive multiple services per day;
[0156] Under the above background conditions, in order to achieve reasonable and efficient scheduling and social care routing and scheduling, the main goal can be to minimize the operating costs of the community service center and balance the time spent by caregivers on the road and the service time. Among them, the operating cost is minimized by minimizing the basic salary expenditure. Since each elderly person in the order needs to be served, it is necessary to minimize the number of dispatched caregivers to reduce the operating costs of the community service center. Therefore, in one example of the present invention, the constraint condition can be constructed using the following formulas (1) to (19):
[0157]
[0158] in, is an indicator variable used to indicate whether the k-th caregiver arrives at the j-th node from the community elderly care service center, It means that the kth caregiver arrives at the jth node from the community elderly care service center. It means that the k-th caregiver has not arrived at the th node from the community elderly care service center, V is the node set in the connected graph including all nodes to be served, and K is the set of caregivers;
[0159]
[0160] in, is an indicator variable used to indicate whether the k-th caregiver arrives at the community elderly care service center from the ,th node, It means that the kth caregiver arrives at the community elderly care service center from the ,th node, It means that the k-th caregiver has not arrived at the community elderly care service center from the ,th node;
[0161]
[0162] in, is an indicator variable used to indicate whether the k-th caregiver reaches the ,th node from the ith node, is an indicator variable used to indicate whether the k-th caregiver reaches the i-th node from the ,th node, and N is a set of nodes that does not include the community elderly care service center;
[0163]
[0164] in, is an indicator variable used to indicate whether the k-th basic nursing staff serves the i-th node, Indicates that the kth basic nursing staff serves the ith node, Indicates that the kth basic care worker does not serve the ith node, K B A collection of basic nursing staff, K A A collection for senior caregivers, is an indicator variable indicating whether the k-th senior caregiver serves the i-th node, indicates that the kth caregiver serves the ith node, indicates that the kth caregiver does not serve the i-th node, N B It is a collection of nodes that basic care workers can serve;
[0165]
[0166] Among them, N A It is a collection of nodes that basic care workers can serve;
[0167]
[0168] in, is the departure time of the kth caregiver from the community elderly care service center, and α is the starting time of the preset community elderly care service center operation time window;
[0169]
[0170] in, is the time when the kth nursing staff returns to the community elderly care service center, and β is the end time of the preset community elderly care service center operation time window;
[0171]
[0172] Among them, τ is the rated working time of the nursing staff;
[0173]
[0174] in, The time for the kth caregiver to serve the jth node, The time for the kth caregiver to serve the i-th node, e i is the starting time of the reservation time window of the i-th node, d i is the demand time of the ith node, t ij is the travel time from the i-th node to the j-th node, M is a preset integer greater than 0;
[0175]
[0176] Among them, W i k is the waiting time required for the nurse to reach the i-th node;
[0177]
[0178]
[0179] Among them, u i is a variable that is either 0 or 1. If the demand at point i is urgent, it is 1; otherwise, it is 0. i is the end time of the reservation time window of the i-th node;
[0180]
[0181] Where p is the maximum number of times that the senior nursing staff downgrades the basic service demand node;
[0182]
[0183] Among them, L k is the cumulative service time of the kth caregiver;
[0184]
[0185] Among them, D is the balance degree of the scheduling scheme, is the indicator variable of whether the k1th caregiver reaches the jth node from the i-th node, is the indicator variable of whether the k2th caregiver reaches the jth node from the i-th node, is the accumulated service time of the k1th caregiver;
[0186]
[0187] Among them, r i is the resource demand of the ith node, R is the maximum resource carrying capacity of a single nursing staff;
[0188]
[0189]
[0190]
[0191] Step S12 can be used to use a preset path generation method to initialize the position and speed of each particle according to the constraint conditions, thereby generating an initial route. The position can be used to represent the route corresponding to each particle, and the speed can be used to represent an update operation of the particle in each iteration. The path generation method can be in various forms known to those skilled in the art. In one example of the present invention, the path generation method may include: Figure 2 In the steps shown in Figure 2 In the method, the path generation method may include the following steps:
[0192] In step S20, a vehicle that has not been selected is randomly selected, wherein the vehicle can be used to transport nursing staff;
[0193] In step S21, the selected node is initialized. Considering that each vehicle starts from a community elderly care service center, the node initialized in step S21 may be a node representing the community elderly care service center.
[0194] In step S22, the demand labels of the remaining nodes are calculated based on the selected node. The demand labels include the change of the service time window, the change of the amount of resources that can continue to be served, the consumption time, and the time to return to the starting point after the vehicle reaches the node;
[0195] In step S23, each of the remaining nodes is screened according to the constraint conditions to obtain a feasible node set;
[0196] In step S24, it is determined whether the feasible node set is empty;
[0197] In step S25, when it is determined that the feasible node set is not empty, the optimal point is selected from the feasible node set according to the relationship between the consumed time.
[0198] In step S26, the optimal point is used as a new selected node, and the process returns to the step of calculating the requirement labels of the remaining nodes according to the selected node, that is, returns to step S22;
[0199] In step S27, when it is determined that the feasible node set is empty, it is determined whether there is currently an unselected vehicle;
[0200] In step S28, if it is determined that there is currently an unselected vehicle, the process returns to the step of randomly selecting an unselected vehicle, that is, returns to step S30;
[0201] In step S29, when it is determined that there is no unselected vehicle currently, all selected nodes are connected in series to obtain a route.
[0202] Step S13 can be used to determine whether the end condition is currently met. The end condition can be in various forms known to those skilled in the art. In one example of the present invention, the end condition can be, for example, to determine whether the current number of iterations is greater than or equal to a preset number threshold. If it is determined that the number of iterations is greater than or equal to the number threshold, then it can be determined that the end condition is met, otherwise the end condition is not met.
[0203] Step S14 can be used to calculate the fitness of each particle. The fitness can be used to indicate the quality of the generated route. The specific calculation method of the fitness can be various forms known to those skilled in the art. In one example of the present invention, the fitness can be calculated using the following formulas (20) to (24):
[0204]
[0205]
[0206]
[0207] min z4=D,(23)
[0208] Z=λ1min z1+λ2min z2+λ3min z3+λ4min z4(24)
[0209] Among them, Z is the fitness, λ1, λ2, λ3, and λ4 are correction weights, C1 is the basic income of basic nursing staff, C2 is the basic income of senior nursing staff, SC1 is the cumulative income of basic nursing staff, SC2 is the cumulative income of senior nursing staff, D is the difference in the cumulative service time of each nursing staff in one day, and A is the path set of nursing staff.
[0210] Step S15 can be used to update the speed and position of each particle, thereby updating the generated route. The specific updating method of the speed and position can be various forms known to those skilled in the art. In one example of the present invention, step S15 can be adopted as follows: Figure 3 Specifically, in the Figure 3 In the step S15, the step S15 may include the following method:
[0211] In step S40, a random number is randomly generated;
[0212] In step S41, it is determined whether the random number is less than a preset value;
[0213] In step S42, when it is determined that the random number is less than the preset value, the speed is updated according to formula (25) and formula (26):
[0214]
[0215] Among them, v i (t+1) is the updated speed, v i (t) is the speed before updating, c1 and C2 are learning factors, r1(t) and r2(t) are random numbers uniformly distributed in the range [0, 1]. is the individual's best historical position, is the historical optimal position of the group, x i (t) is the position interval of the particle;
[0216]
[0217] Among them, ω min ,ω max is the minimum and maximum value of the inertia weight, max_iterations is the maximum number of iterations, and r is the preset initial seed value;
[0218] In step S43, when it is determined that the random number is greater than or equal to the preset value, the speed is updated according to formula (27):
[0219]
[0220] In step S44, the position is updated according to formula (28),
[0221] x i (t+1)=x i (t)+v i (t+1), (28)
[0222] Among them, x i (t+1) is the updated position, x i (t) is the position before updating.
[0223] Step S16 can be used to perform a local search. The specific method of the local search can be a variety of methods known to those skilled in the art. In one example of the present invention, the local search can be a random execution of at least one of a preset insertion operation, a swap operation, and a reversal operation. Among them, the insertion operation may include: randomly deleting a node from the route corresponding to the particle, and inserting the deleted node into other positions of the particle. The swap operation may include: randomly selecting a node from the first half and the second half of the particle respectively and exchanging them. The reversal operation may include: randomly selecting two nodes from the particle, and reversing the order of all nodes including the selected nodes between the two selected nodes.
[0224] In another example of the present invention, the local search operation may also be to first perform a removal operation and then perform a repair operation. Specifically, the removal operation may be to randomly use at least one of the following first removal operator, second removal operator, third removal operator, fourth removal operator, fifth removal operator, and sixth removal operator to perform a deletion operation on the particle.
[0225] The first removal operator may include: randomly removing multiple nodes from the particle. The second removal operator may include: respectively calculating the difference in fixed loss value before and after removing each node from the particle, sorting the nodes in descending order according to the difference in fixed loss value, and finally selecting the first multiple nodes in the sorted sequence to remove. The method for calculating the fixed loss value may be in various forms known to those skilled in the art. In this example, the method for calculating the fixed loss value may be based on the overall node distribution after removing the node, using Figure 2 The route generation method in generates a route, and then the fixed cost z1 corresponding to the route is calculated. Finally, the difference between the fixed cost z1 before deletion and the fixed cost z1 after deletion is calculated as the difference of the fixed loss value.
[0226] The third removal operator may include: respectively calculating the difference in feasibility evaluation value before and after removing each node in the particle, arranging the nodes in descending order according to the difference in feasibility evaluation value, and finally selecting the first plurality of nodes in the arranged sequence to remove. The method for calculating the difference in feasibility evaluation value may be a variety of forms known to those skilled in the art. In this example, the method for calculating the feasibility evaluation value may be based on the overall node distribution after removing the node, using a method such as Figure 2 The route generation method in is used to generate a route, and then the comprehensive cost z2 of the nursing staff corresponding to the route is calculated. Finally, the difference between the comprehensive cost z2 before deletion and the comprehensive cost z2 after deletion is calculated as the difference of the feasibility evaluation value.
[0227] The fourth removal operator may include: respectively calculating the difference in distance consumption before and after removing each node in the particle, arranging the nodes in descending order according to the difference in distance consumption, and finally selecting the first plurality of nodes in the arranged sequence to remove. The method for calculating the difference in distance consumption may be in various forms known to those skilled in the art. In this example, the method for calculating the distance consumption may be based on the overall node distribution after removing the node, using the following method: Figure 2 The route generation method in generates a route, and then calculates the distance consumption z3 corresponding to the route, and finally calculates the difference between the distance consumption z3 before deletion and the distance consumption z3 after deletion.
[0228] The fifth removal operator may include: respectively calculating the difference in the degree of balance before and after removing each node in the particle, arranging the nodes in descending order according to the difference in the degree of balance, and finally selecting the first plurality of nodes in the arranged sequence to remove. The method for calculating the difference in the degree of balance may be in various forms known to those skilled in the art. In this example, the method for calculating the degree of balance may be based on the overall node distribution after removing the node, using the following method: Figure 2 The route generation method in is used to generate a route, and then the balance degree z4 corresponding to the route is calculated, and finally the difference between the balance degree z4 before deletion and the balance degree z4 after deletion is calculated.
[0229] The sixth removal operator may include: calculating the similarity between every two nodes according to formula (29), R(i, j) = χd ij +η|l i -l j |+δ|r i -r j |+ζ|label i -label j |, (29)
[0230] Among them, R(i, j) is the similarity between the i-th node and the j-th node, X, η, δ, ζ are weights, d ijFor service time, i , l j are the relative distances between the i-th node and the j-th node, r i 、r j are the service resource requirements of the i-th node and the j-th node, respectively, label i 、label j are the service demand levels of the i-th node and the j-th node respectively, and then the nodes are paired according to the similarity, and finally a node is randomly removed from the two paired nodes.
[0231] The repair operation may be to randomly use at least one of the following first repair operator, second repair operator, third repair operator, fourth repair operator, fifth repair operator and sixth repair operator to perform a deletion operation on the particle. Among them, the first repair operator may include: randomly inserting the removed operator into the particle. The second repair operator may include: respectively calculating the difference of the fixed loss value before and after the removed node is inserted into each position of the particle, and inserting the node into the position corresponding to the minimum difference. The third repair operator may include: respectively calculating the difference of the distance consumption before and after the removed node is inserted into each position of the particle, and then inserting the node into the position corresponding to the minimum difference. The fourth repair operator may include: respectively calculating the difference of the balance degree before and after the removed node is inserted into each position of the particle, and inserting the node into the position corresponding to the maximum difference. The fifth repair operator may include: firstly respectively calculating the difference of the fitness before and after the removed node is inserted into each position of the particle, and then determining the optimal insertion point and the suboptimal insertion point of the removed node according to the difference of the fitness, and then calculating the difference sum after the removed node is inserted according to the optimal insertion point and the suboptimal insertion point, and finally inserting the node into the position with the maximum difference sum.
[0232] Through the above technical scheme, the present invention provides a route generation method and system for a community elderly care service center. The route generation method and system combines the location and demand characteristics of the community elderly care service center, and then generates the path through an improved particle swarm algorithm, so that the generated path can achieve efficient scheduling of the work progress of nursing staff.
[0233] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0234] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0235] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0236] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0237] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0238] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0239] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0240] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0241] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A route generation method for a community elderly care service center, characterized in that: The route generation method comprises: Obtain the attribute information of the node to be served; constructing constraint conditions according to the attribute information; Initializing the position and velocity of each particle according to the constraint conditions using a preset path search method; Determine whether the end condition is currently met; When it is determined that the end condition is not met, the fitness of each particle is calculated; Update the velocity and position of each particle; Perform local search operations; Update the fitness of each particle; Determine the individual historical optimal position and the group historical optimal position of each particle according to the updated fitness; Update the inertia weight and number of iterations, and return to the step of judging whether the end condition is currently met; When it is determined that the constraint conditions are currently satisfied, the particle corresponding to the optimal historical position of the group is output as the optimal solution; Generate routes based on the output particles.
2. The route generation method according to claim 1, characterized in that: Constructing constraint conditions according to the attribute information includes: The constraint conditions are determined according to formula (1) to formula (19), in, is an indicator variable used to indicate whether the k-th caregiver arrives at the j-th node from the community elderly care service center, It means that the kth caregiver arrives at the jth node from the community elderly care service center. It means that the kth caregiver has not reached the jth node from the community elderly care service center, V is the set of nodes in the connected graph including all nodes to be served, and K is the set of caregivers; in, is an indicator variable used to indicate whether the k-th caregiver arrives at the community elderly care service center from the j-th node, It means that the kth caregiver arrives at the community elderly care service center from the jth node. It means that the kth caregiver has not arrived at the community elderly care service center from the jth node; in, is an indicator variable used to indicate whether the kth caregiver reaches the jth node from the i-th node, is an indicator variable used to indicate whether the kth caregiver reaches the ith node from the jth node, and N is a set of nodes excluding the community elderly care service center; in, is an indicator variable used to indicate whether the k-th basic nursing staff serves the i-th node, Indicates that the kth basic nursing staff serves the ith node, Indicates that the kth basic care worker does not serve the ith node, K B A collection of basic nursing staff, K A A collection for senior caregivers, is an indicator variable indicating whether the k-th senior caregiver serves the i-th node, indicates that the kth senior caregiver serves the ith node, indicates that the kth senior caregiver does not serve the ith node, N B It is a collection of nodes that basic care workers can serve; Among them, N A It is a collection of nodes that basic care workers can serve; in, is the departure time of the kth caregiver from the community elderly care service center, and α is the starting time of the preset community elderly care service center operation time window; in, is the time when the kth nursing staff returns to the community elderly care service center, and β is the end time of the preset community elderly care service center operation time window; Among them, τ is the rated working time of the nursing staff; in, The time for the kth caregiver to serve the jth node, The time for the kth caregiver to serve the i-th node, e i is the starting time of the reservation time window of the i-th node, d i is the demand time of the ith node, t ij is the travel time from the i-th node to the j-th node, M is a preset integer greater than 0; in, is the waiting time required for the nurse to reach the i-th node; Among them, u i is a variable that is either 0 or 1. If the demand at point i is urgent, it is 1; otherwise, it is 0. i is the end time of the reservation time window of the i-th node; Where p is the maximum number of times that the senior nursing staff downgrades the basic service demand node; Among them, L k is the cumulative service time of the kth caregiver; Among them, D is the balance degree of the scheduling scheme, is the indicator variable of whether the k1th caregiver reaches the jth node from the i-th node, is the indicator variable of whether the k2th caregiver reaches the jth node from the i-th node, is the accumulated service time of the k1th caregiver; Among them, r i is the resource demand of the ith node, R is the maximum resource carrying capacity of a single nursing staff; 3. The route generation method according to claim 1, characterized in that: The path search method comprises: randomly selecting an unselected vehicle, wherein the vehicle is used to transport a caregiver; Initialize the selected node; Calculate the demand tags of the remaining nodes according to the selected node, wherein the demand tags include the change of the service time window, the change of the amount of resources that can continue to be served, the consumption time and the time to return to the starting point after the vehicle goes to the node; Filter each of the remaining nodes according to the constraint condition to obtain a feasible node set; Determine whether the feasible node set is empty; When it is determined that the feasible node set is not empty, selecting the optimal point from the feasible node set according to the relationship between the consumed time; The optimal point is used as a new selected node, and the step of calculating the required labels of the remaining nodes according to the selected node is returned to be executed; In the case where it is determined that the feasible node set is empty, determining whether there is currently an unselected vehicle; In the case where it is determined that there is currently an unselected vehicle, returning to execute the step of randomly selecting an unselected vehicle; When it is determined that there is no unselected vehicle currently, all selected nodes are connected in series to obtain the route.
4. The route generation method according to claim 2, characterized in that: Calculating the fitness of each particle and updating the fitness of each particle include: The fitness is calculated according to formula (20) to formula (24), minz4=D, (23) Z=λ1minz1+λ2minz2+λ3minz3+λ4minz4 (24) Among them, Z is the fitness, λ1, λ2, λ3, and λ4 are correction weights, C1 is the basic income of basic nursing staff, C2 is the basic income of senior nursing staff, SC1 is the cumulative income of basic nursing staff, SC2 is the cumulative income of senior nursing staff, D is the difference in the cumulative service time of each nursing staff in one day, and A is the path set of nursing staff.
5. The route generation method according to claim 1, characterized in that: Update the velocity and position of each particle, including: Randomly generate a random number; Determine whether the random number is less than a preset value; When it is determined that the random number is less than the preset value, the speed is updated according to formula (25) and formula (26), Among them, v i (t+1) is the updated speed, v i (t) is the speed before updating, c1 and c2 are learning factors, r1(t) and r2(t) are random numbers uniformly distributed in the range [0,1]. is the individual's historical optimal position, is the historical optimal position of the group, x i (t) is the position interval of the particle; Among them, ω min ,ω max is the minimum and maximum value of the inertia weight, max_iterations is the maximum number of iterations, and r is the preset initial seed value; When it is determined that the random number is greater than or equal to the preset value, the speed is updated according to formula (27): Update the position according to formula (28), x i (t+1)=x i (t)+v i (t+1), (28) Among them, x i (t+1) is the updated position, x i (t) is the position before updating.
6. The route generation method according to claim 1, characterized in that: Perform local search operations, including: At least one of a preset insertion operation, a swap operation, and a reversal operation is randomly performed, wherein: The insert operation includes: randomly deleting a node from the route corresponding to the particle, and inserting the deleted node into another position of the particle; The exchange operation includes: randomly selecting one of the nodes from the first half and the second half of the particle and exchanging them; The reversal operation includes: randomly selecting two of the nodes from the particles, and reversing the order of all nodes between the two selected nodes, including the selected nodes.
7. The route generation method according to claim 1, characterized in that: Perform local search operations, including: Randomly use at least one of the following first removal operator, second removal operator, third removal operator, fourth removal operator, fifth removal operator and sixth removal operator to perform a deletion operation on the particle, wherein: The first removal operator comprises: randomly removing a plurality of the nodes from the particle; The second removal operator includes: Calculate the difference of the fixed loss value before and after removing each node in the particle respectively; Arrange the nodes in descending order according to the difference of the fixed loss values; Select the first plurality of nodes in the arranged sequence to remove; The third removal operator comprises: respectively calculating the difference in feasibility evaluation value before and after removing each node in the particle; Arrange the nodes in descending order according to the differences in the feasibility evaluation values; Select the first plurality of nodes in the arranged sequence to remove; The fourth removal operator comprises: Calculate the difference in distance consumption before and after removing each of the nodes in the particle respectively; Arrange the nodes in descending order according to the difference in distance consumption; Select the first plurality of nodes in the arranged sequence to remove; The fifth removal operator comprises: Calculating the difference in balance degree before and after removing each node in the particle respectively; Arrange the nodes in descending order according to the difference in the degree of balance; Select the first plurality of nodes in the arranged sequence to remove; The sixth removal operator comprises: The similarity between each two nodes is calculated according to formula (29): R(i,j)=xd ij +η|l i -l j |+δ|r i -r j |+ζ|label i -label j |, (29) Among them, R(i,j) is the similarity between the i-th node and the j-th node, χ, η, δ, ζ are weights, and d ij For service time, i , l j are the relative distances between the i-th node and the j-th node, r i 、r j are the service resource requirements of the i-th node and the j-th node, respectively, label i 、label j are the service demand levels of the i-th node and the j-th node respectively; Pairing the nodes in pairs according to the similarities; Randomly remove one of the nodes from the paired two nodes.
8. The route generation method according to claim 1, characterized in that: Perform local search operations, including: Randomly use at least one of the following first repair operator, second repair operator, third repair operator, fourth repair operator, fifth repair operator and sixth repair operator to perform a deletion operation on the particle, wherein: The first repair operator includes: randomly inserting the removed operator into the particle; The second repair operator includes: Calculate the difference of the fixed loss value before and after the removed node is inserted into each position of the particle; Inserting the node into the position corresponding to the minimum difference; The third repair operator comprises: Calculate the difference in distance consumed before and after the removed node is inserted into each position of the particle; Inserting the node into the position corresponding to the minimum difference; The fourth repair operator comprises: Calculate the difference in balance between the removed node and each position of the particle before and after the node is inserted; Inserting the node into the position corresponding to the maximum difference; The fifth repair operator comprises: Calculate the fitness differences of the removed nodes before and after they are inserted into each position of the particle respectively; Determining the optimal insertion point and the suboptimal insertion point of the removed node according to the difference in fitness; Calculate the difference after inserting the removed node according to the optimal insertion point and the suboptimal insertion point; The node is inserted at the position where the sum of the differences is the largest.
9. A route generation system for a community elderly care service center, characterized in that: The route generation system comprises a processor, and the processor is configured to execute the route generation method according to any one of claims 1 to 8.
