CN116911518B - Multi-service fusion dispatch method for gas worksheet and storage medium - Google Patents

Multi-service fusion dispatch method for gas worksheet and storage medium Download PDF

Info

Publication number
CN116911518B
CN116911518B CN202310678859.7A CN202310678859A CN116911518B CN 116911518 B CN116911518 B CN 116911518B CN 202310678859 A CN202310678859 A CN 202310678859A CN 116911518 B CN116911518 B CN 116911518B
Authority
CN
China
Prior art keywords
work order
population
chromosome
employee
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310678859.7A
Other languages
Chinese (zh)
Other versions
CN116911518A (en
Inventor
陈伦勇
章海生
王东华
梁健声
曾志坚
夏忠和
林浩通
甘海新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Hua Intelligent Information Technology Co ltd
Original Assignee
Guangdong Hua Intelligent Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Hua Intelligent Information Technology Co ltd filed Critical Guangdong Hua Intelligent Information Technology Co ltd
Priority to CN202310678859.7A priority Critical patent/CN116911518B/en
Publication of CN116911518A publication Critical patent/CN116911518A/en
Application granted granted Critical
Publication of CN116911518B publication Critical patent/CN116911518B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • G06Q10/063112Skill-based matching of a person or a group to a task
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Strategic Management (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Marketing (AREA)
  • Tourism & Hospitality (AREA)
  • Evolutionary Biology (AREA)
  • General Business, Economics & Management (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Educational Administration (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Primary Health Care (AREA)
  • Water Supply & Treatment (AREA)
  • Public Health (AREA)
  • Quality & Reliability (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a multi-service fusion dispatch method and a storage medium of a gas work order, wherein the method comprises the following steps: acquiring and preprocessing current work order data and current employee data; processing the data by using an improved genetic algorithm to obtain an optimal assignment scheme comprising a plurality of work order sets; according to the scheme, assigning a plurality of work order sets to each corresponding employee, each employee being assigned a work order set corresponding to the scheme; each employee sequentially processes the worksheets in the corresponding worksheets in the worksheets set according to the ordering of the worksheets in the worksheets set. The invention improves the coding mode, the crossing and the mutation process of the genetic algorithm, adopts the row vector of the matrix as the gene segment and generates a new individual in a gene fusion mode so as to improve the retention rate of excellent genes, effectively enhance the optimizing capability of the algorithm, realize the rationality dispatch of the work orders of the gas business by improving the genetic algorithm and improve the efficiency of the work order dispatch. The method and the device are applied to the field of intelligent dispatch.

Description

Multi-service fusion dispatch method for gas worksheet and storage medium
Technical Field
The invention relates to the technical field of intelligent dispatching, in particular to a multi-service fusion dispatching method of a gas work order and a storage medium.
Background
The work orders of the gas industry mainly comprise maintenance work orders and security check work orders for old users and gas installation work orders for new users. Currently, a gas company mostly adopts a management mode of regional standing points to manage a large number of service worksheets, namely, one employee or one group is responsible for managing the service worksheets of a certain area. After customer service personnel receives the requirements of users, such as ignition, installation, management change and the like, corresponding business is input into a system to generate corresponding work orders, and then the work orders are appointed and distributed to the corresponding personnel by the manager of the partition residence according to the distribution experience of the manager, or the automatic distribution of the work orders is finished by relying on a traditional distribution algorithm.
However, the former dispatch mode relies on the dispatch experience of the dispatcher, has strong subjectivity, and simultaneously has the problems of low manual dispatch efficiency and dispatch lag, and is easy to reduce the satisfaction of users. While the latter dispatch mode has limitation, the staff in the existing gas industry often has the skill of processing multiple gas services, but the traditional dispatch algorithm can only conduct intelligent dispatch aiming at the scene of one staff and one gas service, and the prior art does not have the dispatch algorithm of fusion of multiple gas services, so that the dispatch of multiple service worksheets to the same staff can not be realized, and the diversified dispatch can not be realized.
The above problems are to be solved.
Disclosure of Invention
The invention aims to provide a multi-service fusion dispatching method and a storage medium for a gas worksheet, which are used for solving one or more technical problems in the prior art and at least providing a beneficial selection or creation condition.
The invention solves the technical problems as follows: in a first aspect, an embodiment of the present invention provides a multi-service fusion dispatch method for a gas work order, where the method includes the following steps:
acquiring and preprocessing current work order data and current employee data, and generating a work order dispatching database;
the current worksheet data comprise worksheet processing time and task places of a plurality of current worksheets, the current worksheet data carry worksheet type identifiers, and the worksheet type identifiers comprise any one of maintenance identifiers, installation identifiers, security inspection identifiers, pipe changing identifiers or ignition identifiers;
the current employee data comprise departure positions and working times of a plurality of employees currently participating in dispatching, and the current employee data carry skill identifications, wherein the skill identifications comprise one or more of maintenance skill identifications, installation skill identifications, security check skill identifications, management improvement skill identifications and ignition skill identifications;
Processing the work order dispatch database by utilizing an improved genetic algorithm to obtain an optimal dispatch scheme formed by a plurality of work order sets;
distributing a plurality of work order sets to corresponding staff members according to the optimal dispatching scheme, wherein each staff member is distributed with the work order set corresponding to the optimal dispatching scheme;
each employee sequentially processes the worksheets in the corresponding worksheets in the worksheets set according to the ordering of the worksheets in the worksheets set.
In a second aspect, an embodiment of the present invention provides a storage medium storing a program executable by a processor, where the program executable by the processor is configured to implement a multi-service fusion dispatch method for a gas job ticket when executed by the processor.
The beneficial effects of the invention are as follows: the multi-service fusion dispatching method of the gas worksheets and the storage medium are provided, the business worksheets reserved by customers are dispatched through an improved genetic algorithm, the problem caused by a single dispatching mode in the current gas industry is solved, the automatic dispatching of the worksheets with multi-gas service fusion is realized, the worksheets dispatching process of the gas worksheets is optimized, the worksheets waiting time and worksheets turnover time in the dispatching process are reduced, the dispatching efficiency of the worksheets is improved, and the satisfaction of customers is improved; for the genetic algorithm, the invention firstly improves the codes so as to adapt to the application scene of the fusion dispatch of various services; in addition, the process of matrix coding crossover and mutation operation is improved, aiming at the single-dispatch scene of the gas business applied by the invention, a new individual is generated by taking a row vector as a gene segment and using a gene fusion mode, so that the retention rate of excellent gene segments is improved, the phenomenon that the gene segments are repeatedly and widely destroyed is avoided, the optimization capacity of an algorithm is improved, and a Metropolis criterion is introduced to improve the crossover and mutation process, thereby ensuring that the algorithm has the capability of grasping the whole in the aspect of the whole searching capacity, keeping the faster convergence rate, reinforcing the weakness of the algorithm in local searching, and effectively avoiding the algorithm from being sunk into precocity.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
FIG. 1 is a flow chart of a multi-service fusion dispatch method of a gas work order provided by the invention;
FIG. 2 is a flow chart of an improved genetic algorithm provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The present application is further described below with reference to the drawings and specific examples. The described embodiments should not be construed as limitations on the present application, and all other embodiments, which may be made by those of ordinary skill in the art without the exercise of inventive faculty, are intended to be within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
The work orders of the gas industry mainly comprise maintenance work orders and security check work orders for old users and gas installation work orders for new users. The maintenance service is mainly used for solving the problems encountered by the user during daily use, and the security check service is mainly used for checking the gas pipeline of the user so as to ensure the gas use safety of the user. The gas installation service can be divided into three more specific services, namely an installation service, an ignition service and a pipe-changing service, wherein: the installation service is used for accessing a gas pipeline for a new user; the ignition service is used for replacing other gases in the pipeline with natural gas, when the concentration of the natural gas reaches the concentration capable of igniting and burning, the ignition is successful, and the ignition is the last link that a user can normally use the natural gas; the pipe changing service is used for reasonably changing the layout of the gas pipeline according to the requirements of users.
Currently, a gas company mostly adopts a management mode of regional standing points to manage a large number of service worksheets, namely, one employee or one group is responsible for managing the service worksheets of a certain area. After customer service personnel receive the requirements of a user, such as ignition, installation, pipe changing and the like, corresponding business is input into a system to generate a corresponding work order. The existing dispatch type is mainly divided into two types: the first is that a manager of the partition standing point distributes work order assignment to corresponding staff according to the distribution experience; the second is to rely on the traditional dispatch algorithm to complete the automatic dispatch of the worksheet.
However, the first dispatch mode relies on the dispatch experience of the dispatcher, has strong subjectivity, and simultaneously has the problems of low manual dispatch efficiency and dispatch hysteresis, and is easy to reduce the satisfaction of users. While the second form assignment method can overcome the subjective problem of the first form assignment to a certain extent, it has limitations that it cannot realize diversified forms assignment. The staff in the existing gas industry often has the skill of processing various gas services, but the traditional dispatch algorithm can only intelligently dispatch the dispatch for one staff and one gas service scene, and the prior art does not have the dispatch algorithm for the fusion of the multiple gas services, so that the dispatch of various service worksheets to the same staff can not be realized, and the diversified dispatch can not be realized.
In this regard, the application provides a multi-service fusion dispatching method, a system and a storage medium for a gas worksheet combined with an improved genetic algorithm, which aim to solve the problem caused by a single dispatching mode in the current gas industry, realize reasonable dispatching of the gas worksheet, reduce worksheet waiting time in the dispatching process, improve the efficiency of worksheet dispatching and improve the satisfaction of customers.
The method for multi-service fusion dispatch of a gas work order according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.
The method in the embodiment of the invention can be applied to a terminal, a server, software running in the terminal or the server and the like. The terminal may be, but is not limited to, a tablet computer, a notebook computer, a desktop computer, etc. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms.
Referring to fig. 1, the method mainly includes the steps of:
s100: and acquiring and preprocessing current work order data and current employee data, and generating a work order dispatching database.
It should be noted that, the current work order data includes the creation time, the number, the client information, the work order execution status and the work order processing time of a plurality of current work orders. Wherein the current work order is a known work order before the start of the assignment order. It can be appreciated that the work order execution state of the current work order is a to-be-dispatched or to-be-completed state.
It should be noted that, the current work order data carries a work order type identifier, and the work order type identifier includes any one of a maintenance identifier, an installation identifier, a security check identifier, a tube changing identifier or an ignition identifier. The function of the work order type identifier is to describe the service type of the current work order, for example, when the work order type identifier is a maintenance identifier, the service type of the current work order is a maintenance service.
The client information comprises client reservation time, client detailed address, longitude and latitude address, client name and client contact information corresponding to the current work order data, wherein the client detailed address refers to a Chinese address specific to a house number, and the longitude and latitude address corresponding to the client detailed address is longitude and latitude information of the Chinese address on a GPS map. The address of the customer is the task place of the work order.
Optionally, the address resolution is performed on the client detailed address to obtain the longitude and latitude address corresponding to the client detailed address. Only through address resolution, the client address can be converted to a latitude and longitude address and marked on the map. For example, after address resolution of "Beijing university of science and technology library", the result is "lng:116.364012, lat:39.996065".
The work order processing time refers to the time required by the staff to process the current work order. In this embodiment, the job ticket category identifiers are different, and the job ticket processing time of the current job ticket is also different. In other words, the work order processing time required to process work orders of different service types is different, but the work order processing time required to process work orders of the same service type should be the same, and the work order processing time of work orders of the same service type should be a constant value.
It should be noted that the current employee data includes the number, working time, name, contact information, and location information of the employee currently participating in the dispatch.
Optionally, the location information of the employee currently participating in the dispatch is the latitude and longitude address before the dispatch starts, that is, the departure location.
It should be noted that, the current employee data carries a business skill identifier, where the business skill identifier corresponds to a work order type identifier, and includes at least one of a maintenance skill identifier, a security check skill identifier, an installation skill identifier, an ignition skill identifier, and a management improvement skill identifier. Business skill identification refers to the skill of a particular work order type that an employee is able to handle. It can be appreciated that the business skill identifiers of the employees are in one-to-one correspondence with the business type identifiers of the worksheets. For example, when the business identifier of the employee currently participating in the dispatch includes a maintenance skill identifier and a security check skill identifier, the employee can process the work ticket with the business type identifier being the maintenance identifier and the security check identifier, i.e. the maintenance skill identifier corresponds to the maintenance identifier and the security check skill identifier corresponds to the security check identifier.
It is understood that the work time of an employee refers to the total work time of the employee on the day, which is a fixed value. In some embodiments of the invention, the working time may be 8 hours.
S200: and processing the work order dispatch database by using an improved genetic algorithm to obtain an optimal dispatch scheme.
It should be noted that the optimal assignment scheme includes several worksheet sets.
It will be appreciated that the genetic algorithm (Genetic Algorithm, GA) is a computational model of the biological evolution process that mimics the natural selection and genetic mechanisms of the darwinian biological evolution theory, a method of searching for optimal solutions by modeling the natural evolution process.
S300: distributing a plurality of work order sets to corresponding staff members according to the optimal dispatching scheme, wherein each staff member is distributed with the work order set corresponding to the optimal dispatching scheme;
s400: each employee sequentially processes the worksheets in the corresponding worksheets in the worksheets set according to the ordering of the worksheets in the worksheets set.
In some embodiments of the present invention, the preprocessing of S100 may include, but is not limited to, the following steps.
S110: the method comprises the steps of performing data cleaning on current employee data and current worksheet data, traversing the current employee data and the current worksheet data, adjusting and modifying incomplete data, and deleting repeated data;
s120: and constructing an employee skill matrix according to the number and the work order type identification of the employee currently participating in the dispatch by using the current employee data so as to realize intelligent dispatch of various service fusion.
Specifically, the step of constructing an employee skill matrix specifically includes:
s121: constructing a blank employee skill matrix: and constructing an n multiplied by 5 blank employee skill matrix according to the total number of the employees currently participating in the dispatch and the number of the service type identifiers, wherein n represents the total number of the employees currently participating in the dispatch, and the number of the service type identifiers is 5. The blank employee skill matrix is shown as follows:
wherein: a, a n Representing the skill vector of the nth employee. In this step, all staff skill vectors are blank.
S122: building skill vectors for each employee: and constructing a skill vector of each employee currently participating in the dispatch according to the skill identification of the employee currently participating in the dispatch.
Note that the skill vector of the ith employee satisfies a i =[γ 1 ,γ 2 ,γ 3 ,γ 4 ,γ 5 ]. Wherein, gamma w Is any one of 1 or 0, w=1, 2,3,4,5, specifically:
γ 1 is used to characterize whether the employee has the skill of the work order for handling the maintenance identity, and gamma when the skill identity of the employee includes the maintenance skill identity 1 =1, representing that this employee has the skill to process the work order of the maintenance identity; conversely, gamma 1 =0, then this employee is represented as not having the skill to process the work order for the maintenance identification.
γ 2 Is used to characterize whether the employee has the skill of the worksheet for processing the security identification, and when the employee's skill identification includes the security skill identification, gamma 2 =1, representing that this employee has the skill to process the worksheet of the security identification; conversely, gamma 2 =0, then it is representative that the employee does not have a process security markSkill of the identified worksheet.
γ 3 Is used to characterize whether the employee has the skill of the work order to process the ignition key, gamma when the employee's skill key includes the ignition skill key 3 =1, representing that this employee has the skill to process the work order of the ignition mark; conversely, gamma 3 =0, then this employee is represented as not having the skill to process the work order of the ignition mark.
γ 4 Is used to characterize whether the employee has the skill of the work order handling the installation identity, gamma when the employee's skill identity includes the installation skill identity 4 =1, representing that this employee has the skill to process the work order of the installation identity; conversely, gamma 4 =0, then this employee is represented as not having the skill to process the work order of the installation identity.
γ 5 Is used to characterize whether the employee has the skill to process the worksheet of the change management identifier, and gamma when the employee's skill identifier includes the change management skill identifier 5 =1, representing that this employee has the skill to process the worksheet of the change tube identifier; conversely, gamma 5 =0, then this employee is represented as not having the skill to process the worksheet of the change tube identifier.
For example, a 1 =[0,1,0,0,1]Indicating that the first employee has the skill to process the work order of the security identification and the work order of the change management identification.
S123: establishing a mapping table between row vector indexes of employee skill matrixes and employee numbers: creating a 1 xn row vector b= (B) 1 ,b 2 ,...,b n ) Sequentially storing skill vectors into row vectors B according to the sequence of staff numbers from large to small, a) i The representation number is b i Skill vector of staff. Namely b 1 Numbering staff with minimum numerical value, a 1 A skill vector representing the employee corresponding to the employee number with the smallest value; b 2 Numbering staff with the next smallest numerical value, a 2 A skill vector representing an employee corresponding to the employee's number having the next smallest value; …; b n Number of employee with maximum value, a n Representing the employee's technique corresponding to the employee's number with the greatest valueEnergy vectors.
S124: and importing the skill vectors of all the employees currently participating in the dispatch into the blank employee skill matrix according to the corresponding relation between the row vector indexes of the employee skill matrix and the employee numbers in the mapping table so as to form a complete employee skill matrix.
The implementation of the improved genetic algorithm proposed according to the embodiment of the present invention is described in detail below with reference to the accompanying drawings.
The invention solves the dispatch problem of the gas industry based on an improved hybrid self-adaptive genetic algorithm. The traditional genetic algorithm (Genetic Algorithm, GA) has strong global searching capability, but has poor local optimizing capability, and the algorithm convergence is slower, so that the operation efficiency is seriously affected. The invention introduces a elimination mechanism of a Metropolis rule which is a core idea of a simulated annealing algorithm in the crossover and mutation operation, and eliminates child individuals with poor fitness generated in the crossover and mutation stage before entering a selection elimination stage. Specifically, after offspring individuals are obtained at the crossover and mutation stages, the fitness between offspring and parent is compared, and individuals with poor offspring are accepted with probability according to the Metropolis criterion. The invention improves the genetic algorithm, can improve the local searching capability and convergence speed of the algorithm in a best-choice mode, and simultaneously ensures the diversity of the population by simulating the thought of the annealing algorithm, thereby effectively avoiding the algorithm from being in premature.
Referring to fig. 2, the specific implementation process of the improved genetic algorithm proposed in the present application is as follows:
S210: selecting a coding mode: and encoding the work order dispatching database according to a preset encoding mode.
The process of expressing a chromosome as a gene is called coding, and common coding formats include binary coding and floating point coding. However, according to the application scenario of the invention, the invention realizes the coding of individuals in the population by adopting a matrix coding mode. Specifically, the work order dispatch database is encoded in a matrix encoding manner.
It should be noted that the matrix expression used satisfies the following formula:
X=(x 1 ,x 2 ,...,x i ,...,x n ) T
wherein: x represents a chromosome, i.e., a solution, and a chromosome corresponds to a dispatch protocol. Vector x i I=1, 2,..n represents the set of work orders assigned to the i-th employee, vector x i The contained elements map the routing of the task points of the staff, which can be understood as the sequencing of the execution of the worksheet.
It should be noted that the work order set of the ith employee satisfies the following formula: x is x i =(x i1 ,x i2 ,...,x ij )
Wherein: j represents the number of work orders assigned to the ith employee. X is x ij Representing the order of the jth work order assigned to the ith employee among all work orders assigned to the ith employee, i.e. x ij The work order is numbered. X is x ij Taking a natural number between 1 and m, wherein m represents the total number of work orders required to be distributed on the same day, namely the total number of the current work orders. Specifically, when x ij ∈[1,m]When the order number x is assigned to the jth order receiving position of the ith employee ij The worksheet of (1), i.e. the jth order receiving position has worksheet number x ij Is a work order of (3). When x is ij When=0, the j-th contact position representing the i-th employee has no work order. And the order of the order receiving positions indicates the order of completing the work orders, that is, x i1 ,x i2 ,...,x ij The order of (2) indicates the order in which the work orders are executed. The smaller j, the more front the work order is.
Optionally, if no work order exists at a certain connection unit position of a certain employee in the coding matrix, the shape of the coding matrix is ensured by a zero filling mode. For example, assuming that 4 employees are involved in a dispatch, 18 current workflows, one individual X in the population 1 Expressed as:
wherein: to the direction ofQuantity x i I=1, 2,3,4 represents 4 employees, corresponding to 4 row vectors in the matrix, with 5 specific values in each row vector representing 5 job ticket numbers assigned to the ith employee. Wherein there is x 2 = (10, 6, 14, 17, 0) indicating that the work order numbered 10,6, 14, 17 was assigned to employee numbered 2, and 0 indicates that no work order was located at the 5 th contact position of employee numbered 2. Meanwhile, the order of the work orders of 10,6, 14, 17 indicates the order of execution of the 4 work orders. In addition, due to x 2 And x 4 There are only 4 work orders, so the shape of the matrix is guaranteed by zero padding.
S220: population initialization, i.e., creating an initial population: setting a population scale, initializing the population by using a greedy algorithm under constraint conditions, and generating an initial population, so that individuals of the initial population are all located in a preset feasible region. At the same time, basic parameters of the algorithm are set, which can include termination algebra and crossover rate p c1 And mutation rate p m1 Etc.
It should be noted that the initial population is a set of valid candidate solutions (individuals) that are randomly selected. Since the genetic algorithm uses chromosomes to represent each individual, the initial population is actually a set of chromosomes.
Specifically, the population initialization steps are: first, any one integer is taken in the range of [ n+m,2 (n+m) ] as the size of the population and a corresponding matrix is constructed. Then, constraints are constructed.
It should be noted that, the constraint condition is a dispatch constraint condition, which needs to satisfy two sub-conditions simultaneously: the first sub-condition is that the sum of the work order travel time and the work order processing time of the current work order is less than or equal to the work time of the employee assigned to the current work order; the second sub-condition is that the skill identity of the employee assigned to the current work order contains a skill identity corresponding to the work order type identity of the current work order.
The second condition may be determined and screened by the employee skill matrix constructed in S120.
A second sub-condition in the constraint is illustrated. For example, the work order type identifier of the current work order is a maintenance identifier, and the skill identifier of a certain employee includes a maintenance skill identifier and an ignition skill identifier. Wherein the maintenance identification of the work order corresponds to the maintenance skill identification of the employee, and the skill identification of the employee just comprises the maintenance skill identification corresponding to the maintenance identification of the work order, then the employee is considered to meet the second sub-condition. That is, the skill identity of the employee assigned to the first work order must include a skill identity corresponding to the work order type identity of the current work order, but other skill identities may be included in the skill identity of the employee in addition.
For the first work order in each work order set, the work order travel time refers to the travel time required for traveling from the departure position of the employee to the task location of the work order, and the work order travel distance refers to the distance between the departure position of the employee and the task location of the work order.
For the other worksheets except the first worksheet in each worksheet set, the worksheet single-running time of each worksheet refers to the running time required for running from the task place of the last worksheet to the task place of the worksheet, and the worksheet single-running distance of each worksheet refers to the distance between the task place of the last worksheet and the task place of the worksheet. The last work order refers to the work order arranged in the previous position of the work order, and the last work order and the work order are correspondingly positioned in the same work order set.
Alternatively, the work order travel time of the current work order may be calculated from the historical work order data and the current work order data. Specifically, the shortest distance of the actual road between two points is calculated by using a GIS technology, and the working distance of the work order with the history completed is obtained. And calculating the work single-way travel distance and the work single-way travel time of each employee of which the histories are completed according to all the histories of the employees currently participating in the dispatching, and further calculating the average travel speed of the employees. And obtaining the work single travel time of the current work order according to the average travel speed and the work single travel distance of the current work order.
And finally, initializing the population by using a greedy algorithm under the constraint condition to generate an initial population.
Further, the step of initializing the population by using a greedy algorithm to generate an initial population specifically includes:
the initial population size is randomly selected from [ n+m,2 (n+m)]An integer P in the range. Firstly, randomly distributing a work order meeting constraint conditions for a first employee from a current work order, taking the work order as a first work order, distributing the work order for the employee with the number of 1, planning a work order set of the work order, and incorporating the first work order into a work order set x of the employee with the number of 1 1 Is a kind of medium. The first work order closest to the first work order location is selected from the remaining m-1 work orders. It can be understood that the work order position refers to the longitude and latitude address of the client of the current work order, namely the work order task point, and the distance between two adjacent work orders is calculated through the longitude and latitude addresses of the two work orders. Then, it is determined whether the job ticket attempted to be added satisfies the constraint condition. If so, then this worksheet may be added to worksheet set x 1 In, add this work order to work order set x 1 In (a) and (b); if not, discarding the work order, selecting the work order closest to the first work order from the rest work orders, and returning to the step of judging whether the constraint condition is satisfied. Similarly, the employee with the number 1 is sequentially allocated with a second work order, a third work order, … and a j work order. When the work order set of staff with the number of 1 is constructed, the work orders are distributed for the remaining n-1 staff and the work order set is planned by the same method in the remaining unassigned current work orders until all work orders are incorporated into the corresponding work order set. If there are more work orders remaining that are not assigned, then this solution must be an infeasible solution and discarded. According to the method, P chromosomes are found, and the initialization of the population is completed.
The method for initializing the population is to aggregate the work orders closest to the first work order meeting the constraint condition by using the first work order randomly distributed to each employee as a starting point and distribute the work orders to the same employee by using a greedy algorithm, so that the work order set distributed to each employee achieves a local optimal solution, and the initial population X achieves a local optimal solution. By using the method for initializing the population, the generated initial population can minimize the single-way running time and the idle time of staff as soon as possible at the beginning, thereby forming excellent genes, eliminating infeasible solutions and accelerating the convergence speed of a genetic algorithm. Among these, minimizing the travel time of the chemical list and minimizing the idle time of all employees are important parts of the fitness function, as will be explained in the following embodiments.
It should be noted that the population includes a plurality of individuals, namely, chromosome x= (X) 1 ,x 2 ,...,x i ,...,x n ) T The method comprises the steps of carrying out a first treatment on the surface of the Chromosome represents a dispatch protocol. Each chromosome X comprises a plurality of gene segments X 1 ,x 2 ,...,x i ,...,x n The gene segments represent multiple sets of work orders in a dispatch protocol, each set of work orders corresponding to an employee. Each gene segment comprises a plurality of gene points, and the gene points are the work order numbers in the work order set.
S230: calculating population fitness: and constructing a fitness function, and calculating the fitness value of the individuals in the current population through the fitness function.
In the genetic algorithm, an fitness function formula is required to be predefined. And then, calculating the fitness value of the individuals in the initial population. The value of the fitness function is calculated for each individual. This operation will be performed once for the initial population, and then for each new generation after the genetic operators for selection, crossover and mutation are applied. Since the fitness of each individual is independent of the others, the computations can be performed in parallel.
In this step, the fitness function is measured by three parts: the sum of the work travel time of all employees currently participating in the dispatch, the sum of the idle time of all employees, and the sum of the workload differences of all employees. The specific construction steps of the fitness function are as follows:
first, the sum of the work travel times of all the dispatch schemes is calculated, and the first part of the function is constructed by the sum of the work travel times of all the dispatch schemes. The invention reduces the running time of the work order service by distributing proper staff, thereby reducing the service cost.
It should be noted that, the first part of the fitness function satisfies the following formula:
wherein: d (i) represents the sum of the work order travel distances of all work orders required to be completed by the ith employee, namely the sum of the work order travel distances of all work orders in the work order set of the ith employee.Represented is an average of the historical travel speeds of all employees currently engaged in the dispatch.
Optionally, according to the work orders completed by all histories of the staff, calculating the work single-way travel distance and the work single-way travel time of the work orders completed by the histories of each staff, and then calculating the average travel speed of each staff, thereby obtaining the average travel speed of all staff.
And then, according to the work order running time and the work order processing time, calculating to obtain the workload of each employee, further calculating to obtain the workload difference of all employees, and constructing a second part of the function through the workload difference of each employee. The invention realizes the work load balance by balancing the workload difference among each employee. Wherein the staff difference is measured by subtracting the average value of the work time of all staff from the work time of each staff, and the work time of each staff is measured by the sum of the work-sheet running time and the work-sheet processing time.
It should be noted that the second part of the fitness function satisfies the following formula:
wherein: c i Representing the number of work orders of the work order set assigned to the ith employee, i.e., work order set x i Is a work order number of (a); c k Representing the number of work orders of the work order set assigned to the kth employee, i.e., work order set x k K is more than or equal to 1 and less than or equal to n; w (w) j The work order processing time of the jth work order is represented, and d (k) is the sum of the work order single travel distances of all work orders required to be completed by the kth employee, namely the sum of the work order single travel distances of all work orders in the work order set of the kth employee.
And calculating idle time of all staff, and constructing a third part of the fitness function through the idle time. According to the invention, the time utilization rate of staff is maximized by reasonably arranging the work order processing time of the work order and the idle time of the staff.
It should be noted that, the idle time of the ith employee may be defined as the following formula:
wherein: t is t i For the working time of the ith employee, f i The idle time of the ith employee is indicated.
And a third part of the fitness function is obtained as shown in the following formula:
from the above, the fitness function can be designed as follows:
Wherein: a, a 1 The weight of the first part, namely the weight of the sum of the travel time of the worker; a, a 2 The weight of the second part, namely the weight of the workload difference of the staff; a, a 3 The weight of the third part, i.e. the weight of the idle time of the staff, is shown.
It should be emphasized that, according to the invention, the fitness value of the population individuals is calculated through the fitness function, and the smaller the fitness value is, the higher the fitness of the individuals is represented, and the closer the individuals are to the requirement of the optimal solution. Finally, the individual with the smallest fitness value is the optimal solution. It should be understood that fitness values and fitness of genetic algorithms are terms of different meaning.
S240: judging whether the current evolution algebra of the genetic algorithm meets the termination algebra; if not, then S250 is performed; if yes, then execution proceeds to S260.
The present invention uses a termination criterion that specifies the evolution algebra (Gen) in advance to end the algorithm. In other embodiments of the invention, other termination criteria may be employed. There are a variety of termination criteria available for checking when determining whether an algorithm can stop. Two of the most common termination criteria are: (1) the maximum number of evolutionary algebra has been reached, which also serves to limit the run-time and computational resources consumed by the algorithm. (2) In the past few generations, individuals did not have significant improvement. This can be achieved by storing the best fitness value obtained for each generation and then comparing the current best value with the best value obtained a predetermined number of generations ago. If the difference is less than or greater than a certain threshold, the algorithm may stop.
S250: selection, crossover and mutation: selecting and eliminating the current population by adopting a roulette selection method, performing crossing and mutation operation on individuals of the selected and eliminated population to generate a new population, and returning to S230.
It should be noted that the application of genetic operators for selection, crossover and mutation to populations creates a new generation based on the better individuals in the current generation. Wherein: the selection (selection) operation is responsible for selecting the dominant individuals in the current population. A crossover operation, also known as a reconstruction operation, is the creation of offspring from selected individuals, typically by interchanging parts of their chromosomes by two selected individuals to create two new chromosomes representing the offspring. A mutation (mutation) operation may randomly vary one or more chromosome values (genes) for each newly created individual, with mutation typically occurring with a particular probability.
This step involves selection, crossover and mutation.
For the selection strategy, the invention combines the optimal individual reservation and roulette selection method to select, directly copies the chromosome with the smallest fitness value in P chromosomes of each generation group into the next generation, and the rest P-1 chromosomes are generated according to the relative fitness value and the roulette selection method. The method has the advantages that on one hand, the optimal individual can smoothly enter the next generation, other individuals can be generated according to the rule of the win-win rule, and the individual with smaller fitness value can enter the next generation with higher probability. On the other hand, the invention introduces a core idea of a simulated annealing algorithm in the process of crossing and mutation, namely a elimination mechanism of Metropolis criterion, which is helpful for enhancing the local searching capability of the genetic algorithm. Thus, selecting a relatively random roulette selection method may enable the global search capability of the genetic algorithm to be guaranteed.
For the crossing operation, the crossing effect is generally determined by setting a crossing rate and a crossing operator, wherein the crossing rate is used for controlling the probability of crossing of individuals, and the crossing operator is a method for crossing. Similarly, for mutation operations, the mutation effect is generally determined by setting a mutation rate and a mutation operator, wherein the mutation rate is used for controlling the mutation probability of an individual, and the mutation operator is a mutation method.
Further, the steps of interleaving and mutation operations include:
s251: and determining the crossing rate of the individuals of the current population as a first crossing rate according to the ratio of the current evolution algebra to the termination algebra when the ratio is smaller than a preset threshold value, and determining the crossing rate of the individuals of the current population as a second crossing rate when the ratio is larger than or equal to the threshold value.
It should be noted that, the preset threshold value is greater than 0 and less than 1. First crossing rate p c1 Is a constant. First crossing rate p c1 Is a fixed crossover rate; and a second crossing rate p c2 Is an adaptive crossover rate, which is represented by the following formula:
wherein: k (k) 1 ,k 2 Are all constant and 0 < k 1 ,k 2 And is less than or equal to 1.f' represents the smaller fitness value of the two individuals involved in the crossover; f (f) avg Representing the average value of fitness values of all individuals in the current population; f (f) min Representing the smallest fitness value in the current population.
If the selected crossing rate is too high in each generation of population, the convergence speed is too high, so that premature is caused; if the selected crossing rate is too small, the convergence speed is too slow, resulting in stagnation. The invention adopts a self-adaptive method to continuously adjust the crossing rate in the operation process. Specifically, if the ratio of the current algebra to the determined termination algebra (Gen) is less than a given number l (0 < l < 1), a larger and fixed crossover rate, i.e., the first crossover rate p, is used c1 To ensure diversity of the population; if the ratio of the current algebra to the determined termination algebra (Gen) is greater than or equal to l (0 < l < 1), then an adaptive crossover rate, i.e., a second crossover rate p, is used c2 And taking different self-adaptive crossing rates according to the adaptation degree of the individual. Because the fitness function of the invention is a minimization problem, the smaller the fitness value is, the closer the individual is to the optimal solution, so the invention needs to keep the individual with the fitness value lower than the average fitness value as much as possible, and therefore, the relatively smaller fitness crossing rate is adopted. For individuals with fitness values higher than the average fitness value, a relatively large adaptive crossover rate is required to expedite the creation of new individuals.
S252: and performing cross operation on the individuals of the current population according to the cross rate of the individuals of the current population to obtain the population after the cross operation.
Further, the step of cross-manipulating the individuals of the current population includes:
first, according to the crossing rate of individuals in the current population, a plurality of individuals participating in crossing are randomly selected from the current population.
The individuals involved in crossover were male chromosomes.
Then, for any two parent chromosomes, the following crossover steps are performed:
first, fitness values of two parent chromosomes are calculated, and gene segments are selected. The specific process of selecting gene segments is as follows: two parent chromosomes are defined as a first parent chromosome and a second parent chromosome, respectively. Randomly selecting any gene segment on the two parent chromosomes, and defining the gene segment selected on the first parent chromosome as a first gene segment z 1 Defining the selected gene fragment on the second parent chromosome as a second gene fragment z 2
The gene fragment is a work order set.
Second, the gene segments are cross-optimized. Fragment z of the second Gene 2 All worksheets inserted into the first gene fragment z 1 And the first gene segment z is subjected to greedy algorithm and constraint condition 1 Reconstructing to obtain a third gene fragment z 3 Fragment z of the first Gene 1 Substitution with third Gene fragment z 3 Thereby generating a first offspring chromosome.
Similarly, the first gene fragment z 1 All of the worksheets are inserted into the second gene fragment z 2 And applying greedy algorithm and said constraint to the second gene fragment z 2 Reconstructing to obtain a fourth gene fragment z 4 Second Gene fragment z 2 Substitution with fourth Gene fragment z 4 Thereby generating a second offspring chromosome.
And thirdly, gene repair. And respectively carrying out gene repair on the first offspring chromosome and the second offspring chromosome to form a final offspring chromosome corresponding to the first parent chromosome, namely a final first offspring chromosome, and forming a final offspring chromosome corresponding to the second parent chromosome, namely a final second offspring chromosome.
In the above steps, both parent genes will optimize their own genes by using the gene of the other, resulting in more excellent gene fragments to replace the original gene fragments. After the replacement is completed, the work order numbers in the same chromosome have uniqueness, namely, one work order can only be assigned to one staff, and after the cross optimization is completed, the problem of repeated work order numbers in the same chromosome can occur, so that the offspring chromosome needs to be repaired. And after the offspring chromosome repair is completed, the final offspring chromosome is obtained so as to ensure individual diversity.
Still further, the process of gene repair may include the steps of:
for the first offspring chromosome, there is the following repair step:
fragment z of the first Gene 1 And third gene fragment z 3 Comparing;
find in the reconstruction of the first Gene fragment z 1 The deleted work order number is calculated to be the distance between the deleted work order number and the last work order number of other gene segments of the first offspring chromosome, and the deleted work order number is inserted to the tail of the other gene segments of the first offspring chromosome which meet the constraint condition and have the shortest distance.
Deleting the work order numbers repeated with the third gene segment in other gene segments of the first offspring chromosome to form a final first offspring chromosome.
For the second offspring chromosome, there is the following repair step:
fragment z of the second Gene 2 And fourth gene fragment z 4 Comparing;
finding the second Gene fragment z under reconstruction 2 The deleted work order number in the process. And calculating the distance between the deleted work order number and the last work order number of the other gene segments of the second offspring chromosome, and inserting the deleted work order number to the tail of the other gene segments of the second offspring chromosome which meet the constraint condition and have the shortest distance.
Deleting the work order numbers repeated with the fourth gene segment in other gene segments of the second offspring chromosome to form a final second offspring chromosome.
For example, if a certain gene fragment of a parent chromosome is {1,5,6}, and the gene fragment obtained after the crossover operation is {1,4,6}, the work order number newly added to the child chromosome after the crossover operation is 4, and the deleted work order number is 5. For newly added work order number 4, two employees are assigned work order number 4 at the same time, so the work order number identical to the newly added work order number in other gene segments of the offspring chromosome needs to be deleted. For deleted work order number 5, since this work order number is deleted, no employee is currently assigned to the work order of this number, and therefore, it is necessary to assign the deleted work order number to other employees, i.e., to assign the deleted work order number to other gene segments of the child chromosome, to ensure that all work orders are assigned.
The operation ensures that the filial generation generated by the intersection is a feasible solution conforming to constraint conditions, generates two filial generation retaining excellent gene segments, and can generate new individuals even if two parent individuals are the same, thereby being helpful for maintaining population diversity and improving optimizing capability and convergence speed of the algorithm.
Fourth, selecting offspring chromosomes. The step compares the fitness values of the two new offspring chromosomes with the fitness values of the two parent chromosomes. For the child chromosomes with fitness values smaller than or equal to that of the parent chromosomes, directly screening out the parent chromosomes and reserving the child chromosomes; for the offspring chromosomes with fitness values greater than that of the parent chromosomes, adopting Metropolis criterion to accept the offspring chromosomes with probability, and completing the crossover operation. When the offspring chromosomes are less adaptable than their parent chromosomes, considering that the diversity of individuals is maintained and that the offspring chromosomes may contain excellent gene segments, the Metropolis criterion is adopted to accept the offspring chromosomes with probability, the method makes the offspring chromosomes superior or equal to the parent chromosomes as a whole, and simultaneously accepts worse offspring individuals with probability, so that the algorithm is prevented from falling into precocity.
Specifically, for the first parent chromosome and the first offspring chromosome, there are the following selection steps:
and calculating the fitness value of the first offspring chromosome, and judging whether the fitness value of the first offspring chromosome is smaller than or equal to the fitness value of the first parent chromosome. If so, the first offspring chromosome is better than the first parent chromosome, the first offspring chromosome is reserved, and the first parent chromosome is eliminated. If not, it is stated that the first offspring chromosome is not superior to the first parent chromosome, and that the first offspring chromosome is accepted or retained with probability using the Metropolis criterion.
Specifically, for the second parent chromosome and the second offspring chromosome, there are the following selection steps:
and calculating the fitness value of the second parent chromosome, and judging whether the fitness value of the second child chromosome is smaller than or equal to the fitness value of the second parent chromosome. If so, the second offspring chromosome is better than the second parent chromosome, the second offspring chromosome is reserved, and the second parent chromosome is eliminated. If not, it is stated that the second offspring chromosome is not superior to the second parent chromosome, and that the second offspring chromosome is accepted or retained with probability using the Metropolis criterion.
After the above selection is completed, the interleaving step is finished.
When all individuals participating in crossover have completed the crossover step described above, a population consisting of a plurality of retained chromosomes, i.e., a population after crossover operation, is generated.
S253: and determining the mutation rate of the individuals of the population after the cross operation as a first mutation rate according to the ratio of the current evolution algebra to the termination algebra when the ratio is smaller than a preset threshold value, and determining the mutation rate of the individuals of the population after the cross operation as a second mutation rate when the ratio is larger than or equal to the threshold value.
It should be noted that, the preset threshold value is greater than 0 and less than 1. First mutation rate p m1 Constant, first mutation rate p m1 Is a fixed rate of variation; and a second variation rate p m2 The adaptive mutation rate is represented by the following formula:
wherein: k (k) 3 ,k 4 Are all constant and 0 < k 3 ,k 4 And is less than or equal to 1.f represents the fitness value of the individual involved in the mutation, f avg RepresentingAn average value of fitness values of all individuals in the current population; f (f) min Representing the smallest fitness value in the current population. In this mutation operation, the current population is the population generated after the crossover operation.
The variability affects the performance of the genetic algorithm to a large extent. In order to further improve the performance of the genetic algorithm, the invention adopts the same processing mode as the processing crossover rate, and if the ratio of the current algebra to the determined termination algebra (Gen) is smaller than a given number l (0 < l < 1), a larger mutation rate is used, namely a first mutation rate p m1 To eliminate worse individuals as soon as possible. If the ratio of the current algebra to the determined termination algebra (Gen) is greater than or equal to l, then an adaptive mutation rate, i.e., a second mutation rate p, is used m2 So as to protect excellent individuals with low fitness value, and simultaneously ensure that individuals with high fitness value have larger mutation probability and avoid premature.
S254: and carrying out mutation operation on the individuals of the cross-operated population according to the mutation rate of the individuals of the cross-operated population, so as to generate a new population.
Further, the step of performing a mutation operation on the individuals of the cross-operated population specifically includes:
first, a plurality of individuals are randomly selected from a population consisting of a plurality of offspring chromosomes according to the mutation rate of the current population.
The randomly selected individuals were chromosomes involved in mutation.
Then, for each chromosome involved in mutation, the following mutation steps were performed:
in the first step, fitness values of chromosomes involved in mutation are calculated and recorded as fitness values before mutation.
Second, randomly selecting two gene segments on the chromosome involved in mutation, wherein the gene segments are work order sets, and the randomly selected two gene segments are respectively defined as a fifth gene segment z 5 And a sixth gene segment z 6 In the fifth gene fragment z 5 And a sixth gene segment z 6 Randomly selects one gene point, and the gene point is the workerSingly numbering and mutually exchanging selected gene points to generate mutated chromosomes.
The mutated chromosome includes the fifth gene fragment z 5 Corresponding gene variant fragment and sixth gene fragment z 6 Corresponding gene mutation fragments.
And thirdly, judging whether the two gene mutation fragments meet constraint conditions. If not, the mutated chromosome is directly discarded. If yes, the mutated chromosome is a feasible solution, and the fourth step is carried out;
And step four, calculating the fitness value of the mutated chromosome, and judging whether the fitness value of the mutated chromosome is smaller than or equal to the fitness value before mutation. If so, the mutated chromosome is retained and the pre-mutated chromosome is eliminated. If not, the Metropolis criterion is used to probability acceptance of the mutated chromosome. So far, the mutation step is ended.
The principle of selecting chromosomes using the Metropolis criterion in this step is consistent with the principle of selecting chromosomes using the Metropolis criterion in the crossover operation described above. The fourth step is understood to be the comparison of fitness values of the mutated chromosome and the chromosome involved in the mutation, and if the mutated chromosome is not better than the chromosome before the mutation, the metapolis criterion is used to probabilistically accept or retain the mutated chromosome, i.e. the offspring. If the mutated chromosome is better than the pre-mutated chromosome, the mutated chromosome is retained. While discarding its parent.
Finally, when all individuals involved in mutation have completed the mutation step, a new population composed of a plurality of mutated chromosomes is generated.
And S260, taking the individual with the highest fitness value in the current population as an optimal individual, decoding the optimal individual according to the rule of matrix coding, and outputting an optimal assignment scheme.
In summary, the technical scheme provided by the invention has the following technical effects:
firstly, the invention provides a dispatching mode of multiple business fusion based on the employee skill matrix, the business skills of the employee can be rapidly inquired through the employee skill matrix, whether dispatching constraint conditions are met or not is conveniently determined, so that the worksheet is more reasonably aggregated, the time spent by the employee in travelling to the worksheet site is reduced, and the working efficiency of the employee is improved.
Furthermore, the present invention proposes an improved genetic algorithm:
firstly, the invention improves the codes, combines staff skill matrix, realizes automatic dispatch of multi-service fusion, and is suitable for application scenes of multi-service fusion dispatch.
Secondly, the invention adopts an optimal individual protection strategy, and the optimal individual in the parent population directly enters the offspring population, namely, the optimal individual is copied before the crossover to directly enter the next generation, so that the optimal individual can be prevented from being destroyed, and the optimizing speed is improved.
Third, the present invention improves the process of interleaving and mutation operations for matrix coding. In the related art, the crossover operation of conventional matrix coding is performed by cutting a large matrix (i.e., chromosome) into a plurality of small matrices (i.e., gene fragments) and then performing crossover. However, in the application scenario of the invention, one row vector represents a work order set of an employee, the work order set represents the execution sequence of all work orders, if the random transformation of a small matrix is performed, the genes are repeatedly and largely destroyed, the retention probability of excellent genes is greatly reduced, and the optimization capability of an algorithm is reduced. Therefore, aiming at the dispatch scene of the gas business applied by the invention, the invention improves the process of the cross operation of the dispatch scene, adopts a line vector as a gene segment, and uses a gene fusion mode to generate new individuals so as to improve the retention rate of excellent gene segments and avoid the phenomenon that the gene segments are repeatedly and widely destroyed, thereby improving the optimization capability of an algorithm.
In addition, the invention introduces Metropolis criterion in the crossover operation and the mutation operation, compares the adaptability between the offspring and the father after the crossover operation and the mutation operation obtain offspring individuals, and receives the offspring individuals with probability according to the Metropolis criterion. The improved genetic simulated annealing algorithm has the capability of grasping the whole in the aspect of the whole searching capability, can keep the rapid convergence rate of the genetic algorithm, and can strengthen the weakness of the genetic simulated annealing algorithm in local searching by the thought of the simulated annealing algorithm, thereby effectively avoiding the algorithm from falling into precocity.
In addition, the embodiment of the application also provides a storage medium, wherein the storage medium stores instructions executable by a processor, and the instructions executable by the processor are used for executing a multi-service fusion dispatch method of the gas work order when being executed by the processor.
Similarly, the content in the above method embodiment is applicable to the present storage medium embodiment, and the specific functions of the present storage medium embodiment are the same as those of the above method embodiment, and the achieved beneficial effects are the same as those of the above method embodiment.
In some alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flowcharts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed, and in which sub-operations described as part of a larger operation are performed independently.
Furthermore, while the invention is described in the context of functional modules, it should be appreciated that, unless otherwise indicated, one or more of the functions and/or features may be integrated in a single physical device and/or software module or may be implemented in separate physical devices or software modules. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary to an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be apparent to those skilled in the art from consideration of their attributes, functions and internal relationships. Accordingly, one of ordinary skill in the art can implement the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and are not intended to be limiting upon the scope of the invention, which is to be defined in the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, including several programs for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable programs for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with a program execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the programs from the program execution system, apparatus, or device and execute the programs. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the program execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable program execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the foregoing description of the present specification, reference has been made to the terms "one embodiment/example", "another embodiment/example", "certain embodiments/examples", and the like, means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the embodiments described above, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the present invention, and these equivalent modifications and substitutions are intended to be included in the scope of the present invention as defined in the appended claims.

Claims (8)

1. The multi-service fusion dispatch method for the gas worksheet is characterized by comprising the following steps of:
acquiring and preprocessing current work order data and current employee data, and generating a work order dispatching database;
the current worksheet data comprise worksheet processing time and task places of a plurality of current worksheets, the current worksheet data carry worksheet type identifiers, and the worksheet type identifiers comprise any one of maintenance identifiers, installation identifiers, security inspection identifiers, pipe changing identifiers or ignition identifiers;
The current employee data comprise departure positions and working times of a plurality of employees currently participating in dispatching, and the current employee data carry skill identifications, wherein the skill identifications comprise one or more of maintenance skill identifications, installation skill identifications, security check skill identifications, management improvement skill identifications and ignition skill identifications;
processing the work order dispatch database by utilizing an improved genetic algorithm to obtain an optimal dispatch scheme formed by a plurality of work order sets;
distributing a plurality of work order sets to corresponding staff members according to the optimal dispatching scheme, wherein each staff member is distributed with the work order set corresponding to the optimal dispatching scheme;
each employee sequentially processes the worksheets in the corresponding worksheets set according to the ordering of the worksheets in the worksheets set;
the method for processing the work order dispatch database by using the improved genetic algorithm to obtain an optimal dispatch scheme formed by a plurality of work order sets comprises the following steps:
coding the work order dispatching database according to a preset coding mode;
setting a population scale, initializing the population by using a greedy algorithm under constraint conditions, and generating an initial population, so that individuals of the initial population are all located in a preset feasible region;
Calculating the fitness value of the individuals of the current population through a fitness function;
judging whether the current evolution algebra of the genetic algorithm meets the termination algebra; if not, selecting and eliminating the current population by adopting a roulette selection method, performing crossing and mutation operation on individuals of the selected and eliminated population to generate a new population, and returning to the previous step; if yes, entering the next step;
taking an individual with the highest fitness value in the current population as an optimal individual, outputting the optimal individual, decoding the optimal individual according to a rule of matrix coding, and outputting an optimal assignment scheme;
the step of encoding the work order dispatch database according to a preset encoding mode comprises the following steps:
encoding the work order dispatching database in a matrix encoding mode; wherein the matrix expression used is as follows:
wherein, the coding matrix X is a chromosome, which corresponds to a dispatch scheme, and n is the total number of staff;work order set for the ith employee, which satisfies +.>,/>Wherein->Is the order of execution of the work orders, j is the number of work orders assigned to the ith employee,/>Numbering the worksheets; />And is a natural number, m is the total number of the current worksheets, when +. >When the order number is +.>Work order of->When the j-th connection unit of the i-th employee has no work order;
wherein, the step of crossing and mutating the individuals of the selected and eliminated population to generate a new population comprises the following steps:
performing cross operation on individuals of the current population according to the cross rate of the individuals of the current population to obtain a population after the cross operation;
the step of obtaining the population after the intersecting operation comprises the following steps of:
randomly selecting a plurality of individuals participating in crossing from the current population according to the crossing rate of the individuals of the current population, wherein the individuals participating in crossing are parent chromosomes;
for any two of the parent chromosomes, the following crossover steps are performed:
defining two parent chromosomes as a first parent chromosome and a second parent chromosome respectively, calculating fitness values of the two parent chromosomes, and randomly selecting any gene segment on the two parent chromosomes; the method comprises the steps of selecting a first parent chromosome as a first gene fragment, and selecting a second parent chromosome as a second gene fragment, wherein the first parent chromosome is a work order set;
Inserting all worksheets of the second gene segment into the first gene segment, reconstructing the first gene segment through a greedy algorithm and the constraint condition to obtain a third gene segment, and replacing the first gene segment with the third gene segment to obtain a first offspring chromosome;
inserting all worksheets of the first gene segment into the second gene segment, reconstructing the second gene segment through a greedy algorithm and the constraint condition to obtain a fourth gene segment, and replacing the second gene segment with the fourth gene segment to obtain a second offspring chromosome;
respectively carrying out gene repair on the first offspring chromosome and the second offspring chromosome to form a final first offspring chromosome and a final second offspring chromosome;
calculating the fitness value of a final first child chromosome, reserving the final first child chromosome by adopting a Metropolis criterion when the fitness value of the first parent chromosome is smaller than or equal to the fitness value of the final first child chromosome, reserving the final first child chromosome and screening out the first parent chromosome when the fitness value of the first parent chromosome is larger than the fitness value of the final first child chromosome;
Calculating the fitness value of a final second child chromosome, reserving the final second child chromosome by adopting a Metropolis criterion when the fitness value of the second parent chromosome is smaller than or equal to the fitness value of the final second child chromosome, reserving the final second child chromosome and screening out the second parent chromosome when the fitness value of the second parent chromosome is larger than the fitness value of the final second child chromosome;
when all individuals participating in crossover have completed the crossover step described above, a population consisting of a plurality of retained chromosomes, i.e., a population after crossover operation, is generated.
2. The method for multi-service fusion dispatch of gas worksheets according to claim 1, wherein for a first worksheet in a worksheet set, defining a worksheet one-way travel time of the first worksheet as travel time required for traveling from a departure location of an employee to a task location of the worksheet, and defining a worksheet one-way travel distance of the first worksheet as a distance between the departure location of the employee and the task location of the worksheet;
for other worksheets except the first worksheet in the worksheet set, defining the worksheet one-way travel time as the travel time required for traveling from the task site of the last worksheet to the task site of the worksheet, and defining the worksheet one-way travel distance as the distance between the task site of the last worksheet and the task site of the worksheet.
3. The method of claim 2, wherein setting the population size, initializing the population with a greedy algorithm under constraint conditions, and generating an initial population, comprises:
first, inTaking any integer as the scale of the population and constructing a corresponding matrix;
then, constructing constraint conditions, wherein the constraint conditions are defined as that the sum of the work order running time and the work order processing time of the current work order is smaller than or equal to the work time of the staff allocated to the current work order, and the skill identifications of the staff allocated to the current work order comprise skill identifications corresponding to the work order type identifications of the current work order;
and finally, initializing the population by using a greedy algorithm under the constraint condition to generate an initial population, wherein the individuals of the initial population are chromosomes, namely, the dispatch scheme.
4. The method for multi-service fusion dispatch of gas worksheets according to claim 2, wherein the step of constructing the fitness function specifically comprises:
first, the sum of the work travel times of all the pick-up schemes is calculated, and a first part of the fitness function is constructed as follows:
Wherein d (i) is the sum of the work order travel distances of all work orders in the work order set of the ith employee, wherein,an average value of the historic travel speeds of all employees;
then, according to the work order running time and the work order processing time, calculating the workload of each employee, and according to the workload of each employee, calculating the workload difference of each employee, and further constructing a second part of the fitness function as follows:
wherein,the number of work orders of the work order set for the ith employee, +.>The number of work orders representing the work order set of the kth employee,/for the work order set>The job ticket processing time of the jth job ticket, d (k) is the sum of the job ticket single travel distances of all the job tickets in the job ticket set of the kth employee;
and then, calculating idle time of all staff, and constructing a third part of the fitness function according to the idle time:
wherein,the idle time for the ith employee, which satisfies: />,/>Work time for the ith employee;
and then constructing the following fitness function:
wherein,weight of the first part of the fitness function, +.>Weight of the second part of the fitness function, +.>The weight of the third part of the fitness function.
5. The method of claim 1, wherein the step of generating a new population by performing crossover and mutation operations on individuals of the selected and eliminated population further comprises:
determining the crossing rate of the individuals of the current population as a first crossing rate according to the ratio of the current evolution algebra to the termination algebra when the ratio is smaller than a preset threshold value, and determining the crossing rate of the individuals of the current population as a second crossing rate when the ratio is larger than or equal to the threshold value;
wherein the first crossing rate is constant and the second crossing rate satisfies the following formula:
wherein,and->Are constants greater than 0 and less than or equal to 1, f' is the smaller fitness value of the two individuals involved in the crossover, +.>For the average value of fitness values of all individuals in the current population, +.>The minimum fitness value in the current population is obtained;
according to the ratio of the current evolution algebra to the termination algebra, when the ratio is smaller than a preset threshold value, determining the mutation rate of the individuals of the population after the cross operation as a first mutation rate, and when the ratio is larger than or equal to the threshold value, determining the mutation rate of the individuals of the population after the cross operation as a second mutation rate;
Wherein the first mutation rate is a constant, and the second mutation rate satisfies the following formula:
wherein,and->All are constants greater than 0 and less than or equal to 1, f is the fitness value of the individual involved in the mutation, < >>For the average value of fitness values of all individuals in the current population, +.>The minimum fitness value in the current population is obtained;
and carrying out mutation operation on the individuals of the cross-operated population according to the mutation rate of the individuals of the cross-operated population, so as to generate a new population.
6. The method of claim 1, wherein the step of performing gene repair on the first daughter chromosome to form a final first daughter chromosome comprises:
comparing the first gene segment with the third gene segment, and searching the number of the deleted work order in the process of reconstructing the first gene segment;
calculating the distance between the deleted work order number and the last work order number of the other gene segments of the first offspring chromosome, and inserting the deleted work order number to the tail of the other gene segments of the first offspring chromosome which meet the constraint condition and have the shortest distance;
Deleting the work order numbers repeated with the third gene segment in other gene segments of the first offspring chromosome to form a final first offspring chromosome.
7. The method of claim 1, wherein the step of performing gene repair on the second daughter chromosome to form a final second daughter chromosome comprises:
comparing the second gene segment with the fourth gene segment, and searching the number of the deleted work order in the process of reconstructing the second gene segment;
calculating the distance between the deleted work order number and the last work order number of the other gene segments of the second offspring chromosome, and inserting the deleted work order number to the tail of the other gene segments of the second offspring chromosome which meet the constraint condition and have the shortest distance;
deleting the work order numbers repeated with the fourth gene segment in other gene segments in the second offspring chromosome to form a final second offspring chromosome.
8. A computer readable storage medium in which a processor executable program is stored, wherein the processor executable program when executed by a processor is for implementing a multi-service fusion dispatch method of a gas job ticket according to any one of claims 1 to 7.
CN202310678859.7A 2023-06-08 2023-06-08 Multi-service fusion dispatch method for gas worksheet and storage medium Active CN116911518B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310678859.7A CN116911518B (en) 2023-06-08 2023-06-08 Multi-service fusion dispatch method for gas worksheet and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310678859.7A CN116911518B (en) 2023-06-08 2023-06-08 Multi-service fusion dispatch method for gas worksheet and storage medium

Publications (2)

Publication Number Publication Date
CN116911518A CN116911518A (en) 2023-10-20
CN116911518B true CN116911518B (en) 2023-12-26

Family

ID=88351918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310678859.7A Active CN116911518B (en) 2023-06-08 2023-06-08 Multi-service fusion dispatch method for gas worksheet and storage medium

Country Status (1)

Country Link
CN (1) CN116911518B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870647A (en) * 2014-03-14 2014-06-18 西安工业大学 Operation workshop scheduling modeling method based on genetic algorithm
CN112151119A (en) * 2020-09-01 2020-12-29 阿里云计算有限公司 Gene vector model training method, method for analyzing gene data, and respective devices
CN112148446A (en) * 2020-09-22 2020-12-29 华中科技大学 Evolutionary strategy algorithm for multi-skill resource limited project scheduling
CN112598176A (en) * 2020-12-22 2021-04-02 荆门汇易佳信息科技有限公司 Genetic and greedy algorithm fused crowdsourcing efficient assignment method
CN114038502A (en) * 2021-11-09 2022-02-11 湖南大学 Method for associating expression quantitative traits with CNV (CNV) based on gene interaction network clustering and group sparse learning
CN114912346A (en) * 2022-03-31 2022-08-16 杭州电子科技大学 Skill planning configuration and workshop scheduling integrated optimization method based on learning ability
CN114925602A (en) * 2022-05-10 2022-08-19 中国海洋大学 Multi-objective optimization method for development process of trainer rear fuselage

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870647A (en) * 2014-03-14 2014-06-18 西安工业大学 Operation workshop scheduling modeling method based on genetic algorithm
CN112151119A (en) * 2020-09-01 2020-12-29 阿里云计算有限公司 Gene vector model training method, method for analyzing gene data, and respective devices
CN112148446A (en) * 2020-09-22 2020-12-29 华中科技大学 Evolutionary strategy algorithm for multi-skill resource limited project scheduling
CN112598176A (en) * 2020-12-22 2021-04-02 荆门汇易佳信息科技有限公司 Genetic and greedy algorithm fused crowdsourcing efficient assignment method
CN114038502A (en) * 2021-11-09 2022-02-11 湖南大学 Method for associating expression quantitative traits with CNV (CNV) based on gene interaction network clustering and group sparse learning
CN114912346A (en) * 2022-03-31 2022-08-16 杭州电子科技大学 Skill planning configuration and workshop scheduling integrated optimization method based on learning ability
CN114925602A (en) * 2022-05-10 2022-08-19 中国海洋大学 Multi-objective optimization method for development process of trainer rear fuselage

Also Published As

Publication number Publication date
CN116911518A (en) 2023-10-20

Similar Documents

Publication Publication Date Title
Cheung et al. Dynamic routing model and solution methods for fleet management with mobile technologies
CN103413209B (en) Many client many warehouses logistics distribution routing resources
Benyahia et al. Decision support for vehicle dispatching using genetic programming
CN112051825A (en) Multi-target production scheduling method considering employee operation capacity in automobile trial-manufacturing workshop
Khmeleva et al. Fuzzy-logic controlled genetic algorithm for the rail-freight crew-scheduling problem
CN104700160B (en) A kind of vehicle routing optimization method
US20130246107A1 (en) Method and Device for Assigning Surplus Slabs in the Slab Yard before Hot Rolling Process
CN110751411B (en) Cloud manufacturing task oriented manufacturing resource matching method
CN113780676B (en) Method for optimizing distribution path of bottled liquefied gas vehicle
CN110705741B (en) Multi-distribution center vehicle path optimization method based on improved ant colony algorithm
CN115271130B (en) Dynamic scheduling method and system for maintenance order of ship main power equipment
CN111932106B (en) Effective and practical cloud manufacturing task and service resource matching method
CN115759917A (en) Logistics path planning method based on improved mixed ant colony algorithm
CN111191899A (en) Vehicle scheduling method based on region division parallel genetic algorithm
CN111860957B (en) Multi-vehicle-type vehicle path planning method considering secondary distribution and balancing
Haklı et al. Genetic algorithm supported by expert system to solve land redistribution problem
Huang et al. A bi-level model and hybrid heuristic algorithm for the optimal location of prefabricated building industrial park
CN116911518B (en) Multi-service fusion dispatch method for gas worksheet and storage medium
CN117273275A (en) Flight management and control plan generation method based on genetic programming algorithm
CN115421885B (en) Distributed multi-target cloud task scheduling method and device and cloud service system
CN110633784B (en) Multi-rule artificial bee colony improvement algorithm
CN112966968B (en) List distribution method based on artificial intelligence and related equipment
CN110119317A (en) A kind of cloud computing method for scheduling task and system based on genetic algorithm
CN115186905A (en) Multi-task optimization method and system for inter-city network taxi appointment path planning
Zhou et al. A self-adaptive hybrid algorithm for planning city air terminals

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant