A method, device, medium and equipment for multi-department duty scheduling
By performing the average sorting and circular configuration of duty personnel in different departments, the problem of unscientific and unfair manual shift scheduling of duty personnel is solved, and the scientific, reasonable and fairness of duty scheduling is achieved.
Patent Information
- Application Number
- CN202411457191.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-10-18
AI Technical Summary
In the prior art, there are unscientific and unfair problems in manual shift scheduling by on-duty personnel.
By obtaining the set of on-duty personnel and a segmented time list, the average sorting is performed by departments to form a sequence of on-duty personnel, and the on-duty personnel are configured in a circular manner according to the sequence to form a scientific and reasonable on-duty schedule.
The average distribution of on-duty personnel in the on-duty personnel sequence is achieved, ensuring the scientificity and fairness of on-duty scheduling.
Smart Images

Figure CN118966731B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for scheduling shifts for on-duty personnel. Background Art
[0002] In enterprises, schools, hospitals or government departments, due to business needs, it is necessary to configure on-duty personnel so that the unit can quickly respond to some affairs, especially emergency affairs, within 24 hours. When configuring on-duty personnel, for large business departments, only one on-duty personnel is required for each time period. Large business departments are usually divided into several small departments. Considering that the on-duty personnel need to be present or online in time during the configured time period, the on-duty personnel need to take turns. On the other hand, the on-duty personnel cannot be exclusively undertaken by a small department, and usually need to be undertaken by each small department separately. This leads to the average arrangement of on-duty personnel, that is, it requires each department and each on-duty personnel to make arrangements on an average basis. Under the existing technology, the scheduling of on-duty personnel is usually manually scheduled through tools such as Excel tables, which not only has a large workload, but also has unscientific and unfair problems. Summary of the invention
[0003] The problem to be solved by the present invention is the unscientific and unfair problem of manual scheduling of shifts by on-duty personnel.
[0004] To solve the above problems, the solution adopted by the present invention is as follows:
[0005] A method for multi-department duty scheduling according to the present invention comprises the following steps:
[0006] Step S1: Obtain a set of on-duty personnel and a segmented time list; the set of on-duty personnel is a set of on-duty personnel information; the on-duty personnel information includes the department to which the on-duty personnel belong;
[0007] Step S2: sorting the set of on-duty personnel by department and obtaining an on-duty personnel sequence;
[0008] Step S3: traverse the segment time list, and configure corresponding duty personnel for the traversed segment time according to the cyclic order of the duty personnel sequence to form a duty schedule;
[0009] The step S2 comprises the following steps:
[0010] Step S21: according to the departments to which the on-duty personnel belong, the on-duty personnel set is divided into departments to obtain an on-duty personnel department set; the on-duty personnel department set is a set of on-duty personnel department information; the on-duty personnel department information includes the department to which they belong, the number of on-duty personnel in the department and the on-duty personnel queue of the department;
[0011] Step S22: sorting the on-duty personnel department set in the order of the number of on-duty personnel in the department from small to large to obtain an on-duty personnel department sequence;
[0012] Step S23: Count the total number of on-duty personnel NT in the on-duty personnel department sequence, and then initialize the on-duty personnel sequence according to NT; the initialized on-duty personnel sequence is a sequence composed of NT sequence elements indicating that the number of on-duty personnel is empty;
[0013] Step S24: Taking the on-duty personnel department sequence as the remaining on-duty personnel department sequence, extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and then calculating the insertion ordinal number iInsert(iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information, and then filling each on-duty personnel into the sequence element in which the iInsert(iK)th on-duty personnel in the on-duty personnel sequence is empty, until the remaining on-duty personnel department sequence is empty; wherein, the insertion ordinal number iInsert(iK) is calculated in the following manner:
[0014] iInsert(iK)=ROUNDUP(NR*(1+(iK-1)*NK) / x); where,
[0015] iK represents the ordinal number of the duty personnel in the department duty personnel queue in the extracted duty personnel department information, and the value ranges from 1 to NK; wherein NK is the number of department duty personnel in the extracted duty personnel department information;
[0016] iInsert(iK) represents the insertion sequence number corresponding to the iKth on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information;
[0017] ROUNDUP is the round-up function;
[0018] NR is the total number of on-duty personnel in the remaining on-duty personnel department sequence;
[0019] x is the value of the copy. If NK is 1, then x=2, otherwise x=NK*NK.
[0020] Further, according to the multi-department duty scheduling method of the present invention, step S24 includes the following steps:
[0021] Step S241: Count the total number of on-duty personnel NR in the department sequence of the remaining on-duty personnel, and initialize the remaining on-duty personnel sequence according to NR; the initialized remaining on-duty personnel sequence is a sequence composed of NR sequence elements indicating that the number of on-duty personnel is empty;
[0022] Step S242: extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and deleting the extracted on-duty personnel department information from the remaining on-duty personnel department sequence;
[0023] Step S243: calculating the insertion sequence number iInsert (iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information;
[0024] Step S244: fill each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information into the remaining on-duty personnel sequence in accordance with the method of filling the iKth on-duty personnel into the iInsert(iK)th sequence element in the remaining on-duty personnel sequence;
[0025] Step S245: copying the entire remaining on-duty personnel sequence to the on-duty personnel sequence in such a manner that the i-th sequence element of the remaining on-duty personnel sequence corresponds to the sequence element in the on-duty personnel sequence where the i-th on-duty personnel is empty;
[0026] Step S246: Determine whether the remaining on-duty personnel department sequence is empty. If the remaining on-duty personnel department sequence is not empty, repeat steps S241 to S245 in sequence, otherwise end.
[0027] Further, according to the method for multi-department duty scheduling of the present invention, step S1 also includes obtaining conflict rules; when configuring the duty personnel for the traversed segmented time in step S3, it is detected whether the duty personnel meets the conflict rules. If the conflict rules are met, the next duty personnel in the cyclic order of the duty personnel sequence is configured for the traversed segmented time.
[0028] According to a device for multi-department duty scheduling of the present invention, the device includes the following modules:
[0029] Module M1 is used to obtain a set of on-duty personnel and a segmented time list; the set of on-duty personnel is a set of on-duty personnel information; the on-duty personnel information includes the department to which the on-duty personnel belongs;
[0030] Module M2 is used to: sort the set of on-duty personnel by department and obtain a sequence of on-duty personnel;
[0031] Module M3 is used to: traverse the segment time list, configure corresponding duty personnel for the traversed segment time according to the cyclic order of the duty personnel sequence, and form a duty schedule;
[0032] The module M2 includes the following modules:
[0033] Module M21 is used to: divide the on-duty personnel set into departments according to the departments to which the on-duty personnel belong, to obtain a on-duty personnel department set; the on-duty personnel department set is a set of on-duty personnel department information; the on-duty personnel department information includes the department to which they belong, the number of on-duty personnel in the department, and the on-duty personnel queue in the department;
[0034] Module M22 is used to: sort the on-duty personnel department set in the order of the number of on-duty personnel in the department from small to large to obtain an on-duty personnel department sequence;
[0035] Module M23, used for: counting the total number of on-duty personnel NT in the on-duty personnel department sequence, and then initializing the on-duty personnel sequence according to NT; the initialized on-duty personnel sequence is a sequence composed of NT sequence elements indicating that the on-duty personnel are empty;
[0036] Module M24 is used to: use the on-duty personnel department sequence as the remaining on-duty personnel department sequence, extract the first on-duty personnel department information from the remaining on-duty personnel department sequence, and then calculate the insertion ordinal number iInsert(iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information, and then fill each on-duty personnel into the sequence element in which the iInsert(iK)th on-duty personnel in the on-duty personnel sequence is empty, until the remaining on-duty personnel department sequence is empty; wherein, the insertion ordinal number iInsert(iK) is calculated in the following manner:
[0037] iInsert(iK)=ROUNDUP(NR*(1+(iK-1)*NK) / x); where,
[0038] iK represents the ordinal number of the duty personnel in the department duty personnel queue in the extracted duty personnel department information, and the value ranges from 1 to NK; wherein NK is the number of department duty personnel in the extracted duty personnel department information;
[0039] iInsert(iK) represents the insertion sequence number corresponding to the iKth on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information;
[0040] ROUNDUP is the round-up function;
[0041] NR is the total number of on-duty personnel in the remaining on-duty personnel department sequence;
[0042] x is the value of the copy. If NK is 1, then x=2, otherwise x=NK*NK.
[0043] Further, according to the device for multi-department duty scheduling of the present invention, the module M24 includes the following modules:
[0044] Module M241 is used to: count the total number of on-duty personnel NR of the remaining on-duty personnel in the department sequence, and initialize the remaining on-duty personnel sequence according to NR; the initialized remaining on-duty personnel sequence is a sequence composed of NR sequence elements indicating that the number of on-duty personnel is empty;
[0045] Module M242, used for: extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and deleting the extracted on-duty personnel department information from the remaining on-duty personnel department sequence;
[0046] Module M243, used for: calculating the insertion sequence number iInsert (iK) of each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information;
[0047] Module M244, used for: filling in the iKth on-duty personnel in the iInsert(iK)th sequence element in the remaining on-duty personnel sequence with the device, and filling in each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information into the remaining on-duty personnel sequence;
[0048] Module M245, used to: copy the remaining on-duty personnel sequence as a whole to the on-duty personnel sequence in such a manner that the i-th sequence element of the remaining on-duty personnel sequence corresponds to the sequence element in the on-duty personnel sequence in which the i-th on-duty personnel is empty;
[0049] Module M246 is used to determine whether the sequence of the remaining on-duty personnel by department is empty. If the sequence of the remaining on-duty personnel by department is not empty, the functions of modules M241 to M245 are repeatedly executed in sequence, otherwise the process ends.
[0050] Further, according to the device for multi-department duty scheduling of the present invention, the module M1 also includes obtaining conflict rules; when configuring the duty personnel for the traversed segmented time in the module M3, it is detected whether the duty personnel meets the conflict rules. If the conflict rules are met, the next duty personnel in the cyclic order of the duty personnel sequence is configured for the traversed segmented time.
[0051] According to a machine-readable medium of the present invention, a program instruction set that can be read by a machine is stored in the medium; when the program instruction set stored in the medium is read by a machine and loaded for execution, the above-mentioned multi-department duty scheduling method can be implemented.
[0052] An electronic device according to the present invention includes a processor and a memory; the memory stores a program instruction set; and is characterized in that when the program instruction set stored in the memory is executed by the processor, the device can implement the above-mentioned multi-department duty scheduling method.
[0053] The technical effects of the present invention are as follows: the present invention disperses the positions of the on-duty personnel of each department in the on-duty personnel sequence, so that the on-duty personnel of each department are averaged in the on-duty personnel sequence, thereby ensuring the scientificity and fairness of the duty scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 The figure is a flow chart of the steps of average sorting by department in an embodiment of the present invention.
[0055] Figure 2 It is a schematic structural diagram of an electronic device embodiment of the present invention. DETAILED DESCRIPTION
[0056] The present invention is further described in detail below with reference to the accompanying drawings.
[0057] FIG2 illustrates an electronic device, which is a general-purpose computer device of von Neumann type, and at least includes a connected processor 201 and a memory 202. The memory 202 is used to store a computer program instruction set and data. The processor 201 implements the method for multi-department duty scheduling referred to in the present invention by loading and executing the computer program instruction set stored in the memory 202. The memory 202 is also the machine-readable medium referred to in the present invention, which is usually a sustainable storage device, including but not limited to disks, tapes, solid-state hard disks, etc.
[0058] The method for multi-department duty scheduling of the present invention mainly includes two steps: an average sorting step by department and a step of configuring duty personnel for the segmented time list. The "obtaining a set of duty personnel and a segmented time list" in the aforementioned step S1 indicates that the set of duty personnel and the segmented time list are inputs of the present invention, and how to input them specifically is not within the scope of discussion of the present invention. It should be noted that the set of duty personnel is a set of duty personnel information. The duty personnel information includes the identification code of the duty personnel and the department to which the duty personnel belongs. The identification code of the duty personnel is used to identify the duty personnel and may be a work number or a name. The set of duty personnel is usually directly input. In another optional implementation, the list of duty personnel is obtained by input, and the department to which the corresponding duty personnel belongs is obtained by querying the human resources database. Those skilled in the art understand that the "obtaining" in step S1 of the present invention includes an implementation method of obtaining the department to which the duty personnel belongs by querying the human resources database.
[0059] The step of average sorting by department is the aforementioned step S2, in which the set of on-duty personnel is averagely sorted by department to obtain the on-duty personnel sequence. Figure 1 For example, the average sorting step by department includes a step of dividing by department, a step of sorting by the number of people in department, a step of initializing a sequence of on-duty personnel, and a step of filling the on-duty personnel sequence into the on-duty personnel sequence according to the insertion sequence number through calculation of the insertion sequence number.
[0060] The step of dividing by department is the aforementioned step S21, which divides the set of on-duty personnel into departments according to the departments to which the on-duty personnel belong, to obtain a set of on-duty personnel by departments. The set of on-duty personnel by departments is a set of on-duty personnel by department information. The on-duty personnel by department information includes the department to which they belong, the number of on-duty personnel in the department, and the department on-duty personnel queue. The on-duty personnel by department information can be represented by data as {VDepart, ListPerson, NK}. Among them, VDepart represents the department to which they belong; ListPerson is the department on-duty personnel queue; NK is the number of on-duty personnel in the department, which is the total number of on-duty personnel in the department on-duty personnel queue.
[0061] The step of sorting by number of people in the department is the aforementioned step S22, which sorts the on-duty personnel by department set in the order of the number of on-duty personnel in the department from small to large to obtain the on-duty personnel by department sequence. The on-duty personnel by department sequence is a queue of on-duty personnel by department information in order. For example, an example of a on-duty personnel by department sequence is as follows:
[0062] {Department G,{Personnel G1},1}
[0063] {Department F,{Personnel F1},1}
[0064] {Department E,{Personnel E1, Personnel E2},2}
[0065] {Department D,{Personnel D1, Personnel D2},2}
[0066] {Department C,{Personnel C1, Personnel C2, Personnel C3},3}
[0067] {Department A,{Personnel A1, Personnel A2, Personnel A3, Personnel A4, Personnel A5},5}
[0068] {Department B,{Personnel B1, Personnel B2, Personnel B3, Personnel B4, Personnel B5, Personnel B6, Personnel B7,},7}
[0069] In the above example of the on-duty personnel department sequence, there are 7 departments: Department A, Department B, Department C, Department D, Department E, Department F, and Department G. Personnel A1 to Personnel A5 are on-duty personnel for Department A; Personnel B1 to Personnel B7 are on-duty personnel for Department B; Personnel C1 to Personnel C3 are on-duty personnel for Department C; Personnel D1 and Personnel D2 are on-duty personnel for Department D; Personnel E1 and Personnel E2 are on-duty personnel for Department E; Personnel F1 and Personnel G1 are on-duty personnel for Department F and G respectively. The total number of on-duty personnel is 21.
[0070] The on-duty personnel sequence initialization step is the aforementioned step S23, which counts the total number of on-duty personnel on-duty personnel by department sequence NT, and then initializes the on-duty personnel sequence according to NT. The initialized on-duty personnel sequence is a sequence consisting of NT sequence elements representing empty on-duty personnel. The initialized on-duty personnel sequence can be expressed as {O_1, O_2, O_3, ..., O_NT}; wherein O_1, O_2, O_3, ..., O_NT represent NT empty sequence elements to be filled with on-duty personnel.
[0071] The step of filling the on-duty personnel into the on-duty personnel sequence according to the insertion sequence number by calculating the insertion sequence number is the aforementioned step S24, taking the on-duty personnel department sequence as the remaining on-duty personnel department sequence, extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and then calculating the insertion sequence number iInsert(iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information, and then filling each on-duty personnel into the sequence element in which the iInsert(iK)th on-duty personnel in the on-duty personnel sequence is empty, until the remaining on-duty personnel department sequence is empty. Among them, the insertion sequence number iInsert(iK) is calculated in the following way:
[0072] iInsert(iK)=ROUNDUP(NR*(1+(iK-1)*NK) / x); where,
[0073] iK represents the ordinal number of the duty personnel in the department duty personnel queue in the extracted duty personnel department information, and the value ranges from 1 to NK; wherein NK is the number of department duty personnel in the extracted duty personnel department information;
[0074] iInsert(iK) represents the insertion sequence number corresponding to the iKth on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information;
[0075] ROUNDUP is the round-up function;
[0076] NR is the total number of on-duty personnel in the remaining on-duty personnel department sequence;
[0077] x is the value of the copy. If NK is 1, then x=2, otherwise x=NK*NK.
[0078] Step S24 is a loop processing step. Each round of the loop processes the first on-duty personnel sub-department information in the remaining on-duty personnel sub-department sequence, makes arrangements for the on-duty personnel in the first on-duty personnel sub-department information, and removes the first on-duty personnel sub-department information from the remaining on-duty personnel sub-department sequence. The number of cycles depends on the number of departments in the on-duty personnel sub-department sequence. The number of departments in the on-duty personnel sub-department sequence is the number of on-duty personnel sub-department information in the on-duty personnel sub-department sequence. The on-duty personnel in the on-duty personnel sub-department information is the on-duty personnel in the department on-duty personnel queue in the on-duty personnel sub-department information. Take the above-mentioned example of the on-duty personnel sub-department sequence as an example:
[0079] In the first cycle, the remaining on-duty personnel department sequence is equal to the original on-duty personnel department sequence, and the on-duty personnel of department G are processed. At this time, NR=NT=21. Since the number of on-duty personnel in department G is NK=1, x=2. Accordingly, the insertion number of personnel G1, iInsert(1)=ROUNDUP(21*(1+(1-1)*1) / 2)=ROUNDUP(10.5)=11. Therefore, in the on-duty personnel sequence, O_11=personnel G1 is filled in.
[0080] In the second cycle, the remaining on-duty personnel by department sequence excludes the on-duty personnel by department information of department G, and the remaining on-duty personnel by department information of department F, department E, department D, department C, department A and department B are processed. The on-duty personnel of department F are processed. At this time, NR=20. Since the number of on-duty personnel in department F is NK=1, x=2. Accordingly, the insertion number of person F1, iInsert(1)=ROUNDUP(20*(1+(1-1)*1) / 2)=ROUNDUP(10)=10. Therefore, in the on-duty personnel sequence, fill in O_10=person F1.
[0081] In the third cycle, the remaining on-duty personnel department sequence excludes the on-duty personnel department information of departments G and F, and the remaining on-duty personnel department information of departments E, D, C, A and B is processed by the on-duty personnel of department E. At this time, NR=19. Since the number of on-duty personnel in department E NK=2, x=4. Correspondingly, the insertion ordinal numbers iInsert(1) of personnel E1 and iInsert(2) of personnel E2 are:
[0082] iInsert(1)=ROUNDUP(19*(1+(1-1)*2) / 4)=ROUNDUP(4.75)=5;
[0083] iInsert(2)=ROUNDUP(19*(1+(2-1)*2) / 4)=ROUNDUP(14.25)=15;
[0084] At this time, in the on-duty personnel sequence, the 5th empty sequence element is O_5, so fill in O_5=personnel E1; the 15th empty sequence element is O_17, so fill in O_17=personnel E2.
[0085] In the fourth cycle, the remaining on-duty personnel department sequence excludes the on-duty personnel department information of departments G, F and E, and the remaining on-duty personnel department information of departments D, C, A and B is processed. The on-duty personnel of department D are processed. At this time, NR=17. Since the number of on-duty personnel in department D is NK=2, x=4. Accordingly, the insertion ordinal number iInsert(1) of personnel D1 and the insertion ordinal number iInsert(2) of personnel D2 are:
[0086] iInsert(1)=ROUNDUP(17*(1+(1-1)*2) / 4)=ROUNDUP(4.25)=5;
[0087] iInsert(2)=ROUNDUP(17*(1+(2-1)*2) / 4)=ROUNDUP(12.75)=13;
[0088] At this time, in the on-duty personnel sequence, the 5th empty sequence element is O_6, so fill in O_6=personnel D1; the 13th empty sequence element is O_16, so fill in O_16=personnel D2.
[0089] In the fifth cycle, the remaining on-duty personnel department sequence excludes the on-duty personnel department information of departments G, F, E and D, and the remaining on-duty personnel department information of departments C, A and B is processed. The on-duty personnel of department C are processed. At this time, NR=15. Since the number of on-duty personnel in department C is NK=3, x=9. Correspondingly, the insertion ordinal numbers iInsert(1), iInsert(2), and iInsert(3) of personnel C1, C2, and C3 are:
[0090] iInsert(1)=ROUNDUP(15*(1+(1-1)*3) / 9)=ROUNDUP(1.67)=2;
[0091] iInsert(2)=ROUNDUP(15*(1+(2-1)*3) / 9)=ROUNDUP(6.67)=7;
[0092] iInsert(3)=ROUNDUP(15*(1+(3-1)*3) / 9)=ROUNDUP(11.67)=12.
[0093] At this time, in the on-duty personnel sequence, the second empty sequence element is O_2, so fill in O_2=personnel C1; the seventh empty sequence element is O_9, so fill in O_9=personnel C2; the twelfth empty sequence element is O_18, so fill in O_18=personnel C3.
[0094] In the sixth cycle, the remaining on-duty personnel department sequence excludes the on-duty personnel department information of departments G, F, E, D, and C. The remaining on-duty personnel department information of departments A and B is processed, and the on-duty personnel of department A are processed. At this time, NR=12. Since the number of on-duty personnel in department A is NK=5, x=25. Correspondingly, the insertion ordinal numbers iInsert(1), iInsert(2), iInsert(3), iInsert(4), and iInsert(5) of personnel A1, A2, A3, A4, and A5 are:
[0095] iInsert(1)=ROUNDUP(12*(1+(1-1)*5) / 25)=ROUNDUP(0.48)=1;
[0096] iInsert(2)=ROUNDUP(12*(1+(2-1)*5) / 25)=ROUNDUP(2.88)=3;
[0097] iInsert(3)=ROUNDUP(12*(1+(3-1)*5) / 25)=ROUNDUP(5.28)=6;
[0098] iInsert(4)=ROUNDUP(12*(1+(4-1)*5) / 25)=ROUNDUP(7.68)=8;
[0099] iInsert(5)=ROUNDUP(12*(1+(5-1)*5) / 25)=ROUNDUP(10.08)=11.
[0100] At this time, in the on-duty personnel sequence, the first empty sequence element is O_1, so fill in O_1=personnel A1;
[0101] The third empty sequence element is O_4, so fill in O_4=personnel A2;
[0102] The sixth empty sequence element is O_12, so fill in O_12=personnel A3;
[0103] The 8th empty sequence element is O_14, so fill in O_14=personnel A4;
[0104] The 11th empty sequence element is O_20, so fill in O_20=personnel A5.
[0105] In the seventh cycle, the remaining on-duty personnel are divided into departmental sequence department B on-duty personnel information, and the on-duty personnel of department B are processed. At this time, NR=NK=7, x=49. Correspondingly, the insertion ordinal numbers iInsert(1), iInsert(2), iInsert(3), iInsert(4), iInsert(5), iInsert(6), iInsert(7) of personnel B1, B2, B3, B4, B5, B6 and B7 are respectively:
[0106] iInsert(1)=ROUNDUP(7*(1+(1-1)*7) / 49)=ROUNDUP(0.14)=1;
[0107] iInsert(2)=ROUNDUP(7*(1+(2-1)*7) / 49)=ROUNDUP(1.14)=2;
[0108] iInsert(3)=ROUNDUP(7*(1+(3-1)*7) / 49)=ROUNDUP(2.14)=3;
[0109] iInsert(4)=ROUNDUP(7*(1+(4-1)*7) / 49)=ROUNDUP(3.14)=4;
[0110] iInsert(5)=ROUNDUP(7*(1+(5-1)*7) / 49)=ROUNDUP(4.14)=5;
[0111] iInsert(6)=ROUNDUP(7*(1+(6-1)*7) / 49)=ROUNDUP(5.14)=6;
[0112] iInsert(7)=ROUNDUP(7*(1+(7-1)*7) / 49)=ROUNDUP(6.14)=7.
[0113] At this time, in the on-duty personnel sequence, the first empty sequence element is O_3, so fill in O_3 = personnel B1;
[0114] The second empty sequence element is O_7, so fill in O_7=personnel B2;
[0115] The third empty sequence element is O_8, so fill in O_8=personnel B3;
[0116] The fourth empty sequence element is O_13, so fill in O_14 = person B4;
[0117] The fifth empty sequence element is O_15, so fill in O_20 = person B5;
[0118] The fourth empty sequence element is O_19, so fill in O_14 = person B6;
[0119] The fifth empty sequence element is O_21, and O_20=personnel B7 is filled in.
[0120] The final sequence of on-duty personnel is:
[0121] O_1=personnel A1
[0122] O_2 = Personnel C1
[0123] O_3=Personnel B1
[0124] O_4 = Personnel A2
[0125] O_5=Personnel E1
[0126] O_6=Personnel D1
[0127] O_7=Personnel B2
[0128] O_8=Personnel B3
[0129] O_9=Personnel C2
[0130] O_10=Personnel F1
[0131] O_11=Personnel G1
[0132] O_12=Personnel A3
[0133] O_13=Personnel B4
[0134] O_14=Personnel A4
[0135] O_15=Personnel B5
[0136] O_16=Personnel D2
[0137] O_17=Personnel E2
[0138] O_18=Personnel C3
[0139] O_19=Personnel B6
[0140] O_20=Personnel A5
[0141] O_21=Personnel B7.
[0142] In another optional implementation, step S24 can be decomposed into the following steps:
[0143] Step S241: Count the total number of on-duty personnel NR in the department sequence of the remaining on-duty personnel, and initialize the remaining on-duty personnel sequence according to NR; the initialized remaining on-duty personnel sequence is a sequence composed of NR sequence elements indicating that the number of on-duty personnel is empty;
[0144] Step S242: extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and deleting the extracted on-duty personnel department information from the remaining on-duty personnel department sequence;
[0145] Step S243: calculating the insertion sequence number iInsert (iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information;
[0146] Step S244: fill each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information into the remaining on-duty personnel sequence in accordance with the method of filling the iKth on-duty personnel into the iInsert(iK)th sequence element in the remaining on-duty personnel sequence;
[0147] Step S245: copy the remaining on-duty personnel sequence as a whole to the on-duty personnel sequence in such a manner that the i-th sequence element of the remaining on-duty personnel sequence corresponds to the sequence element in the on-duty personnel sequence where the i-th on-duty personnel is empty;
[0148] Step S246: Determine whether the remaining on-duty personnel department sequence is empty. If the remaining on-duty personnel department sequence is not empty, repeat steps S241 to S245 in sequence, otherwise end.
[0149] The above implementation differs from the aforementioned implementation in that, when filling each on-duty personnel into the sequence element in which the iInsert(iK)th on-duty personnel in the on-duty personnel sequence is empty, the above implementation constructs a remaining on-duty personnel sequence, and completes the step of filling the on-duty personnel into the on-duty personnel sequence by overall copying the remaining on-duty personnel sequence, which is essentially the same.
[0150] In addition, it should be pointed out that in the aforementioned step S24, the "extract" in "extract the first on-duty personnel department information from the remaining on-duty personnel department sequence" means treating the remaining on-duty personnel department sequence as a stack, and "extracting" is equivalent to the stacking process.
[0151] The step of configuring the duty personnel for the segment time list is the aforementioned step S3, traversing the segment time list, configuring the corresponding duty personnel for the traversed segment time according to the cyclic order of the duty personnel sequence, and forming a duty schedule. In step S3, in simple terms, the duty personnel sequence is regarded as a cyclic sequence, and the duty personnel are sequentially selected in this cyclic sequence to configure the duty personnel for each segment time in the segment time list one by one.
[0152] In another optional implementation, the input in step S1 may also include conflict rules. That is, step S1 may also include obtaining conflict rules. When configuring the duty personnel for the traversed segment time in step S3, it is detected whether the duty personnel meets the conflict rules. If the conflict rules are met, the next duty personnel in the cyclic order of the duty personnel sequence is configured for the traversed segment time. Compliance with the conflict rules here means that there is an unsatisfied conflict. For example, the conflict rule defines that female employees cannot be arranged to work at night. Accordingly, compliance with the conflict rules means that the current segment time is night and the duty personnel is a female employee; the conflict rule defines that a certain duty personnel cannot be arranged to work at night continuously. Accordingly, compliance with the conflict rules means that the current segment time is night and the duty personnel was on duty at night last time; a certain duty personnel cannot be arranged to work on holidays continuously. Accordingly, compliance with the conflict rules means that the current segment time is a holiday and the duty personnel was arranged to work on the last holiday; and so on. At this time, step S3 can be specifically decomposed into the following steps:
[0153] Step S31: iT=1, iP=1;
[0154] Step S32: If iT is greater than countT, then end, otherwise go to step S33; where countT is the number of segment time in the segment time list;
[0155] Step S33: Check whether the iP%NTth on-duty personnel in the on-duty personnel sequence meets the conflict rule according to the conflict rule and the segment time of the assigned on-duty personnel; if it meets the conflict rule, then iP is increased by 1 and step S33 is repeated until it does not meet the conflict rule;
[0156] Step S34: assigning the on-duty personnel of the ith segment time in the segment time list as the ith on-duty personnel in the on-duty personnel sequence;
[0157] Step S35: After iT is increased by 1, return to step S32.
[0158] In addition, it should be pointed out that the device for multi-department duty scheduling referred to in the present invention is a virtual device implemented by executing computer program instructions, and the modules it contains correspond one-to-one to the steps in the method for multi-department duty scheduling, and no further elaboration is needed.
Claims
1. A method for multi-department duty scheduling, characterized in that: The method comprises the following steps: Step S1: Obtain a set of on-duty personnel and a segmented time list; the set of on-duty personnel is a set of on-duty personnel information; the on-duty personnel information includes the department to which the on-duty personnel belong; Step S2: sorting the set of on-duty personnel by department and obtaining an on-duty personnel sequence; Step S3: traverse the segment time list, and configure corresponding duty personnel for the traversed segment time according to the cyclic order of the duty personnel sequence to form a duty schedule; The step S2 comprises the following steps: Step S21: according to the departments to which the on-duty personnel belong, the on-duty personnel set is divided into departments to obtain an on-duty personnel department set; the on-duty personnel department set is a set of on-duty personnel department information; the on-duty personnel department information includes the department to which they belong, the number of on-duty personnel in the department and the on-duty personnel queue of the department; Step S22: sorting the on-duty personnel department set in the order of the number of on-duty personnel in the department from small to large to obtain an on-duty personnel department sequence; Step S23: Count the total number of on-duty personnel NT in the on-duty personnel department sequence, and then initialize the on-duty personnel sequence according to NT; the initialized on-duty personnel sequence is a sequence composed of NT sequence elements indicating that the number of on-duty personnel is empty; Step S24: Taking the on-duty personnel department sequence as the remaining on-duty personnel department sequence, extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and then calculating the insertion ordinal number iInsert(iK) of each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information, and then filling each on-duty personnel into the sequence element in which the iInsert(iK)th on-duty personnel in the on-duty personnel sequence is empty, until the remaining on-duty personnel department sequence is empty; wherein, the insertion ordinal number iInsert(iK) is calculated in the following manner: iInsert(iK)=ROUNDUP(NR*(1+(iK-1)*NK) / x); where, iK represents the ordinal number of the duty personnel in the department duty personnel queue in the extracted duty personnel department information, and the value ranges from 1 to NK; wherein NK is the number of department duty personnel in the extracted duty personnel department information; iInsert(iK) represents the insertion sequence number corresponding to the iKth on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information; ROUNDUP is the round-up function; NR is the total number of on-duty personnel in the remaining on-duty personnel department sequence; x is the value of the copy. If NK is 1, then x=2, otherwise x=NK*NK.
2. The method for multi-department duty scheduling according to claim 1, characterized in that: The step S24 comprises the following steps: Step S241: Count the total number of on-duty personnel NR in the department sequence of the remaining on-duty personnel, and initialize the remaining on-duty personnel sequence according to NR; the initialized remaining on-duty personnel sequence is a sequence composed of NR sequence elements indicating that the number of on-duty personnel is empty; Step S242: taking the first on-duty personnel department information from the remaining on-duty personnel department sequence, and deleting the extracted on-duty personnel department information from the remaining on-duty personnel department sequence; Step S243: calculating the insertion sequence number iInsert (iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information; Step S244: fill each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information into the remaining on-duty personnel sequence in accordance with the method of filling the iKth on-duty personnel into the iInsert(iK)th sequence element in the remaining on-duty personnel sequence; Step S245: copying the entire remaining on-duty personnel sequence to the on-duty personnel sequence in such a manner that the i-th sequence element of the remaining on-duty personnel sequence corresponds to the sequence element in the on-duty personnel sequence where the i-th on-duty personnel is empty; Step S246: Determine whether the remaining on-duty personnel department sequence is empty. If the remaining on-duty personnel department sequence is not empty, repeat steps S241 to S245 in sequence, otherwise end.
3. The method for multi-department duty scheduling according to claim 1, characterized in that: The step S1 also includes obtaining conflict rules; in the step S3, when configuring the on-duty personnel for the traversed segment time, it is detected whether the on-duty personnel meets the conflict rules. If the conflict rules are met, the next on-duty personnel in the cyclic order of the on-duty personnel sequence is configured for the traversed segment time.
4. A device for scheduling multi-department shifts, characterized in that: The device includes the following modules: Module M1 is used to obtain a set of on-duty personnel and a segmented time list; the set of on-duty personnel is a set of on-duty personnel information; the on-duty personnel information includes the department to which the on-duty personnel belongs; Module M2 is used to: sort the set of on-duty personnel by department and obtain a sequence of on-duty personnel; Module M3 is used to: traverse the segment time list, configure corresponding duty personnel for the traversed segment time according to the cyclic order of the duty personnel sequence, and form a duty schedule; The module M2 includes the following modules: Module M21 is used to: divide the on-duty personnel set into departments according to the departments to which the on-duty personnel belong, to obtain a on-duty personnel department set; the on-duty personnel department set is a set of on-duty personnel department information; the on-duty personnel department information includes the department to which they belong, the number of on-duty personnel in the department, and the on-duty personnel queue in the department; Module M22 is used to: sort the on-duty personnel department set in the order of the number of on-duty personnel in the department from small to large to obtain an on-duty personnel department sequence; Module M23, used for: counting the total number of on-duty personnel NT in the on-duty personnel department sequence, and then initializing the on-duty personnel sequence according to NT; the initialized on-duty personnel sequence is a sequence composed of NT sequence elements indicating that the on-duty personnel are empty; Module M24 is used to: use the on-duty personnel department sequence as the remaining on-duty personnel department sequence, extract the first on-duty personnel department information from the remaining on-duty personnel department sequence, and then calculate the insertion ordinal number iInsert(iK) of each on-duty personnel for each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information, and then fill each on-duty personnel into the sequence element in which the iInsert(iK)th on-duty personnel in the on-duty personnel sequence is empty, until the remaining on-duty personnel department sequence is empty; wherein, the insertion ordinal number iInsert(iK) is calculated in the following manner: iInsert(iK)=ROUNDUP(NR*(1+(iK-1)*NK) / x); where, iK represents the ordinal number of the duty personnel in the department duty personnel queue in the extracted duty personnel department information, and the value ranges from 1 to NK; wherein NK is the number of department duty personnel in the extracted duty personnel department information; iInsert(iK) represents the insertion sequence number corresponding to the iKth on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information; ROUNDUP is the round-up function; NR is the total number of on-duty personnel in the remaining on-duty personnel department sequence; x is the value of the copy. If NK is 1, then x=2, otherwise x=NK*NK.
5. The device for multi-department duty scheduling according to claim 4, characterized in that: The module M24 includes the following modules: Module M241 is used to: count the total number of on-duty personnel NR of the remaining on-duty personnel in the department sequence, and initialize the remaining on-duty personnel sequence according to NR; the initialized remaining on-duty personnel sequence is a sequence composed of NR sequence elements indicating that the number of on-duty personnel is empty; Module M242, used for: extracting the first on-duty personnel department information from the remaining on-duty personnel department sequence, and deleting the extracted on-duty personnel department information from the remaining on-duty personnel department sequence; Module M243, used for: calculating the insertion sequence number iInsert (iK) of each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information; Module M244, used for: filling in the iKth on-duty personnel in the iInsert(iK)th sequence element in the remaining on-duty personnel sequence with the device, and filling in each on-duty personnel in the department on-duty personnel queue in the extracted on-duty personnel department information into the remaining on-duty personnel sequence; Module M245, used to: copy the remaining on-duty personnel sequence as a whole to the on-duty personnel sequence in such a manner that the i-th sequence element of the remaining on-duty personnel sequence corresponds to the sequence element in the on-duty personnel sequence in which the i-th on-duty personnel is empty; Module M246 is used to determine whether the sequence of the remaining on-duty personnel by department is empty. If the sequence of the remaining on-duty personnel by department is not empty, the functions of modules M241 to M245 are repeatedly executed in sequence, otherwise the process ends.
6. The device for multi-department duty scheduling according to claim 4, characterized in that: The module M1 also includes obtaining conflict rules; when configuring the on-duty personnel for the traversed segment time in the module M3, it is detected whether the on-duty personnel meets the conflict rules. If the conflict rules are met, the next on-duty personnel in the cyclic order of the on-duty personnel sequence is configured for the traversed segment time.
7. A machine-readable medium storing a program instruction set that can be read by a machine; characterized in that: When the program instruction set stored in the medium is read by a machine and loaded for execution, the method for multi-department duty scheduling according to any one of claims 1 to 3 can be implemented.
8. An electronic device, comprising a processor and a memory; the memory stores a program instruction set; characterized in that: When the program instruction set stored in the memory is executed by the processor, the device can implement the method for multi-department duty scheduling according to any one of claims 1 to 3.
Citation Information
Patent Citations
Automatic scheduling system
CN106952079A
Dynamic design method of subway environmental control system
CN110135075A
Cited By
Multi-parameter fusion load balancing scheduling adaptation system and method
CN121073158A
Multi-parameter fusion load balancing scheduling adaptation system and method
CN121073158B