Method and electronic device for task scheduling in a work environment

CN122902455APending Publication Date: 2026-10-13BSH HOME APPLIANCES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611096806.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0003]传统调度方案中,一些方案严重依赖人工经验,易陷入局部最优,且随着作业环境复杂度提升,其决策质量显著下降

Benefits of technology

[0041]由此,可将产品切换类型纳入搜索过程,可引导算法在搜索中主动降低换型次数和换型成本,提升搜索效率,减少因频繁换型导致的无效搜索。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122902455A_ABST
    Figure CN122902455A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method for task scheduling in a job environment, comprising: performing iterative search by means of a searcher to generate candidate solutions corresponding to job scheduling plans, the candidate solutions comprising at least job ordering information and resource allocation information of each task in the job environment; evaluating the candidate solutions generated by each search by means of an evaluator, and determining a corresponding fitness at least according to whether each candidate solution satisfies a zero-tardiness constraint, the fitness of the candidate solution satisfying the zero-tardiness constraint being superior to that of the candidate solution with tardiness; guiding subsequent search of the searcher according to the fitness to generate next-generation candidate solutions; and stopping the iterative search and outputting the candidate solution with the optimal fitness when a preset termination condition is satisfied. By means of the fitness evaluation mechanism with the zero-tardiness constraint as a hard constraint, the feasible solution satisfying the zero-tardiness constraint is strictly superior to any solution with tardiness, the search resources can be preferentially concentrated in the feasible region satisfying the hard deadline, and the stability of the zero-tardiness scheduling is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent scheduling, and in particular to a method for task scheduling in a working environment, an electronic device, a computer program product, and a computer-readable storage medium. Background Technology

[0002] Against the backdrop of increasingly stringent requirements for digital supply chains and on-time delivery, manufacturing companies need to quickly generate executable scheduling solutions under conditions of dynamic order arrivals, fluctuating demand, and limited equipment and spare parts resources.

[0003] Traditional scheduling schemes often rely heavily on human experience, making them prone to getting trapped in local optima. Furthermore, their decision-making quality significantly deteriorates as the complexity of the work environment increases. In some typical search algorithms, the objective function is designed to retain solutions that allow high profits but violate time constraints for extended periods, making it difficult to guarantee zero-delay delivery. Moreover, the candidate solution structure of existing algorithms typically only contains job ranking information, resulting in a single decision variable and difficulty in simultaneously expressing multiple resource constraints, thus limiting their applicability and solution quality in complex work environments.

[0004] It is evident that existing scheduling schemes still have significant limitations when dealing with complex operating environments. Summary of the Invention

[0005] The purpose of the embodiments of this application is to provide a method for task scheduling in a working environment, an electronic device, and a computer program product, so as to at least solve some of the problems in the prior art.

[0006] According to a first aspect of this application, a method for task scheduling in a work environment is provided, comprising: An iterative search is performed using a search engine to generate candidate solutions for the job scheduling plan. The candidate solutions include at least the job ordering information and resource allocation information of each task in the job environment. The evaluator is used to evaluate the candidate solutions generated in each search. The fitness of each candidate solution is determined based on whether it satisfies the zero delay constraint. The fitness of the candidate solution that satisfies the zero delay constraint is better than that of the candidate solution that has delay. The fitness level guides the searcher's subsequent searches to generate the next generation of candidate solutions; and When the preset termination condition is met, the iterative search stops and the candidate solution with the best fitness is output.

[0007] This application specifically includes the following technical concept: When determining fitness, the evaluation mechanism of this application uses zero-delay as a hard constraint and follows the principle of prioritizing feasibility, ensuring that feasible solutions satisfying the zero-delay constraint are strictly superior to any infeasible solutions with delays. Therefore, search resources can be preferentially concentrated on feasible regions that satisfy the hard deadline, effectively preventing the search direction from being deviated from by high-profit but infeasible solutions, and significantly improving the stability and interpretability of zero-delay scheduling.

[0008] According to an optional embodiment of this application, if all tasks in the job scheduling plan corresponding to a candidate solution can be completed within their corresponding delivery deadlines, then the candidate solution satisfies the zero delay constraint.

[0009] Therefore, the zero-delay constraint is clearly defined as the criterion for each task, providing a strict quantitative basis for feasibility evaluation rather than a holistic qualitative assessment, thereby fundamentally ensuring the zero-delay nature of the scheduling plan.

[0010] According to an optional embodiment of this application, the evaluator further determines the fitness based on the degree of delay corresponding to each candidate solution. For example, a candidate solution with a lower fitness has a better fitness. For example, the degree of delay is at least one of the following: the total delay time of all tasks, the number of delayed tasks, or the number of products not completed on time in the delayed tasks.

[0011] This allows for a more refined method of determining fitness, guiding the search algorithm to prioritize exploring solutions with less delay and improving search efficiency.

[0012] According to an optional embodiment of this application, the evaluator further determines fitness based on the profit corresponding to each candidate solution. For example, among multiple candidate solutions with the same degree of delay, the candidate solution with higher profit has better fitness. For example, fitness is additionally determined based on profit only if the candidate solution satisfies the zero delay constraint. For example, the profit is determined based on the gross profit of each task, outsourcing costs or revenue, inventory holding costs, and task switching costs.

[0013] Therefore, when searching for feasible scheduling plans, economic benefits can be considered, guiding the search algorithm to converge towards high-profit feasible solutions. Furthermore, by considering profit only if candidate solutions satisfy the zero-delay constraint, rather than uniformly weighing profit and delay across all candidate solutions, solutions with delays but high profits are avoided from being retained for extended periods, thus improving search efficiency.

[0014] According to an optional embodiment of this application, the evaluator determines fitness based on the following priority rules: First, candidate solutions are divided into feasible and infeasible solutions according to whether they satisfy the zero delay constraint, with the fitness of any feasible solution being better than that of any infeasible solution; for the feasible solutions, fitness is further determined based on profit, with feasible solutions having better fitness for higher profits; for the infeasible solutions, fitness is further determined based on the degree of delay, with infeasible solutions having better fitness for lower delay degrees.

[0015] Therefore, by using a tiered evaluation mechanism, the absolute priority of zero-delay constraints can be ensured, while taking into account the multi-dimensional optimization of profit and the degree of delay.

[0016] According to an optional embodiment of this application, the method further includes: translating the candidate solution into a corresponding schedule using a decoder, and then providing it to the evaluator for evaluation, wherein the schedule includes at least the estimated completion time of each task (e.g., identified as internally produced in the candidate solution); using the evaluator, comparing the estimated completion time of each task (e.g., identified as internally produced in the candidate solution) with its corresponding delivery deadline; if the estimated completion time of all tasks (e.g., identified as internally produced in the candidate solution) is not later than the corresponding delivery deadline, then the candidate solution is determined to satisfy the zero-delay constraint.

[0017] Therefore, complex industrial constraints can be moved forward to a unified decoding stage, so that the candidate solutions generated by the searcher are transformed into actual executable scheduling schemes before being evaluated, thereby ensuring that the fitness determination is more objective and accurate, while significantly reducing invalid searches caused by physical resource conflicts.

[0018] According to an optional embodiment of this application, the decoder embeds a resource availability synchronization mechanism into the decoding process when generating the scheduling schedule. For example, the decoder dynamically maintains the occupancy status and earliest available time of the following resources in the work environment to avoid resource usage conflicts: work equipment, work accessories, and / or auxiliary replacement resources. For instance, if the resources required by a task are currently occupied by other tasks, the estimated start time of the task is postponed until the required resources become available.

[0019] Therefore, physical resource conflicts are resolved simultaneously during the decoding process, ensuring that the scheduling timetable corresponding to the candidate solution is executable in the actual working environment, and significantly reducing invalid searches caused by physical resource conflicts.

[0020] According to an optional embodiment of this application, the decoder further determines the estimated completion time of each task based on the task switching type of successive tasks on the same work equipment. For example, the task switching types include: no switching required, material change only, work accessory change only, and simultaneous material and work accessory change. For instance, when the task switching type involves changing work accessories, the decoder further determines the estimated start time of the task based on the occupancy status of auxiliary switching resources.

[0021] Therefore, incorporating task switching types into the decoding process allows the scheduling time to reflect the switching time in the time calculation and synchronizes the occupancy status of shared auxiliary resources, thereby improving the accuracy of scheduling.

[0022] According to an optional embodiment of this application, the method further includes: generating an initial solution as a candidate solution before the first iteration search, wherein the initial solution is generated by a mixture of at least two of the following rules: random rule, empirical rule, priority rule and FIFO rule.

[0023] Therefore, by combining multiple initialization rules, the initial solution can simultaneously possess search diversity and feasibility orientation, which helps the searcher enter the high-quality feasible region more quickly, reduces early invalid searches, and improves the stability and convergence efficiency of the search algorithm in complex scheduling scenarios.

[0024] According to an optional embodiment of this application, the method further includes: when the evaluator determines that a candidate solution is delayed, and under the condition of meeting a preset triggering condition, performing a feasibility repair operation on the delayed candidate solution, wherein the feasibility repair operation includes: switching at least some tasks in the delayed candidate solution from internal production to outsourced production. For example, after the feasibility repair operation is completed, the repaired candidate solution is re-evaluated, and the candidate solution with better fitness is selected as the new candidate solution between the original candidate solution and the repaired candidate solution.

[0025] Therefore, by using an outsourcing switchover repair mechanism, internal resources can be released under reasonable conditions, effectively reducing the amount of delayed defaults and increasing the probability of discovering a zero-delay feasible solution.

[0026] According to an optional embodiment of this application, the preset triggering conditions include: triggering with a preset probability, triggering when the delay of a candidate solution exceeds a preset threshold, and / or triggering when no candidate solution satisfying the zero delay constraint is generated for multiple consecutive generations; and / or, the at least part of the tasks are one or more tasks that have the greatest impact on the delay of the candidate solution among the outsourceable tasks of the candidate solution.

[0027] Therefore, by setting trigger conditions for outsourced repairs, unnecessary outsourcing can be reduced while ensuring delivery time, and the computational and time overhead caused by performing repair operations too frequently can be avoided.

[0028] According to an optional embodiment of this application, the searcher employs a metaheuristic search algorithm, which includes a genetic algorithm, a discrete particle swarm optimization algorithm, and / or a simulated annealing algorithm.

[0029] Therefore, the search algorithm can be flexibly selected or switched according to the specific application scenario, which enhances the versatility and adaptability of the method.

[0030] According to an optional embodiment of this application, when the searcher executes the genetic algorithm, the subsequent search of the searcher is guided by fitness in the following manner: parent selection is performed based on fitness, and candidate solutions with higher fitness have a higher probability of being selected in the parent selection; based on the fitness, the next generation candidate solution is selected between the parents of the current population and the generated offspring.

[0031] Thus, by guiding parental selection and population renewal through fitness, the population evolves towards a direction of zero delay and high profit.

[0032] According to an optional embodiment of this application, when the searcher executes the discrete particle swarm optimization algorithm, the subsequent search of the searcher is guided by fitness in the following ways: determining the individual historical best position and the global best position of the population based on fitness to guide the flight direction of the particles; determining whether to accept the new particle position generated after the position update based on fitness; and performing a local search on elite particles based on fitness to improve the position of elite particles.

[0033] Therefore, by using fitness to guide particle flight direction, position acceptance judgment, and elite local search, multi-level search optimization can be achieved.

[0034] According to an optional embodiment of this application, when the searcher executes the simulated annealing algorithm, the subsequent search of the searcher is guided by fitness in the following manner: based on fitness, a decision is made on whether to accept a newly generated candidate solution according to an acceptance criterion; if the fitness of the newly generated candidate solution is better than that of the current candidate solution, it is accepted; if the fitness of the newly generated candidate solution is worse than that of the current candidate solution, it is accepted with a preset probability related to the current temperature; and / or, based on the comparison result between the fitness of the current solution at the end of the previous temperature layer and the historical best solution, the search performance of the previous temperature layer is determined, and the temperature adjustment action of the next temperature layer is determined by a Q-learning controller according to the search performance.

[0035] Therefore, by using fitness-guided acceptance criteria and temperature adjustment, a dynamic balance can be achieved between exploration and development.

[0036] According to an optional embodiment of this application, when the searcher executes a population-based search algorithm, the search is performed in parallel and independently on multiple CPU cores. Each CPU core maintains its own candidate solution population and iterates independently. When preset migration conditions are met, the CPU cores exchange some candidate solutions to share search information.

[0037] Therefore, by using the parallel island search mechanism, multi-core computing resources can be fully utilized, the overall population size can be effectively expanded, and the efficiency of solving large-scale scheduling problems can be significantly improved.

[0038] According to an optional embodiment of this application, the working environment is an injection molding workshop, the job sorting information in the candidate solutions includes the processing order of each production order, and the resource allocation information includes the injection molding machine and mold allocated to each production order or its corresponding process.

[0039] This clarifies the specific meaning of job sequencing and resource allocation, allowing this method to be well adapted to the injection molding workshop scenario and effectively address the complex scheduling needs of multiple machines, molds, and orders in the injection molding workshop.

[0040] According to an optional embodiment of this application, the working environment is an injection molding workshop. When generating the next generation of candidate solutions with the help of a search engine, the product switching type corresponding to two production orders processed consecutively on the same injection molding machine is considered. The product switching type determines whether it is necessary to change the mold for the injection molding machine and whether it is necessary to occupy the crane. And / or, when the search engine performs modification operations on the candidate solutions, it adopts a modification direction that reduces the number of mold changes and / or the changeover cost between successive production orders on the same injection molding machine.

[0041] Therefore, product type switching can be incorporated into the search process, which can guide the algorithm to actively reduce the number of type switching times and the cost of type switching, improve search efficiency, and reduce invalid searches caused by frequent type switching.

[0042] According to an optional embodiment of this application, the method further includes: converting the output candidate solution with the best fitness into an executable scheduling schedule and sending it to the job environment for execution; and / or, the method adopts a rolling window rescheduling strategy to obtain a set of tasks to be processed within a preset time period over time and execute the search process to generate a corresponding job scheduling plan.

[0043] Therefore, new requirements can be repeatedly read within the scrolling window, which can reasonably cope with dynamic changes in the work environment such as order release, order insertion, and demand fluctuations.

[0044] According to a second aspect of this application, an electronic device is provided, the electronic device including a memory and a processor, the memory storing computer program instructions, which, when executed by the processor, enable the processor to perform the method according to the first aspect of this application.

[0045] According to a third aspect of this application, a computer program product is provided, comprising computer program instructions, wherein, when executed by a processor, the computer program instructions enable the processor to perform the method according to a first aspect of this application.

[0046] According to a fourth aspect of this application, a computer-readable storage medium is provided that stores computer program instructions, which, when executed by a processor, cause the processor to perform the method described according to a first aspect of this application. Attached Figure Description

[0047] The principles, features, and advantages of this application will be better understood below with reference to the accompanying drawings. The drawings include: Figure 1 A flowchart is shown of a method for task scheduling in a job environment according to an exemplary embodiment of this application; Figure 2 A schematic diagram illustrating a task scheduling framework for a working environment according to an exemplary embodiment of this application is shown. Figure 3 A schematic diagram of a scheduling schedule generated by decoding a candidate using a decoder, according to an exemplary embodiment of this application, is shown. Figure 4 A schematic diagram of an evaluator according to an exemplary embodiment of this application is shown; Figure 5 A schematic diagram illustrating the parallel execution of a search process on multiple CPU cores according to an exemplary embodiment of this application is shown; Figure 6 An exemplary flowchart illustrating the use of a searcher to perform a genetic algorithm to search for candidate solutions according to an exemplary embodiment of this application is shown; Figure 7 An exemplary flowchart is shown, illustrating a method for searching candidate solutions by employing a discrete particle swarm optimization algorithm with the aid of a searcher, according to an exemplary embodiment of this application. Figure 8 An exemplary flowchart illustrating the use of a searcher to perform a simulated annealing algorithm to search for candidate solutions, according to an exemplary embodiment of this application, is shown; and Figure 9 A block diagram of an electronic device according to an exemplary embodiment of this application is shown. Detailed Implementation

[0048] To make the technical problems to be solved, the technical solutions, and the beneficial technical effects of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and several exemplary embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit the scope of protection of this application.

[0049] Before proceeding with the specific description, it should be noted that the terms "first," "second," etc., used in this document are only for distinguishing descriptions and should not be construed as indicating or implying relative importance, nor should they be construed as implicitly indicating the number of technical features indicated.

[0050] Figure 1 A flowchart of a method for task scheduling in a working environment according to an exemplary embodiment of this application is shown. In this embodiment, the method includes steps 101 to 102, wherein step 101 is further shown to include sub-steps 1010 to 1012.

[0051] In step 101, an iterative search is performed using a search engine to generate candidate solutions corresponding to the job scheduling plan. The candidate solutions include at least job sorting information and resource allocation information for each task in the job environment.

[0052] The work environment refers to systems or places that require task scheduling and resource allocation, such as industrial manufacturing environments (covering production, processing, assembly, etc., such as injection molding workshops, machining workshops, and electronic assembly lines), logistics and warehousing environments (such as automated storage and retrieval systems, AGV handling systems, and sorting centers), as well as food processing / distribution sites, pharmaceutical production workshops, etc.

[0053] In one embodiment, the operating environment is an industrial automation environment, meaning that each operational step related to production, processing, and assembly follows controllable and predictable operating parameters, and the state of the operating environment can be simulated, modeled, or decoded within a predetermined accuracy range. For example, in an injection molding workshop, the processing time, mold change time, and crane occupancy time of each piece of equipment are all known parameters. The state of the operating environment (such as equipment idle time, occupancy status of work parts, and available crane time) can be accurately calculated or predicted, thereby providing a reliable simulated production scheduling basis for scheduling decisions.

[0054] A job scheduling plan refers to an executable arrangement of the execution order and resource allocation of various tasks in a work environment. For example, a scheduling plan can be represented as a task execution table arranged in chronological order, which lists the tasks to be executed at each time node, the allocated work equipment, the auxiliary resources required, the outsourcing status, and whether there are any delays, to guide actual production execution.

[0055] A candidate solution for a job scheduling plan refers to a correspondence between a candidate solution (i.e., a data structure generated by a search algorithm) and a complete job scheduling plan (i.e., an executable production arrangement). For example, through the transformation of a decoder, the mathematical representation of a candidate solution can be decoded to obtain the job scheduling plan.

[0056] Job sequencing information includes, for example, the execution order of each task or task procedure in the work environment. Resource allocation information includes, for example, the allocation relationship between tasks or task procedures and work equipment, and the allocation relationship between tasks or task procedures and work accessories.

[0057] A task refers to a work unit that needs to be performed by work equipment in a work environment; it can be understood as a customer order, picking order, or production order. Each task corresponds to a task type (e.g., product type, part type, or operation type) and includes a corresponding delivery deadline (i.e., the latest time the task must be completed) and the estimated operation time on each work equipment. In actual operation, a task may include multiple operations, which may have a certain sequence and coordination, and may require different work equipment and accessories.

[0058] Operating equipment refers to physical resources that perform tasks in a working environment, such as injection molding machines, CNC machine tools, machining centers, robotic arms, autonomous mobile robots, conveyor belts, testing equipment, and packaging equipment. Typically, operating equipment can only perform one task at a time and corresponds to one task type (e.g., product or part type). It can only start the next task after completing the previous one, and its idle or busy status and earliest available time can be obtained in real time.

[0059] Workpieces refer to process equipment that needs to be used in sync with the work equipment during operation, including but not limited to replaceable parts such as molds, fixtures, and cutting tools. These auxiliary resources are continuously occupied during task execution, and their availability and assembly status directly affect whether the task can be carried out normally. In some cases, the number of workpieces is limited, and the same workpiece can only be occupied by one task at a time. Therefore, resource conflicts will occur when multiple tasks compete for the same workpiece simultaneously. These workpieces that require coordinated allocation and cannot be occupied by multiple tasks simultaneously are also referred to as shared workpieces in this application.

[0060] In addition, auxiliary changeover resources may be provided in the work environment. These are auxiliary equipment temporarily needed during task switching or the preparation phase before the start of a task. Examples include cranes, preheating devices, and cleaning equipment for changing work parts. These auxiliary resources are generally only used during the parts changeover operation and are released after the changeover is completed, without participating in the continuous processing of the task.

[0061] Taking an injection molding workshop as an example, operating accessories include molds mounted on machines, while auxiliary changeover resources include the single, non-preemptive overhead crane required for mold changes. The crane can only serve one operating device at a time; other devices must wait for it to be released before it can be used. The availability of shared auxiliary resources directly affects the estimated start time of the task, especially when changing operating accessories.

[0062] In one embodiment, the solution space of candidate solutions can be a multi-layered encoding structure (e.g., three layers), encoding different decision dimensions such as task ranking, job equipment allocation, and job accessory allocation in different layers, so that different search algorithms can represent and operate on solutions under the same data structure. For example, the task ranking layer can be represented as [job3, job2, job1, job4, …], the job equipment allocation layer can be represented as [M1, M1, M3, …], and so on. This multi-layered encoding structure can be shared by multiple search algorithms.

[0063] In another embodiment, candidate solutions can also employ other forms of encoding structures, such as a single-layer encoding structure, which encodes job sequencing information and resource allocation information in the same sequence. For example, a candidate solution can be represented as [job3-M1-m2, job2-M1-m1, job1-M3-m2, …], meaning that task job3 is assigned to equipment M1 and accessory m2 and is executed first; task job2 is assigned to equipment M1 and accessory m1 and is executed second; and so on. Furthermore, candidate solutions can also employ other non-encoded solution representations.

[0064] For example, the operating environment is an injection molding workshop, and the job sequencing information in the candidate solutions includes the processing order of each production order, while the resource allocation information includes the injection molding machines and molds allocated to each production order or its corresponding process. The job sequencing information and resource allocation information can also be determined, for example, based on the product type, process requirements, and / or equipment compatibility of each production order.

[0065] For example, the equipment assigned to each task must belong to the set of workable equipment for that task. This set of workable equipment can be predefined by a machine qualification matrix to represent the compatibility relationship between different task types and workable equipment. If the candidate equipment set for a task (such as job1) contains only two injection molding machines, M1 and M5, then the resource allocation information can only assign M1 or M5 to that task. There cannot be any allocation relationship to incompatible equipment such as M2, thereby ensuring that the resource allocation information always meets the equipment compatibility constraints.

[0066] In one embodiment, the candidate solutions may further include production mode identifiers for each task to indicate whether the corresponding task is outsourced or in-house. If a task is in-house, its resource allocation information includes the equipment and spare parts allocated to that task. If a task is outsourced, the resource allocation information does not allocate equipment and spare parts to that task, indicating that the task does not occupy in-house equipment and spare parts resources.

[0067] In one embodiment, the searcher may employ a metaheuristic search algorithm, such as a genetic algorithm, a discrete particle swarm optimization algorithm, and / or a simulated annealing algorithm.

[0068] like Figure 1 As shown, step 101 further includes sub-steps 1011 and 1012, and also includes an optional sub-step 1010.

[0069] For each iteration of the search, in sub-step 1011, the currently obtained candidate solutions are evaluated using an evaluator. The fitness of each candidate solution is determined based on whether it satisfies the zero-delay constraint, with candidate solutions satisfying the zero-delay constraint having a higher fitness than those with delays. In sub-step 1012, the fitness guides the searcher's subsequent searches to generate the next generation of candidate solutions. This process is repeated iteratively until the termination condition is met.

[0070] In one embodiment, the zero-delay constraint is determined as follows: if all tasks in the job scheduling plan corresponding to a candidate solution can be completed within their corresponding delivery deadlines, then the candidate solution satisfies the zero-delay constraint. For example, in candidate solution A, one task, job2, is overdue, while the remaining tasks are completed on time; in candidate solution B, all tasks are completed on time. Therefore, regardless of how candidate solution A performs in terms of profit or other indicators, its fitness is lower than that of candidate solution B because candidate solution B satisfies the zero-delay constraint while candidate solution A does not.

[0071] In another embodiment, more stringent conditions may be set, such as requiring that the estimated completion time of all tasks is earlier than their respective delivery deadlines by a certain time margin, in order to be considered to meet the zero-delay constraint.

[0072] In one embodiment, the feasibility of candidate solutions is determined based on the zero-delay constraint. Candidate solutions that satisfy the zero-delay constraint are defined as feasible solutions, while candidate solutions that do not satisfy the zero-delay constraint are defined as infeasible solutions. The fitness of feasible solutions is better than that of infeasible solutions.

[0073] In one embodiment, the evaluator also additionally determines fitness based on the degree of delay corresponding to each candidate solution. For example, among multiple infeasible solutions, the candidate solution with a smaller degree of delay has better fitness. The degree of delay can be characterized, for example, by any of the following: the total delay time of all tasks, the number of delayed tasks, or the number of products not completed on time in the delayed tasks.

[0074] In one embodiment, the evaluator additionally determines fitness based on the profit corresponding to each candidate solution. For example, among multiple candidate solutions with the same degree of delay, the candidate solution with higher profit has better fitness. When the degree of delay is different, fitness is determined primarily based on the degree of delay. Alternatively, fitness may be additionally determined based on profit only if the candidate solution satisfies the zero delay constraint.

[0075] In one embodiment, when determining fitness, the evaluator prioritizes zero-delay constraints over the degree of delay, and the degree of delay over profit, as will be discussed below. Figure 4 To elaborate further.

[0076] In one embodiment, fitness can be represented as an array, for example, fitness = [feasibility, delay level, profit], and the array elements are compared one by one according to their priority. That is, feasibility is compared first, then the delay level, and finally the profit. This comparison method is also called lexicographical comparison.

[0077] For example, the fitness of solution A is fitness = [0, 0, 300], where 0 indicates that the solution is feasible (zero delay) and the profit is 300. The fitness of solution B is fitness = [1, 5, 500], where 1 indicates that the solution is infeasible (delay exists), the delay level is 5, and the profit is 500. In the comparison, the first feasibility criterion is compared first; 0 is better than 1, therefore the fitness of solution A is better than that of solution B, even though solution B has a higher profit. If the feasibility is the same, the delay level is then compared. If the delay level is also the same, the profit is compared last.

[0078] In another embodiment, fitness can also be in scalar form, for example, calculated as a single value using a weighted method. In this numerical calculation, zero-delay feasibility, for example, has the highest weight, so that the fitness is mainly determined by zero-delay feasibility, ensuring that the fitness of all feasible solutions is better than that of any infeasible solution.

[0079] In one embodiment, in sub-step 1012, the process of using fitness to guide the search for candidate solutions can be implemented in different ways depending on the search algorithm. For example, for a genetic algorithm, fitness affects parent selection and elite retention. For a discrete particle swarm optimization algorithm, fitness affects particle position updates and the local search of elite particles. For a simulated annealing algorithm, fitness affects the acceptance criteria for new neighborhood solutions and the temperature adjustment method.

[0080] In one embodiment, when generating the next generation of candidate solutions using a search engine, the product switching type corresponding to two consecutive production orders processed on the same injection molding machine can be considered. This product switching type determines whether a mold change is needed for the injection molding machine and whether a crane needs to be used. For example, during the mutation operation on the job ranking information of candidate solutions in a genetic algorithm, tasks with the same or similar product switching types can be clustered together to avoid disrupting the continuous structure of similar tasks and increasing the need for switching. When reallocating resource allocation information, the allocation of machines and molds can also be guided by the product switching type to reduce the switching costs between adjacent tasks.

[0081] In one embodiment, the process of generating the next generation of candidate solutions using a searcher includes modifying the job ranking information and / or resource allocation information of the previous generation of candidate solutions. When performing such modifications, for example, modification directions that can reduce the number of job changes or the cost of job changes can be prioritized, thereby guiding candidate solutions to gradually converge to a scheduling scheme with fewer job changes and better cost.

[0082] Before the first iteration search, an initial solution can be generated as a candidate solution in an optional step 1010, and the initial solution can be evaluated by an evaluator in sub-step 1011 to obtain the corresponding fitness value, which is provided to the searcher as the starting point for the search. Then, subsequent iterations of the search are started to generate the next generation of candidate solutions.

[0083] For example, the initial solution may be generated using a combination of at least two of the following rules: Randomization rules: Initial solutions are generated randomly. For job ordering information, such as randomly shuffling the task sequence, the order of operations within the same task remains unchanged (e.g., multiple operations within the same task must be processed sequentially according to the process order). For example, the sequence {3, 2, 2, 1} indicates that the processing order is: task job3 is processed first, then the first operation of task job2, then the second operation of task job2, and finally task job1. The two operations of job2 have a fixed order and cannot be changed. For resource allocation information, corresponding equipment and accessories can be randomly selected from the candidate equipment set and candidate accessory set for each task. Random initialization is used to cover different search areas.

[0084] Empirical rules: Initial solutions are generated based on historical scheduling experience or manual planning experience. For job sequencing information, clustering can be performed first according to the types of job accessories suitable for each task. After clustering, sorting can be performed by time window, accessory type, and material type. Within the same cluster, tasks can be sorted in ascending order by required time (e.g., delivery deadline). For resource allocation information, historical experience data can be prioritized (e.g., for each task type, existing experience indicates the most efficient or best-fitting equipment / accessory combination). If no experience is available, then, for example, the equipment and accessory combination with the lowest switching cost can be selected for each task.

[0085] Priority rules: An initial solution is generated based on at least one of the following: task delivery deadline, minimum slack time, changeover time, and / or changeover cost. For job sequencing information, tasks can be sorted in ascending order by delivery deadline or minimum slack time (i.e., the latest possible start time, calculated by subtracting processing time from the delivery deadline), with tasks having earlier latest start times receiving higher priority. For resource allocation information, all combinations of available equipment and spare parts can be iterated through, and a greedy strategy can be used to select the equipment-spare part combination that minimizes the task's expected start time, changeover time, and / or changeover cost.

[0086] Time ordering rule: also known as FIFO rule. For job sorting information, the initial sorting is determined according to the release time or arrival order of tasks. The task with the earliest release time or the earliest arrival is given priority for processing. For resource allocation information, a greedy strategy can be used to select the earliest available combination of equipment and accessories.

[0087] In step 102, when the preset termination condition is met, the iterative search stops and the candidate solution with the best fitness is output.

[0088] In one embodiment, the preset termination condition includes the used solution time reaching or exceeding a preset time threshold. The used solution time is, for example, the actual time the algorithm spends on the processor for computation, excluding I / O wait times, operating system scheduling, or CPU time occupied by other programs.

[0089] For example, the preset time threshold can be adaptively determined based on the size of the current scheduled instance. For instance, when the number of orders and machines is less than a first size threshold (corresponding to small / medium-sized instances), the preset time threshold is 1200 seconds. When the number of orders and machines is greater than a second size threshold (corresponding to large-scale instances), the preset time threshold is 28800 seconds. The size of the scheduled instance can be measured by dimensions such as the number of tasks to be processed within the scrolling window and / or the number of working devices in the job environment, to characterize the size of the solution space.

[0090] In one embodiment, after stopping iteration and obtaining the candidate solution with the best current fitness (hereinafter referred to as the optimal solution), the optimal solution can be converted into an executable scheduling schedule and sent to the work environment for execution. The optimal solution may include, for example, a mathematical representation of job sequencing information, job equipment allocation information, and job accessory allocation information. The converted executable scheduling schedule is further enhanced with detailed time information, including the estimated start and end times of each task, whether the task is marked as outsourced, the estimated operation duration, required job accessories (such as mold numbers), crane occupancy status, inventory status changes, and product type and quantity. This information can be used to guide actual production execution, progress tracking, and resource scheduling optimization.

[0091] An example of an executable scheduling schedule is shown below: 9:00-9:30: Task job1 (product type P1, quantity 300) is assigned to work equipment M1, using mold m1, expected to be completed by 9:30, inventory +300; 9:30-10:15: Task job3 (product type P2, quantity 200) is assigned to work equipment M2, using mold m2. Mold change is required, which will occupy the crane from 9:30 to 9:45. It is expected to be completed at 10:15. Inventory +200. 10:15-11:00: Task job2 (product type P1, quantity 250) is assigned to work equipment M1, using mold m1 (same mold as job1, no mold change required), expected to be completed at 11:00, inventory +250; 11:00-11:40: Task job4 (product type P3, quantity 180) is assigned to work equipment M3, using mold m3. Mold change is required, which will occupy the crane from 11:00 to 11:15. It is expected to be completed at 11:40. Inventory +180.

[0092] It should be noted that the specific values ​​and information items such as quantities, times, and inventory status involved in the above executable schedule are exemplary. In practical applications, specific information content can be added, reduced, or adjusted according to the type of work environment and actual needs. In addition, the presentation format of the above overall work plan is not limited to structured text data; it can also use other meaningful forms of expression such as Excel forms and graphs.

[0093] In one embodiment, the method employs, for example, a rolling window rescheduling strategy, which acquires a set of tasks to be processed within a preset time period over time and performs the search process to generate a corresponding job scheduling plan.

[0094] Taking an injection molding workshop as an example, the system can read the demand for the next 14 days each day, execute the above search process using a fixed CPU time budget, and output an executable schedule that includes orders, machines, molds, time, and crane usage. The system can also output the in-house / outsourced status, estimated completion time, changeover cost, inventory holding cost, total profit, and delivery feasibility flag for each order.

[0095] In other embodiments, rescheduling may also be triggered by other events, such as changes in the task queue (e.g., a new task is released and added to the queue, or an existing pending task is canceled or its delivery deadline is changed); or, predetermined events occur in resources in the work environment (e.g., sudden failure of work equipment or shared auxiliary resources, failure recovery, or changes in quantity).

[0096] Figure 2 A schematic diagram of a task scheduling framework for a working environment according to an exemplary embodiment of this application is shown.

[0097] like Figure 2 As shown, the framework illustrates the core components of the iterative search loop, including the searcher 22, decoder 23, and evaluator 24. The searcher 22 performs an iterative search in the solution space to generate candidate solutions 31. The evaluator 24 evaluates the candidate solutions 31 and generates corresponding fitness values.

[0098] In each iteration of the search, candidate solutions 31 are provided to evaluator 24, and for example, pass through an optional decoder 23. Decoder 23 translates the candidate solutions 31 generated by searcher 22 into corresponding scheduling timetables 32. Decoder 23 takes candidate solutions 31 as input and receives current state information of the working environment, and models the changes in environment state after each task is executed sequentially. This environment state information includes, for example, at least task state information (such as the actual execution status of tasks on each working device) and resource state information (such as the working status of the working device, the earliest available time and occupancy status of working parts and replacement resources). Scheduling timetables 32 include, for example, at least the estimated completion time of each task. (The following text is in conjunction with...) Figure 3 An example of a visual representation of the scheduling timetable 32 is shown.

[0099] In one embodiment, tasks can be read one by one according to the job sorting information in the candidate solutions. Then, job accessories are assigned to each task and arranged to the corresponding job equipment according to resource allocation information (such as job equipment allocation relationship and job accessory allocation relationship). Then, the estimated start time of each task and its estimated job duration on the corresponding job equipment are determined, and the estimated completion time is calculated based on the two.

[0100] For example, the estimated completion time can be calculated using the following formula: in, Let be the estimated completion time for task k. Let be the estimated start time of task k. Let k be the estimated duration of operation on its operating equipment.

[0101] For example, if task k is assigned to work equipment M1, and its expected start time on work equipment M1 is 10:00 and the expected work duration is 30 minutes, then the expected completion time of the task is 10:30.

[0102] In one embodiment, the estimated start time of each task can be determined based on the earliest available time of the work equipment allocated to each task. Specifically, according to the allocation relationship and execution order specified in candidate solution 31, each task is sequentially allocated to the corresponding work equipment, and an independent task queue is maintained on each equipment. The earliest available time of a work equipment is the estimated completion time of its previous assigned task. For example, if work equipment M1 is currently processing task job1 with an estimated completion time of 10:00, then the estimated start time of the next task job3 allocated to work equipment M1 is 10:00, and so on.

[0103] In one embodiment, the estimated job duration depends on the number and type of products involved in the task, and can be calculated in advance using a mathematical model or by looking up a table. Furthermore, the estimated job duration may also be related to the assigned equipment (e.g., different equipment has different working efficiencies), and therefore needs to be determined in conjunction with the equipment allocation relationships specified in the candidate solutions.

[0104] In one embodiment, the decoder 23 embeds a resource availability synchronization mechanism into the decoding process when generating the scheduling schedule. For example, the decoder dynamically maintains the occupancy status and earliest available time of each work equipment, work accessories, and / or auxiliary replacement resources in the work environment to avoid resource usage conflicts.

[0105] In one embodiment, if the resources required by a task are currently occupied by other tasks, the estimated start time of the task is postponed until the required resources become available. For example, the following resource constraints must be followed when determining the estimated start and estimated completion times of each task: - Only one task can be executed by the same work equipment at any given time. Therefore, subsequent tasks assigned to the same work equipment must wait for the current task on that equipment to be completed before they can begin. - For a limited number of auxiliary changeover resources, such as a trolley (with a quantity of 1), only one task can occupy it at a time. If the current task needs to occupy the trolley for a changeover operation, subsequent tasks that need to occupy the trolley must wait for the trolley to be released before they can be executed. - For a limited number of shared work parts, such as shared molds, multiple tasks using the mold cannot overlap in time. Subsequent tasks that need to use the same mold must wait until the previous task finishes occupying the mold before they can start; otherwise, resource contention will occur.

[0106] In one embodiment, when performing decoding, the decoder 23 also determines the estimated completion time of each task based on the task switching type of successive tasks on the same work equipment. The task switching types include at least: no switching required (i.e., continuous production of the same task type), material-only switching (e.g., same mold, different materials), work accessory-only switching (different mold, same materials), and material and work accessory switching simultaneously.

[0107] Specifically, the switching type can be determined by looking up a table or reading the value of a flag field. A switching type matrix can be pre-constructed for all combinations of task types. This matrix records the switching type, switching time, and whether shared auxiliary resources are required to switch from one task type to another. During decoding, the table can be looked up based on the combination of the task type of the current task and the previous task on the same job device, thereby quickly obtaining the relevant information and improving computational efficiency.

[0108] For example, the estimated completion time can be calculated using the following formula: Where j is the sequence number of the previous task and k is the sequence number of the current task. Let be the estimated completion time for task k. Let be the estimated start time of task k. Let k be the estimated duration of operation on its operating equipment. This is the sequence-dependent switching time from task j to task k, and its value depends on the switching type between task j and k (e.g., mold change time, material change and cleaning time, etc.).

[0109] For example, if the task switching type involves changing working parts, it requires the use of auxiliary changeover resources (such as a crane). In this case, the task switching time must include the crane's mold-changing time, resulting in a longer switching time. The availability of auxiliary changeover resources must also be considered. If no working parts need to be changed, but only materials, the switching time only involves material cleaning time, resulting in a shorter switching time. If neither working parts nor materials need to be changed, the switching time is the shortest. Therefore, different switching types correspond to different switching times, thus affecting the estimated completion time of each task.

[0110] In one embodiment, the estimated start time may also be calculated based on the switching type between two successive tasks on the same work equipment. .

[0111] If the switch type does not require changing work parts (i.e., using the same tool), the expected start time is equal to the earliest available time of the work equipment: If the switch type requires changing operating parts, then the earliest available time of shared auxiliary resources (such as molds and cranes) must also be considered, and the later one should be taken: in, The earliest available time for the operating equipment. The earliest available time for the crane. This is the earliest available time for the mold.

[0112] Next, as follows Figure 2 As shown, the decoded schedule 32 is provided to the evaluator 24 for evaluation. The evaluator 24 evaluates the candidate solution 31 based on the schedule 32 output by the decoder 23 and generates the corresponding fitness. For example, with the help of the evaluator 24, the expected completion time of each task is compared with its corresponding delivery deadline. If the expected completion time of all tasks is no later than the corresponding delivery deadline, the candidate solution is determined to satisfy the zero delay constraint.

[0113] The fitness output by evaluator 24 is fed back to searcher 22 to guide the subsequent search direction of searcher 22 and generate the next generation of candidate solutions.

[0114] In one embodiment, the searcher 22 supports multiple search algorithms, such as genetic algorithms, discrete particle swarm optimization, and simulated annealing. These search algorithms share a unified candidate solution representation method and operate under the same evaluation rules of the evaluator 24. Therefore, appropriate search algorithms can be flexibly selected or switched according to the scale of the scheduling problem, real-time requirements, and computing power conditions, reducing maintenance costs and improving system adaptability.

[0115] In one embodiment, when the searcher 22 executes the genetic algorithm, the search is guided based on fitness in the following ways: for example, parent selection can be performed based on fitness, where candidate solutions with higher fitness are more likely to be selected in the parent selection. Furthermore, for example, selection can be made between the parents and generated offspring of the current population based on fitness to determine candidate solutions for the next generation, and at least one elite individual with the best fitness can be directly retained for the next generation.

[0116] In one embodiment, when the searcher 22 executes the discrete particle swarm optimization algorithm, the search is guided based on fitness in the following ways: for example, the individual historical best position and the global best position of the population can be determined based on fitness to guide the particle's flight direction. Furthermore, the fitness can be used to determine whether to accept the new particle position generated after the position update. Additionally, a local search can be performed on elite particles based on fitness to improve their positions.

[0117] In one embodiment, when the searcher 22 executes the simulated annealing algorithm, the search is guided based on fitness in the following ways: for example, based on fitness, an acceptance criterion can be used to decide whether to accept a newly generated candidate solution. If the fitness of the newly generated candidate solution is better than that of the current candidate solution, it is accepted unconditionally; if the fitness of the new candidate solution is worse than that of the current candidate solution, it is accepted with a probability related to the current temperature. Furthermore, for example, the search performance can be determined based on a comparison between the fitness of the current solution at the end of the previous temperature layer and the historical best solution, and the temperature adjustment action for the next temperature layer can be determined by a Q-learning controller based on the search performance.

[0118] It should be noted that, although in Figure 2 In the framework shown, candidate solution 31 is first decoded by decoder 23 and then provided to evaluator 24 for evaluation. However, in other embodiments, if candidate solution 31 itself contains sufficient scheduling information, or if the fitness determination does not need to be based on specific time information but only needs to be evaluated by fast proxy, then candidate solution 31 can also be provided directly to evaluator 24 to generate fitness without going through decoder 23.

[0119] Figure 3 A schematic diagram of a scheduling schedule generated by decoding a candidate using a decoder, according to an exemplary embodiment of this application, is shown.

[0120] like Figure 3 As shown, the schedule 32 is, for example, achieved by using... Figure 2 The above is a visualization of the decoding results of the decoder 23 on the candidate solution 31, for example, presented in the form of a Gantt chart. The horizontal axis represents time, and the vertical axis lists each work unit M1, M2, and M3. The chart shows the allocation relationship of each task on each work unit and the expected execution status. Each hollow rectangle corresponds to a task or a task operation, and the length of the rectangle represents the expected operation time required for that task or task operation on the corresponding work unit.

[0121] In one embodiment, the decoding process of the decoder is as follows: Each task is read sequentially according to the task execution order specified in the job sorting information of the candidate solution; according to the resource allocation relationship specified in the resource allocation information, job accessories are allocated to each task in sequence and placed into the corresponding job equipment. Then, based on the allocation results, the estimated start time and estimated completion time of each task are calculated, and the start and end positions of the rectangular blocks representing each task or process in the Gantt chart are determined accordingly.

[0122] In one embodiment, based on the job sequencing information of the candidate solutions, task job1 is, for example, the first task to be executed. Therefore, the decoder first retrieves job1, then schedules it to job equipment M1 according to the resource allocation information, and assigns it job accessory m_a. The next task to be executed in the job sequencing information is, for example, job3. According to the resource allocation information, it is scheduled to job equipment M2, and assigned job accessory m_c. Subsequently, task processes job2-1 and job2-2 are scheduled to job equipment M1 and M3 respectively, and assigned corresponding job accessories m_b and m_e respectively, and so on. In addition, if the resource allocation information indicates that task job7 is outsourced production, then this task is not reflected in the scheduling timetable 32 and does not occupy internal resources.

[0123] Depend on Figure 3 It can also be seen that the decoder calculates the estimated start time and estimated completion time of each task based on the allocation results. For example, although job3 is assigned to job device M2, it is not executed immediately, but must wait for the previous task on job device M2 to be completed before it can start. Therefore, there is an idle waiting time on the timeline.

[0124] In addition Figure 3 In the illustrated embodiment, the decoder also embeds a resource availability synchronization mechanism into the decoding process to dynamically maintain the occupancy status and earliest available time of the operating equipment, operating accessories, and auxiliary changeover resources, in order to avoid resource usage conflicts. Specifically, in the figure, for example, the occupancy time of the vehicle is marked by shaded rectangles, which is used to indicate the period of time that each task occupies the vehicle resources when performing the mold changeover operation.

[0125] For example, task (or task operation) job2-1 does not start execution immediately after the previous task job1 on the work equipment M1 is completed; there is a shaded rectangular block between the two. This is because task job2-1 requires a mold change operation between itself and the previous task job1. This change operation requires the use of a unique non-preemptive crane, and the length of the shaded rectangular block roughly corresponds to the crane operation time.

[0126] Similarly, job4 does not begin execution immediately after the completion of job3 on work equipment M2. This is because switching from job3 to job4 also requires mold changing (from m_c to m_d) and occupies the crane. However, at the end of job3, the crane is occupied by job2-1, causing job4 to wait until the crane is idle before it can begin mold changing, and only after the mold changing is completed can processing officially begin. Therefore, job4 is separated from job3 not only by the crane operation time corresponding to the shaded rectangle, but also by a short waiting time for shared auxiliary resources to become available.

[0127] Accordingly, the two successive tasks job4 and job6 executed on the same work equipment M2 both use the same model of mold m_d, so there is no need to change the mold or occupy the crane. Therefore, job6 can start immediately after job4 is completed.

[0128] Ultimately, the decoded schedule 32 includes not only the estimated start and finish times of each task, but also the occupancy status and earliest available time of various resources in the work environment. After providing this schedule to the evaluator, the evaluator can incorporate consideration of product switchover types between two production orders processing consecutively on the same work equipment when generating fitness. This product switchover type is used to determine whether it is necessary to change work accessories (such as molds) and whether it is necessary to occupy shared auxiliary resources (such as overhead cranes).

[0129] It should be noted that Figure 3 The specific form and listed values ​​of the decoded schedule timetable 32 shown are merely illustrative. In practical applications, the schedule timetable can also be presented in other visualization methods.

[0130] Figure 4 A schematic diagram of an evaluator according to an exemplary embodiment of this application is shown.

[0131] like Figure 4 As shown, the evaluator 24 includes, for example, three evaluation stages: a feasibility evaluation stage 410, a delay degree evaluation stage 430, and a profit evaluation stage 420, as well as a feasibility repair stage 440. The evaluator 24 generally follows a feasibility-first evaluation mechanism to ensure a search direction oriented towards zero delays.

[0132] Specifically, the candidate solutions provided to the evaluator 24 for evaluation include, for example, s1, s2, s3, s4, and s5 (or their respective decoding results, not shown for clarity). First, in the feasibility evaluation stage 410, each candidate solution is classified into feasible and infeasible solutions based on whether it satisfies the zero-delay constraint. Candidate solutions s2, s4, and s5 satisfy the zero-delay constraint and are determined to be feasible solutions, while candidate solutions s1 and s3 do not satisfy the zero-delay constraint and are determined to be infeasible solutions. The fitness of any feasible solution is superior to the fitness of any infeasible solution.

[0133] In one embodiment, the feasibility determination based on the zero-delay constraint is a prerequisite for the evaluator 24 to determine the fitness level, so the feasibility evaluation step 410 has the highest evaluation priority.

[0134] In one embodiment, if all tasks in the job scheduling plan corresponding to a candidate solution can be completed within their corresponding delivery deadlines, then the candidate solution satisfies the zero-delay constraint. For example, by Figure 3 The decoding process shown has calculated the estimated completion time for each task in each candidate solution, and the estimated completion time can then be compared with its corresponding delivery deadline. If the estimated completion time of any task is later than its delivery deadline, it indicates that the candidate solution does not meet the zero-delay constraint.

[0135] For example, a candidate solution may contain three tasks job1, job2 and job3, where job1 is expected to complete at 10:00 and has a delivery deadline of 9:30. Even if the other two tasks meet their delivery deadlines, the candidate solution is still infeasible.

[0136] Next, the candidate solutions evaluated in the feasibility assessment stage 410 can be provided to the delay assessment stage 430 and the profit assessment stage 420 to further refine the determination of their fitness based on the delay level and / or profit corresponding to each candidate solution. Specifically, feasible solutions s2, s4, and s5 are provided to the profit assessment stage 420, for example, to further determine their fitness based on the profit of each feasible solution. Infeasible solutions s1 and s3 are provided to the delay assessment stage 430 to further determine their fitness based on the delay level of each infeasible solution.

[0137] The profit evaluation stage 420 follows, for example, the following evaluation rule: among multiple feasible solutions s2, s4, and s5, the candidate solution with the higher profit has better fitness. Profit information, for example, reflects the economic efficiency of the candidate solution under the premise of satisfying feasibility.

[0138] In one embodiment, profit can be determined based on the gross profit of each task, outsourcing costs or revenue, inventory holding costs, and task switching costs. For example, the profit for each task can be calculated using the following formula: in: The profit for task k; Let $k$ be the gross profit of task k, which is the revenue generated by the task through internal production minus the direct production costs. For the early completion time of the task, Cost of holding inventory per unit time This refers to inventory holding costs. Inventory holding costs represent the expenses incurred due to storage and capital tied up while waiting for delivery after a task has been completed ahead of schedule. The higher this value, the earlier the task is completed, the longer the inventory is held, and the higher the warehousing costs.

[0139] This represents the sequence-dependent switching cost of switching from the previous task j to the current task k on the same work equipment. This cost depends on the switching type; for example, the cost is zero when no switching is required (neither material nor mold changes); the cost is low when only materials are changed (e.g., cleaning costs); the cost is high when only work accessories are changed (e.g., molds); and the cost is highest when both materials and work accessories are changed. By incorporating switching costs into profit calculations, the search algorithm can be guided to reduce unnecessary switching during the decision-making process, thereby reducing job changeover overhead and improving overall work efficiency.

[0140] Total profit of candidate solutions This is the sum of the individual profits of all tasks in the candidate solution: In one embodiment, fitness is additionally determined based on profit only if a candidate solution satisfies the zero-delay constraint. That is, profit is compared to determine fitness only if both candidate solutions are feasible. If a candidate solution has delays, it is not included in the profit comparison, and its fitness is determined by the degree of delay.

[0141] The delay evaluation step 430 follows the following evaluation rule: among multiple infeasible solutions s1 and s3, the candidate solution with a smaller delay has better fitness.

[0142] In one embodiment, the degree of delay can be characterized in different forms, such as the sum of the delay time of each task, the number of delayed tasks, or the number of products that were not completed on time in the delayed tasks.

[0143] For example, for two infeasible solutions s1 and s3, if a candidate solution s1 has only one delayed task and the other candidate solution s3 has two delayed tasks, then the former (with fewer delayed tasks) has a better fitness than the latter. If the two infeasible solutions have the same number of delayed tasks, then the total delay time can be compared further, and the candidate solution with the smaller total delay time has a better fitness.

[0144] In another embodiment (not shown), when the degree of delay is the same, the profit corresponding to the candidate solution can also be further considered. For example, for multiple infeasible solutions with the same degree of delay, their merits can be further distinguished based on profit, with candidate solutions with higher profits having relatively better fitness.

[0145] In the above embodiment, when determining fitness, the evaluator 24 prioritizes the zero-delay constraint over the delay severity, and the delay severity prioritizes profit. That is, zero-delay feasibility is a prerequisite for judging the merits of candidate solutions. Therefore, the search algorithm is generally guided to prioritize finding feasible solutions that satisfy the zero-delay constraint; once zero-delay is satisfied, profit maximization is further considered. Through this hierarchical evaluation mechanism, economic benefits can be gradually optimized under the hard constraint of ensuring delivery deadlines.

[0146] In one embodiment, fitness may be determined by at least two dimensions, such as feasibility, delay level, and profit. For example, fitness may be an array fitness(f, d, r) containing multiple dimensions, including feasibility, delay level, and profit, where f is a feasibility flag (e.g., 0 for feasibility, 1 for infeasibility), d is the delay level corresponding to the candidate solution, and r is the profit corresponding to the candidate solution, with the feasibility dimension having the highest priority.

[0147] In another embodiment, fitness can also be a scalar value, calculated by assigning the highest weight to the feasibility factor, such that the fitness value of a feasible solution is always better than any infeasible solution.

[0148] like Figure 4 As exemplified, of the five candidate solutions s1, s2, s3, s4, and s5 initially provided to the evaluator 24, after the feasibility evaluation stage 410, three are determined to be feasible solutions s2, s4, and s5, and two are determined to be infeasible solutions s1 and s3. The three feasible solutions s2, s4, and s5 are further evaluated in the profit evaluation stage 420, and their final fitness ranking result is, for example, candidate solution s2 is better than s5, which is better than s4. The two infeasible solutions s1 and s3 are evaluated in the delay evaluation stage 430, and their final fitness ranking result is, for example, candidate solution s1 is better than s3.

[0149] In the overall ranking, feasible solutions s2, s4, and s5 have better fitness than any infeasible solutions s1 and s3. Therefore, the final fitness ranking result is, for example, s2 > s5 > s4 > s1 > s3. This ranking result reflects the evaluation mechanism followed by evaluator 24 in generating fitness, which prioritizes feasibility, ranks feasible solutions by profit, and ranks infeasible solutions by delay.

[0150] In addition, the evaluator 24 may also include a feasibility repair step 440. The function of the feasibility repair step 440 is: when the evaluator 24 determines that candidate solutions s1 and s3 are delayed, and a preset trigger condition is met, a feasibility repair operation is performed on the delayed candidate solution s3. The feasibility repair operation includes, for example, switching at least some tasks in the delayed candidate solution s3 from internal production to outsourced production.

[0151] For example, switching a task to outsourced production status is equivalent to de-allocating the corresponding work equipment and work parts in the resource allocation information, so that it no longer occupies internal resources. Through this modification, the decoder will recognize the task as outsourced during subsequent decoding, thus skipping the internal scheduling.

[0152] For example, for a candidate solution with a three-layer coding structure, switching a task to outsourced production status is equivalent to setting the corresponding coding value of the task in both the work equipment allocation layer and the work parts allocation layer to a preset value (e.g., -1) to mark the task as outsourced production, thus preventing it from occupying internal work equipment and auxiliary resources. Through this coordinated modification of the coding layers, the decoder will recognize the task as outsourced in subsequent decoding processes, thereby skipping the internal scheduling.

[0153] In one embodiment, the preset triggering conditions include, for example, triggering with a preset probability, triggering when the delay of a candidate solution exceeds a preset threshold, and / or triggering when no candidate solution satisfying the zero delay constraint is generated for several consecutive generations. For example, triggering repair with a preset probability of 30% means that there is a 30% probability of attempting repair each time an infeasible solution is encountered, or triggering repair when the total delay time of a candidate solution exceeds 2 hours, or triggering repair when no feasible solution is generated for 5 consecutive generations.

[0154] In one embodiment, when performing a feasibility repair operation, one or more tasks that belong to the set of outsourceable tasks in the candidate solution and have the greatest impact on the delay are outsourced.

[0155] For example, in candidate solution s3, tasks job2 and job4 are outsourceable tasks. Job2 is not overdue, while job4 is overdue. Therefore, job4, which is causing the overdue task, can be outsourced first to free up internal resources, improve the feasibility of the candidate solution, and obtain the repaired candidate solution s3'.

[0156] In one embodiment, after the feasibility repair operation is completed, for example, the repaired candidate solution can be re-decoded and evaluated, and the candidate solution with better fitness can be selected as the new candidate solution between the original candidate solution and the repaired candidate solution.

[0157] For example, candidate solution s3 was originally infeasible. After the aforementioned repair operation switches task job4 to outsourcing, the repaired candidate solution s3' is resubmitted to the feasibility evaluation stage 410 for judgment. If s3' no longer delayed, its fitness is better than the original infeasible solution s3, and the repaired candidate solution s3' is retained. If the repaired candidate solution s3' is still delayed, the degree of delay between the original candidate solution s3 and the repaired candidate solution s3' is compared according to the feasibility priority rule, and the one with the smaller degree of delay is selected as the current candidate solution. Alternatively, fitness can be determined by combining profit and degree of delay, and the one with better fitness can be selected between the original s3 and the repaired s3'.

[0158] It should be noted that Figure 4 The internal logic structure of the evaluator 24 shown is merely exemplary and does not constitute a limitation of this application. The specific composition, quantity, and execution order of each evaluation stage 410, 420, 430 and the repair stage 440 can be adjusted according to actual application requirements. For example, only the feasibility evaluation stage (feasibility evaluation based on zero delay constraints) can be retained, or more evaluation dimensions can be added on this basis, or the priority order of each stage can be adjusted to adapt to the scheduling optimization needs under different scenarios.

[0159] Figure 5 A schematic diagram illustrating the parallel execution of a search process on multiple CPU cores according to an exemplary embodiment of this application is shown.

[0160] like Figure 5 As shown, when the searcher executes the population-based search algorithm, the search can be performed in parallel and independently on multiple CPU cores 501, 502, 503, ... 508. Each CPU core deploys a search island, and the islands are independent of each other. Each CPU core 501, 502, 503, ... 508 maintains its own candidate solution population and iterates independently. For example, when preset migration conditions are met, the cores exchange some candidate solutions to share search information.

[0161] In this context, a CPU core is an independent computing unit within a central processing unit (CPU) capable of executing computational tasks in parallel. A search island (or simply "island") refers to an independent search instance deployed on a single CPU core. Each island maintains its own population of candidate solutions and independently performs genetic operations such as selection, crossover, and mutation, or particle update operations.

[0162] Figure 5The example shows 8 CPU cores, with 8 search islands deployed accordingly. Each core maintains its own candidate solution populations 51 and 52 and performs search iterations independently.

[0163] Taking a genetic algorithm as an example, the initial population of 50 contains, for instance, 280 individuals. These individuals are evenly distributed across 8 islands, with 35 individuals allocated to each island. Each island uses a calibrated population size (e.g., 35 individuals) and independently performs genetic operations (selection, crossover, mutation). By distributing the initial population across islands for independent evolution, the computational pressure caused by an excessively large single population size can be effectively reduced, the speed of a single iteration can be accelerated, and the overall search range can be expanded, balancing convergence speed and solution quality.

[0164] In one embodiment, an information exchange mechanism is established between the search islands. When a preset migration condition is met, such as after a preset number of iterations (e.g., 30 iterations), the islands exchange a portion of candidate solutions (e.g., individuals or particles) to share search information. For example, each island can send the candidate solutions 51' with the best fitness in its current population at a preset proportion (e.g., 20%) to neighboring islands, while simultaneously receiving candidate solutions 52' sent by neighboring islands. The received candidate solutions are then merged with the existing candidate solutions of the island, and the optimal preset number of individuals are retained after screening according to a feasibility-first rule. This accelerates convergence while maintaining population diversity and fully utilizes the computing resources of multi-core CPUs.

[0165] In one embodiment, the number of parallel islands and the population size of each island can be adjusted according to the size of the scheduling instance: when the scheduling instance is large, the number of islands can be increased or the population size of each island can be increased. When the scheduling instance is small, the number of islands can be reduced or the population size can be reduced to balance search accuracy and computational efficiency.

[0166] In one embodiment, the migration topology of each island can be either circular or fully connected. In a circular topology, each island exchanges candidate solutions only with its two adjacent islands. In a fully connected topology, each island can exchange candidate solutions with any other island.

[0167] In one embodiment, information exchange can only be performed between islands using the same algorithm. For example, eight islands all using a genetic algorithm can exchange candidate solutions via a migration mechanism. Similarly, eight islands all using a discrete particle swarm optimization algorithm can also exchange candidate solutions via a migration mechanism. In other embodiments, information exchange can also be performed between islands using different types of algorithms to leverage the complementary advantages of different algorithms.

[0168] It should be noted that Figure 5The number of parallel CPU cores (islands) and the population size of each island shown are merely exemplary and are not limited thereto. In practical applications, the number of parallel CPU cores can be flexibly configured according to computing resources, the size of scheduling instances, and search efficiency requirements.

[0169] Figure 6 An exemplary flowchart illustrating the use of a searcher to perform a genetic algorithm to search for candidate solutions, according to an exemplary embodiment of this application, is shown.

[0170] In this algorithm, each individual corresponds to a candidate solution. In the initialization step (not shown), for example, the initial population size (e.g., 35 individuals) can be determined, and a mixed initialization rule is used to generate the initial position of each individual, with each individual's position corresponding to a candidate solution. Then, each initial individual is decoded and evaluated, its fitness is calculated, and this serves as the starting point for the subsequent population evolution and iterative search process.

[0171] In step 601, parent selection is performed based on the fitness of the previous generation of candidate solutions. Candidate solutions with higher fitness have a higher probability of being selected in the parent selection. If this is the first iteration, the previous generation of candidate solutions refers to the initial population generated in the initialization step.

[0172] In one embodiment, a tournament selection mechanism is used for parent selection. This selection method is based on fitness comparison, where fitness follows the zero-delay feasibility dominance principle, meaning that the fitness of a feasible solution (satisfying the zero-delay constraint) is better than any infeasible solution (existing delay).

[0173] Specifically, a predetermined number (e.g., 2 or 3) of candidate solutions are randomly selected from the previous generation to form a tournament group. Fitness within each group is compared, and the solution with the highest fitness is selected as the parent. This process is repeated until the required number of parent individuals are selected. Since candidate solutions with higher fitness have a higher probability of winning in each tournament, their probability of being selected as parents is correspondingly greater. For example, if candidate solution A satisfies the zero delay constraint, and candidate solution B has a delay, then A wins. If both are feasible solutions, the one with the higher profit wins. If both are infeasible solutions, the one with the lower delay wins.

[0174] In other embodiments, other parent selection methods such as roulette wheel selection or truncation selection can also be used, as long as the probability of selection can be allocated according to the fitness level.

[0175] In step 602, a crossover mutation operation is performed on the parent generation to produce offspring individuals.

[0176] First, the parents are paired up and crossover is performed, resulting in gene recombination between pairs to produce temporary offspring individuals.

[0177] In one embodiment, a first crossover operation is performed on the job sorting information of the parent generation, and a second crossover operation is performed on the resource allocation information of the parent generation. For example, the first crossover operation can be a POX (Precedence Operation Crossover) crossover, and the second crossover operation can be a uniform crossover.

[0178] In one embodiment, the candidate solution has a three-layer coding structure (i.e., including a task sorting layer, a job equipment allocation layer, and a job accessory allocation layer). For the task sorting layer, POX crossover combines the task sorting fragments of two parent generations to generate the child sorting by maintaining the relative order of the tasks. For the job equipment allocation layer and / or the job accessory allocation layer, uniform crossover inherits the coded values ​​from the two parent generations bit by bit randomly.

[0179] In one embodiment, if the job sorting information and resource allocation information of the candidate solutions are mixed and encoded in the same data structure, the crossover operation can also be performed on the entire sequence as a whole, that is, without distinguishing layers, and directly performing operations such as segment exchange and uniform crossover on the mixed encoded sequence.

[0180] In one embodiment, the crossover operation is triggered with a preset crossover probability. If crossover is triggered, offspring are generated according to the aforementioned crossover method. If crossover is not triggered, the offspring directly copies all the encoding information of one of the parent candidate solutions, without generating a new encoding combination.

[0181] Then, perform mutation operations on the temporary offspring generated by the crossover. Iterate through each temporary offspring and trigger mutation according to the preset mutation probability.

[0182] In one embodiment, for the job ordering information of candidate solutions, neighborhood permutation and variation can be performed using individual tasks or job blocks as the basic operation unit. For example, the execution order of two tasks or task operations can be swapped, or consecutive job blocks on the same job equipment can be identified first based on job accessories and / or material information, and then block-level operations can be performed, such as swapping adjacent blocks, moving blocks to merge similar blocks, or rearranging multiple blocks to select the arrangement with the fewest permutations.

[0183] In one embodiment, resource allocation information (such as work equipment allocation relationships and / or work accessory allocation relationships) can be mutated using resampling or random reset methods. Specifically, several coded bits are randomly selected, and compatible equipment and accessories are reselected from the candidate set of the corresponding task to reset the resource allocation relationship. Furthermore, if the task belongs to the outsourcing set, it can be switched to an outsourcing state according to a preset probability; otherwise, a resampling operation is performed.

[0184] In one embodiment, if the candidate solution does not employ a hierarchical coding structure, the resources allocated to it can be moved along with the task execution order, and resource reallocation or outsourcing switching operations can be triggered on any number of tasks or processes.

[0185] In one embodiment, the crossover and mutation probabilities can be dynamically adjusted based on the dispersion of population fitness to achieve a balance between global exploration and local exploitation. For example, when the dispersion of population fitness is large, indicating high population diversity, the crossover and mutation probabilities can be appropriately reduced to protect superior individuals. When the dispersion of population fitness is small, the crossover and mutation probabilities can be appropriately increased to avoid getting trapped in local optima.

[0186] In step 603, based on the generated offspring, the next generation of the population is selected according to the feasibility priority rule and the elite preservation strategy.

[0187] Specifically, before updating the population, the parent individuals of the previous generation can be merged with the newly generated offspring individuals to form a candidate pool, and the candidate pool is ranked according to the feasibility priority rule of fitness. Candidate offspring individuals generated by mutation can be quickly screened through proxy evaluation, and only the top-K candidates are fully decoded to reduce computational overhead. The ranking rules are as follows: feasible solutions (satisfying the zero-delay constraint) have higher priority than infeasible solutions (with delays); feasible solutions are ranked according to profit, and infeasible solutions are ranked according to the degree of delay.

[0188] In addition, at least one elite individual with the best fitness from the previous generation can be selected and directly retained into the next generation to ensure that the historical optimal solution is not lost. After proxy evaluation and elite selection, a predetermined number of individuals are selected from the merged candidate pool to form the next generation population, while the population size remains unchanged.

[0189] In step 604, it is determined whether the restart conditions are met. If they are met, proceed to step 605 to perform the restart operation. If not, proceed to step 606 to maintain the current population.

[0190] In one embodiment, the restart condition is triggered when a search stall is detected (e.g., no better solution is produced for 30 consecutive generations) or when the population diversity is below a preset threshold (e.g., the similarity between individuals exceeds 99%), so as to guide the search to a new candidate region.

[0191] In step 605, a restart operation is performed. For example, 3-5 candidate solutions with poor quality or high similarity to other individuals in the current population are identified, removed from the population, and replaced with new candidate solutions. The newly generated candidate solutions can be generated, for example, using a hybrid initialization rule to introduce new genetic information, restore population diversity, and prevent the algorithm from getting trapped in local optima prematurely. After the restart operation is completed, subsequent iterations continue.

[0192] In step 607, it is checked whether a preset migration condition is met (this applies, for example, to the case of multiple islands running in parallel). The preset migration condition may be, for example, reaching a preset number of iterations, or detecting that the population diversity of each island is lower than a preset threshold.

[0193] If the migration conditions are met, proceed to step 608 to perform inter-island migration operations, where islands exchange some candidate solutions to share search information and superior genes. The specific migration method can be described in the preceding text. Figure 5 The process is as follows: each island sends a predetermined percentage (e.g., 20%) of its best-fit candidate solutions to neighboring islands, while simultaneously receiving candidate solutions from neighboring islands. If the migration conditions are not met, each island continues its independent search and does not perform candidate solution exchange.

[0194] Subsequently, by migrating or retaining the current population, the next generation of candidate solutions is obtained, and the process proceeds to step 609 for fitness evaluation. It should be noted that, for clarity, step 609 is set up separately to evaluate the fitness of the final candidate solutions determined after this iteration. However, if fitness has already been determined in previous steps such as elite retention or population selection, this step can be omitted.

[0195] Next, in step 610, it is determined whether a preset termination condition is met (e.g., the used solution time reaches or exceeds a preset time threshold). If the termination condition is not met, the process returns to step 601, and the genetic algorithm search process continues based on the fitness of the new generation of candidate solutions, i.e., repeating steps such as parent selection, crossover, mutation, and population update. If the termination condition is met, the process proceeds to step 611, where the current globally optimal solution (i.e., the candidate solution with the best fitness) is output and exported as an executable job scheduling plan.

[0196] It should be noted that, in combination Figure 6 The crossover operator, mutation operator, parent selection mechanism, and parameters such as population size, crossover probability, mutation probability, restart conditions, and migration conditions used in the described genetic algorithm are all exemplary configurations. In practical applications, they can be flexibly adjusted according to specific scheduling scenarios, job environment complexity, and computing resource conditions to adapt to different needs.

[0197] It should also be understood that although the above description of modification operations (such as crossover and mutation) involves modifications to both job sorting information and resource allocation information, in other embodiments, the modification operation may be performed on only one of the job sorting information and resource allocation information.

[0198] Figure 7 An exemplary flowchart is shown, illustrating the use of a searcher to perform a discrete particle swarm optimization algorithm to search for candidate solutions according to an exemplary embodiment of this application.

[0199] In this algorithm, the position of each particle corresponds to a candidate solution. For example, discrete update operators are defined for job sorting information and resource allocation information, respectively.

[0200] In the initialization step (not shown), for example, the particle swarm size (e.g., 35 particles) can be determined, and a hybrid initialization rule can be used to generate the initial positions of each particle, with each particle's position corresponding to a candidate solution. Then, the initial position of each particle is decoded and evaluated, its fitness value is calculated, and this serves as the starting point for the subsequent particle position update and iterative search process.

[0201] In step 701, based on the fitness of each particle in the previous generation, the individual historical best position (pbest) and the population global best position (gbest) are determined. The individual historical best position refers to the position with the best fitness found by each particle in its own search process, that is, the best candidate solution that the particle has experienced in history. The population global best position refers to the position with the best fitness among the individual historical best positions of all particles in the entire particle swarm, that is, the best candidate solution found by the entire swarm in the current search stage.

[0202] In the first iteration, the initial position of each particle is its individual historical best position, and the position with the best fitness among all particles is the initial global best position of the population.

[0203] In steps 702 and 703, the particle's position is updated by inertial flight and guided flight, respectively.

[0204] In one embodiment, particle position updates may include the following three modes: updating only resource allocation information, updating only job sorting information, or updating both job sorting information and resource allocation information simultaneously.

[0205] In the inertial flight involved in step 702, neighborhood exploration is achieved by applying a local perturbation to the current particle position. Specifically, inertial flight includes applying a local random perturbation to the particle's current position.

[0206] For job sequencing information, neighborhood operations can be performed in units of individual tasks (task processes) or job blocks, such as swapping the positions of adjacent job blocks, moving job blocks to merge similar blocks, or rearranging a plurality of adjacent job blocks to select an arrangement with the minimum number of changeovers. In addition, shift perturbation in units of individual tasks or processes can also be adopted: two positions i and j (i<j) are randomly selected, the task or process at position i is taken out and inserted after position j, and the tasks or processes at intermediate positions are sequentially shifted left by one position.

[0207] For resource allocation information (for example, job equipment allocation relationships and / or job accessory allocation relationships), several tasks can be randomly selected for resource reallocation or outsourcing switching.

[0208] In one embodiment, the magnitude of the local perturbation is controlled by the perturbation strength. The perturbation strength determines the step size of each round of particle position update, that is, the number of decision variables modified or the modification magnitude in each iteration. Specifically, the perturbation strength determines, for example, the number of perturbation executions in the job sequencing information, and also determines the number of reset tasks in the resource allocation information.

[0209] For example, to achieve a smooth transition from global exploration to local exploitation, during the inertial flight phase, the perturbation strength dynamically (for example, linearly) decreases with the search process: in the early stage of the search, the perturbation strength is relatively large to enhance the global exploration capability, which is beneficial to jumping out of the local optimum. In the later stage of the search, the perturbation strength is relatively small to reduce the modification magnitude of the particle position, strengthen local exploitation, and facilitate later convergence. The advancement of the search process can be measured, for example, by the ratio of the current number of iterations to the total number of iterations.

[0210] Exemplarily, the perturbation strength can be calculated according to the following formula: wherein: is the perturbation strength; is the normalized search progress, ; is the initial perturbation strength (for example, 0.7); is the final perturbation strength (for example, 0.1).

[0211] When the search is in the early stage, approaches 0, and the perturbation strength approaches , corresponding to a relatively large modification magnitude; when the search is in the later stage, approaches 1, and the perturbation strength approaches , corresponding to a relatively small modification magnitude.

[0212] In step 703, by guiding the flight, the particle inherits high-quality decision components from its individual historical best position and the population global best position, thereby causing the particle to move toward its individual best solution and global best solution.

[0213] For example, for the particle position of a candidate solution represented by a three-layer coding structure, the process of guiding flight includes, for example, causing the perturbated particle to inherit at least a portion of the coding fragment of at least one coding layer from the three-layer coding structure of the individual historical best position and / or the population global best position.

[0214] For task sequencing information, guided flight may include, for example, inheriting the relative order of at least some tasks or procedures from an individual’s historical best position or the population’s global best position, such as using the POX inheritance method.

[0215] For resource allocation information, guided flight may include, for example, inheriting a continuous segment of resource allocation from an individual's historical best position or the population's global best position, that is, simultaneously inheriting the allocation relationships of work equipment and / or work accessories within that continuous segment to the current particle, while the rest outside that segment remains unchanged.

[0216] For example, if the job sorting information of the preceding candidate solutions specifies a sorting order of [1,3,2,5,4], it means the execution order is job1, job3, job2, job5, job4; the job sorting information of gbest specifies a sorting order of [1,2,3,4,5]. If learning from gbest is triggered, the relative order of tasks job2 and job3 is inherited, and the new sorting becomes [1,2,3,5,4].

[0217] For example, the job allocation relationship specified in the resource allocation information of the current candidate solution is [M1, M2, M1, M3, M2], indicating that job1 is assigned to M1, job2 to M2, job3 to M1, job4 to M3, and job5 to M2; the job allocation relationship of gbest is [M2, M1, M2, M3, M1]. If learning from gbest is triggered, a continuous segment (such as positions 2 to 4) is randomly selected, and this segment is inherited from gbest, while the remaining positions remain unchanged. The new allocation becomes [M1, M1, M2, M3, M2].

[0218] In one embodiment, during guided flight, the probability of learning from an individual's historical best position is controlled by a first coefficient c1, and the probability of learning from the population's global best position is controlled by a second coefficient c2. c1 controls the weight of a particle learning from its own historical best position, and c2 controls the weight of a particle learning from the population's global best position. c1 and c2 can be preset or dynamically adjusted according to the search process to balance the particle's dependence on individual experience and group experience.

[0219] In step 704, it is determined whether to accept the new particle. Specifically, the updated particle position is decoded and evaluated, its fitness is recalculated, and the updated particle position is compared with the original particle position. This comparison follows, for example, the zero-delay feasibility dominance principle, which states that a feasible solution that satisfies the zero-delay constraint is superior to any infeasible solution with delays.

[0220] If the fitness of the updated particle position is better than that of the original position, proceed to step 705, accept the new position, update the particle position to the new position, and update the individual's historical best position pbest accordingly. If the fitness of the new position is worse than that of the original position (e.g., from zero delay to having delay), proceed to step 706, reject the new position, keep the particle position unchanged, which is still the candidate solution of the previous generation, and the individual's historical best position pbest remains unchanged.

[0221] By using the above acceptance criteria, we can ensure that the quality of particle search does not degrade and that the algorithm continues to converge toward a better direction during the iteration process.

[0222] Next, in step 707, the individual best positions after all particles accepted or rejected the offer are summarized, and the global best position of the population is updated accordingly. Specifically, among all the individual best positions of all particles, the individual best position with the best fitness is selected as the global best position gbest, so as to realize the sharing of population information and iterative guidance.

[0223] In step 708, a local search can also be performed on the elite particles. Specifically, a preset proportion (e.g., the top 20%) of particles with optimal fitness are selected from the current particle swarm as elite particles. Each elite particle is finely adjusted near its current position to generate candidate improvement positions for secondary improvement. If a candidate improvement position is better than the current elite particle position, the improvement is accepted and the individual's historical best position and the population's global best position are updated accordingly.

[0224] In one embodiment, fine-tuning in a local search may include, for example, adjusting the processing order of tasks or task steps to reduce the number of changeovers for job sequencing information (e.g., scheduling tasks requiring the same parts or materials on the same work equipment as consecutive tasks). For resource allocation information, resource fine-tuning may be performed on tasks causing delays, such as prioritizing adjustments to the work equipment and / or work parts allocated to tasks causing delays, and triggering outsourcing transfers when necessary, i.e., switching the task to outsourced production status to free up internal equipment and parts resources and improve scheduling feasibility.

[0225] In step 709, it is checked whether the preset migration conditions are met (applicable to the case of multiple islands running in parallel). If the conditions are met, the process proceeds to step 710 to perform the inter-island migration operation, that is, the islands exchange some candidate solutions to share search information and superior solutions. If the conditions are not met, the islands continue to search independently.

[0226] Subsequently, in step 711, the current position of each particle after the position update in this iteration is decoded and evaluated, and its fitness is calculated. The fitness of each particle is obtained by evaluating the scheduling timetable generated by the decoder. The fitness follows the zero-delay feasibility dominance principle. The specific evaluation mechanism can be referred to the previous text. Figure 4 The evaluation process is described. Note that this step can be omitted if fitness has already been determined.

[0227] Next, step 712 determines whether a preset termination condition is met (e.g., the used solution time reaches or exceeds a preset time threshold). If the termination condition is met, the iteration terminates, and step 713 is executed, outputting the current global optimal solution for the population, i.e., the candidate solution with the best fitness, and exporting it as an executable scheduling table. If the termination condition is not met, the process returns to step 701, continuing the search and update process for the next generation of particles based on the obtained fitness.

[0228] It should be noted that, although in Figure 7 The algorithm shown includes acceptance criteria and local search steps, but these steps are not mandatory. For example, in other embodiments, after generating a new particle position, the new position can be directly forced to accept and replace the original position, without performing acceptance criteria or local search.

[0229] Figure 8 An exemplary flowchart is shown, illustrating a simulated annealing algorithm performed by a searcher to search for candidate solutions according to an exemplary embodiment of this application.

[0230] Combined with the above Figure 6 and Figure 7Unlike the population-based algorithms described, simulated annealing employs a chain-based search strategy. In this embodiment, for example, eight independent chains are set up. Each chain generates an initial candidate solution using initialization rules, which serves as the starting point of the chain and is considered the chain's current historical best solution. By using multiple independent starting points, each corresponding to an initial candidate solution and independently executing the simulated annealing search process, the dependence on a single initial solution can be effectively reduced.

[0231] The search state of the simulated annealing algorithm on each chain is determined by three core variables: the candidate solution currently held at the current temperature; the historical best solution found in the chain's history; and the current temperature T, which affects the acceptance probability of degraded candidate solutions, thereby adjusting the exploration intensity of the search process.

[0232] In step 801, the search performance of the previous temperature layer is determined based on the comparison between the fitness of the current solution and the historical best solution at the end of the previous temperature layer, and the Q-learning controller performs the temperature adjustment action of the next temperature layer according to the search performance.

[0233] Specifically, if a better candidate solution is generated in the previous temperature layer, the number of consecutive unimproved iterations Fu is reset to 0; otherwise, Fu is incremented by 1. The Q-learning controller selects an action based on the current state by looking up a table, thus determining the temperature adjustment method for the current temperature layer.

[0234] The rows of the Q-table correspond to the state space, where each state is composed of a running time percentage Cr (the proportion of cumulative running time to the total time budget, e.g., divided into 3 intervals) and the number of consecutive unimproved intervals Fu (e.g., divided into 5 intervals), for a total of 15 states. The columns of the Q-table correspond to a preset set of temperature adjustment actions, exemplified by {0.95, 0.97, 0.99, 1.00, 1.02}, representing the temperature of the previous temperature level multiplied by the corresponding temperature adjustment coefficient to obtain the temperature of the current temperature level. The Q-learning controller selects an action based on the current state, determines the temperature adjustment coefficient, and thus achieves dynamic adaptive temperature control.

[0235] For example, if Cr is currently in the middle range and Fu is 3 (indicating no improvement for 3 consecutive attempts), the action with the highest Q value in the Q table under this state is 1.02. Therefore, the option is to increase the temperature by multiplying the current temperature by 1.02 to increase the probability of accepting a poor solution, enhance exploration capabilities, and attempt to escape local optima. If Fu is 0, the action with the highest Q value in the Q table under this state is 0.95. Therefore, the option is to decrease the temperature by multiplying the current temperature by 0.95 to reduce the probability of accepting a poor solution and strengthen local exploration.

[0236] In one embodiment, the offline training process of the Q-learning controller is as follows: First, the Q-table is initialized, setting all Q values ​​to be the same. Then, the following steps are executed cyclically: Identify the current state (Cr, Fu), select a temperature adjustment action according to the ε-greedy policy, execute the action to update the temperature, and continue the search. After performing a preset number of neighborhood searches at the current temperature, it is determined whether a candidate solution with better fitness has been generated within that temperature layer, and a reward signal is determined based on the improvement of the current solution relative to the historical best solution: if a candidate solution with better fitness has been generated (e.g., a reduction in total delay, or an increase in profit in the case of zero delay), a positive reward signal is output to the Q-learning controller; if no candidate solution with better fitness has been generated, a negative reward signal is output. Then, according to the Q-learning update formula, the Q value of the current state-action pair is updated using the current state, the selected action, the obtained reward, and the maximum Q value of the next state. The above process is repeated until a preset number of training times or time is reached, and a trained stable Q-table is output. After training, this Q-table is fixed for temperature control in online searches.

[0237] In step 802, at the current temperature, a neighborhood operation is performed on the current candidate solution for each chain to generate a new candidate solution. The types of neighborhood operations include, for example, sorting-level neighborhood (modifying only job sorting information), resource-level neighborhood (modifying only resource allocation information), and combined neighborhood (modifying both job sorting and resource allocation information).

[0238] In one embodiment, task sorting layer neighborhood operations may include generating a new sort by swapping, moving, or rearranging the order of tasks or task steps. For example, the positions of two tasks may be randomly swapped, or a task may be inserted into another position, or multiple consecutive tasks may be rearranged to select the order with the fewest swaps or the lowest cost.

[0239] In one embodiment, the resource layer neighborhood operation includes, for example, reallocating resources (e.g., work equipment and / or work accessories) to at least one target task while maintaining the task execution order specified in the job sequencing information. This reallocation is determined based on the material similarity and / or work accessory similarity between the target task and adjacent tasks on each candidate work equipment, selecting the allocation combination that maximizes the material similarity and / or work accessory similarity between adjacent tasks to reduce switching costs.

[0240] In one embodiment, adaptive selection weights are maintained for each neighborhood operation. Initially, each neighborhood operator is selected with equal probability, for example. After each temperature layer, the number of times each neighborhood operator is used, accepted, and improved is counted, and the historical score of each operator is updated accordingly. The score is calculated, for example, as follows: score = (a*improved + b*accepted) / used, Where, improved is the number of times that a new candidate solution is determined to be better than the current candidate solution before the neighborhood operation is performed, after a neighborhood operator generates a new candidate solution; The accepted value is the total number of times that the neighborhood operator generates a new solution and is accepted by the Metropolis criterion. `used` represents the total number of times the neighborhood operator has been attempted across the entire temperature layer. For example, within a certain temperature layer, if the task ranking layer neighborhood has been selected 20 times, then `used=20`. a and b are preset weighting coefficients, used to control the relative importance of the number of improvements and the number of acceptances in the score, respectively.

[0241] Subsequently, a roulette wheel mechanism is used to adjust the selection probability of each operator based on the score, so that operators with higher scores have a higher probability of being selected in subsequent temperature layers.

[0242] In one embodiment, the neighborhood size can be dynamically adjusted during the search process. The neighborhood size refers to the magnitude or range of code modification in each neighborhood operation; it controls the degree to which a single neighborhood move changes the current solution. When performing neighborhood operations on job sorting information, the neighborhood size, for example, determines the number of tasks involved in a block-level operation or the size of the block. When performing neighborhood operations on resource allocation information, for example, the neighborhood size determines the number of tasks involved in each resource reallocation or the length of the resource allocation fragment.

[0243] For example, the neighborhood size is larger in the early stages of the search to cover a wider search space. As the running time increases, the neighborhood size decreases linearly to promote local convergence. Through this adaptive mechanism, the algorithm can dynamically adjust the selection tendency of neighborhood operations at different search stages, balancing exploration and exploitation capabilities.

[0244] In step 803, a newly generated candidate solution is accepted based on the fitness using an acceptance criterion. Specifically, if the fitness of the new candidate solution is better than that of the current candidate solution, it is accepted unconditionally. If the fitness of the new candidate solution is worse than that of the current candidate solution, it is accepted with a probability related to the current temperature, which follows the Metropolis criterion: the higher the temperature, the greater the probability of accepting a worse solution.

[0245] in, This is the fitness difference between the new candidate solution and the current candidate solution (i.e., the decrease in fitness of the new solution relative to the current solution). This indicates that the new solution is inferior to the current solution. This is the current temperature. When... The smaller (i.e., the closer the new solution is to the current solution) or The larger the value (i.e., the higher the temperature), the greater the probability of accepting a poor solution.

[0246] If the new solution is accepted, it is set as the current candidate solution in step 804. If the new solution is rejected, the current candidate solution remains unchanged in step 805.

[0247] In step 806, it is determined whether the preset number of iterations IC at the current temperature level has been completed. If not, the process returns to step 802 to continue the neighborhood operation. If completed, the process proceeds to step 807.

[0248] In step 807, the final candidate solutions obtained at the end of the current temperature layer are decoded and evaluated, their fitness values ​​are calculated, and the historical best solutions of the chain are updated (if the fitness of the current solution is better than that of the historical best solution, then the historical best solution is updated with the current solution). At the same time, the number of times each neighborhood operator is used, accepted, and improved within the current temperature layer is counted, and the historical scores and selection weights of each operator are updated for adaptive selection of neighborhood operators in subsequent temperature layers.

[0249] In step 808, it is determined whether a preset termination condition is met (e.g., the used solution time reaches or exceeds a preset time threshold). If not, the process returns to step 801 to update the temperature of the next temperature layer based on the search performance of the previous temperature layer, and continues the search for the next temperature layer. If the termination condition is met, the process proceeds to step 809.

[0250] In step 809, the feasible candidate solution with the best fitness is selected from the historical optimal solutions of all chains as the global optimal solution, and it is derived into an executable scheduling schedule.

[0251] It should be noted that the simulated annealing algorithm described in the above embodiments is, for example, a multi-startpoint adaptive simulated annealing algorithm, but this application is not limited to this. In other embodiments, a single-startpoint simulated annealing algorithm or a conventional simulated annealing algorithm without an adaptive mechanism may also be used. The specific type of simulated annealing algorithm can be flexibly selected according to the actual application scenario and computing resource conditions.

[0252] Figure 9 A block diagram of an electronic device according to an exemplary embodiment of this application is shown.

[0253] Electronic device 10 includes processor 11 and memory 12. Memory 12 (such as a computer-readable storage medium like a hard disk, RAM, or flash memory) stores computer program instructions. When processor 11 (e.g., a central processing unit / CPU, microprocessor, digital signal processor / DSP, or other general-purpose processor) executes these instructions, it can implement methods for task scheduling in the operating environment. The specific implementation details of these methods have been described in detail above and will not be repeated here.

[0254] The electronic device 10 can be deployed in a local terminal device or in a server (such as a cloud platform).

[0255] The electronic device 10 may also include an input / output interface for visualizing information such as work scheduling plans, schedule times, estimated completion times, changeover costs, total profits, and delivery feasibility indicators. This visualization can be output in the form of charts, tables, or text.

[0256] It should be understood that the methods of the various embodiments of this application can be implemented by computer programs / software. This software can be loaded into the processor's memory and, when run, is used to execute the methods according to the various embodiments of this application.

[0257] It should be understood that the same or similar parts between the various embodiments in this specification can be referred to each other, and each embodiment focuses on describing the differences from other embodiments. In particular, for the apparatus embodiments, since their control logic basically corresponds to that of the method embodiments, the description is relatively brief, and relevant parts can be referred to the description of the method embodiments.

[0258] According to another embodiment of this application, a computer program product including computer program instructions is provided, the computer program instructions being configured to perform the methods according to various embodiments of this application when the computer program product is run on a computer or stored on a computer-readable storage medium (such as a CD-ROM). The machine-readable storage medium is, for example, an optical storage medium or a solid-state medium supplied together with or as part of other hardware.

[0259] Although specific embodiments have been described above, these embodiments are not intended to limit the scope of this application, even when only a single embodiment is described with respect to a particular feature. The feature examples provided in this application are intended to be illustrative and not limiting, unless otherwise stated. In practice, multiple features may be combined with each other as needed and where technically feasible. In particular, features from different embodiments may also be combined with each other. Various substitutions, modifications, and alterations are conceived without departing from the spirit and scope of this application.

Claims

1. A method for task scheduling in a work environment, comprising: An iterative search is performed using a search engine to generate candidate solutions for the job scheduling plan. The candidate solutions include at least the job ordering information and resource allocation information of each task in the job environment. The evaluator is used to evaluate the candidate solutions generated in each search. The fitness of each candidate solution is determined based on whether it satisfies the zero delay constraint. The fitness of the candidate solution that satisfies the zero delay constraint is better than that of the candidate solution that has delay. The fitness level guides the searcher's subsequent searches to generate the next generation of candidate solutions; and When the preset termination condition is met, the iterative search stops and the candidate solution with the best fitness is output.

2. The method according to claim 1, wherein, If all tasks in the job scheduling plan corresponding to a candidate solution can be completed within their corresponding delivery deadlines, then the candidate solution satisfies the zero-delay constraint.

3. The method according to claim 1 or 2, wherein, The evaluator also additionally determines the fitness based on the degree of delay corresponding to each candidate solution; In particular, candidate solutions with smaller delays have better fitness. Specifically, the degree of delay is at least one of the following: the total delay time of all tasks, the number of delayed tasks, or the number of products not completed on time among the delayed tasks.

4. The method according to any one of claims 1 to 3, wherein, The evaluator also additionally determines the fitness based on the profit corresponding to each candidate solution; In particular, among multiple candidate solutions with the same degree of delay, the candidate solution with higher profit has better fitness. In particular, fitness is additionally determined based on profit only if the candidate solution satisfies the zero delay constraint; Specifically, the profit is determined based on the gross profit of each task, outsourcing costs or revenue, inventory holding costs, and task switching costs.

5. The method according to any one of claims 1 to 4, wherein, The evaluator determines fitness based on the following priority rules: First, based on whether the candidate solutions satisfy the zero delay constraint, the candidate solutions are divided into feasible solutions and infeasible solutions. The fitness of any feasible solution is better than that of any infeasible solution. For the feasible solution, the fitness is further determined based on the profit; the higher the profit, the better the fitness of the feasible solution. For the aforementioned infeasible solutions, the fitness is further determined based on the degree of delay; the smaller the degree of delay, the better the fitness of the infeasible solution.

6. The method according to any one of claims 1 to 5, wherein, The method further includes: The candidate decoders are translated into corresponding schedules using a decoder and then provided to the evaluator for evaluation. The schedules include at least the estimated completion time of each task. Using an evaluator, the estimated completion time of each task is compared with its corresponding delivery deadline. If the estimated completion time of all tasks is no later than the corresponding delivery deadline, the candidate solution is determined to satisfy the zero delay constraint.

7. The method according to claim 6, wherein, When generating the scheduling timetable, the decoder embeds a resource availability synchronization mechanism into the decoding process. Specifically, the decoder dynamically maintains the occupancy status and earliest available time of the following resources in the operating environment to avoid resource usage conflicts: operating equipment, operating accessories and / or auxiliary replacement resources; Specifically, if the resources required by a task are currently occupied by other tasks, the expected start time of the task is postponed until the required resources become available.

8. The method according to claim 6 or 7, wherein, The decoder also determines the estimated completion time of each task based on the task switching type of successive tasks on the same working device; Specifically, the task switching types include: no switching required, material switching only, operation accessory switching only, and both material and operation accessory switching. In particular, when the task switching type involves changing work parts, the decoder also determines the estimated start time of the task based on the occupancy status of auxiliary switching resources.

9. The method according to any one of claims 1 to 8, wherein, The method further includes generating an initial solution as a candidate solution before the first iteration search, wherein the initial solution is generated by a mixture of at least two of the following rules: random rule, empirical rule, priority rule and FIFO rule.

10. The method according to any one of claims 1 to 9, wherein, The method further includes: When the evaluator determines that a candidate solution is delayed, and under the condition of meeting the preset triggering conditions, a feasibility repair operation is performed on the candidate solution with delay. The feasibility repair operation includes: switching at least some tasks in the candidate solution with delay from internal production to outsourced production. Specifically, after the feasibility repair operation is completed, the repaired candidate solutions are re-evaluated, and the candidate solution with better fitness is selected as the new candidate solution between the original candidate solution and the repaired candidate solution.

11. The method according to any one of claims 1 to 10, wherein, The searcher uses a metaheuristic search algorithm, which includes genetic algorithms, discrete particle swarm optimization, and / or simulated annealing.

12. The method according to any one of claims 1 to 11, wherein, When the searcher executes the genetic algorithm, its subsequent searches are guided based on fitness in the following manner: Parent selection is based on fitness, and candidate solutions with higher fitness are more likely to be selected in the parent selection. Based on the fitness, the next generation of candidate solutions is selected from the parents and the generated offspring of the current population.

13. The method according to any one of claims 1 to 12, wherein, When the searcher executes the discrete particle swarm optimization algorithm, the subsequent search of the searcher is guided according to fitness in the following way: The individual historical optimal position and the global optimal position of the population are determined based on fitness to guide the flight direction of the particles. Whether to accept the new particle position generated after the position update is determined based on fitness; Local searches are performed on elite particles based on fitness to improve their positions.

14. The method according to any one of claims 1 to 13, wherein, When the searcher executes the simulated annealing algorithm, the subsequent search of the searcher is guided according to the fitness in the following way: Based on fitness, a decision is made on whether to accept a newly generated candidate solution using an acceptance criterion. If the fitness of the newly generated candidate solution is better than that of the current candidate solution, it is accepted. If the fitness of the newly generated candidate solution is worse than that of the current candidate solution, it is accepted with a preset probability related to the current temperature. and / or Based on the comparison between the fitness of the current solution and the historical best solution at the end of the previous temperature layer, the search performance of the previous temperature layer is determined, and the temperature adjustment action of the next temperature layer is determined by the Q-learning controller according to the search performance.

15. The method according to any one of claims 1 to 14, wherein, When the searcher executes the population-based search algorithm, the search is performed in parallel and independently on multiple CPU cores. Each CPU core maintains its own candidate solution population and iterates independently. When preset migration conditions are met, the CPU cores exchange some candidate solutions to share search information.

16. The method according to any one of claims 1 to 15, wherein, The working environment is an injection molding workshop, the job sorting information in the candidate solutions includes the processing order of each production order, and the resource allocation information includes the injection molding machines and molds allocated to each production order or its corresponding process.

17. The method according to any one of claims 1 to 16, wherein, The work environment is an injection molding workshop. When generating next-generation candidate solutions using a search engine, the product switching type corresponding to two consecutive production orders processed on the same injection molding machine is considered. This product switching type determines whether a mold change is needed for the injection molding machine and whether a crane needs to be used; and / or When the searcher performs modification operations on candidate solutions, it adopts a modification direction that reduces the number of changeovers and / or changeover costs between successive production orders on the same injection molding machine.

18. The method according to any one of claims 1 to 17, wherein, The method further includes: The output candidate solution with the best fitness is converted into an executable scheduling schedule and sent to the job environment for execution; and / or The method employs a rolling window rescheduling strategy, which acquires a set of tasks to be processed within a preset time period over time and executes the search process to generate a corresponding job scheduling plan.

19. An electronic device comprising a memory and a processor, the memory storing computer program instructions which, when executed by the processor, enable the processor to perform the method according to any one of claims 1 to 18.

20. A computer program product comprising computer program instructions, wherein, When executed by a processor, the computer program instructions enable the processor to perform the method according to any one of claims 1 to 18.

21. A computer-readable storage medium storing computer program instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 18.