Resource scheduling method and electronic equipment
By using the resource scheduling method of computing cost-first mode and computing process-first mode in multi-project, multi-factory, and multi-resource scenarios, the acquisition and selection of resource scheduling solutions are optimized, and the artificial dependence and high error rate in the existing technology are solved. The problem of this has achieved more efficient and accurate resource scheduling.
Patent Information
- Application Number
- CN202410723339.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-06-05
AI Technical Summary
The existing technology relies on manual in resource scheduling of multiple projects, multiple factories and multiple resources, and has a high error rate, which cannot effectively cope with the expansion of application scenarios, and it is difficult to quickly obtain optimized scheduling solutions.
Provide a resource scheduling method and electronic equipment to obtain the target scheduling scheme through the calculation cost-first mode and the calculation process-first mode, use the gap array and the weekly complexity to prune and group, optimize the acquisition and selection of scheduling schemes, and ensure that resource scheduling conforms to User requirements.
It improves the accuracy and efficiency of resource scheduling, reduces the number of scheduling times and time, reduces the operating costs of enterprises, and enhances the system's decision-making capabilities.
Smart Images

Figure CN118426969B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of material scheduling, and in particular to a resource scheduling method and electronic equipment. Background Art
[0002] At present, when enterprises face the problem of selecting planning solutions for multiple projects, multiple factories, and multiple resources, the planning is usually done by the deployment personnel based on the different resources of different projects in different factories. However, the current planning method mainly relies on manual computing power, has a high error rate, and cannot cope with the gradually expanding application scenarios. Summary of the invention
[0003] The present application provides a resource scheduling method and an electronic device. In the method, the electronic device can output a target scheduling solution according to user needs.
[0004] In a first aspect, the present application provides a resource scheduling method, the method comprising: determining a target solution acquisition mode in response to a received user operation. The target solution acquisition mode comprises a computational cost priority mode and a computational process priority mode, wherein the computational cost priority mode comprises a number priority mode or a time priority mode, and the computational process priority mode comprises a local priority mode or a global priority mode. Based on the computational process priority mode, a set of scheduling solutions is acquired. Based on the computational cost priority mode, a target scheduling solution is selected from the set of scheduling solutions. In this way, the present application can plan resources according to user needs to obtain corresponding target scheduling solutions.
[0005] In a possible implementation, the method further includes: scheduling resources based on the target scheduling scheme. In this way, by scheduling resources using the obtained target scheduling scheme, the resource scheduling can meet the user's demand for fewer resource scheduling times or shorter resource scheduling time.
[0006] In a possible implementation, the resource is a non-consumable resource. In this way, the scheduling scheme of the present application can plan the scheduling of the non-consumable resource in the scene.
[0007] In a possible implementation, the target scheduling scheme is used to indicate the scheduling information of any resource within at least one week after the current week, and the scheduling information includes the scheduling start position, the scheduling destination position and the scheduling quantity. In this way, the present application can plan resource scheduling for multiple weeks. Among them, the scheduling start position and the destination position can be different scenarios. For example, if resources are transported from factory a to factory b, factory a is the scheduling start position and factory b is the scheduling destination position. The scheduling quantity is the scheduling quantity of the same resource from factory a to factory b.
[0008] In a possible implementation, if the computing process priority mode is the global priority mode, the obtaining of a set of scheduling solutions based on the computing process priority mode includes: obtaining a gap array, wherein the gap array is used to characterize the resource gap situation within at least one week. In the process of calculating the set of scheduling solutions corresponding to the gap array based on the global priority mode, based on the scheduling cost of the gap array, the set of scheduling solutions that meet the scheduling cost among all scheduling solutions corresponding to the gap array is searched. In this way, the present application can set a pruning baseline value based on the scheduling cost of the gap array. Therefore, based on the pruning baseline value, in the process of obtaining the scheduling solution, the scheduling solutions that exceed the pruning baseline value are pruned, thereby shortening the traversal time of the scheduling solution and improving the efficiency of searching for the optimal solution of the scheduling solution.
[0009] In a possible implementation, if the calculation process priority mode is the local priority mode, the obtaining of the scheduling solution set based on the calculation process priority mode includes: obtaining the gap array and the circumferential complexity corresponding to the gap array. Grouping the gap array based on the circumferential complexity. Based on at least one gap grouping after grouping, obtaining the scheduling solution corresponding to each gap grouping to form the scheduling solution set. In this way, through the local priority mode, the time for obtaining the scheduling solution can be effectively shortened, the efficiency of obtaining the scheduling solution can be improved, and the purpose of rapid solution can be achieved.
[0010] In a possible implementation, the obtaining of the gap array includes: obtaining the gap array based on a gap array obtaining model; wherein the construction condition of the gap array model includes that resources need to be scheduled one week in advance. Thus, when constructing the gap array, the application takes into account the time taken for resource transportation, thereby setting the condition that resources need to be scheduled one week in advance, so as to ensure that when resources are scheduled according to the scheduling plan, the resources are scheduled at least one week in advance, thereby ensuring the orderly progress of production.
[0011] In a possible implementation, the target scheduling scheme is selected from the scheduling scheme set based on the computational cost priority mode, including: if the computational cost priority mode is the number priority mode, the scheduling scheme with the smallest number cost is selected from the scheduling scheme set as the target scheduling scheme. If the computational cost priority mode is the time priority mode, the scheduling scheme with the smallest time cost is selected from the scheduling scheme set as the target scheduling scheme. In this way, the present application can select the scheduling scheme with the shortest time or the least number of transports based on user needs.
[0012] In a second aspect, the present application provides an electronic device comprising: one or more processors, a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: in response to a received user operation, determine a target solution acquisition mode; the target solution acquisition mode includes a computational cost priority mode and a computational flow priority mode, wherein the computational cost priority mode includes a number priority mode or a time priority mode, and the computational flow priority mode includes a local priority mode or a global priority mode; based on the computational flow priority mode, obtain a scheduling solution set; based on the computational cost priority mode, select a target scheduling solution from the scheduling solution set.
[0013] In a possible implementation manner, when the computer program is executed by the one or more processors, the electronic device executes the following steps: scheduling resources based on the target scheduling scheme.
[0014] In a possible implementation manner, the resource is a non-consumable resource.
[0015] In a possible implementation, the target scheduling scheme is used to indicate scheduling information for any resource within at least one week after the current week, and the scheduling information includes a scheduling start position, a scheduling destination position, and a scheduling quantity.
[0016] In one possible implementation, the computing process priority mode is the global priority mode. When the computer program is executed by the one or more processors, the electronic device performs the following steps: obtaining a gap array, where the gap array is used to characterize the resource gap situation within at least one week; in the process of calculating the set of scheduling schemes corresponding to the gap array based on the global priority mode, based on the scheduling cost of the gap array, searching for the set of scheduling schemes that meet the scheduling cost among all scheduling schemes corresponding to the gap array.
[0017] In one possible implementation, if the computing process priority mode is the local priority mode, when the computer program is executed by the one or more processors, the electronic device performs the following steps: obtaining the gap array and the circumferential complexity corresponding to the gap array; grouping the gap array based on the circumferential complexity; and obtaining the scheduling plan corresponding to each gap group based on at least one gap group after grouping to form the scheduling plan set.
[0018] In one possible implementation, when the computer program is executed by the one or more processors, the electronic device performs the following steps: acquiring a model based on a gap array to obtain the gap array; wherein the construction conditions of the gap array model include that resources need to be scheduled one week in advance.
[0019] In one possible implementation, when the computer program is executed by the one or more processors, the electronic device performs the following steps: if the computational cost priority mode is the number priority mode, selecting a scheduling scheme with the smallest number cost from the scheduling scheme set as the target scheduling scheme; if the computational cost priority mode is the time priority mode, selecting a scheduling scheme with the smallest time cost from the scheduling scheme set as the target scheduling scheme.
[0020] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.
[0021] In a third aspect, the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0022] In a fourth aspect, the present application provides a computer program, comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0023] In a fifth aspect, the present application provides a chip, the chip comprising a processing circuit and a transceiver pin, wherein the transceiver pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method in the first aspect or any possible implementation of the first aspect to control the receiving pin to receive a signal and control the sending pin to send a signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of an application scenario is shown as an example;
[0025] Figure 2 A schematic diagram of a flow chart of a resource scheduling method shown as an example;
[0026] Figure 3 A schematic diagram of a global optimal mode scheduling solution acquisition process is shown as an example;
[0027] Figure 4 The following is an exemplary calculation process of a single resource scheduling solution;
[0028] Figure 5 is a schematic diagram of an exemplary scheduling scheme tree;
[0029] Figure 6 is a schematic diagram of a nested process flow shown as an example;
[0030] Figure 7 A schematic diagram of a global optimal mode scheduling solution acquisition process is shown as an example;
[0031] Figure 8 is a schematic diagram of a gap array shown as an example;
[0032] Fig. 9 A schematic diagram of a scheduling scheme queue is shown as an example;
[0033] Fig.10 A schematic diagram of a scheduling scheme queue is shown as an example;
[0034] Fig.11 Schematic diagram of the device structure shown as an example. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0036] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0037] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.
[0038] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0039] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0040] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on a mobile device or electronic device, and finally presented as content that the user can recognize. The commonly used form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner.
[0041] Before describing the technical solution of the embodiment of the present application, the application scenario of the embodiment of the present application is first described in conjunction with the accompanying drawings. Figure 1 , is a schematic diagram of an application scenario provided in an embodiment of the present application. The application scenario includes a factory, a dispatching device, and a warehouse. Among them, the dispatching device can be a device with communication functions such as a computer, an electronic device, or a server. The dispatching device can provide a user platform, and the dispatching personnel can operate on the user interface provided by the user platform. In addition, the operators of each factory (also referred to as the dispatching personnel) can log in to the user platform provided by the dispatching end through the local device to input the resource information of the corresponding factory, and can obtain the dispatching plan output by the dispatching device from the user platform.
[0042] Figure 1 Only factory a, factory b and factory c are used as examples for illustration. In actual applications, the scenario may include more or fewer factories, and this application does not limit this.
[0043] The resources involved in the embodiments of the present application are all non-consumable resources. That is, resources are dispatched and circulated between factories or warehouses, and they always exist in the application scenario. For example, in the production process, factory a needs to dispatch part c of factory c (parts are non-consumable resources), and accordingly, part c is dispatched from factory c to factory a. It should be noted that resource consumption caused by special reasons does not affect the execution of the solution of this application.
[0044] In the embodiment of the present application, the scheduling device is an application scenario (for example Figure 1 In the scheduling scheme formulated for the application scenario shown in the figure, the application conditions are as follows:
[0045] 1. The total number of resources required for production in the scenario meets the demand, and each resource can operate normally without considering maintenance time.
[0046] 2. The resource allocation process involves the transfer of resources from the resource warehouse, which means that resources cannot be allocated between factories.
[0047] 3. There is no scenario of mutual substitution or one-way substitution between the resources essential for production.
[0048] 4. Resources need to be deployed one week in advance (or two weeks in advance), and transportation time should not exceed 7 days, leaving time for pre-production preparation.
[0049] It should be noted that the above application conditions are prerequisites for the scheduling device to calculate the scheduling plan. Of course, in some instances, if the parameters in the conditions fluctuate slightly, the scheduling device can still output the corresponding scheduling plan, that is, the condition deviation caused by some special reasons can be ignored.
[0050] This application provides a resource scheduling method for enterprises facing multiple projects, multiple factories, and multiple resources. In the process of generating resource scheduling solutions, this application takes into account the preparation time of production resources, and establishes a set of optimal resource allocation solutions based on the user's transportation cost selection preferences. Based on the production demand, resource list, and transportation cost matrix in the scenario, the optimal planning solution that meets production demand is obtained. It gets rid of the traditional resource allocation solution decision-making's heavy reliance on business personnel, improves the decision-making efficiency of the system, and reduces the operating costs of the enterprise.
[0051] In an embodiment of the present application, the execution cycle of the allocation device can be one week (or other durations, which can be set according to actual needs and are not limited in this application). For example, the allocation device executes the calculation process of the resource allocation plan in the embodiment of the present application once a week to calculate the corresponding allocation plan.
[0052] The following is a brief introduction to some calculation symbols involved in this application:
[0053] :factory, , For company warehouses, factories .
[0054] :product, , Product Collection .
[0055] :resource, , resource set .
[0056] :week, .
[0057] : The number of lines required for the pth product of the i-th factory in week wk, . Among them, the number of lines refers to the number of production lines.
[0058] : The single-line demand quantity of the s-th resource of the p-th product of the i-th factory, .
[0059] : The cost of deploying the minimum unit resource from the ith factory to the jth factory, .
[0060] : The time cost of deploying the minimum unit resource from the i-th factory to the j-th factory, .
[0061] : The cost of the number of times the minimum unit resource is deployed from the i-th factory to the j-th factory, .
[0062] : The sth resource gap of the ith factory in week wk.
[0063] : The inventory quantity of the sth resource of the ith factory in week wk.
[0064] : The amount of the s-th resource deployed from the i-th factory to the j-th factory in week wk, .
[0065] : The quantity of the s-th resource deployed from the warehouse to the j-th factory in week wk, , .
[0066] : The amount of the s-th resource deployed from the i-th factory to the warehouse in week wk, , .
[0067] : The number of factories with resource gaps for the s-th resource in week wk.
[0068] : The total gap of the s-th resource in week wk.
[0069] : The number of factories with surplus of the s-th resource in week wk.
[0070] : The total surplus of the s-th resource in week wk.
[0071] : Weekly complexity of week wk.
[0072] : Weekly deviation value for week wk.
[0073] : The cumulative weekly complexity from week 1 to week wk.
[0074] In the embodiment of the present application, the deployment device pre-sets the model. The model is established as follows:
[0075] 1) Rules for handling resource gaps:
[0076] In the embodiment of the present application, as described above, during the process of resource transfer (i.e., transfer from one factory to another), one week is unavailable, i.e., in transit. Preprocessing is performed as follows:
[0077] a. When hour,
[0078] like , , = ;
[0079] like , , = ;
[0080] like , , = ;
[0081] like , , = ;
[0082] b. When hour,
[0083] like , = ;like , =
[0084] Wherein, T is a preset threshold value, for example, 4 weeks or 8 weeks, which can be set according to actual needs and is not limited in this application. It can be understood that in the embodiment of this application, a scheduling plan can be formulated for the next T weeks.
[0085] Based on the above conditions, the scheduling device can obtain the gap value based on the parameter value in the scene during actual operation. , that is, the number of gaps in the sth resource of the ith factory in week wk.
[0086] 2) Build the model:
[0087] (1)
[0088]
[0089] For example, during the solution process, the scheduling device can solve the scheduling solution set based on the above model. ,in The scheduling device can calculate the cost of each solution based on the solution combination set A. The cost set ,in , the minimum cost , corresponding plan The specific application will be described in detail in the following embodiments.
[0090] To facilitate modeling, as mentioned above, the warehouse is set as a virtual factory during the modeling process. In the actual solution process, the virtual factory is restored to the warehouse, which is the optimal solution mentioned above. Convert to business layer execution. The conversion rules are as follows:
[0091] , (2)
[0092] (3)
[0093] (4)
[0094] (5)
[0095] Figure 2 For a flow chart of an exemplary resource scheduling method, please refer to Figure 2 , including but not limited to the following steps:
[0096] S201: Determine a solution acquisition mode in response to a received user operation.
[0097] Exemplarily, a mode selection option may be provided in the display interface of the application platform of the scheduling device, and the scheduling device determines the corresponding solution acquisition method in response to the received user operation.
[0098] In the embodiment of the present application, the solution acquisition mode includes at least one of the following: a global optimal mode, a local optimal mode, a number optimal mode, and a time optimal mode.
[0099] Global optimal mode, local optimal mode: To ensure the rapid output of the dispatching plan, the user can choose the solution search method. Among them, the local optimal mode takes a shorter time to solve. The global optimal mode takes longer time than the local optimal mode. The solution it outputs is the optimal solution selected from the calculation of the global possible solutions. Therefore, the dispatching plan output by the global optimal mode is basically the optimal solution among all solutions.
[0100] Optimal frequency mode, optimal time mode: Users can select frequency priority or time priority based on their preferences in business scenarios. Time priority means that the solution with short deployment time is selected first, and then the solution with less deployment time of resources is selected. Frequency priority means that the solution with less deployment time is selected first, and then the solution with short deployment time of resources is selected.
[0101] In an embodiment of the present application, the user can select any one of the global optimal mode and the local optimal mode, and / or any one of the times optimal mode and the time optimal mode. For example, the solution acquisition mode (also referred to as the target mode) selected by the user can be the times optimal mode and the local optimal mode, or can be the time optimal mode and the global optimal mode, which can be set based on actual needs and is not limited by the present application. Optionally, if the user does not select times / time priority, or global / local priority, the system can select by default (which can be set according to actual needs), which is not limited by the present application.
[0102] S202: Determine whether the solution acquisition mode is a local optimal mode.
[0103] Exemplarily, the scheduling device determines whether the solution acquisition mode is a local optimal mode based on the user selection result in S201.
[0104] In one example, if it is a local optimal mode, S204 is executed.
[0105] In another example, if it is not a local optimal mode (ie, a global optimal mode), S203 is executed.
[0106] S203: Based on the local optimal mode, obtain a scheduling solution in a time optimal mode or a number optimal mode.
[0107] S204: Based on the global optimal mode, obtain a scheduling solution in a time optimal mode or a number optimal mode.
[0108] Exemplarily, after determining that the calculation process of the scheduling plan adopts the local optimal mode or the global optimal mode, the scheduling device can obtain the optimal scheduling plan that meets the scenario requirements based on the time optimal mode or the number optimal mode selected by the user in S201 (or the system default).
[0109] Combine the following Figure 3 The schematic diagram of the process flow for obtaining the global optimal mode scheduling solution is shown as an example. For a detailed description of S203, please refer to Figure 3 , including but not limited to the following steps:
[0110] S301, dividing the weekly data according to the built-in value.
[0111] Exemplarily, the scheduling device may obtain input parameters. Optionally, the input parameters may include but are not limited to: , that is, the inventory quantity of the sth resource of the ith factory in week wk.
[0112] For example, the operator of each factory can log in to the platform provided by the scheduling device at the terminal of the factory and input the inventory quantity of different types of resources of the factory in week wk. Accordingly, the scheduling device can obtain the inventory quantity of different types of resources of each factory in week wk.
[0113] The dispatching device can obtain The scheduling device can calculate the gap array based on the formula above. For example, Table 1 shows the gap array of the last 5 weeks (this value is T above) of factories A, B, C, and D. The values in Table 1 are only for illustrative purposes and are not limited in this application. Please refer to Table 1:
[0114] Table 1
[0115]
[0116] Exemplarily, the total number of weeks acquired by the scheduling device can be set according to actual needs. In the embodiment of the present application, only the five weeks after the current week are acquired each time as an example for explanation. That is, the first week in Table 1 is the current week. Of course, it can also be the first week after the start of the plan. This application does not limit it. In other embodiments, the total number of weeks can also be other values, such as 8 weeks, that is, each time the scheduling device acquires the gap data of each factory within 8 weeks, which is not limited by this application.
[0117] Exemplarily, in the local calculation process, the scheduling device can divide the weekly data based on the built-in value (which can be set according to actual needs, such as 3 or 4). Taking Table 1 as an example, assuming that the built-in value is 3 (i.e., 3 weeks), the scheduling device divides the weekly data based on the built-in value to obtain two groups of data. The first group of data includes the 1st week, the 2nd week, and the 3rd week, that is, the weekly data that meets the built-in value 3. The remaining data is then divided, and the remaining is the 4th week and the 5th week, which is less than the built-in value. The 4th week and the 5th week are grouped together, namely the second group.
[0118] S302, determining whether the maximum number of cycles of the current processing block is less than or equal to the total number of cycles.
[0119] Exemplarily, the scheduling device processes each gap array after segmentation in order. For example, the scheduling device starts to process the first group (including week 1, week 2, and week 3). The scheduling device determines whether the maximum week in the current processing block (i.e., the gap array (also referred to as a group) currently being processed, such as group 1) is less than or equal to the total number of weeks. The total number of weeks is the total number of weeks obtained before S301 or S301, for example, the total number of weeks in Table 1 is 5 weeks.
[0120] In one example, if it is less than or equal to the total number of weeks, S303 is executed.
[0121] In another example, if it is greater than the total number of weeks, S309 is executed.
[0122] S303, obtaining the gap array that currently needs to be calculated.
[0123] Exemplarily, the scheduling device obtains the gap array that needs to be calculated currently, which can also be called a gap group or a gap matrix, which is not limited in this application, that is, the group that needs to be processed currently after S301 division. For example, it is the first group mentioned above (including week 1, week 2, and week 3). The scheduling device can obtain the gap data corresponding to the first group in Table 1 to form the gap array that needs to be calculated currently, as shown in Table 2:
[0124] Table 2
[0125]
[0126] S304, updating the subsequent gap array according to the previous set of scheduling plans.
[0127] Exemplarily, the scheduling device updates the subsequent gap matrix according to the scheduling plan (also referred to as a scheduling scheme) obtained after processing the previous set of data.
[0128] Optionally, if there is no previous set of corresponding scheduling plans, the previous set of scheduling plans is empty, and the gap matrix may not be updated. For example, if the gap array of the first week is currently being processed, there may be no previous set of corresponding scheduling plans, and there is no need to update the gap array.
[0129] Optionally, if there is a previous group of corresponding scheduling plans, for example, the second group of gap arrays is currently being processed, then the first group of gap arrays is processed Figure 3 After the process processing is completed (for example, after S307 is executed), the scheduling plan (i.e., scheduling scheme, which may also be called scheduling strategy, etc., which is not limited in this application) corresponding to the first group of gap arrays is obtained, and the scheduling device can update the subsequent gap arrays according to the scheduling scheme corresponding to the previous group of gap arrays. Here, updating the subsequent gap arrays refers to updating the data in the gap arrays in the current gap group (i.e., processing block) and thereafter, that is, the updated gap data does not include the gap group processed in the previous group and the gap data before the previous group. For example, the current gap group (i.e., processing block) is the second group (i.e., the 4th and 5th weeks), and the scheduling device can update the subsequent gap arrays in Table 1, i.e., the data of the 4th and 5th weeks, according to the scheduling scheme corresponding to the previous group of gap groups (i.e., the first group, weeks 1 to 3) (if there is gap data later, it will be updated synchronously).
[0130] S305: Based on the single resource scheduling solution calculation process, obtain a scheduling solution result set.
[0131] Exemplarily, the scheduling device may calculate a single resource scheduling solution process (such as Figure 4 As shown in the figure), obtain the scheduling solution result set. Figure 4 The specific execution process will be described in detail in step S310 and will not be repeated here.
[0132] It can be understood that after this step is completed, the scheduling device can obtain the optimal scheduling plan corresponding to the gap group currently being processed (for example, Table 2), which can also be called a local initial scheduling plan (the initial plan will be updated later).
[0133] Optionally, the scheduling solution set may be understood as an initial scheduling solution set, and the scheduling device optimizes the initial scheduling solution set through subsequent steps to obtain an optimal scheduling solution.
[0134] S306, determine whether there is a scheduling plan.
[0135] Exemplarily, the scheduling device determines whether there is a scheduling solution for the current gap array (eg, the first group). It can also be understood as executing S305 (ie Figure 4 After that, check whether the corresponding scheduling plan is obtained.
[0136] In one example, if no scheduling solution is obtained, that is, the scheduling solution corresponding to the gap array currently being processed is an empty set, S308 is executed.
[0137] In another example, if there is a corresponding scheduling solution, execute S307.
[0138] S307, accumulate the total transportation cost and update the gap array for all subsequent weeks.
[0139] Exemplarily, the scheduling device executes Figure 4 Afterwards, if the scheduling plan corresponding to the currently processed gap group is obtained, the scheduling device can obtain the transportation cost corresponding to the scheduling plan based on the formula above. The scheduling device can add the total transportation costs of the processed gap groups to obtain the cumulative total transportation cost. For example, assuming that the scheduling device is currently processing the second group of gap groups in Table 1 (including the 4th and 5th weeks), when executing the current step, the scheduling device can add the transportation cost obtained after the last processing of the first group to the transportation cost of the gap group (i.e., the second group) processed this time to obtain the cumulative total transportation cost.
[0140] Furthermore, the scheduling device can update the gap data of all subsequent weeks based on the scheduling scheme of the gap group currently obtained, wherein the gap data of all subsequent weeks refers to the gap data of all weeks after the current gap group (excluding the current gap group) in the gap array. For example, the gap group currently processed is Table 2, which is the first group. The scheduling device can update the gap data of all weeks after the first group in Table 1, such as the 4th and 5th weeks, based on the scheduling scheme corresponding to the first group.
[0141] For example, the total transportation cost calculated in this step is S309, that is, executing again Figure 4 The pruning conditions used when pruning (i.e., the pruning benchmark value) are used.
[0142] S308, return the maximum value of the integer and mark it as unsolvable.
[0143] Exemplarily, if the scheduling device determines that the current gap group has no corresponding scheduling solution, an infinite value may be used as a pruning reference value for subsequent steps, and it is marked that the currently processed gap group has no corresponding scheduling solution.
[0144] S309, setting pruning conditions based on the transportation cost in the local optimal mode.
[0145] Exemplarily, the scheduling device traverses all gap groups, that is, after executing steps S302 to S308 for each gap group, the total transportation cost can be obtained, which is the accumulated value of the transportation cost corresponding to each gap group. When the scheduling device executes S309, the accumulated total transportation cost (that is, the transportation cost in the local optimal mode) is used as a pruning condition (that is, a pruning reference value) to prune the subsequent plan.
[0146] S310, based on the single resource scheduling solution calculation process, obtain a scheduling solution result set.
[0147] Figure 4 For an example of the calculation process of a single resource scheduling solution, please refer to Figure 4 , including but not limited to the following steps:
[0148] S401, obtaining the gap array and pruning baseline value currently being processed.
[0149] Exemplarily, the scheduling device executes Figure 4 , get the currently processed gap array and pruning baseline value.
[0150] Optionally, when executing step S305, call Figure 4 When the process Figure 4 The gap array currently to be processed obtained in is the gap group, that is, the gap group after grouping. The initial pruning baseline value is the preset value or the current accumulated total transportation cost. For example, when calculating the second group, the pruning baseline value may be the total transportation cost corresponding to the first group.
[0151] Optionally, when executing step S310, call Figure 4 When the process Figure 4 The gap array currently to be processed obtained in is the entire gap array, such as Table 1. And the initial pruning baseline value is the cumulative value of the transportation costs corresponding to all gap groups after executing S307.
[0152] S402, traverse the gap array to obtain the scheduling plan corresponding to the current week.
[0153] Exemplarily, the scheduling device traverses the gap array, that is, the scheduling device performs the following steps on the gap data of each week one by one according to the traversal order of each week in the gap group. Exemplarily, the scheduling device can calculate all scheduling schemes corresponding to the current gap array based on the formula described above. Figure 5 For a schematic diagram of an exemplary scheduling scheme tree, please refer to Figure 5, the scheduling device calculates the scheduling plan for the current week according to the gap data in the current gap array (for example, it may be the first gap group in Table 2, or it may be the overall gap array in Table 1). For example, assuming that the current week is W1, two scheduling plans N11 and N12 corresponding to W1 can be obtained.
[0154] Exemplarily, the scheduling device traverses the gap array in units of weeks. For example, as shown in Table 1, the scheduling device starts traversing in the order of the first week, the second week, and the third week.
[0155] S403, determining whether there is a scheduling plan for the current week.
[0156] Exemplarily, the scheduling device determines whether there is a scheduling plan for the currently traversed weekly gap (for example, the first week).
[0157] In one example, if there is no scheduling solution, S404 is executed. For example, if the current week is the first week, there may be no scheduling solution, and S404 can be executed.
[0158] In another example, if a scheduling solution exists, execute S412.
[0159] S404, looping through all scheduling plans for the current week.
[0160] For example, if there is a scheduling plan for the current week, the scheduling device traverses all scheduling plans corresponding to the current week in the currently traversed branch. Figure 5 , Week 1 (W1) includes scheduling schemes N11 and N12. The scheduling device traverses all scheduling schemes of Week 1 (W1) in order, for example, the currently traversed scheme is N11. When traversing Week 2, assuming that the currently traversed branch is the branch corresponding to N11, then when traversing Week 2, the traversal order is N21 and N22.
[0161] S405, determining whether the scheduling plan for the current week has been traversed.
[0162] Exemplarily, the schedule plan goes through the schedule plan of the current week one by one in order, for example, Figure 5 As shown, the traversal order of the scheduling scheme for W1 is N11, N12. The scheduling device determines whether all scheduling schemes for the current week have been traversed. For example, after the scheduling scheme traverses N12, it can be determined that all scheduling schemes for W1 week have been traversed.
[0163] In one example, the scheduling device determines that the scheduling plan traversal for the current week is complete and outputs a set of scheduling plans.
[0164] In another example, if the scheduling device determines that the scheduling plan for the current week has not been completed, it continues to traverse the next scheduling plan for the current week, that is, executes S406.
[0165] S406, calculating the total scheduling cost up to the current week.
[0166] Exemplarily, the scheduling device calculates the sum of the total scheduling costs of the scheduling schemes corresponding to the currently traversed week. For example, if the currently traversed week is the first week in the currently processed gap group, the total scheduling cost is the total scheduling cost corresponding to the first week. The calculation of the scheduling cost can refer to the above formula to calculate the corresponding .
[0167] For another example, if the week currently traversed is the second week, the total scheduling cost is the sum of the total scheduling cost of the first week and the total scheduling cost of the second week on the branch currently traversed.
[0168] For example, refer to Figure 5 , assuming that the current traversal is N22, the total scheduling cost is the sum of the total scheduling cost of N11 and the total scheduling cost of N22. That is to say, the sum of the total scheduling costs of N11 and N22 is the sum of the total scheduling costs of traversing the currently traversed branch (for example, N11-N22) to the current node (that is, N22).
[0169] S407, determining whether the total cost is greater than the pruning baseline value.
[0170] Exemplarily, the scheduling device determines whether the total scheduling cost is greater than the pruning baseline value.
[0171] In one example, if it is greater than the pruning baseline value, then the execution returns to S406, that is, continuing to traverse other scheduling solutions of the current week. In other words, no further traversal of other scheduling solutions under this branch is performed, that is, pruning. For example, referring to Figure 5 When traversing the branches N11-N21, if the sum of the current scheduling total costs is greater than the pruning baseline value, N21 is pruned, and there is no need to traverse the scheduling schemes after N21. For example, as described above, the scheduling device traverses all scheduling schemes corresponding to the current week in the currently traversed branch. Please refer to Figure 5 , assuming that when traversing the second week, the branch corresponding to N11 is currently traversed, then when traversing the second week, the traversal order is N21 and N22. That is, the scheduling device determines that the total cost of N11 and N21 is greater than the pruning baseline value, and the step returns to S405. The next node traversed by the scheduling device (also called a child node or a leaf node, which is not limited in this application) is the node under the N11 branch in the second week, for example, N22.
[0172] In another example, if it is less than or equal to the pruning baseline value, S408 is executed.
[0173] S408, updating the total scheduling plan and the gap array of the latest scheduling plan.
[0174] Exemplarily, the scheduling device updates the latest scheduling plan. Specifically, the scheduling device may maintain a set or list of scheduling plans. The scheduling device records the scheduling plans corresponding to the gap groups, and the scheduling plans include the corresponding scheduling plans for each week. Of course, the weekly scheduling plan may also be a set. The specific description can refer to the above model, which will not be repeated here. Exemplarily, the scheduling device can record each scheduling plan that is less than the pruning baseline value into the list. Of course, as the traversal is executed in sequence, the scheduling plan may be updated, and the total transportation cost corresponding to the updated scheduling plan is the minimum total transportation cost among the scheduling plans that can be obtained at present.
[0175] Exemplarily, the scheduling device may update the gap array based on the current scheduling scheme (it may be the gap group currently being processed, such as the first group shown in Table 2, or it may be the entire gap array, such as Table 1). For example, the current scheduling scheme indicates that x s1 resources are scheduled from factory a to factory b in week 1, and y s2 resources are scheduled from factory b to factory c in week 2. Based on this scheduling method, the number of gaps in the gap group is updated, that is, the number of s1 resources of factory a in week 1 in the original gap group is reduced by x, and the number of s1 resources of factory b is increased by x. It should be noted that updating the gap array here refers to updating the number of gaps in the weeks after the currently traversed week, without updating the number of gaps in the currently traversed week and the weeks before the current week.
[0176] S409, determining whether the current week is the last week.
[0177] Exemplarily, the scheduling device determines whether the currently traversed week is the last week. The last week here refers to the last week in the currently processed gap group, for example, the third week in Table 2 is the last week of the currently processed gap group. For another example, if the currently processed gap array is the entire array in Table 1, the last week is the fifth week.
[0178] In one example, if it is the last week, S411 is executed.
[0179] In another example, if it is not the last week, the process returns to S410 .
[0180] For example, refer to Figure 5, assuming that the scheduling device traverses in the order of N11-N22, the scheduling device determines that the current total transportation cost is less than the pruning baseline value. The scheduling device records the scheduling plan, and the currently recorded scheduling plans are N11 and N22. In addition, the scheduling device updates the gap array of the third week in Table 2 according to the current scheduling plan (of course, it may also update the third week to the fifth week in Table 1). The scheduling device re-executes S402 and starts traversing the third week (i.e., W3). Based on the gap array, the scheduling device obtains that the scheduling plans corresponding to W3 are N31 and N32. The scheduling device executes S403 and S404 and starts traversing N31. The scheduling device may detect that the total scheduling cost corresponding to N31 is greater than the pruning baseline value, then re-executes S405 and continues to traverse N32. Assume that the scheduling device obtains the total scheduling cost up to the current week of N32 (i.e., the sum of the total transportation costs of N11, N22 and N32, the total transportation cost in this application may also be referred to as the total scheduling cost, which will not be repeated below) is less than the pruning baseline value. The scheduling device updates the scheduling plan, and the updated scheduling plan is N11, N22, and N32. The scheduling device updates the gap array and executes S411. Assuming that the scheduling device determines that the current week is the last week, S410 is executed.
[0181] S410, the gap matrix is shifted left by one column, and a scheduling solution result set is obtained based on a single resource scheduling solution calculation process.
[0182] For example, if the scheduling device determines that the current week is not the last week, it will shift the gap matrix to the left and obtain the scheduling solution result set based on the single resource scheduling solution calculation process. It can also be understood that the scheduling device continues to call the gap data (i.e., gap matrix) of the week after the current week. Figure 4 process to obtain the corresponding scheduling solution result set.
[0183] For example, Figure 5 As shown, after traversing to N11 of W1, the scheduling device obtains the scheduling plan N11. The scheduling device executes S409, determines that the week currently traversed (ie, W1) is not the last week, and executes S410. The scheduling device shifts the gap matrix to the left by one column, that is, continues to call W2 and W3 Figure 4 In the embodiment of the present application, calling Figure 4 It can be understood that from Figure 4 For example, the scheduling device is executing Figure 4 (Remember the currently executed Figure 4 Called when the process is the first nested process) S410 Figure 4 , it can be understood that the call is embedded in S410. Optionally, in this example, the first call Figure 4 This is recorded as the second nested process. Figure 6For an exemplary nested flow diagram, please refer to Figure 6 When the first nested process is executed to S410, it calls Figure 4 , that is, the second nested process.
[0184] Exemplarily, when the scheduling device executes the second nested process, Figure 4 Specifically, when executing S401, the gap array obtained by the scheduling device is the gap data after the update of W2 and W3, and the pruning baseline value is the pruning baseline value obtained most recently. Figure 4 The process in Figure 5 For example, the scheduling device can calculate all scheduling plans for the current week (ie W2), including N22 (actually N11-N22) and N21 (actually N11-N21). The scheduling device begins to sequentially traverse the two scheduling plans for W3. Assuming that the scheduling cost of N11-N21 is greater than the pruning baseline value, prune it. The scheduling device continues to traverse the next node, which is N22, and the scheduling cost of N11-N22 is less than the pruning baseline value. The scheduling device updates the scheduling plan, which is N11-N22, and updates the gap array and the pruning baseline value (that is, the scheduling cost of N11-N22 (or it can be called the total transportation cost)). The scheduling device determines that the currently traversed W2 is not the last week, and executes S410. The scheduling device shifts the gap matrix to the left by one column, that is, continues to call W3 (if there is an array after W3, it is for W3 and the array after it) Figure 4 In the embodiment of the present application, calling Figure 4 It can be understood that from Figure 4 For example, the scheduling device is executing Figure 4 (Currently executing Figure 6 The second nested process shown in FIG. 1 is called when S410 Figure 4 , it can be understood that the call is embedded in S410 for execution. Optionally, as Figure 6 As shown, in this example, the second call Figure 4 Recorded as the third nested process.
[0185] Exemplarily, when the scheduling device executes the third nested process, Figure 4 Specifically, when executing S401, the gap array obtained by the scheduling device is the gap data of W3, and the pruning baseline value is the pruning baseline value obtained most recently. The scheduling device executes Figure 4 The process in Figure 5For example, the scheduling device can calculate all scheduling plans for the current week (ie, W3), including N31 (actually N11-N22-N31) and N32 (actually N11-N22-N31). The scheduling device starts to traverse the two scheduling plans for W3 in sequence. Assuming that the scheduling cost of N11-N22-N31 is greater than the pruning baseline value, prune it. The scheduling device traverses N32, and the scheduling cost of N11-N22-N31 is less than the pruning baseline value. The scheduling device updates the scheduling plan to N11-N22-N31, and updates the gap array. The scheduling device determines that the currently traversed W3 is the last week and executes S411. The scheduling device records the scheduling plan as N11-N22-N31, refreshes the gap array, and updates the pruning baseline value to the total scheduling cost of N11-N22-N31. The scheduling device re-executes S405 and determines that the scheduling solution of W3 has been traversed, and then outputs the scheduling solution result set as N11-N22-N31. Figure 6 After the third nested process is executed and the scheduling scheme, pruning baseline and gap array are output, the step returns to S410 of the second nested process and continues to execute the second nested process. Figure 4 That is, the scheduling device calls the embedded Figure 4 The process can traverse all the scheduling schemes in the same week, and then traverse all the scheduling schemes in the previous layer of the branch. For example, when the scheduling device executes the second nested process, it returns to execute S405, and will determine whether the traversal of the scheduling scheme of W2 is completed, and if there are still nodes of the same level in W2 (nodes of the same level refer to nodes under the N11 branch, excluding the two nodes under N12), it can continue to traverse other nodes of the same level. After all the scheduling schemes in the W2 week under the current branch (i.e., the branch under N11) are traversed, the second nested process ends and returns to S410 of the first nested process. The scheduling device can continue to execute the process in the first nested process to traverse the next node (i.e., scheduling scheme) in W1, such as N12.
[0186] S411, record the scheduling plan, refresh the gap array, and update the pruning baseline value.
[0187] Exemplarily, the scheduling device records the scheduling plan, and the scheduling plan is output as the gap array (which may also be the gap grouping).
[0188] Exemplarily, if the scheduling device determines that the total cost of the scheduling solution corresponding to the currently traversed branch is less than the pruning baseline value, that is, the total cost of the currently traversed scheduling solution is less than the total cost of the scheduling solution corresponding to the current pruning baseline value. Therefore, the scheduling device updates the recorded scheduling solution to the currently traversed scheduling solution, so that the total cost of the scheduling solution finally output is the minimum total cost.
[0189] Exemplarily, the scheduling device updates the gap array based on the scheduling scheme. It should be noted that, as described above, Figure 4 There may be embedded calls in Figure 4 Process situation, in the call Figure 4 During the process, after the scheduling device executes S411 to update the gap array and the pruning baseline, the scheduling device ends the embedded call and returns to execute Figure 4 When the process is completed, subsequent processes will be continued based on the updated schedule, gap array, and pruning baseline.
[0190] S412, determining whether the current week is the last week.
[0191] Exemplarily, the scheduling device determines whether the currently traversed week (e.g., week 1) is the last week in the currently processed gap array (which may be a gap group or the entire gap array). For example, if the currently traversed week is week 3, it is the last week of the currently processed block (i.e., gap group).
[0192] In one example, if it is the last week, S411 is executed.
[0193] In another example, if it is not the last week, S402 is executed, that is, the gap data of the next week in the gap group currently being processed is continuously traversed.
[0194] S413, the gap matrix is shifted left by one column, and a scheduling solution result set is obtained based on the single resource scheduling solution calculation process.
[0195] The description may refer to S410 and will not be repeated here.
[0196] S414, calculating the total scheduling cost according to the scheduling plan, and updating the gap array after using the scheduling plan.
[0197] Exemplarily, the scheduling device calculates the sum of the total scheduling costs of the scheduling schemes corresponding to the currently traversed week. For example, if the currently traversed week is the first week in the currently processed gap group, the total scheduling cost is the total scheduling cost (also called the total transportation cost) corresponding to the first week. The calculation of the scheduling cost can refer to the above formula to calculate the corresponding The scheduling device can obtain the total scheduling cost corresponding to the currently recorded scheduling plan.
[0198] S415, determining whether the total cost is less than or equal to the pruning baseline value.
[0199] Exemplarily, the scheduling device determines whether the total scheduling cost is greater than the pruning baseline value.
[0200] In one example, if it is greater than the pruning baseline value, S416 is executed.
[0201] In another example, if it is less than or equal to the pruning baseline value, S417 is executed.
[0202] S416, return an empty list.
[0203] For example, if the total scheduling cost is greater than the pruning baseline value, it means that there is no scheduling solution for the gap group currently being processed. For example, there may be no gaps in each week of the current gap group.
[0204] The meaning of an empty list can also be understood as that the set of output scheduling scheme sets A is empty.
[0205] S417, record the scheduling plan, refresh the gap array, and update the pruning baseline value.
[0206] Exemplarily, the scheduling device records the scheduling plans that have been traversed and whose total cost is less than or equal to the pruning baseline value. And according to the scheduling data in the scheduling plan, the data in the gap array is updated. In addition, the scheduling device updates the pruning baseline value. Among them, the updated pruning baseline value is the total cost corresponding to the currently traversed scheduling plan. It can be understood that as long as the total cost is less than the pruning baseline value, the pruning baseline value is updated to a value corresponding to a smaller total cost. In this way, after the scheduling device updates the pruning baseline value, in subsequent processes (including Figure 3 Subsequent processes and re-execution in Figure 4 The tree corresponding to the scheduling scheme will be pruned with the new pruning baseline value, so as to find the scheduling scheme with the minimum total cost.
[0207] Exemplarily, the scheduling device outputs a scheduling solution result set, which includes at least one scheduling solution with an equal total scheduling cost (there may be multiple scheduling solutions with an equal total scheduling cost that are all minimum values).
[0208] S311, determine whether it is a local optimal mode.
[0209] Exemplarily, the scheduling device determines whether the mode selected by the user is a local optimal mode.
[0210] In one example, if it is a local optimal mode, S312 is executed, that is, the local calculation process is continued.
[0211] In another example, if the non-local optimal mode is used, then Figure 7 S713 in.
[0212] S312, determine whether it is a time priority mode.
[0213] Exemplarily, the scheduling device determines whether the user selects the time priority mode.
[0214] In one example, if the time priority mode is selected, S313 is executed.
[0215] In another example, if the limited number mode is selected, S314 is executed.
[0216] It can be understood that in the embodiment of the present application, the scheduling device may obtain multiple scheduling schemes with equal scheduling costs. In this case, the scheduling device can select the scheduling scheme with the least transportation times or the shortest transportation time from the multiple scheduling schemes based on user needs.
[0217] Optionally, if the scheduling solution acquired by the scheduling device based on the above process is unique, S315 may be directly executed.
[0218] S313, loop through the scheduling scheme set and calculate the total cost C of the number of transportation times corresponding to the scheme.
[0219] Exemplarily, the scheduling device loops through each scheduling scheme in the scheduling scheme set and calculates the total cost C of the number of transportation times corresponding to the scheme.
[0220] S314, loop through the scheduling scheme set and calculate the total cost C of the transportation time corresponding to the scheme.
[0221] Exemplarily, the scheduling device loops through each scheduling scheme in the scheduling scheme set and calculates the total cost C of the transportation time corresponding to the scheme.
[0222] S315, selecting and outputting a set of scheduling solutions with the smallest total cost C.
[0223] Exemplarily, the scheduling device selects a scheduling solution set with the smallest total cost C as the target scheduling solution set and outputs it to the user.
[0224] Combine the following Figure 7 The schematic diagram of the process flow for obtaining the global optimal mode scheduling solution is shown as an example. For a detailed description of S204, please refer to Figure 7 , including but not limited to the following steps:
[0225] S701, initialize the scheduling result queue.
[0226] Exemplarily, the scheduling device initializes a scheduling result queue, and the scheduling result queue is used to place the scheduling plan.
[0227] S702, group the remaining gap arrays according to the complexity value and write an empty scheduling solution set.
[0228] Exemplarily, the scheduling device obtains the complexity parameter. Specifically, the scheduling device may calculate the complexity parameter based on the obtained input parameters. Optionally, the input parameters may include but are not limited to: , that is, the inventory quantity of the sth resource of the ith factory in week wk.
[0229] For example, the operator of each factory can log in to the platform provided by the scheduling device at the terminal of the factory and input the inventory quantity of different types of resources of the factory in week wk. Accordingly, the scheduling device can obtain the inventory quantity of different types of resources of each factory in week wk.
[0230] Exemplarily, the scheduling device may calculate the complexity parameter based on the formula described above: .
[0231] Exemplarily, the scheduling device traverses each week in the order of the weeks in the gap array and calculates the cumulative complexity value. If the cumulative complexity value is greater than the week complexity threshold (which can be set according to actual needs and is not limited in this application), the previous weeks are divided into a group. For example, Figure 8 For an exemplary schematic diagram of a gap array, please refer to Figure 8 , assuming that the current gap array includes week 1 to week 5 (the values can be referred to Table 1, which is only a schematic representation of the grouping situation). The scheduling device traverses the first week and calculates the week complexity value of the first week according to the formula described above, assuming that the week complexity value of the first week is less than the week complexity threshold. The scheduling device continues to calculate the week complexity of the second week, and calculates the cumulative week complexity value of the first and second weeks. Assuming that the cumulative week complexity value of the first and second weeks is less than the week complexity threshold, the scheduling device continues to calculate the cumulative week complexity value of the third week (that is, the sum of the week complexity values of the first, second and third weeks). Assuming that the cumulative week complexity value of the third week is still less than the week complexity threshold. The scheduling device continues to calculate the cumulative week complexity value of the fourth week. Assuming that the cumulative week complexity value of the fourth week is greater than the week complexity threshold. Then, the scheduling device divides the first week, the second week and the third week into a gap group, which is the first group.
[0232] Exemplarily, the scheduling device writes an empty scheduling scheme into the scheduling result queue, such as Fig. 9 shown.
[0233] S703, determine whether the queue is empty.
[0234] Exemplarily, the scheduling device determines whether the queue is empty. In one example, if the queue is empty, S705 is executed.
[0235] In another example, if the queue is not empty, S704 is executed.
[0236] For example, Fig. 9 For example, the current queue includes an empty solution, and the scheduling device determines that the queue is not empty, and executes S704.
[0237] S704, determine whether the traversal of the current layer nodes of the gap grouping is complete.
[0238] Exemplarily, the scheduling device traverses the scheduling solutions in the queue one by one, and executes subsequent processes for the scheduling solutions until all scheduling solutions of the current layer are traversed. The concept of the current layer can be referred to below and will not be described here.
[0239] In one example, if the traversal is completed, S706 is executed.
[0240] In another example, if the traversal is not completed, execute S710.
[0241] For example, refer to Fig. 9 , there are untraversed nodes in the queue (i.e., an empty solution), and the scheduling device determines that the number of nodes in the current layer is 1 and the number of nodes in the next layer is 0.
[0242] S705, obtaining a set of scheduling solutions with the minimum allocation cost.
[0243] Exemplarily, the scheduling device may obtain the total transportation cost of each scheduling plan based on at least one scheduling plan in the queue, and obtain at least one scheduling plan with the smallest total transportation cost (there may be multiple scheduling plans with equal and smallest total transportation costs), and execute S312.
[0244] S706, determining whether there are any remaining uncalculated gap arrays.
[0245] Exemplarily, the scheduling device determines whether there are any remaining uncalculated gap arrays. For example, Figure 8 As shown, when the scheduling device traverses the gap groups (week 1, week 2, and week 3), in this step, the scheduling device determines that there are still remaining gap arrays, namely, week 4 and week 5.
[0246] In one example, if it is determined that there are still uncalculated gap arrays remaining, S707 is executed.
[0247] In another example, if it is determined that there is no remaining gap array, S708 is executed.
[0248] S707, re-slice the remaining gap array according to the complexity value.
[0249] Exemplarily, the scheduling device re-slices the remaining gap array according to the complexity value. The slicing method can refer to S702 and will not be described in detail here.
[0250] S708, output the leaf node as a scheduling solution result.
[0251] Exemplarily, the scheduling device may take the leaf node (ie, all scheduling schemes in the queue) as the scheduling result and execute 705 .
[0252] S709, record the number of scheduling solutions for the next layer of nodes.
[0253] Exemplarily, the scheduling device records the number of scheduling solutions for the next layer of nodes based on the node conditions corresponding to the scheduling solutions in the queue. Fig. 9 , there is an empty solution in the queue, that is, the number of current nodes is 1 and the number of nodes in the next layer is 0.
[0254] S710, take out the node, the current layer number - 1, and prepare to calculate the scheduling plan.
[0255] Exemplarily, the scheduling device takes out the topmost node from the queue, reduces the number of nodes in the current layer by 1, and calculates the scheduling scheme corresponding to the taken-out node.
[0256] For example, refer to Fig. 9 , the scheduling device takes out the empty solution node from the queue and reduces the number of nodes in the current layer by 1, that is, 0.
[0257] S711, based on the current scheduling solution set, update the gap array.
[0258] Exemplarily, the scheduling device may update the gap array based on the current scheduling solution in the queue.
[0259] For example, refer to Fig. 9 , the current scheduling plan is an empty plan, so there is no need to update the gap array. It can also be understood that the updated gap array is the same as the current gap array.
[0260] S712, calling the global process based on the updated gap array.
[0261] Exemplarily, the scheduling device may schedule the global pattern calculation process based on the updated gap array, that is, from Figure 3 S301 in the process starts to be executed, and a set of scheduling solutions corresponding to the updated gap array is calculated.
[0262] S713, loop all allocation plans and assemble the next layer of nodes.
[0263] Exemplary, scheduling device calls Figure 3 When the process in the embodiment is executed to S311, it is determined whether it is in the local priority mode. When it is determined to be in the local priority mode, jump to Figure 7S713 continues to execute the process corresponding to the local priority mode. Specifically, the scheduling device cycles all scheduling schemes and assembles the next layer of nodes.
[0264] For example, refer to Fig. 9 , assuming that the scheduling device executes Figure 3 After that, solution 1 and solution 2 are obtained. Solution 1 and solution 2 are the nodes of the next layer of the empty solution node. The scheduling device puts solution 1 and solution 2 in the queue.
[0265] S714, update the number of nodes.
[0266] Exemplarily, the scheduling device updates the number of nodes. For example, still refer to Fig. 9 , the scheduling device places solution 1 and solution 2 after the queue, the number of nodes in the current layer is 2, and the number of nodes in the next layer is 0. The scheduling device re-executes S703 to continue traversing the solutions in the queue.
[0267] Continuing with the examples, refer to Fig. 9 , the scheduling device continues to traverse the queue to determine whether the queue is empty.
[0268] The step proceeds to S704, where the scheduling queue determines whether all scheduling schemes for the gap group have been traversed. In this example, it is determined that they are not completed.
[0269] Steps proceed to S710, please refer to Fig.10 , the scheduling device takes out the node of scheme 1, and the current layer number is reduced by 1, that is, 1.
[0270] The step proceeds to S711, and the scheduling device updates the gap array (updates the arrays of the 4th week to the 5th week) based on solution 1. The method of updating the gap array can be referred to above and will not be repeated here.
[0271] Step proceeds to S712, the scheduling device calls the gap array based on the gap array (i.e., the gap array of the 4th week to the 5th week after the update) Figure 3 Process, for example, obtaining solution 1-1 and solution 1-2.
[0272] The step proceeds to S713, and the scheduling device assembles scheme 1-1 and scheme 1-2 into the next layer of nodes, that is, puts them in the queue, such as Fig.10 shown.
[0273] Step proceeds to S714, the scheduling device updates the number of nodes. In this example, Fig.10 As shown, the current number of nodes is still 1 (i.e., including scheme 2), and the number of nodes in the next layer is updated to 2, including scheme 1-1 and scheme 1-2.
[0274] The step proceeds to S703, where the scheduling device determines that the queue is not empty.
[0275] The step proceeds to S704, where the scheduling device detects that the number of the current layer is 1 and determines that the traversal of the nodes in the current layer has not been completed.
[0276] The step proceeds to S710. Fig.10 As shown, the scheduling device takes out the node of plan 2, the number of nodes in the current layer is reduced by 1, that is, 0, and the number of nodes in the next layer is still 2.
[0277] The step proceeds to S711, and the scheduling device updates the gap array based on solution 2 (updates the original gap array of the 4th week to the 5th week).
[0278] Step proceeds to S712, the scheduling device calls based on the updated gap array Figure 3 Process, for example, obtaining Solution 2-1 and Solution 2-2.
[0279] The step proceeds to S713, where the scheduling device cycles through all scheduling schemes and assembles the next layer of nodes. Specifically, Fig.10 As shown, the scheduling device places scheme 2-1 and scheme 2-2 in the queue.
[0280] Step proceeds to S714, the scheduling device updates the number of nodes, such as Fig.10 As shown, the number of nodes in the current layer is still 0, and the number of nodes in the next layer is updated to 4.
[0281] The step proceeds to S703, where the scheduling device determines that the queue is not empty.
[0282] The step proceeds to S704, where the scheduling device detects that the number of nodes in the current layer is 0, ie, it is determined that the nodes in the current layer of the current gap group (ie, the gap group corresponding to the 1st to 3rd week) have been traversed.
[0283] Step proceeds to S706, where the scheduling device determines whether there are any uncalculated gap arrays. Figure 8 As shown, the scheduling device detects that the 4th and 5th weeks also exist.
[0284] After the scheduling device groups the 4th and 5th weeks, the above steps are repeated, and examples are not given one by one here. Exemplarily, after the scheduling device performs the process for all gap groups, the steps will proceed from S706 to S708. The scheduling device can use the scheme in the queue as the scheduling scheme result and execute S705 to obtain at least one scheduling scheme with the minimum scheduling cost in the queue scheme.
[0285] S205: Schedule resources based on the scheduling plan.
[0286] For example, the scheduling device may send the scheduling plan to the platform of each factory, and the operator may schedule the resources of the local factory through the scheduling plan displayed on the platform.
[0287] In summary, the technical solution in the embodiment of the present application can design a scheduling solution according to user needs (i.e., the user chooses time priority, number priority, or global priority, local priority) in the process of calculating the scheduling solution, based on the cost and transportation time in the scheduling process. In addition, in the process of obtaining the scheduling solution, the scheduling device can update the gap array based on the scheduling solution to take into account factors such as the resource occupancy time, so that in actual applications, each manufacturer can schedule according to the scheduling solution, which can ensure that the resources are scheduled at least one week in advance to ensure that production can proceed smoothly. In addition, in the solution process, the scheduling device uses a combination of breadth-first (i.e., global priority) and depth-first (i.e., local priority) through a traversal algorithm to optimize the solution speed. When solving the deployment plan within a single week, the breadth-first algorithm is used to exchange space for time in view of its small amount of calculation data and high call frequency, so as to achieve the purpose of rapid solution. When solving multi-week dispatch plans, due to the huge amount of data, this solution uses a depth-first plus dynamic pruning strategy for optimization. First, the local minimum of the transportation cost is obtained through pre-calculation, and then this value is used as a reference for dynamic pruning when exploring the global optimal solution using the depth-first strategy to improve search efficiency. In addition, the scheduling device can group the gap array based on the complexity value to improve the calculation accuracy while ensuring the speed of scheduling plan generation. For example, if the amount of data in a group is too large, it may cause excessive CPU and memory usage, affecting the stability of equipment operation. The scheduling device appropriately groups the data that needs to be calculated based on complexity, which can effectively reduce the CPU and memory usage while ensuring the accuracy of scheduling plan calculations.
[0288] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0289] In one example, Fig.11 A schematic block diagram of a device 1100 according to an embodiment of the present application is shown. The device 1100 may include: a processor 1101 and a transceiver / transceiver pin 1102 , and optionally, a memory 1103 .
[0290] The various components of the device 1100 are coupled together via a bus 1104, wherein the bus 1104 includes a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clarity, various buses are referred to as bus 1104 in the figure.
[0291] Optionally, the memory 1103 may be used for the instructions in the aforementioned method embodiment. The processor 1101 may be used to execute the instructions in the memory 1103, and control the receiving pin to receive a signal, and control the sending pin to send a signal.
[0292] The apparatus 1100 may be the electronic device or a chip of the electronic device in the above method embodiment.
[0293] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0294] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.
[0295] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.
[0296] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.
[0297] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0298] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource scheduling method, characterized in that: include: In response to the received user operation, determining a target solution acquisition mode; The target solution acquisition mode includes a calculation cost priority mode and a calculation process priority mode, wherein the calculation cost priority mode includes a number priority mode or a time priority mode, and the calculation process priority mode includes a local priority mode or a global priority mode; Based on the computing process priority mode, obtaining a scheduling solution set; Based on the computational cost priority mode, selecting a target scheduling solution from the scheduling solution set; Wherein, if the computing process priority mode is the global priority mode, the obtaining of a scheduling scheme set based on the computing process priority mode includes: Obtain a gap array, where the gap array is used to characterize resource gap conditions within at least one week; In the process of calculating the set of scheduling solutions corresponding to the gap array based on the global priority mode, searching the set of scheduling solutions that meet the scheduling cost among all the scheduling solutions corresponding to the gap array based on the scheduling cost of the gap array; If the computing process priority mode is the local priority mode, obtaining a scheduling solution set based on the computing process priority mode includes: Obtaining the gap array and the circumference complexity corresponding to the gap array; Based on the circumferential complexity, grouping the gap array; Based on at least one gap group after grouping, a scheduling scheme corresponding to each gap group is obtained to form the scheduling scheme set.
2. The method according to claim 1, characterized in that The method further comprises: Based on the target scheduling scheme, resources are scheduled.
3. The method according to claim 2, characterized in that The resource is a non-consumable resource.
4. The method according to claim 1, characterized in that: The target scheduling scheme is used to indicate the scheduling information of any resource within at least one week, and the scheduling information includes a scheduling start position, a scheduling destination position and a scheduling quantity.
5. The method according to claim 1, characterized in that The step of obtaining the gap array comprises: Based on the gap array acquisition model, the gap array is obtained; wherein the construction condition of the gap array acquisition model includes that resources need to be scheduled one week in advance.
6. The method according to claim 1, characterized in that The selecting a target scheduling scheme from the scheduling scheme set based on the computational cost priority mode includes: If the computational cost priority mode is the number priority mode, selecting a scheduling scheme with the smallest number cost from the scheduling scheme set as the target scheduling scheme; If the computational cost priority mode is the time priority mode, a scheduling scheme with the smallest time cost is selected from the scheduling scheme set as the target scheduling scheme.
7. An electronic device, characterized in that: include: One or more processors, memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: In response to the received user operation, determining a target solution acquisition mode; the target solution acquisition mode includes a calculation cost priority mode and a calculation process priority mode, wherein the calculation cost priority mode includes a number priority mode or a time priority mode, and the calculation process priority mode includes a local priority mode or a global priority mode; Based on the computing process priority mode, obtain a set of scheduling solutions; Selecting a target scheduling solution from the set of scheduling solutions based on a computational cost priority mode; Wherein, if the computing process priority mode is the global priority mode, the obtaining of a scheduling scheme set based on the computing process priority mode includes: Obtain a gap array, where the gap array is used to characterize resource gap conditions within at least one week; In the process of calculating the set of scheduling solutions corresponding to the gap array based on the global priority mode, searching the set of scheduling solutions that meet the scheduling cost among all the scheduling solutions corresponding to the gap array based on the scheduling cost of the gap array; If the computing process priority mode is the local priority mode, obtaining a scheduling solution set based on the computing process priority mode includes: Obtaining the gap array and the circumference complexity corresponding to the gap array; Based on the circumferential complexity, grouping the gap array; Based on at least one gap group after grouping, a scheduling scheme corresponding to each gap group is obtained to form the scheduling scheme set.
8. The electronic device according to claim 7, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Based on the target scheduling scheme, resources are scheduled.
9. The electronic device according to claim 8, characterized in that: The resource is a non-consumable resource.
10. The electronic device according to claim 7, characterized in that: The target scheduling scheme is used to indicate the scheduling information of any resource within at least one week, and the scheduling information includes a scheduling start position, a scheduling destination position and a scheduling quantity.
11. The electronic device according to claim 7, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: Based on the gap array acquisition model, the gap array is obtained; wherein the construction condition of the gap array acquisition model includes that resources need to be scheduled one week in advance.
12. The electronic device according to claim 7, characterized in that: When the computer program is executed by the one or more processors, the electronic device performs the following steps: If the computational cost priority mode is the number priority mode, selecting a scheduling scheme with the smallest number cost from the scheduling scheme set as the target scheduling scheme; If the computational cost priority mode is the time priority mode, a scheduling scheme with the smallest time cost is selected from the scheduling scheme set as the target scheduling scheme.
13. A computer storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 6.
14. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
15. A chip, characterized in that: The electronic device comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 6.
