Scheduling scheme generation method and device, equipment and storage medium
By generating and evaluating scheduling solutions by generating and evaluating scheduling solutions, the problem of unbalanced workload in traditional scheduling methods is solved, more efficient and flexible scheduling management is achieved, and employee satisfaction and enterprise adaptability are improved.
Patent Information
- Application Number
- CN202510573439.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
The traditional scheduling method lacks systematic analysis and optimization capabilities, resulting in uneven workload allocation, affecting work efficiency and employee satisfaction, and making it difficult to adapt to dynamically changing work needs.
Generative adversarial network is adopted, and the shift scheduling scheme is generated and evaluated through multi-level generators and discriminators, taking into account the working duration, work content and work intensity and other factors, and a graph convolutional network and a variational autoencoder are used to generate diversified solutions, and the shift scheduling scheme is optimized in combination with the multi-objective evaluation mechanism.
It improves the reliability and balance of the scheduling plan, improves work efficiency and employee satisfaction, and can be dynamically adjusted to adapt to changes in corporate needs.
Smart Images

Figure CN120494371A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a method, device, equipment and storage medium for generating a shift scheduling plan. Background Art
[0002] Proper shift scheduling is crucial for improving work efficiency and employee satisfaction. Traditional scheduling methods, which rely primarily on manual experience or simple rule-based algorithms, can meet business needs to a certain extent. However, as businesses expand and workloads become more complex, their limitations gradually become apparent. Specifically, traditional scheduling methods often lack systematic analysis and optimization capabilities. The resulting schedules, when executed, can easily lead to uneven workload distribution, reducing overall employee productivity and impacting work quality and employee well-being. Summary of the Invention
[0003] The present application provides a method, apparatus, device and storage medium for generating a shift scheduling plan, which are used to solve the problem of insufficient reliability of existing shift scheduling methods.
[0004] A first aspect of an embodiment of the present application provides a method for generating a shift scheduling plan, the method comprising:
[0005] Obtaining shift scheduling information, the shift scheduling information including at least one of the following: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical shift scheduling record information, and company business demand information;
[0006] Inputting the scheduling information into a multi-level generator of a generative adversarial network, so that each level of generator generates a corresponding initial scheduling plan based on a preset workload weight parameter; wherein the workload weight parameter represents a weight parameter of one or more of the working hours, work content, and work intensity in the generated initial scheduling plan, and the workload weight parameters are different between the multiple levels of the generator; wherein the generative adversarial network includes the multi-level generator and the multi-level discriminator;
[0007] Inputting the initial scheduling plan into the multi-level discriminator of the generative adversarial network, allowing each level of discriminator to evaluate the initial scheduling plan respectively, generating a corresponding initial evaluation result, and integrating the initial evaluation results output by the discriminators at each level to obtain a final evaluation result for each of the initial scheduling plans;
[0008] A target shift scheduling scheme is determined from the plurality of initial shift scheduling schemes according to the final evaluation result.
[0009] A second aspect of the present application further provides a scheduling plan generation device, which is used to execute the scheduling plan generation method described in the first aspect. The device includes:
[0010] An input module for obtaining shift scheduling information, wherein the shift scheduling information includes at least one of the following: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical shift scheduling record information, and company business demand information;
[0011] A generative adversarial network, comprising a multi-level generator and a multi-level discriminator; wherein each level of the multi-level generator is used to generate a corresponding initial scheduling plan based on the scheduling information and a preset workload weight parameter; wherein the workload weight parameter represents a weight parameter of one or more of the working hours, work content, and work intensity in the generated initial scheduling plan, and the workload weight parameters are different between the multiple levels of the generator;
[0012] Each level of the multi-level discriminator is used to evaluate the initial scheduling plan and generate a corresponding initial evaluation result. The multi-level discriminator integrates the initial evaluation results output by the discriminators at each level to obtain a final evaluation result for each of the initial scheduling plans; and determines a target scheduling plan from the multiple initial scheduling plans based on the final evaluation result.
[0013] A third aspect of an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the scheduling plan generation method described in the first aspect are implemented.
[0014] The fourth aspect of the embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method for generating a shift schedule as described in the first aspect are implemented.
[0015] The beneficial effects of the present application are as follows: the scheduling scheme generation method proposed in the present application uses a generative adversarial network to generate a suitable target scheduling scheme based on the input scheduling information. Among them, the generative adversarial network includes a multi-level generator, and a multi-dimensional workload weight parameter (a weight parameter of one or more of the working hours, work content and work intensity in the generated scheduling scheme) is introduced into the generator. By comprehensively considering multiple factors such as working hours, work content and work intensity, an initial scheduling scheme is generated. The multi-level generators use different workload weight parameters to generate initial scheduling schemes from different directions, and the discriminator evaluates them to identify the optimal scheduling scheme with a more balanced workload (target scheduling scheme), thereby improving the reliability of the scheduling method.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the following is a brief introduction to the drawings required for the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without inventive effort. It should be noted that the proportions in the drawings are for illustration only and do not represent the actual proportions.
[0018] Figure 1 This is a flowchart of the steps of a method for generating a shift schedule in an embodiment of the present application;
[0019] Figure 2 This is a schematic diagram of the structure of a generative adversarial network in an embodiment of the present application;
[0020] Figure 3 This is a schematic diagram of a generation process of a scheduling plan in an embodiment of the present application;
[0021] Figure 4 This is a flow chart of a global optimization process for a scheduling scheme in an embodiment of the present application;
[0022] Figure 5 This is a structural diagram of a shift scheduling plan generating device in an embodiment of the present application;
[0023] Figure 6 It is a schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0024] To make the above-mentioned purposes, features, and advantages of this application more clearly understood, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of this application.
[0025] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first" and "second" are generally of the same type, and do not limit the number of objects. For example, the first object can be one or at least two. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0026] In modern enterprise management, effective scheduling is crucial for improving work efficiency and employee satisfaction. Traditional scheduling methods, which primarily rely on manual experience or simple rule-based algorithms, can meet business needs to a certain extent. However, as enterprises expand and workloads become more complex, their limitations gradually become apparent. Firstly, traditional scheduling methods often lack systematic analysis and optimization capabilities, leading to uneven workload distribution. Employees may experience excessive workloads during certain periods while experiencing less workload during other periods. This situation not only reduces overall work efficiency but can also lead to employee dissatisfaction and fatigue, impacting work quality and their physical and mental well-being. Secondly, traditional scheduling methods are often static and lack flexibility and adaptability. In real-world work environments, work demands and employee status are constantly changing. Static scheduling plans are difficult to adjust and optimize in a timely manner, resulting in scheduling that fails to adapt to actual needs and hinders work effectiveness. For example, traditional scheduling methods struggle to quickly respond to unexpected tasks or employees taking temporary leave, making it difficult to make appropriate adjustments, leading to chaotic work arrangements. Among the related technologies, some scheduling optimization methods based on heuristic algorithms, integer programming and linear programming use mathematical models and algorithms to optimize scheduling. Although they have improved the rationality and optimization level of scheduling plans to a certain extent, these methods usually require a lot of computing resources and time, making it difficult to achieve real-time optimization in practical applications.
[0027] In view of the above problems, the present application provides a method, device, equipment and storage medium for generating a scheduling scheme, which uses a generative adversarial network to generate a suitable target scheduling scheme based on the input scheduling information. Among them, the generative adversarial network includes a multi-level generator, and a multi-dimensional workload weight parameter (a weight parameter of one or more of the working hours, work content and work intensity in the generated scheduling scheme) is introduced into the generator. By comprehensively considering multiple factors such as working hours, work content and work intensity, an initial scheduling scheme is generated. The multi-level generators use different workload weight parameters to generate initial scheduling schemes from different directions, and the discriminator evaluates them to identify the optimal scheduling scheme with a more balanced workload (target scheduling scheme), thereby improving the reliability of the scheduling method and taking into account the balance of multiple aspects such as working hours, work content, work intensity, employee satisfaction and company business needs.
[0028] The first aspect of this application proposes a method for generating a scheduling plan, referring to Figure 1 , Figure 1 A flowchart of the steps of a method for generating a shift plan is shown in FIG. Figure 1 As shown, the method includes:
[0029] Step S101, obtaining scheduling information, wherein the scheduling information includes at least one of the following: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical scheduling record information, and company business demand information.
[0030] Specifically, the scheduling information is information related to the work that needs to be completed for scheduling, including at least one of the following: employee working hour information, which refers to the historical working hour information of each employee when previously scheduled, for example, employee A works 6 hours a day; employee work content information, which refers to the historical work content of each employee when previously scheduled, for example, the work performed by employee B each time scheduled is work content b; employee work intensity information, which refers to the skill level of each employee in each work skill, for example, employee C has an excellent skill level in work skill 1; historical scheduling record information refers to the historical scheduling records of each employee, such as the historical scheduling records of employee D; company business demand information refers to the fact that in order to meet production requirements, the company may need to arrange working hours for different shifts, such as morning shift, mid-shift, night shift, etc.
[0031] Step S102: Input the scheduling information into a multi-level generator of a generative adversarial network, so that each level of generator generates a corresponding initial scheduling plan based on a preset workload weight parameter; wherein the workload weight parameter represents the weight parameter of one or more of the working hours, work content and work intensity in the generated initial scheduling plan, and the workload weight parameters between the multi-level generators are different; wherein the generative adversarial network includes the multi-level generator and the multi-level discriminator.
[0032] Step S103: Input the initial scheduling plan into the multi-level discriminator of the generative adversarial network, so that each level of discriminator evaluates the initial scheduling plan respectively, generates a corresponding initial evaluation result, and integrates the initial evaluation results output by the discriminators at each level to obtain the final evaluation result of each initial scheduling plan.
[0033] Step S104: determining a target scheduling plan from the multiple initial scheduling plans according to the final evaluation result.
[0034] This embodiment proposes to generate an appropriate scheduling plan (target scheduling plan) based on the input scheduling information based on the generative adversarial network. The target scheduling plan includes information such as the scheduling time, work content, and work intensity of each employee in this scheduling. Figure 2 , Figure 2 A schematic diagram of the structure of a generative adversarial network is shown in FIG. Figure 2 As shown, the generative adversarial network includes a multi-level generator and a multi-level discriminator, and L is a positive integer greater than 1. The multi-level generator includes multiple cascaded generators, and each level of generator G l Used to generate initial scheduling plans in different aspects based on the input scheduling information; multi-level discriminator D l They are used to evaluate different aspects of each initial scheduling plan, where l represents the lth level. Generative Adversarial Networks (GANs) is a deep learning model consisting of two parts: a generator and a discriminator. The goal of the generator is to generate fake data that is as close to the real data as possible (in this embodiment, the goal is to generate an initial scheduling plan that is as close to the optimal sample scheduling plan as possible), while the goal of the discriminator is to distinguish between real data and fake data generated by the generator (in this embodiment, the goal of the discriminator is to determine the most appropriate target scheduling plan). These two parts (generator and discriminator) compete with each other during the training process to improve the quality of the generated data. In this embodiment, they are used to generate and evaluate scheduling plans, with the goal of optimizing the balance of employee workload, employee satisfaction, and the matching degree of the company's business needs.
[0035] To improve the reliability of the scheduling scheme generation method and ensure that the generated scheduling scheme can achieve a balanced consideration of multiple aspects (such as working hours, work content, and work intensity), the present embodiment proposes improvements to the generator and discriminator in the generative adversarial network. The scheduling scheme generation method proposed in the present embodiment is described in detail below in accordance with Sections 1.1-1.5.
[0036] 1.1. Specific description of the generator.
[0037] In the Generative Adversarial Network, multiple generators are not completely independent. Each level of generator G l Responsible for generating different aspects of the scheduling plan, and they are separated by the discriminator D l For example, a primary generator might focus on basic workload distribution, while a higher-level generator optimizes more detailed aspects, such as employee satisfaction and alignment with company business needs. The output of the previous generator serves as the input for the next generator, creating a hierarchical relationship between generators. Each generator further optimizes the scheduling solution based on the previous generator, ultimately generating the optimal scheduling solution through step-by-step optimization using a multi-level generative adversarial network.
[0038] 1.1.1. Introduce multi-dimensional workload weight parameters in the generator.
[0039] In step S102, each level of generator generates a corresponding initial scheduling plan based on a preset workload weight parameter; wherein the workload weight parameter represents a weight parameter of one or more of the working hours, work content and work intensity in the generated initial scheduling plan, and the workload weight parameters between the generators at multiple levels are different.
[0040] The embodiment of the present application proposes to set different workload weight parameters in each level of generator, so that each level of generator can focus on different aspects and comprehensively consider the working time T i 、Work content C j and work intensity I k Factors, generate initial scheduling plan
[0041]
[0042] in, is the initial scheduling plan output by the l-th level generator, They represent the weight parameters of working hours, work content and work intensity at level l, N, U and V represent the data dimensions of working hours, work content and work intensity, respectively. i represents the working hours of the i-th employee, Cj Indicates the job content of the jth employee, I k Indicates the work intensity of the kth employee.
[0043] Traditional scheduling methods typically only consider single factors such as working hours, work content, and work intensity, or simply treat them as independent variables. This embodiment of the application introduces a multi-dimensional workload weight parameter into the generator, comprehensively considering multiple factors such as working hours, work content, and work intensity to generate an initial scheduling plan. This ensures that the scheduling plan is balanced across different dimensions, significantly improving work efficiency and employee satisfaction.
[0044] 1.1.2. Combine graph convolutional networks and variational autoencoders in the generator.
[0045] This embodiment combines the feature extraction capability of graph convolutional networks with the generation capability of variational autoencoders to generate diverse scheduling solutions.
[0046] In one possible implementation, the generator includes: a graph convolutional network and a variational autoencoder; step S102 enables each level of the generator to generate a corresponding initial scheduling plan based on a preset workload weight parameter, including:
[0047] Step S1021: Based on the graph convolutional network, feature extraction is performed on the scheduling information to obtain a workload feature matrix. Specifically, the scheduling information is organized into a graph, where each node represents a corresponding employee and the edges represent the working relationships between employees or the relevance of work content. The workload feature matrix is extracted from the graph convolutional network to obtain the workload feature matrix, which represents the workload characteristics of each employee (such as working hours, work content, work intensity, etc.).
[0048] In one possible implementation, the graph convolutional network includes multiple cascaded graph convolutional layers. Step S1021 performs feature extraction on the scheduling information based on the graph convolutional network to obtain a workload feature matrix, including:
[0049] Step S1021-1, performing multi-level feature extraction on the scheduling information based on multiple graph convolution layers to obtain graph structure features extracted by the graph convolution layer at each level; see the output formula of the graph convolution layer in 1.1.2-1 below.
[0050] Step S1021-2, calculating the attention weight of each of the graph structure features;
[0051] Step S1021 - 3 , performing weighted summation on the graph structure features according to the attention weights to obtain the workload feature matrix.
[0052] Step S1022: Encode and decode the schedule information based on the variational autoencoder to obtain a decoding result.
[0053] Specifically, the variational autoencoder includes an encoder and a decoder, which are used to assist in generating more diverse scheduling schemes. The input of the variational autoencoder is the feature vector of the scheduling information (employee workload data), which represents the workload characteristics of each employee. The output of the variational autoencoder (decoding result) is a latent variable. This latent variable is a low-dimensional representation learned from the input data. The latent variable can be regarded as a compressed representation of the input data, which captures the key features of the input data. In addition, the output of the variational autoencoder (decoding result) also includes reconstructed input data, that is, the original input data reconstructed from the latent variable by the decoder. The latent variable obtained according to the decoding result will be used as one of the inputs of the generator to help the generator generate a variety of scheduling schemes in step S1023.
[0054] Step S1023: Generate the initial scheduling plan based on the workload weight parameter, in combination with the workload feature matrix and the decoding result.
[0055] Specifically, the latent variable in the decoding result is a low-dimensional representation learned from the input data, which captures the key features of the input data. The latent variable can be regarded as a hidden layer input in the generator network (or, the latent variable can be concatenated or weighted summed with the workload feature matrix of the graph convolutional network to generate a richer feature representation, which is then used as the input of the generator). By affecting the internal parameters or feature representation of the generator, it indirectly affects the output of the generator, helping the generator to generate diverse scheduling plans.
[0056] This embodiment proposes to use a combination of graph convolutional networks and variational autoencoders in the generator, where the graph convolutional network is used to extract the graph structural features of the workload (employee working hours information, employee work content information, employee work intensity information, etc. in the scheduling information), and the variational autoencoder is used to generate a variety of scheduling schemes. By constructing a graph convolutional network layer to extract the graph structural features of the workload, and the encoder and decoder network structure of the variational autoencoder, the generation capability and optimization level of the generative adversarial network are enhanced, enabling it to better handle and optimize complex scheduling problems. Thus, by combining the feature extraction capability of the graph convolutional network with the generation capability of the variational autoencoder, the generator is able to generate a variety of scheduling schemes that take into account not only the workload characteristics of employees, but also the work relationships between employees and the relevance of content.
[0057] 1.1.2-1. Graph Convolutional Network:
[0058] Specifically, a graph convolutional network (GCN) is a deep learning model for graph-structured data. This embodiment uses it to extract graph-structured features from employee workload data (such as employee work hours, work content, and work intensity information in scheduling information) to help generate diverse and optimized scheduling plans.
[0059] The graph convolution network includes multiple levels of graph convolution layers. In this embodiment, the structure of the graph convolution network is not specifically limited, that is, the implementation details of the graph convolution layer can be flexible to a certain extent, and its specific form does not need to be strictly limited. The main purpose of the graph convolution layer is to extract node features and graph structure information from the graph structure data to provide a basis for generating a reasonable scheduling plan. It only needs to be able to extract the graph structure features from the input information. The graph convolution network includes multiple graph convolution layers for extracting the graph structure features of the workload data. The output formula of the graph convolution layer is:
[0060] H (l+1) =σ(AH (l) W (l) );
[0061] Among them, H (l) Represents the feature matrix output by the l-th layer of graph convolutional layer, A represents the adjacency matrix of the graph, W (l) Represents the weight matrix of the lth layer of graph convolution layer, σ represents the activation function, which is used to convert the output into a probability distribution. Through multi-level graph structure feature extraction, the workload feature matrix H output by the final graph convolution network is obtained GCN .
[0062] 1.1.2-2, Attention Mechanism:
[0063] This embodiment also introduces an attention mechanism into the graph convolutional network to better balance the workload of different dimensions by calculating attention weights.
[0064] In step S1021-2, the attention weight is calculated according to the following formula:
[0065]
[0066] Among them, α t represents the attention weight at the t-th time step (t-th graph convolution layer), u t Represents the context vector, where the context vector is used in the attention mechanism to capture global features or task-specific information. It can be a learnable parameter vector, a task-specific vector, or a dynamically generated vector. a represents the attention weight matrix, H tThe feature matrix of the t-th time step is the graph structure feature output by the t-th graph convolution layer. The application of the attention mechanism in the graph convolution network is mainly to generate the final feature representation by weighted summation of the feature matrices extracted by multiple graph convolution layers. The workload feature matrix H GCN .
[0067] In step S1023, the generator at each level generates the initial scheduling plan based on the workload weight parameter, combined with the workload feature matrix output by the graph convolutional network and the decoding result output by the variational autoencoder.
[0068] Specifically, the output formula of the generator is:
[0069] P gen =softmax(W out ·H GCN +b put );
[0070] Among them, P gen represents the generated initial scheduling plan, W out represents the output weight matrix, H GCN represents the output feature matrix of the graph convolutional network, b out Indicates output bias;
[0071] The generator's structure primarily consists of two components: a graph convolutional network (GCN) and a variational autoencoder (VAE). The GCN is used to extract graph structural features, while the VAE is used to generate diverse scheduling solutions. By combining these two modules, the generator is able to generate reasonable and balanced scheduling solutions. The generator, incorporating the specific hierarchical structure of employee work habits and preferences, generates a reasonable initial scheduling solution based on a generation strategy designed to adapt to individual employee characteristics. Specifically, the generation strategy involves extracting employee graph structural features through a GCN to capture relationships and individual characteristics between employees. The generator also uses an attention mechanism to calculate attention weights, highlighting important feature dimensions and further enhancing adaptability to individual employee characteristics. The VAE's encoder and decoder generate diverse scheduling solutions that reflect individual employee characteristics. Finally, the softmax function in the output layer converts the decoding results into a probability distribution to generate an initial scheduling solution that represents each employee's work schedule during different time periods.
[0072] 1.2. Specific description of the discriminator.
[0073] This embodiment introduces a multi-objective evaluation mechanism into the discriminator, which takes into account workload balance, employee satisfaction, and the matching degree of the company's business needs when evaluating the scheduling plan. This can ensure that the scheduling plan is balanced in different dimensions and significantly improve work efficiency and employee satisfaction.
[0074] In one possible implementation, step S103 enables each level of discriminators to evaluate the initial scheduling plan respectively, generates a corresponding initial evaluation result, and integrates the initial evaluation results output by the discriminators at each level to obtain a final evaluation result for each initial scheduling plan, including:
[0075] Step S1031: Using each level of discriminators, based on preset scheduling evaluation weight parameters, the initial scheduling plan is evaluated from three aspects: workload balance, employee satisfaction, and company business demand matching, to obtain an initial evaluation result for the initial scheduling plan output by each level of discriminators; the initial evaluation result includes an evaluation score; wherein the scheduling evaluation weight parameters of the discriminator represent the weight parameters of the workload balance, the employee satisfaction, and the company business demand matching in the generated initial evaluation result, and the scheduling evaluation weight parameters between multiple levels of discriminators are different.
[0076] In this embodiment, the discriminator can adopt a deep neural network in combination with a multi-task learning architecture. Among them, the network hierarchy of the discriminator includes an input layer, multiple hidden layers and an output layer, and each layer adopts a ReLU activation function. In this embodiment, the specific architecture of the deep neural network is not limited. The multi-task learning architecture is used to simultaneously evaluate workload balance, employee satisfaction and company business demand matching (i.e., executing step S1031), and the deep neural network is used to integrate the initial evaluation results. The scheduling evaluation weight parameters between the multi-level discriminators are different, so that multiple discriminators evaluate the scheduling plan from different aspects. Among the scheduling evaluation weight parameters, workload balance represents the degree of balance between the workload of each employee in the scheduling plan (the average value of the difference between the employee working hours and the average working hours), employee satisfaction represents the overall satisfaction of the employees with the scheduling plan (the average value of the satisfaction of each employee), and the company business demand matching represents the overall matching degree between the scheduling plan and the company's business needs (the average value of the difference between the company's business needs and the average company's business needs in the scheduling plan).
[0077] In one possible implementation, the initial shift scheduling plan is evaluated based on the following formula, based on preset shift scheduling evaluation weight parameters, from three aspects: workload balance, employee satisfaction, and matching degree with company business needs:
[0078]
[0079] in, They represent the scheduling evaluation weight parameters of workload balance, employee satisfaction and company business demand matching in the discriminator at level l, T irepresents the working hours of the i-th employee in the initial scheduling plan, represents the average working time, S j Denotes the satisfaction score of the jth employee in the initial scheduling plan, D k represents the business demand of the kth company in the initial scheduling plan, represents the average company business needs, N, M, K represent the data dimensions of working hours, employee satisfaction and company business needs respectively. Among them, the employee satisfaction score S j These scores can come from historical data collection, simulated data generation, or real-time feedback systems. These scores are used as part of the evaluation metrics and loss function to ensure that the generated schedule meets the requirements in terms of employee satisfaction.
[0080] Step S1032: For each of the initial shift scheduling plans, the evaluation scores of the initial evaluation results output by the discriminators at each level are summed to obtain a final evaluation result of the initial shift scheduling plan.
[0081] Specifically, refer to Figure 3 , Figure 3 A schematic diagram of the generation process of a scheduling plan is shown in FIG. Figure 3 As shown, there are L generators and discriminators. Based on the input scheduling information, L generators generate l initial scheduling plans respectively. For each initial scheduling plan (such as Figure 3 The initial scheduling scheme 2) shown in the figure is input into L discriminators to obtain L initial evaluation results D l (P), such as Figure 3 The initial evaluation result 1, initial evaluation result 2, ... initial evaluation result 1 are shown. Thus, the evaluation scores of all the initial evaluation results are summed up to obtain the final evaluation result of the initial scheduling plan.
[0082] In step S104, based on the final evaluation results of each initial scheduling plan, a target scheduling plan is selected to ensure optimal workload balance, employee satisfaction, and matching of company business needs:
[0083]
[0084] Among them, P * represents the target scheduling scheme, L represents the total number of levels of the generative adversarial network, It represents the total evaluation score of all level discriminators for the initial scheduling plan P, that is, the final evaluation result of the initial scheduling plan.
[0085] Traditional discriminators are usually only responsible for evaluating the authenticity of the generated plan, which is generally a single evaluation mechanism. However, the embodiment of the present application introduces a multi-objective evaluation mechanism in each level of the discriminator to evaluate the scheduling plan P l When considering workload balance B l , employee satisfaction S l Matching degree with company's business needs M l , from the initial scheduling plans output by multiple generators, the optimal scheduling plan is determined as the target scheduling plan.
[0086] The discriminator uses a deep neural network combined with a multi-task learning architecture to simultaneously evaluate workload balance, employee satisfaction, and the degree of matching with the company's business needs. It achieves joint learning of different tasks by sharing hidden layer parameters. The introduction of the multi-task learning architecture improves the evaluation accuracy and robustness of the discriminator, and can more comprehensively evaluate the rationality and optimization level of the scheduling plan.
[0087] 1.3. Multi-round iterative optimization of generative adversarial networks.
[0088] This embodiment proposes to use the created training set and validation set to perform multiple rounds of iterations on the generator and discriminator in the generative adversarial network, and use the game process of the generator and discriminator to gradually optimize the scheduling plan, and finally generate a near-optimal scheduling plan.
[0089] In one possible implementation, the generative adversarial network is trained according to the following steps:
[0090] Step S201, create a training sample data set; the training sample data set includes multiple sample data and a real scheduling plan corresponding to each sample data, each sample data includes: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical scheduling record information and company business demand information.
[0091] First, we collected employee work hours, work content, work intensity, employee skill levels, historical shift records, and company business needs data to construct an employee workload dataset. We then preprocessed the dataset and divided it into a training set (i.e., a training sample dataset) and a validation set.
[0092] Specifically, it includes: collecting data related to employee working hours (i.e. employee working hours information), denoted as T i , where i represents the working hours of the i-th employee; collect data related to the employee's work content (i.e., employee work content information), denoted as C j, where j represents the work content of the jth employee; collect data related to employee work intensity (i.e., employee work intensity information), denoted as I k , where k represents the work intensity of the kth employee; collect data related to the employee's skill level (i.e., employee skill level information), denoted as S l , where l represents the skill level of the lth employee; collect historical scheduling record information, denoted as H m , where m represents the historical schedule record of the mth employee; collect the company's business demand information, recorded as D n , where n represents the business demand of the nth company (business demand means that in order to meet production requirements, the company may need to arrange different shifts of work, such as morning shift, afternoon shift, night shift, etc.). Based on the above information collected, the employee workload dataset E is constructed, including:
[0093] E={(T i ,C j ,I k ,S l ,H m ,D n )}. Each data in the workload dataset also needs to include the corresponding real shift scheduling plan, that is, the actual scheduled working hours, work content, and work intensity of each employee.
[0094] Then, the data in the employee workload dataset E is denoised and the moving average method is used to smooth the data to obtain the denoised employee workload dataset E. smoothed ; For the denoised employee workload dataset E smoothed Normalization is performed to scale the value of each data dimension to the interval [0,1]. Finally, the normalized employee workload dataset E norm The training set E is randomly divided into two parts according to the ratio of 8:2. train (i.e., training sample data set) and validation set E val .
[0095] In step S202, the sample data is input into the multi-level generator of the generative adversarial network to obtain an initial sample schedule output by each generator level. The generator generates multiple initial schedules based on the input sample data and performs preliminary screening on the generated initial schedules to remove obviously unreasonable schedules. The generator's processing of input data during training is similar to the processing of input data during actual inference. See the description of step S102 above and will not be repeated here.
[0096] In step S203, the initial sample schedule is input into the multi-level discriminator of the generative adversarial network. Each level of the discriminator evaluates the initial sample schedule, generating a corresponding initial sample evaluation result. The initial sample evaluation results output by each level of the discriminator are then integrated to obtain a sample evaluation result for each initial sample schedule. The discriminator's evaluation of the schedule during training is similar to the evaluation process during the actual inference process. See the description of step S103 above and will not be repeated here.
[0097] Step S204: determining an optimal sample scheduling plan from the initial sample scheduling plans based on the sample evaluation results.
[0098] Step S205: Calculate the loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan, and update the parameters of the generator and discriminator of the generative adversarial network according to the loss function to obtain the trained generative adversarial network.
[0099] Specifically, the loss function of each generator is calculated to update the parameters of the generator, and the loss function of the discriminator is calculated to complete the parameter update of the discriminator. The optimization formulas of the generator and discriminator are:
[0100]
[0101] Among them, P r represents the distribution of the real scheduling scheme in the training sample dataset, P g represents the distribution of the generated scheduling plan output by the generator, Z represents the random noise vector, Denotes the expected value, and V denotes the value function. The above optimization formula is used to adjust the parameters of the generator and discriminator, completing the initial optimization of the generator and discriminator. The concept of the value function V is embodied through the optimization objectives of the generator and discriminator. The optimization formulas for the generator and discriminator directly express the optimization direction, while the value function, as a high-level metric for measuring model performance, is implicitly embedded in these optimization objectives.
[0102] The discriminator evaluates the initially screened schedules based on the validation set data, scoring them based on work hours, work content, work intensity, employee satisfaction, and their alignment with the company's business needs. The scoring results are fed back to the generator, which then adjusts its generation strategy based on the feedback to generate a new schedule. In a generative adversarial network (GAN), a game relationship exists between the generator and the discriminator. In each iteration, the generator generates new schedules, and the discriminator evaluates these plans and provides feedback. The generator's loss function depends not only on the fixed training data but also on the dynamic feedback from the discriminator. The iterative process is bidirectional, with the generator and discriminator gradually optimizing their respective parameters through game theory. Specifically, each time the above steps S202-S205 are executed once, the generative adversarial network is deemed to have completed one training. By repeating the above steps, the generator and the discriminator perform multiple rounds of iterations, and the relevant parameters of the generator and the discriminator of the generative adversarial network are gradually optimized through game theory. In each round of iteration, the generator generates a new scheduling plan based on the training set data, and the discriminator evaluates it and feeds back the results. Through multiple rounds of iterations, the generated scheduling plan gradually approaches the optimal state.
[0103] 1.3.1. About the loss function of the generator during training.
[0104] This embodiment proposes to introduce a dynamic adaptive optimization module into the generator. The Dynamic Adaptive Optimization Module (DAOM) is a method for optimizing model performance in machine learning and deep learning. This embodiment proposes that when calculating the loss function of the generator, the final evaluation result of the discriminator is taken into consideration in the calculation, so as to adjust the (dynamic) generation strategy in real time according to the feedback result of the discriminator (i.e., update the relevant parameters of the generator according to the loss function), so as to achieve the purpose of optimizing the generated scheduling plan.
[0105] In one possible implementation, calculating a loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan includes:
[0106] The loss function of the generator is calculated based on the initial sample scheduling plan and the sample evaluation result; the loss function of the generator includes at least an adversarial loss function, and the training goal of the adversarial loss function is to maximize the probability that the discriminator believes that the initial sample scheduling plan is the optimal sample scheduling plan.
[0107] In one possible implementation, the loss function L of the generator is calculated according to the following formula: G :
[0108]
[0109] in, is the adversarial loss function, P represents the initial sample scheduling scheme, P g represents the distribution of the initial sample scheduling scheme, D(P) is the sample evaluation result, and P target represents the real scheduling plan (in the training process of the generative adversarial network, the sample data input for each training also includes the corresponding real scheduling plan), λ G1 ,λ G2 ,λ G3 ,λ G4 is the weight parameter of the loss function of the generator, MSE represents mean square error, MAE represents mean absolute error, represents the average employee satisfaction, T i represents the working hours of the i-th employee, represents the average working time, S j represents the satisfaction score of the jth employee, Represents the average employee satisfaction score. Among them, MSE and MAE are used to measure the difference between the generated initial sample scheduling plan P and the actual scheduling plan P target The optimization target of the generator changes dynamically because the loss function of the generator depends on the feedback result D(P) of the discriminator.
[0110] The dynamic adaptive optimization module is based on the feedback result D of the discriminator. l (P l ) Adjust the generation strategy in real time (pass gradients back to the generator and update parameters) to optimize the generated shift plan. That is, update the parameters of the generator according to the calculated loss function according to the following formula:
[0111]
[0112] in, Represents the parameters of the level l generator before this update, represents the parameters of the updated level l generator, η represents the learning rate, represents the gradient of the generator loss function.
[0113] After generating a plan, traditional GAN models typically lack the ability to dynamically adjust and optimize the generated plan strategy and cannot adapt to actual conditions. This embodiment proposes introducing a dynamic adaptive optimization module into the generator. This module adjusts the generation strategy (i.e., updates the relevant parameters of the generator) in real time based on the feedback (evaluation results) of the discriminator to optimize the generated scheduling plan. Through multiple rounds of iteration, the game process between the generator and the discriminator gradually optimizes the scheduling plan, ultimately generating a near-optimal scheduling plan.
[0114] In addition, according to the proposal in 1.1.2 above, the contents of the graph convolutional network and the variational autoencoder are combined in the generator. This embodiment proposes that in each training process, before calculating the loss function of the generator and updating the parameters of the generator according to the loss function of the generator, the loss function of the variational autoencoder can be calculated first to complete the parameter update of the variational autoencoder.
[0115] The loss function of the variational autoencoder is calculated according to the following formula:
[0116]
[0117] in, Represents the reconstruction loss, which is used to measure the difference between the reconstructed data and the original input data, q φ (z|x) represents the output of the encoder in the variational autoencoder, p θ (x|z) represents the output of the decoder in the variational autoencoder, z represents the latent variable, x represents the input data (i.e., the input schedule information), KL represents the Kullback-Leibler divergence, KL(q φ (z|x)||p(z)) is used to measure the latent variable distribution q output by the encoder φ The difference between (z|x) and the prior distribution p(z). The loss function L is calculated VAE Afterwards, according to the loss function L VAE Directly update the parameters of the variational autoencoder.
[0118] Variational autoencoder loss function L VAE It is used to optimize the parameters of the variational autoencoder to ensure that the generated scheduling plan can restore the input data and has diversity. The loss function L of the above generator is G It is used to optimize the parameters of the entire generator (including graph convolutional networks and variational autoencoders), comprehensively considering multiple optimization objectives to generate a more reasonable scheduling plan.
[0119] 1.3.2. About the loss function of the discriminator during training.
[0120] 1.3.2-1. Set the loss function of the discriminator to a multi-task learning loss function to achieve multi-objective optimization. Multi-objective optimization refers to the simultaneous consideration of multiple objective functions in an optimization problem, which may conflict or compete with each other. Unlike single-objective optimization, multi-objective optimization does not have a single optimal solution, but rather seeks a set of solutions that strike a balance between multiple objectives, which is usually called a Pareto optimal solution. This embodiment defines employee workload balance, employee satisfaction, and the matching degree of company business needs as a multi-objective optimization problem.
[0121] In one possible implementation, calculating a loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan includes:
[0122] The loss function of the discriminator is calculated as follows:
[0123] Determining workload balance loss, employee satisfaction loss, and company business demand matching loss based on the actual scheduling plan and the optimal sample scheduling plan;
[0124] Based on the task loss weight parameters of the discriminator at each level, a weighted sum is performed to obtain the loss function of the discriminator. The task loss weight parameters are the weight parameters of the workload balance loss, the employee satisfaction loss and the company business demand matching loss in the loss function of the discriminator. The task loss weight parameters are different between the generators at multiple levels.
[0125] Specifically, the multi-task learning loss function of the discriminator is defined, including: workload balancing loss L B , employee satisfaction loss L S Loss of matching degree with company business needs L M ; The loss function of the discriminator is as follows:
[0126] L D =λ1L B +λ2L S +λ3L M ;
[0127] Where λ1 represents the workload balancing loss L B The task loss weight parameter, λ2 represents the employee satisfaction loss L S The task loss weight parameter, λ3 represents the company's business demand matching loss L M The task loss weight parameter is
[0128] In one possible implementation, the workload balancing loss is calculated according to the following formula:
[0129]
[0130] Among them, L B represents the workload balancing loss, T i represents the working hours of the i-th employee, represents the average working time, C ij It represents the working time of the i-th employee on the j-th task content, represents the average working time of the jth task, I ik represents the working time of the i-th employee at the k-th work intensity, represents the average working time at the kth work intensity, α j represents the work content weight parameter, β k It represents the work intensity weight parameter, and N, U, and V represent the data dimensions of employee working hours, work content, and work intensity, respectively.
[0131] In a possible implementation, the employee satisfaction loss is calculated according to the following formula:
[0132]
[0133] Among them, L S Denotes the employee satisfaction loss, S j represents the satisfaction score of the jth employee, represents the average employee satisfaction score, T ij It represents the working time of the i-th employee on the j-th task content, represents the average working hours of the i-th employee, γ i It represents the weight parameter of employee working hours, M and U represent the data dimensions of employee satisfaction and work content respectively.
[0134] In a possible implementation, the company's business needs matching degree is calculated according to the following formula:
[0135]
[0136] Among them, L M Indicates the matching degree of the company's business needs, D k represents the business needs of the k-th company, represents the company's average business demand, T ik represents the working time of the i-th employee on the k-th business requirement, represents the average working hours of the i-th employee, δ irepresents the employee working time weight parameter, C kj Indicates the matching degree between the kth business requirement and the jth work content, represents the average matching degree of the jth job content, η j It represents the job matching weight parameter, K, N, and U represent the data dimensions of business requirements, employee working hours, and job content, respectively.
[0137] The discriminator network structure consists of a shared hidden layer and a task-specific output layer. The parameters of the shared hidden layer are shared across all tasks, while each task has its own specific output layer. In a multi-task learning architecture, the shared hidden layer parameters are used to jointly learn different tasks and optimize the discriminator parameters θ. D To minimize the multi-task loss function L D , that is, update the parameters of the discriminator according to the following formula.
[0138]
[0139] Among them, η1 represents the learning rate, represents the gradient of the loss function, represents the parameters of the discriminator before updating, Represents the updated discriminator parameters.
[0140] 1.3.2-2. Introduce a feedback enhancement mechanism into the discriminator.
[0141] This embodiment proposes to introduce a feedback enhancement mechanism into the discriminator to optimize the evaluation accuracy and robustness of the discriminator by accumulating historical evaluation data (the historical evaluation data is mainly reflected by MSE and MAE).
[0142] In one possible implementation, updating parameters of a generator and a discriminator of the generative adversarial network according to the loss function includes:
[0143] The stability index is calculated using historical evaluation data, where the stability index includes the mean square error loss and mean absolute error loss of the discriminator; the historical evaluation data includes historical sample evaluation results obtained in multiple rounds of training iterations; specifically, in this embodiment, the discriminator caches the final evaluation results D(P) obtained in previous multiple rounds of training as historical evaluation data for calculating the stability index.
[0144] According to the following formula, the parameters of the discriminator are updated according to the loss function of the discriminator and the stability index:
[0145]
[0146] in, represents the optimized l-th level discriminator function, represents the l-th level discriminator function before optimization, η ′ represents the learning rate of the discriminator, represents the gradient of the loss function of the discriminator, P r represents the distribution of the real scheduling scheme, is the final evaluation result of the discriminator on the real scheduling plan, is the final evaluation result of the discriminator on the optimal sample scheduling solution, λ D1 ,λ D2 ,λ D3 is the weight parameter for updating the discriminator parameters, MSE represents the mean square error loss of the discriminator, MAE represents the mean absolute error loss of the discriminator, D k represents the business needs of the k-th company, represents the company's average business needs, K represents the data dimension of the company's business needs, and D target Indicates the target value of business demand, which is used to evaluate whether the scheduling plan meets the expected business demand.
[0147] Therefore, the embodiment of the present application accumulates historical evaluation data and introduces a weighted or regularized term of historical feedback in the gradient calculation to optimize the evaluation accuracy and robustness of the discriminator.
[0148] 1.4 Combine the generative adversarial network with the global optimization module.
[0149] This embodiment proposes that after using a generative adversarial network to determine the target scheduling plan, a global optimization module is input to perform global optimization on the target scheduling plan with the goal of minimizing the global optimization loss function to obtain an optimized target scheduling plan.
[0150] In one possible implementation, the method further includes:
[0151] Based on the global optimization module, the target scheduling plan is globally optimized with the goal of minimizing the global optimization loss function to obtain an optimized target scheduling plan;
[0152] The global optimization loss function includes workload balance loss, employee satisfaction loss and company business demand matching loss.
[0153] Specifically, refer to Figure 4 , Figure 4 A schematic diagram of a process for global optimization of the scheduling scheme is shown, as Figure 4As shown in the figure, after determining the target scheduling plan by using the generative adversarial network, global optimization is performed through other combined particle swarm optimization algorithms to ensure that the scheduling plan achieves the best results in multiple objectives (workload balance, employee satisfaction and company business demand matching). Particle Swarm Optimization (PSO) is a global optimization algorithm based on swarm intelligence, which finds the optimal solution to the problem by simulating the collaboration and information sharing of individuals (particles) in the group. In this embodiment, based on the target scheduling plan output by the generative adversarial network, the global optimal solution (optimized target scheduling plan) is searched in the solution space by simulating group collaboration and information sharing. In the process of seeking the optimal solution, the goal is to minimize the global optimization loss function, that is, to find a scheduling plan that simultaneously satisfies the workload balance loss, employee satisfaction loss and company business demand matching loss. Among them, the workload balance loss, employee satisfaction loss and company business demand matching loss are explained in the relevant content of the discriminator loss function in Section 1.3.2 above, and will not be repeated here.
[0154] In addition, during the training of the generative adversarial network (steps S201-S205 above), the global optimization module is collaboratively trained. Specifically, in each training process: the generator generates multiple initial sample scheduling schemes, and the discriminator generates sample evaluation results for each initial sample scheduling scheme, from which the optimal one or more target sample scheduling schemes are determined (corresponding to step S205), and fed back to the global optimization module. The global optimization module updates the particle swarm based on the sample evaluation results and the target sample scheduling scheme, retaining one or more optimal schemes on the Pareto front (optimized sample scheduling schemes). It is fed back to the generator so that the generator adjusts the latent variable distribution of the variational autoencoder according to the optimized sample scheduling scheme (calculates the loss function of the generator and updates the parameters of the generator) to generate a better new scheme. Ultimately, a set of scheduling schemes that balance load, satisfaction, and business needs are provided.
[0155] The second aspect of the embodiment of the present application further provides a scheduling plan generating device, referring to Figure 5 , Figure 5 A schematic diagram of the structure of a shift scheduling scheme generating device is shown in FIG. Figure 5 As shown, the application executes the generation method described in the first aspect of the embodiment of the present application, and the device includes:
[0156] An input module for obtaining shift scheduling information, wherein the shift scheduling information includes at least one of the following: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical shift scheduling record information, and company business demand information;
[0157] A generative adversarial network, comprising a multi-level generator and a multi-level discriminator; wherein each level of the multi-level generator is used to generate a corresponding initial scheduling plan based on the scheduling information and a preset workload weight parameter; wherein the workload weight parameter represents a weight parameter of one or more of the working hours, work content, and work intensity in the generated initial scheduling plan, and the workload weight parameters are different between the multiple levels of the generator;
[0158] Each level of the multi-level discriminator is used to evaluate the initial scheduling plan and generate a corresponding initial evaluation result. The multi-level discriminator integrates the initial evaluation results output by the discriminators at each level to obtain a final evaluation result for each of the initial scheduling plans; and determines a target scheduling plan from the multiple initial scheduling plans based on the final evaluation result.
[0159] In one possible implementation, the generator includes: a graph convolutional network and a variational autoencoder; generating a corresponding initial scheduling plan based on the scheduling information and a preset workload weight parameter, including:
[0160] Based on the graph convolutional network, feature extraction is performed on the scheduling information to obtain a workload feature matrix;
[0161] Based on the variational autoencoder, encoding and decoding the scheduling information to obtain a decoding result;
[0162] The initial scheduling plan is generated based on the workload weight parameter, combined with the workload feature matrix and the decoding result.
[0163] In one possible implementation, the graph convolutional network includes multiple cascaded graph convolutional layers. Based on the graph convolutional network, feature extraction is performed on the scheduling information to obtain a workload feature matrix, including:
[0164] Performing multi-level feature extraction on the scheduling information based on the multiple graph convolution layers to obtain graph structure features extracted by the graph convolution layers at each level;
[0165] Calculating the attention weight of each of the graph structure features;
[0166] The graph structure features are weighted and summed according to the attention weights to obtain the workload feature matrix.
[0167] In a possible implementation, the multi-level discriminator evaluates the initial scheduling schemes to obtain a final evaluation result of each initial scheduling scheme, including:
[0168] Using each level of discriminators, based on preset scheduling evaluation weight parameters, the initial scheduling plan is evaluated from three aspects: workload balance, employee satisfaction, and matching degree with company business needs, to obtain the initial evaluation results for the initial scheduling plan output by each level of discriminators; the initial evaluation results include evaluation scores;
[0169] For each of the initial scheduling plans, summing the evaluation scores of the initial evaluation results output by the discriminators at each level to obtain a final evaluation result of the initial scheduling plan;
[0170] Among them, the scheduling evaluation weight parameters of the discriminator represent the weight parameters of the workload balance, the employee satisfaction and the company's business needs matching in the generated initial evaluation results, and the scheduling evaluation weight parameters between multiple levels of discriminators are different.
[0171] In one possible implementation, the initial shift scheduling plan is evaluated based on the following formula, based on preset shift scheduling evaluation weight parameters, from three aspects: workload balance, employee satisfaction, and matching degree with company business needs:
[0172]
[0173] in, They represent the scheduling evaluation weight parameters of workload balance, employee satisfaction and company business demand matching in the discriminator at level l, T i represents the working hours of the i-th employee in the initial scheduling plan, represents the average working time, S j Denotes the satisfaction score of the jth employee in the initial scheduling plan, D k represents the business demand of the kth company in the initial scheduling plan, represents the average company business demand, N, M, and K represent the data dimensions of working hours, employee satisfaction, and company business demand, respectively.
[0174] In one possible implementation, the generative adversarial network is trained according to the following steps:
[0175] Creating a training sample dataset; the training sample dataset includes multiple sample data and a real scheduling plan corresponding to each sample data, each sample data including: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical scheduling record information, and company business demand information;
[0176] Inputting the sample data into the multi-level generator of the generative adversarial network to obtain an initial sample scheduling plan output by each level of the generator;
[0177] Inputting the initial sample scheduling plan into the multi-level discriminator of the generative adversarial network, allowing each level of discriminator to evaluate the initial sample scheduling plan respectively, generating a corresponding initial sample evaluation result, and integrating the initial sample evaluation results output by the discriminators at each level to obtain a sample evaluation result for each of the initial sample scheduling plans;
[0178] Determining an optimal sample scheduling plan from the initial sample scheduling plans based on the sample evaluation results;
[0179] According to the initial sample scheduling plan, the sample evaluation results and the optimal sample scheduling plan, a loss function is calculated, and the parameters of the generator and discriminator of the generative adversarial network are updated according to the loss function to obtain the trained generative adversarial network.
[0180] In one possible implementation, calculating a loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan includes:
[0181] The loss function of the generator is calculated based on the initial sample scheduling plan and the sample evaluation result; the loss function of the generator includes at least an adversarial loss function, and the training goal of the adversarial loss function is to maximize the probability that the discriminator believes that the initial sample scheduling plan is the optimal sample scheduling plan.
[0182] In one possible implementation, the loss function of the generator is calculated according to the following formula:
[0183]
[0184] in, is the adversarial loss function, P represents the initial sample scheduling scheme, P g represents the distribution of the initial sample scheduling scheme, D(P) is the sample evaluation result, and P target represents the actual scheduling plan, λ G1 ,λ G2 ,λ G3 ,λ G4 is the weight parameter of the loss function of the generator, MSE represents mean square error, MAE represents mean absolute error, represents the average employee satisfaction, T i represents the working hours of the i-th employee, represents the average working time, S j represents the satisfaction score of the jth employee, Represents the average employee satisfaction rating.
[0185] In one possible implementation, calculating a loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan includes:
[0186] The loss function of the discriminator is calculated as follows:
[0187] Determining workload balance loss, employee satisfaction loss, and company business demand matching loss based on the actual scheduling plan and the optimal sample scheduling plan;
[0188] Based on the task loss weight parameters of the discriminator at each level, a weighted sum is performed to obtain the loss function of the discriminator. The task loss weight parameters are the weight parameters of the workload balance loss, the employee satisfaction loss and the company business demand matching loss in the loss function of the discriminator. The task loss weight parameters are different between the generators at multiple levels.
[0189] In one possible implementation, the workload balancing loss is calculated according to the following formula:
[0190]
[0191] Among them, L B represents the workload balancing loss, T i represents the working hours of the i-th employee, represents the average working time, C ij It represents the working time of the i-th employee on the j-th task content, represents the average working time of the jth task, I ik represents the working time of the i-th employee at the k-th work intensity, represents the average working time at the kth work intensity, α j represents the work content weight parameter, β k It represents the work intensity weight parameter, and N, U, and V represent the data dimensions of employee working hours, work content, and work intensity, respectively.
[0192] In a possible implementation, the employee satisfaction loss is calculated according to the following formula:
[0193]
[0194] Among them, L S Denotes the employee satisfaction loss, S j represents the satisfaction score of the jth employee, represents the average employee satisfaction score, T ij It represents the working time of the i-th employee on the j-th task content, represents the average working hours of the i-th employee, γ i It represents the weight parameter of employee working hours, M and U represent the data dimensions of employee satisfaction and work content respectively.
[0195] In a possible implementation, the company's business needs matching degree is calculated according to the following formula:
[0196]
[0197] Among them, L M Indicates the matching degree of the company's business needs, D k represents the business needs of the k-th company, represents the company's average business demand, T ik represents the working time of the i-th employee on the k-th business requirement, represents the average working hours of the i-th employee, δ i represents the employee working time weight parameter, C kj Indicates the matching degree between the kth business requirement and the jth work content, represents the average matching degree of the jth job content, η j It represents the job matching weight parameter, K, N, and U represent the data dimensions of business requirements, employee working hours, and job content, respectively.
[0198] In one possible implementation, updating parameters of a generator and a discriminator of the generative adversarial network according to the loss function includes:
[0199] Calculating stability indicators using historical evaluation data, the stability indicators including mean square error loss and mean absolute error loss of the discriminator; the historical evaluation data including historical sample evaluation results obtained in multiple rounds of training iterations;
[0200] According to the following formula, the parameters of the discriminator are updated according to the loss function of the discriminator and the stability index:
[0201]
[0202] in, represents the optimized l-th level discriminator function, represents the l-th level discriminator function before optimization, η ′ represents the learning rate of the discriminator, represents the gradient of the loss function of the discriminator, P r represents the distribution of the real scheduling scheme, is the evaluation result of the discriminator on the real scheduling plan, is the evaluation result of the discriminator on the optimal sample scheduling solution, λ D1 ,λ D2 ,λ D3 is the weight parameter for updating the discriminator parameters, MSE represents the mean square error loss of the discriminator, MAE represents the mean absolute error loss of the discriminator, D k represents the business needs of the k-th company, represents the company's average business needs, and K represents the data dimension of the company's business needs.
[0203] In a possible implementation, the device further includes:
[0204] A global optimization module is used to perform global optimization on the target scheduling plan with the goal of minimizing the global optimization loss function to obtain an optimized target scheduling plan;
[0205] The global optimization loss function includes workload balance loss, employee satisfaction loss and company business demand matching loss.
[0206] The present application also provides an electronic device, Figure 6 , Figure 6 Schematic diagram of the electronic device proposed in the embodiment of the present application. Figure 6 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps of the scheduling plan generation method described in the first aspect disclosed in the embodiment of the present application.
[0207] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the scheduling plan generation method as described in the first aspect disclosed in the embodiment of the present application are implemented.
[0208] The present application also provides a computer program product that, when executed on an electronic device, causes a processor to implement the steps of the method for generating a shift schedule as described in the first aspect of the present application. The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between the various embodiments can be referenced separately.
[0209] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, commodity, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, commodity, or device that includes the element.
[0210] The above is a detailed introduction to the scheduling plan generation method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0211] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0212] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0213] References herein to "one embodiment," "an embodiment," or "one or more embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Furthermore, please note that instances of the phrase "in one embodiment" do not necessarily all refer to the same embodiment.
[0214] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.
[0215] In the claims, any reference signs placed between brackets shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0216] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating a shift scheduling plan, characterized in that: The method comprises: Obtaining shift scheduling information, the shift scheduling information including at least one of the following: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical shift scheduling record information, and company business demand information; Inputting the scheduling information into a multi-level generator of a generative adversarial network, so that each level of generator generates a corresponding initial scheduling plan based on a preset workload weight parameter; wherein the workload weight parameter represents a weight parameter of one or more of the working hours, work content, and work intensity in the generated initial scheduling plan, and the workload weight parameters are different between the multiple levels of the generator; wherein the generative adversarial network includes the multi-level generator and the multi-level discriminator; Inputting the initial scheduling plan into the multi-level discriminator of the generative adversarial network, allowing each level of discriminator to evaluate the initial scheduling plan respectively, generating a corresponding initial evaluation result, and integrating the initial evaluation results output by the discriminators at each level to obtain a final evaluation result for each of the initial scheduling plans; A target shift scheduling scheme is determined from the plurality of initial shift scheduling schemes according to the final evaluation result.
2. The method for generating a shift schedule according to claim 1, wherein: The generator includes: a graph convolutional network and a variational autoencoder; each level of the generator generates a corresponding initial scheduling plan based on a preset workload weight parameter, including: Based on the graph convolutional network, feature extraction is performed on the scheduling information to obtain a workload feature matrix; Based on the variational autoencoder, encoding and decoding the scheduling information to obtain a decoding result; The initial scheduling plan is generated based on the workload weight parameter, combined with the workload feature matrix and the decoding result.
3. The method for generating a shift schedule according to claim 2, wherein: The graph convolutional network includes multiple cascaded graph convolutional layers. Based on the graph convolutional network, feature extraction is performed on the scheduling information to obtain a workload feature matrix, including: Performing multi-level feature extraction on the scheduling information based on the multiple graph convolution layers to obtain graph structure features extracted by the graph convolution layers at each level; Calculating the attention weight of each of the graph structure features; The graph structure features are weighted and summed according to the attention weights to obtain the workload feature matrix.
4. The method for generating a shift schedule according to claim 1, wherein: Each level of discriminators is made to evaluate the initial scheduling plan respectively to generate a corresponding initial evaluation result, and the initial evaluation results output by the discriminators at each level are integrated to obtain a final evaluation result of each initial scheduling plan, including: Using each level of discriminators, based on preset scheduling evaluation weight parameters, the initial scheduling plan is evaluated from three aspects: workload balance, employee satisfaction, and matching degree with company business needs, to obtain the initial evaluation results for the initial scheduling plan output by each level of discriminators; the initial evaluation results include evaluation scores; For each of the initial scheduling plans, summing the evaluation scores of the initial evaluation results output by the discriminators at each level to obtain a final evaluation result of the initial scheduling plan; The scheduling evaluation weight parameter of the discriminator represents the weight parameters of the workload balance, the employee satisfaction and the company's business needs matching in the initial evaluation results, and the scheduling evaluation weight parameters between multiple levels of discriminators are different.
5. The method for generating a shift schedule according to claim 4, wherein: According to the following formula, based on the preset scheduling evaluation weight parameters, the initial scheduling plan is evaluated from three aspects: workload balance, employee satisfaction, and matching degree with company business needs: in, They represent the scheduling evaluation weight parameters of workload balance, employee satisfaction and company business demand matching in the discriminator at level l, T i represents the working hours of the i-th employee in the initial scheduling plan, represents the average working time, S j Denotes the satisfaction score of the jth employee in the initial scheduling plan, D k represents the business demand of the kth company in the initial scheduling plan, represents the average company business demand, N, M, and K represent the data dimensions of employee working hours, employee satisfaction, and company business demand, respectively.
6. The method for generating a shift schedule according to claim 1, wherein: The generative adversarial network is trained according to the following steps: Creating a training sample dataset; the training sample dataset includes multiple sample data and a real scheduling plan corresponding to each sample data, each sample data including: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical scheduling record information, and company business demand information; Inputting the sample data into the multi-level generator of the generative adversarial network to obtain an initial sample scheduling plan output by each level of the generator; Inputting the initial sample scheduling plan into the multi-level discriminator of the generative adversarial network, causing each level of the discriminator to evaluate the initial sample scheduling plan respectively, generating a corresponding initial sample evaluation result, and integrating the initial sample evaluation results output by the discriminators at each level to obtain a sample evaluation result for each of the initial sample scheduling plans; Determining an optimal sample scheduling plan from the initial sample scheduling plans based on the sample evaluation results; According to the initial sample scheduling plan, the sample evaluation results and the optimal sample scheduling plan, a loss function is calculated, and the parameters of the generator and discriminator of the generative adversarial network are updated according to the loss function to obtain the trained generative adversarial network.
7. The method for generating a shift schedule according to claim 6, wherein: Calculating a loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan includes: The loss function of the generator is calculated based on the initial sample scheduling plan and the sample evaluation result; the loss function of the generator includes at least an adversarial loss function, and the training goal of the adversarial loss function is to maximize the probability that the discriminator believes that the initial sample scheduling plan is the optimal sample scheduling plan.
8. The method for generating a shift schedule according to claim 7, wherein: The loss function of the generator is calculated according to the following formula: in, is the adversarial loss function, P represents the initial sample scheduling scheme, P g represents the distribution of the initial sample scheduling scheme, D(P) is the sample evaluation result, and P target represents the actual scheduling plan, λ G1 ,λ G2 ,λ G3 ,λ G4 is the weight parameter of the loss function of the generator, MSE represents mean square error, MAE represents mean absolute error, S represents average employee satisfaction, T i represents the working hours of the i-th employee, represents the average working time, S j represents the satisfaction score of the jth employee, Represents the average employee satisfaction rating.
9. The method for generating a shift schedule according to claim 7, wherein: Calculating a loss function based on the initial sample scheduling plan, the sample evaluation results, and the optimal sample scheduling plan includes: The loss function of the discriminator is calculated as follows: Determining workload balance loss, employee satisfaction loss, and company business demand matching loss based on the actual scheduling plan and the optimal sample scheduling plan; Based on the task loss weight parameters of the discriminator at each level, a weighted sum is performed to obtain the loss function of the discriminator. The task loss weight parameters are the weight parameters of the workload balance loss, the employee satisfaction loss and the company business demand matching loss in the loss function of the discriminator. The task loss weight parameters are different between the generators at multiple levels.
10. The method for generating a shift schedule according to claim 9, wherein: The workload balancing loss is calculated according to the following formula: Among them, L B represents the workload balancing loss, T i represents the working hours of the i-th employee, represents the average working time, C ij It represents the working time of the i-th employee on the j-th task content, represents the average working time of the jth task, I ik represents the working time of the i-th employee at the k-th work intensity, represents the average working time at the kth work intensity, α j represents the work content weight parameter, β k Represents the work intensity weight parameter, where N, U, and V represent the data dimensions of employee working hours, work content, and work intensity, respectively; or The employee satisfaction loss is calculated according to the following formula: Among them, L S Denotes the employee satisfaction loss, S j represents the satisfaction score of the jth employee, represents the average employee satisfaction score, T ij It represents the working time of the i-th employee on the j-th task content, represents the average working hours of the i-th employee, γ i represents the weight parameter of employee working hours, M and U represent the data dimensions of employee satisfaction and work content respectively; or The matching degree of the company's business needs is calculated according to the following formula: Among them, L M Indicates the matching degree of the company's business needs, D k represents the business needs of the k-th company, represents the company's average business demand, T ik represents the working time of the i-th employee on the k-th business requirement, represents the average working hours of the i-th employee, δ i represents the employee working time weight parameter, C kj Indicates the matching degree between the kth business requirement and the jth work content, represents the average matching degree of the jth job content, η j It represents the job matching weight parameter, K, N, and U represent the data dimensions of business requirements, employee working hours, and job content, respectively.
11. The method for generating a shift schedule according to claim 9, wherein: Updating parameters of a generator and a discriminator of the generative adversarial network according to the loss function includes: Calculating stability indicators using historical evaluation data, the stability indicators including mean square error loss and mean absolute error loss of the discriminator; the historical evaluation data including historical sample evaluation results obtained in multiple rounds of training iterations; According to the following formula, the parameters of the discriminator are updated according to the loss function of the discriminator and the stability index: in, represents the optimized l-th level discriminator function, represents the l-th level discriminator function before optimization, η ′ represents the learning rate of the discriminator, represents the gradient of the loss function of the discriminator, P r represents the distribution of the real scheduling scheme, is the evaluation result of the discriminator on the real scheduling plan, is the evaluation result of the discriminator on the optimal sample scheduling solution, λ D1 ,λ D2 ,λ D3 is the weight parameter for updating the discriminator parameters, MSE represents the mean square error loss of the discriminator, MAE represents the mean absolute error loss of the discriminator, D k represents the business needs of the k-th company, represents the company's average business needs, and K represents the data dimension of the company's business needs.
12. The method for generating a shift schedule according to any one of claims 1 to 11, characterized in that: The method further comprises: Based on the global optimization module, the target scheduling plan is globally optimized with the goal of minimizing the global optimization loss function to obtain an optimized target scheduling plan; The global optimization loss function includes workload balance loss, employee satisfaction loss and company business demand matching loss.
13. A shift scheduling plan generating device, characterized in that: The application performs the generation method according to any one of claims 1 to 12, wherein the device comprises: An input module for obtaining shift scheduling information, wherein the shift scheduling information includes at least one of the following: employee working hours information, employee work content information, employee work intensity information, employee skill level information, historical shift scheduling record information, and company business demand information; A generative adversarial network, comprising a multi-level generator and a multi-level discriminator; wherein each level of the multi-level generator is used to generate a corresponding initial scheduling plan based on the scheduling information and a preset workload weight parameter; wherein the workload weight parameter represents a weight parameter of one or more of the working hours, work content, and work intensity in the generated initial scheduling plan, and the workload weight parameters are different between the multiple levels of the generator; Each level of the multi-level discriminator evaluates the initial scheduling plan respectively to generate a corresponding initial evaluation result. The multi-level discriminator integrates the initial evaluation results output by the discriminators at each level to obtain a final evaluation result for each of the initial scheduling plans; and determines a target scheduling plan from the multiple initial scheduling plans based on the final evaluation result.
14. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method for generating a shift schedule according to any one of claims 1 to 12 are implemented.
15. A readable storage medium, characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method for generating a shift schedule according to any one of claims 1 to 12 are implemented.