Task scheduling method and electronic equipment thereof
By classifying and prioritizing tasks for power metering equipment verification, combined with automation and manual adjustment methods, the problem of low task scheduling efficiency in the existing technology is solved, and efficient and accurate task scheduling is achieved.
Patent Information
- Application Number
- CN202411935526.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-16
AI Technical Summary
In the prior art, task scheduling for power metering equipment verification mostly relies on manual methods, lacking scientific scheduling methods, resulting in low scheduling efficiency, long time and prone to errors, affecting the verification work efficiency.
A task scheduling method is proposed. By filtering and checking tasks from the task database, setting task scheduling parameters, classifying them according to the task type, and scheduling and adjustments are carried out according to the priority of the task type, automatic task scheduling and manual adjustments are allowed to improve the applicability and efficiency of scheduling.
Automatic task scheduling is realized, the scheduling efficiency of the verification task is improved, the task scheduling time is shortened, manual errors are reduced, and the theoretical optimal solution is approached.
Smart Images

Figure CN120011009A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the field of task scheduling methods. More specifically, the present invention relates to a task scheduling method for calibrating power metering equipment. Background Art
[0002] With the development of automation technology, automated calibration lines for power metering equipment have begun to appear. It can use a pipelined calibration line to calibrate power metering equipment, which improves the calibration efficiency to a certain extent and reduces the use of manual labor. The calibration line can often calibrate two or more types of power metering equipment, and can achieve flexible operation. Due to the characteristics of the calibration line, the flexible operation workshop scheduling problem of the calibration line is an NP problem (Nondeterministic Polynomial Problem), which is difficult to solve well. In the prior art, the task scheduling for the calibration of power metering equipment for the calibration line is mostly based on experience and manual methods are used for task scheduling. There is a lack of scientific task scheduling methods for calibration work, and the efficiency of task scheduling is relatively low, the time spent is long, the deviation from the theoretical optimal solution is large, and it is also prone to errors, which affects the efficiency of calibration work.
[0003] In view of this, there is an urgent need to provide a method for task scheduling for calibration of electric power metering equipment, which method can automatically schedule calibration tasks and can adjust manual tasks according to the situation to improve the applicability of the method; at the same time, it is also necessary to enable the method to complete the task scheduling work in a shorter time to reduce the time for generating a task sequence list through task scheduling; in addition, it is also necessary to have the function of scheduling calibration tasks according to different priorities to meet the needs of actual work. Summary of the invention
[0004] In order to at least solve the technical problems mentioned above, the present disclosure proposes a task scheduling method and a technical solution of an electronic device thereof in multiple aspects.
[0005] In a first aspect, the present disclosure provides a task scheduling method for calibrating electric power metering equipment, wherein the method comprises the following steps: screening calibration tasks that need to be scheduled from a task database; setting task scheduling parameters for each calibration task according to task information of each calibration task; classifying each calibration task according to the task scheduling parameters of each calibration task, and storing the calibration tasks of the same task type into a task set corresponding to the task type; scheduling the calibration tasks in the task set of each type of the task type according to a first task scheduling priority based on the task type to obtain a first task sequence table; adjusting the first task sequence table according to calibration task adjustment information to obtain a second task sequence table; issuing the second task sequence table, and updating the second task sequence table when the calibration tasks in the second task sequence table are completed; wherein the first task sequence table and the second task sequence table contain the task sequence of the task execution line.
[0006] In a second aspect, the present disclosure provides an electronic device for task scheduling, comprising: a processor configured to execute program instructions; and a memory configured to store the program instructions; wherein, when the program instructions are loaded and executed by the processor, the electronic device executes the task scheduling method of any one of the embodiments of the present disclosure.
[0007] By classifying the verification tasks according to the task type and scheduling them according to the first task scheduling priority, it is possible to automatically schedule the verification tasks according to the priority; by dividing the entire task scheduling method into two stages, task scheduling and task adjustment, it is possible to combine computer task scheduling and manual task scheduling, thereby improving the applicability of the task scheduling method. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0009] Figure 1 A schematic flow chart of a task scheduling method according to an embodiment of the present disclosure is shown;
[0010] Figure 2 A schematic diagram showing a task sequence table of an embodiment of the present disclosure;
[0011] Figure 3a and Figure 3b A schematic diagram showing a task sequence table after verification tasks are added in different situations in the disclosed embodiment;
[0012] Figure 4a and Figure 4b A schematic diagram showing a task sequence table after the verification task is queued up in different situations in the disclosed embodiment;
[0013] Figure 5 A structural block diagram of a task scheduling electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0015] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present disclosure indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0016] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.
[0017] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0018] The specific implementation of the present disclosure is described in detail below with reference to the accompanying drawings.
[0019] Figure 1 A schematic flow chart of a task scheduling method 100 according to an embodiment of the present disclosure is shown.
[0020] like Figure 1As shown, a task scheduling method is used to calibrate electric power metering equipment, and the method includes the following steps: screening calibration tasks that need to be scheduled from a task database; setting task scheduling parameters for each calibration task according to task information of each calibration task; classifying each calibration task according to the task scheduling parameters of each calibration task, and storing calibration tasks of the same task type into a task set corresponding to the task type; scheduling the calibration tasks in the task set of each task type according to a first task scheduling priority based on the task type to obtain a first task sequence list; adjusting the first task sequence list according to calibration task adjustment information to obtain a second task sequence list; issuing the second task sequence list, and updating the second task sequence list when the calibration tasks in the second task sequence list are completed; wherein the first task sequence list and the second task sequence list contain task sequences of task execution lines.
[0021] Specifically, the present disclosure discloses a task scheduling method, which is used to calibrate power metering equipment on a calibration line to solve the flexible job-shop scheduling problem (Flexible Job-shop Scheduling Problem, FJSP) of the calibration line.
[0022] Electricity metering equipment includes various types of energy meters, which are used to monitor and record energy consumption in the power system. Since it is directly related to the measurement of electricity costs, the accuracy of its metering function and the stability of its operation are very important. In order to ensure the accuracy and reliability of electricity metering equipment, it is necessary to calibrate the electricity metering equipment before leaving the factory.
[0023] In recent years, the automated verification line of power metering equipment has emerged. The power metering equipment can be verified by the pipelined verification line, which improves the verification efficiency to a certain extent. Each verification line can often verify two or more types of power metering equipment; the same verification line may have different verification steps and verification time for different types of power metering equipment; different verification lines may also have different verification steps and verification time for the same type of power metering equipment. Due to the above-mentioned characteristics of the verification line, the flexible workshop scheduling problem of the verification line is an NP problem. The characteristics of the NP problem are that it is relatively difficult to find the optimal solution and it is relatively easy to verify the results. In the prior art, the task scheduling for the verification of power metering equipment for the verification line is generally based on experience and manual methods are used for task scheduling. There is a lack of scientific task scheduling methods for verification work, and the efficiency of task scheduling is relatively low, the time spent on task scheduling is long, the deviation from the theoretical optimal solution is large, and it is also prone to errors, which affects the efficiency of verification work.
[0024] A task scheduling method disclosed in the present disclosure may provide a solution to this problem.
[0025] For the calibration work, several sets of power metering equipment of the same model can be calibrated as a calibration task, and the calibration tasks can be digitally saved, such as stored in the task database, so as to facilitate the task scheduling of these calibration tasks later. Through computer technology, the calibration tasks can be automatically scheduled, and the staff can be allowed to make certain adjustments to improve the efficiency and accuracy of the entire task scheduling, and the task sequence table can be issued through the computer network to ensure the smooth completion of the calibration work.
[0026] In this embodiment, the task scheduling method for calibrating the power metering equipment includes the following steps:
[0027] Step S110, screening the verification tasks that need to be scheduled for execution from the task database. The verification tasks can be stored in the task database, which can be a relational database, a non-relational database, or a file that stores tasks. Screen out the verification tasks that need to be scheduled for execution from the task database. In the screening operation, all verification tasks that meet the conditions can be screened out, only the first several verification tasks can be selected, and other conditions can be added for screening, such as screening according to the time stored in the task database.
[0028] Step S120, according to the task information of each verification task, set the task scheduling parameters for each verification task. After screening out the verification tasks that need to be scheduled, set the task scheduling parameters for each verification task according to the task information of each screened verification task. The task information may include the designated task execution line and the designated task deadline of the verification task, that is, on which task execution line the verification task is required to be verified, and the latest completion time required for the verification task. In addition, the task information may also include the task ID, the model of the power metering device, the recommended execution order, etc. The task scheduling parameters may be represented by one or more values, for example, the task scheduling parameters may include an integer value representing the task ID of the verification task, an array representing the designated task execution line of the verification task, a DateTime type object representing the designated task deadline of the verification task, a String type object representing the model of the power metering device of the verification task, and an enumeration value representing the recommended execution order of the verification task. Task scheduling parameters can also be represented by a class. For example, one of the properties of this class can include an integer value representing the task ID of the verification task, an attribute can represent an array of the specified task execution lines of the verification task, an attribute can represent a DateTime object of the specified task deadline of the verification task, an attribute can represent a String object of the model of the power metering equipment of the verification task, and an attribute can represent an enumeration value of the recommended execution order of the verification task. Task scheduling parameters can also be represented in the form of key-value pairs, such as in json format or XML format. The verification task and the task scheduling parameters of the verification task correspond one to one and are related to each other.
[0029] Step S130, classify each verification task according to the task scheduling parameters of each verification task, and store the verification tasks of the same task type into the task set corresponding to the task type. Analyze the task scheduling parameters associated with the verification task to obtain the task type of the verification task. Each verification task belongs to only one of the task types. At the same time, generate a verification task set corresponding to the number of task types. The data structure of the task set can be an array, a queue, or a heap.
[0030] According to the task type, the verification task is stored in the task set corresponding to the task type to realize the classification of the verification task. The verification tasks in each task set can be logically ordered or disordered, and the verification tasks in the task set are preferably logically ordered. When the verification tasks in the task set are logically ordered, after being saved in the task set, the verification tasks in each task set can be sorted according to a certain condition, such as being sorted in the task set according to the recommended execution order of the verification tasks, so that the verification tasks in the same task set can be arranged in the order of a certain condition. The sorting method in the present embodiment is preferably Quick Sort. The average time complexity of Quick Sort is O(nlog2n), which has a good balance in time complexity and space complexity.
[0031] Step S140, according to the first task scheduling priority based on the task type, the verification tasks in the task set of each type of task are scheduled to obtain a first task sequence table. There is a sequence of the first task scheduling priority, which is based on the task type, that is, one or some task types are at a lower priority of the priority, and another or some other task types are at a higher priority of the priority. The task set of the task type with a higher priority is prior to the task set of the task type with a lower priority in the task scheduling process. Therefore, in the task scheduling process, the verification tasks in the task set of the task type with the highest priority are first scheduled, and the verification tasks are selected from the task set of the task type with the highest priority one by one, and the tasks are scheduled in a task sequence table. After all the verification tasks in the task set of the task type with the highest priority are completed, then, the verification tasks in the task set of the task type with the second highest priority are continued to be scheduled on the task sequence table in which the verification tasks with the highest priority have been arranged. This process is repeated in this way until the verification task in the task set of the lowest priority task type is scheduled on the task sequence list into which the verification task of the second lowest priority has been scheduled.
[0032] If the task set has been sorted according to a certain condition in step S130, the verification tasks selected one by one can also meet the order of this condition. For example, when the task set has been sorted according to the recommended execution order of the verification tasks in step S130, when the verification tasks are selected from the task set one by one, the verification tasks selected one by one also meet the recommended execution order, so that the verification tasks with a higher recommended execution order in the same task set are arranged first in the task sequence table, and the verification tasks with a lower recommended execution order in the same task set are arranged later in the task sequence table.
[0033] When all the verification tasks in the entire task set have been arranged into the task sequence table, the task sequence table is the first task sequence table. The first task sequence table is a task sequence table, which may include a set of task sequences of each task execution line, and each task sequence represents the working order of the task execution line corresponding to the task sequence. The first task sequence table is obtained through the above-mentioned task scheduling.
[0034] Step S150, according to the calibration task adjustment information, the first task sequence table is adjusted to obtain the second task sequence table. The calibration task can be adjusted after the above-mentioned task scheduling and before it is issued. The staff can generate the calibration task adjustment information according to the actual working conditions of the task execution line or the temporary adjustment of the task. For example, when a minor fault occurs in the task execution line, resulting in reduced production efficiency, the corresponding calibration task adjustment information can be generated to make appropriate task adjustments to the first task sequence table, such as reducing the calibration tasks in the task sequence of the task execution line with the minor fault, and allocating the reduced calibration tasks to the task sequence of other task execution lines. The calibration task adjustment information acts on the first task sequence table, and the task adjustment method includes adjusting a calibration task forward or backward on the task sequence, transferring a calibration task on a task sequence to other task sequences, splitting a calibration task, exchanging two calibration tasks, etc., and obtaining the second task sequence table through task adjustment. When no task adjustment is required, the verification task adjustment information is empty, the first task sequence table is not adjusted, and the second task sequence table is directly obtained. The second task sequence table is also a task sequence table, and the task sequence table may include a set of task sequences of each task execution line body, and each task sequence represents the working order of the task execution line body corresponding to the task sequence. The second task sequence table is obtained through the above-mentioned task adjustment based on the first task sequence table.
[0035] Step S160, issue the second task sequence table, and when the verification task in the second task sequence table is completed, update the second task sequence table. Issue the second task sequence table to the production department, so that the production department can produce according to the second task sequence table. When a verification task in the second task sequence table is completed, update the second task sequence table, so that the task sequence corresponding to the task execution line of the completed verification task in the second task sequence table is updated.
[0036] The first task sequence table and the second task sequence table contain the task sequences of all task execution lines, which are a collection of these task sequences. In the first task sequence table and the second task sequence table, each task sequence can be arranged in a specific order, such as according to the line ID of the task execution line. The task sequence represents the working order of a task execution line, and the task sequence may include each verification task of the task execution line. These verification tasks are sorted in chronological order, and can indicate the estimated start time of each verification task, the estimated execution time of each verification task, and the estimated completion time of each verification task.
[0037] Figure 2 FIG. 1 is a schematic diagram showing a task sequence table of an embodiment of the present disclosure. Figure 2 As shown, the task sequence table records the task sequences of three task execution lines, namely, task execution line 1, task execution line 2 and task execution line 3, and their line IDs are 100, 200 and 300 respectively.
[0038] Among them, task execution line 1 shows two verification tasks in the figure, namely verification task 1 and verification task 5, and the task IDs of the verification tasks are 10001 and 10005 respectively; the expected start time of verification task 1 is 8:10, the expected execution time is 40 minutes, and the expected completion time is 8:50; the expected start time of verification task 5 is 9:10, the expected execution time is 20 minutes, and the expected completion time is 9:30; the gap between verification task 1 and verification task 5 is 20 minutes. Task execution line 2 shows two verification tasks in the figure, namely verification task 2 and verification task 4, and the task IDs of the verification tasks are 10002 and 10004 respectively; the expected start time of verification task 2 is 8:20, the expected execution time is 40 minutes, and the expected completion time is 9:00; the expected start time of verification task 4 is 9:00, the expected execution time is 20 minutes, and the expected completion time is 9:20; there is no gap between the two verification tasks. Task execution line 3 shows two verification tasks in the figure, namely verification task 3 and verification task 6. The task IDs of the verification tasks are 10003 and 10006 respectively; the estimated start time of verification task 3 is 8:00, the estimated execution time is 40 minutes, and the estimated completion time is 8:40; the estimated start time of verification task 6 is 9:20, the estimated execution time is 20 minutes, and the estimated completion time is 9:40; the gap between verification task 1 and verification task 5 is 40 minutes.
[0039] In some embodiments, the task scheduling parameters include task execution lines and task deadlines.
[0040] Specifically, in this embodiment, the task scheduling parameters at least include the task execution line and the task deadline. The task scheduling parameters are used to classify the verification tasks, that is, for each verification task screened from the task database, the verification task is classified according to the task scheduling parameters of the verification task. In this embodiment, the classification is performed based on the two parameters of the task execution line and the task deadline.
[0041] The task execution line in the task scheduling parameters corresponds to the designated task execution line of the verification task in the task information. For example, if the task information records that a verification task is designated to use the task execution line with line ID 100, it means that the verification task is designated to use the task execution line, and its task type is a task type of a designated task execution line, and the verification task can eventually be verified on the task execution line with line ID 100. For another example, if the task information records that a verification task is designated to use the task execution line with line IDs 100 and 200, it means that the verification task is designated to use the task execution line, and its task type is a task type of a designated task execution line, and the verification task can be split into two sub-verification tasks, and these two sub-verification tasks can eventually be verified on the task execution lines with line IDs 100 and 200, respectively. For example, if the task information records that a verification task has not been specified to use any task execution line, it means that the verification task has not been specified to use a task execution line, and its task type is a task type that has not been specified to use a task execution line. The verification task will eventually be verified on a task execution line, and can also be split into multiple sub-tasks and verified on multiple task execution lines.
[0042] The task deadline in the task scheduling parameters corresponds to the specified task deadline of the verification task in the task information. For example, if the task information records that a verification task is specified with a task deadline of time T, it means that the verification task is specified with a task deadline, and its task type is a task type with a specified task deadline, and the verification task should eventually complete the verification before time T. For another example, if the task information records that a verification task is not specified with any task deadline, it means that the verification task is not specified with a task deadline, and its task type is a task type with no specified task deadline, and the date on which the verification task is finally completed is not restricted.
[0043] In some embodiments, task types include: simultaneously designated task execution line body and task deadline, designated task execution line body, designated task deadline, and simultaneously undesignated task execution line body and task deadline; the first task scheduling priority includes priority scheduling and normal scheduling, wherein the task types corresponding to priority scheduling include simultaneously designated task execution line body and task deadline, designated task execution line body, and designated task deadline, and the task types corresponding to normal scheduling include simultaneously undesignated task execution line body and task deadline.
[0044] Specifically, with respect to the above two task scheduling parameters for distinguishing task types, namely, task execution line body and task deadline, the embodiments disclosed herein include four task types, namely: simultaneously designated task execution line body and task deadline, designated task execution line body, designated task deadline, and simultaneously undesignated task execution line body and task deadline. Among them, designated task execution line body indicates that the verification task is designated with a task execution line body, but is not designated with a task deadline; designated task deadline indicates that the verification task is designated with a task deadline, but is not designated with a task execution line body. The four task types do not intersect with each other, and the union of the four task types includes all verification tasks. Therefore, any verification task can be classified as one of these four task types.
[0045] The first task scheduling priority can be a preset sequence that can be used to indicate the priority order of each task type. The sequence can include two priorities, namely priority scheduling and normal scheduling. Priority scheduling means that the verification task of the corresponding task type takes precedence over the verification task of the task type corresponding to normal scheduling during task scheduling. Normal scheduling means that the verification task of the corresponding task type takes precedence over the verification task of the task type corresponding to priority scheduling during task scheduling.
[0046] The task types corresponding to priority scheduling include three types: both the task execution line and the task deadline are specified, and the task execution line is specified, and the task deadline is specified. The task types corresponding to normal scheduling include one type: both the task execution line and the task deadline are not specified. Therefore, the task sets corresponding to the three types of tasks: both the task execution line and the task deadline are specified, the task execution line is specified, and the task deadline is specified. The task sets corresponding to the task type that does not specify the task execution line and the task deadline are scheduled later.
[0047] In some embodiments, the verification task may be divided into one or more sub-verification tasks. When the one or more sub-verification tasks are all completed, the verification task is considered to be completed.
[0048] Specifically, in the present disclosure, during task scheduling or task adjustment, a verification task can be divided into one or more sub-verification tasks. When a verification task is divided into a sub-verification task, the verification task and the sub-verification task can be executed on the same task execution line, can be executed on different task execution lines, can have the same expected start time, and can have different expected start times. When a verification task is divided into multiple sub-verification tasks, the verification task and the multiple sub-verification tasks can be executed on the same task execution line, can be executed on different task execution lines; and, multiple sub-verification tasks can be executed on the same task execution line, can be executed on different task execution lines; a task execution line can execute multiple sub-verification tasks divided from the same verification task.
[0049] When one or more sub-verification tasks divided from a verification task are all completed, it is equivalent to the completion of the divided verification task. For example, if a verification task is divided into three sub-verification tasks, the expected completion times of the three sub-verification tasks are t1, t2 and t3 respectively, and t1 is the earliest, t2 is the second, and t3 is the latest in time sequence, then the expected completion time of the verification task is regarded as the latest in time sequence among the expected completion times of the three sub-verification tasks, that is, the expected completion time of the verification task is t3. Therefore, if a verification task is assigned a task deadline, one or more sub-verification tasks divided from the verification task are also regarded as having a specified task deadline, and the task deadline of the sub-verification task is the same as the task deadline of the verification task, so that when scheduling tasks, t1, t2 and t3 are all no later than the specified task deadline.
[0050] The following introduces the task scheduling method for the verification task of each of the above four task types.
[0051] In some embodiments, when the task type is a designated task execution line, the method for scheduling the calibration task includes: when the number of task execution lines designated for the calibration task is 1, adding the calibration task to the task sequence of the designated task execution line; when the number of task execution lines designated for the calibration task is multiple, dividing the calibration task into multiple sub-calibration tasks according to the actual production efficiency and task sequence of the task execution line, and adding the multiple sub-calibration tasks to the task sequences of the designated multiple task execution lines respectively.
[0052] Specifically, when the task type is a designated task execution line, the verification task will be added to the designated task execution line. Depending on the number of designated task execution lines for the verification task, there are two cases:
[0053] When the number of task execution lines specified for a verification task is 1, the verification task is added to the end of the task sequence of the specified task execution line, and the verification tasks that have completed task scheduling at the front of the task sequence are not changed.
[0054] When a calibration task is assigned to multiple task execution lines, the calibration task is divided into multiple sub-calibration tasks according to the actual production efficiency of the task execution lines and the current task sequence. The multiple sub-calibration tasks are respectively appended to the end of the task sequence of the specified multiple task execution lines, while the calibration tasks that have completed task scheduling at the front of the task sequence will not be changed.
[0055] For example, suppose a calibration task requires calibration of a certain type of power metering equipment, the number of power metering equipment is X, and three task execution lines are specified for the calibration task, namely line A, line B and line C. For this type of power metering equipment, the production efficiency of these three task execution lines is a, b and c respectively. The estimated completion time of the current last calibration task in the task sequence of these three task execution lines is T a , T b and T c , and T a <T b <T c , that is, line A completes all the current verification tasks of its task sequence the earliest, line B is the second, and line C is the latest.
[0056] Based on the above conditions, the verification task can be logically divided into three parts.
[0057] The first part is used to increase the number of power metering devices x for line A, which has completed the existing verification task first. a1 , try to make the estimated completion time of the task added by line body A the same as the estimated completion time of the current last verification task of line body B.
[0058] The second part is used to increase the number of power metering devices x for line A and line B that have completed the existing verification tasks earlier than line C, based on the first part. a2 and x b2 , while ensuring that the estimated completion time of the tasks added to line A is the same as the estimated completion time of the tasks added to line B, try to make the estimated completion time of the tasks added to line A and line B the same as the estimated completion time of the current last verification task of line C.
[0059] The third part is used to increase the number of power metering devices x for line A, line B and line C respectively based on the first and second parts. a3 、x b3 and xc3 , try to make the estimated completion time of the tasks added by line A, line B, and line C the same.
[0060] Therefore, it can be divided into the following three situations.
[0061] When 0≤X <a·(T b -T a )hour:
[0062] x a1 =x
[0063] x a2 =x b2 =0
[0064] x a3 =x b3 =x c3 =0
[0065] When a·(T b -T a )≤X <a·(T b -T a )+(a+b)·(T c -T b )hour:
[0066] x a1 =a·(T b -T a )
[0067]
[0068] x a3 =x b3 =x c3 =0
[0069] When X≥a·(T b -T a )+(a+b)·(T c -T b )hour:
[0070] x a1 =a·(T b -T a )
[0071] x a2 =a·(T c -T b )
[0072] x b2 = b·(T c -T b )
[0073]
[0074] Finally, the verification task is divided into three sub-verification tasks, among which the number of power metering devices x in the sub-verification task added to the tail of the task sequence of line body A is a It can be expressed as x a =x a1 +x a2 +x a3 ; The number of power metering devices in the sub-verification task added to the end of the task sequence of line B x b It can be expressed as x b =x b2 +x b3 ; The number of power metering devices in the sub-verification task added to the end of the task sequence of line C x c It can be expressed as x c =x c3 .
[0075] Here, the verification task can be added after the expected completion time of the last verification task in the task sequence according to the verification tasks that have completed the task scheduling in the task sequence. Figure 3a and Figure 3b A schematic diagram showing a task sequence table after verification tasks are added in different situations in the disclosed embodiment. Figure 3a It means that the verification task a is added to the end of the task sequence of task execution line 1; Figure 3b It means that the verification task b is added to the end of the task sequence of task execution line 1. Figure 3a and Figure 3b The difference is that verification task a is added just after the estimated completion time of verification task 5, while although verification task b is added after verification task 5, there is a certain gap between the estimated completion time of verification task 5 and the estimated start time of verification task b. Figure 3a This method of adding verification tasks is to enable all verification tasks to be completed as soon as possible.
[0076] In some embodiments, when the task type is a task with a specified deadline, the method for scheduling the verification task includes: selecting a task execution line, and adding the verification task to the task sequence of the corresponding task execution line; selecting a task execution line, and inserting the verification task into the task sequence of the corresponding task execution line; calculating the minimum number of task execution lines m, splitting the verification task into m sub-verification tasks, and adding the m sub-verification tasks to the task sequences of the m task execution lines respectively; calculating the minimum number of task execution lines n, splitting the verification task into n sub-verification tasks, and inserting the n sub-verification tasks into the task sequences of the n task execution lines respectively; obtaining the number of all task execution lines p, splitting the verification task into p sub-verification tasks, and inserting the p sub-verification tasks into the task sequences of all p task execution lines respectively.
[0077] Specifically, when the task type is a specified task deadline, there are five methods for scheduling the verification task. These five methods have a calculation order, that is, first try to use the first method to solve, when the first method does not have a solution that meets the conditions, then try to use the second method to solve, when the second method does not have a solution that meets the conditions, then try to use the third method to solve, and so on, until a method has a solution that meets the conditions.
[0078] Method 1: Select a task execution line and add the verification task to the task sequence of the corresponding task execution line. When scheduling a verification task, try to select a task execution line from the task execution line, and add the verification task to the end of the task sequence of the selected task execution line. Do not change the verification tasks that have completed task scheduling in the previous task sequence, and judge whether the selected task execution line can complete the verification task before the specified task deadline. If the above conditions can be met, then add the verification task to the end of the task sequence of the selected task execution line to complete the task scheduling of the verification task; if the above conditions cannot be met, try to select other task execution lines. If none of the selected task execution lines can meet the above conditions, give up using method 1 to schedule the verification task, and try to use method 2 to schedule the verification task.
[0079] Method 2: Select a task execution line and insert the verification task into the task sequence of the corresponding task execution line. When scheduling a verification task, try to select a task execution line from the task execution line and insert the verification task into the task sequence of the selected task execution line. The verification tasks that have completed the task scheduling before the insertion position in the task sequence will not be changed, but the verification tasks after the insertion position will be changed in sequence. After the insertion is completed, it is determined whether the selected task execution line can complete the verification task before the specified task deadline. If the above conditions can be met, the verification task will be inserted into the task sequence of the selected task execution line to complete the task scheduling; if the above conditions cannot be met, try to select other task execution lines. If none of the selected task execution lines can meet the above conditions, give up using method 2 to schedule the verification task, and try to use method 3 to schedule the verification task instead.
[0080] Here, the verification task can be queued up to a certain position in the task sequence, including the beginning, middle and end of the task sequence, according to the verification tasks that have completed the task scheduling in the task sequence. Figure 4a and Figure 4b The following is a schematic diagram showing the task sequence table after the verification task is inserted into the queue in different situations in the disclosed embodiment. When the verification task does not overlap with the completed task schedule after being inserted, the verification task can be directly inserted into the position. Figure 4a As shown in the figure, verification task c is inserted after verification task 3, but since verification task c does not overlap with verification task 6 in the task sequence after insertion, verification task 6 does not need to be changed. When the verification task overlaps with the completed task schedule after insertion, the verification tasks after the insertion position need to be changed in sequence. Figure 4b As shown, verification task d is inserted after verification task 1. However, after verification task d is inserted, the estimated execution time of verification task d is 15 minutes, which exceeds the time length of the gap between verification task 1 and verification task 5, and overlaps with verification task 5 in the task sequence. Therefore, verification task 5 needs to be changed to move verification task 5 backward to ensure that the estimated start time of verification task 5 is not earlier than the estimated completion time of verification task d.
[0081] Method 3: Calculate the minimum number of task execution lines m, split the verification task into m sub-verification tasks, and add the m sub-verification tasks to the task sequence of the m task execution lines. Try to select m task execution lines, split the verification task into m sub-verification tasks, and add the m sub-verification tasks to the end of the task sequence of the selected m task execution lines. Do not change the verification tasks that have completed the task scheduling in the front of the task sequence. Determine whether the selected m task execution lines can be completed before the specified task deadline of the verification task, that is, determine whether the latest expected completion time of the m sub-verification tasks split out is not later than the task deadline of the verification task. If the above conditions can be met, then add the m sub-verification tasks to the end of the task sequence of the selected m task execution lines respectively, so that the verification task completes the task scheduling; if the above conditions cannot be met, try to select other task execution lines or select a larger m. If the m task execution lines selected in any case cannot meet the above conditions, then abandon the use of method three to schedule the verification task, and try to use method four to schedule the verification task instead.
[0082] Method 4: Calculate the minimum number of task execution lines n, split the verification task into n sub-verification tasks, and insert the n sub-verification tasks into the task sequence of the n task execution lines. Try to select n task execution lines, split the verification task into n sub-verification tasks, and insert the n sub-verification tasks into the task sequence of the selected n task execution lines respectively. The verification tasks that have completed the task scheduling in the front of the task sequence will not be changed, but the verification tasks behind the insertion position will be changed in turn. After the queue is completed, it is determined whether the selected n task execution lines can be completed before the specified task deadline of the verification task, that is, whether the latest expected completion time of the n sub-verification tasks that have been split out can be no later than the task deadline of the verification task. If the above conditions can be met, the n sub-verification tasks will be inserted into the task sequence of the selected n task execution lines respectively, so that the verification task completes the task scheduling; if the above conditions cannot be met, try to select other task execution lines or select a larger n. If the n task execution lines selected in any case cannot meet the above conditions, it means that neither adding nor queuing can guarantee that the verification task will be completed before the specified task deadline. Give up using method 4 to schedule the verification task and try using method 5 to schedule the verification task instead.
[0083] Method 5: Get the number p of all task execution lines, split the verification task into p sub-verification tasks, and insert the p sub-verification tasks into the task sequence of all p task execution lines. Similar to method 4, the difference is that there is no need to try the value of p, which is directly equal to the number of all task execution lines, and try to insert the p sub-verification tasks into the task sequence of each task execution line. Although the queue insertion method cannot guarantee that the verification task will be completed before the specified task deadline, method 5 can schedule as many parts of the verification task as possible in the task sequence table, reduce the proportion of the overdue part of the verification task, and complete the verification task as early as possible. In actual work, after scheduling the task in method 5, the staff can be prompted so that the staff can communicate the situation with the customer in a timely manner.
[0084] In some embodiments, when the task type is simultaneously assigned a task execution line and a task deadline, the method for scheduling the verification task includes: appending the verification task to the task sequence of the specified task execution line; inserting the verification task into the task sequence of the specified task execution line.
[0085] Specifically, when the task type is a task execution line and a task deadline that are both specified, the method for scheduling the verification task includes appending the verification task to the task sequence of the specified task execution line, and inserting the verification task into the task sequence of the specified task execution line.
[0086] The method of adding the verification task to the task sequence of the specified task execution line is similar to the method 1 and method 3 of the method of scheduling the verification task when the task type is the specified task deadline in the previous text; the method of inserting the verification task into the task sequence of the specified task execution line is similar to the method 2 and method 4 of the method of scheduling the verification task when the task type is the specified task deadline in the previous text. The difference is that in the current case, the task execution line is specified, rather than selected in the attempt in the previous text.
[0087] The task scheduling method that appends the verification task to the task sequence of the specified task execution line is used first. If this method does not exist and the above conditions are met, the task scheduling method that inserts the verification task into the task sequence of the specified task execution line is used.
[0088] In some embodiments, when the task type is a task type in which neither the task execution line nor the task deadline is specified, a genetic algorithm is used to schedule the verification task.
[0089] Specifically, the fourth type of task type is a task that has neither a task execution line nor a task deadline specified. The first task scheduling priority of this task type is normal scheduling, which is lower than the priority scheduling of the three task types of task that has both a task execution line and a task deadline specified, task execution line specified, and task deadline specified.
[0090] In this embodiment, after the task scheduling has been completed for the verification work of the above three task types, the genetic algorithm can be used to schedule the remaining verification tasks according to the characteristics of the task type. Considering the characteristics of the verification work of the power metering equipment, in the initialization stage of the genetic algorithm, specific limiting conditions are used to limit the initialization population, thereby increasing the speed of the genetic algorithm evolution, reducing the time consumption of the genetic algorithm, and enabling the genetic algorithm to approach the optimal solution in fewer rounds (within 10 rounds).
[0091] The calibration work of this type of power metering equipment has the following characteristics: each calibration line can calibrate two or more types of power metering equipment; the same calibration line may require different calibration steps and calibration time for different types of power metering equipment; different calibration lines may require different calibration steps and calibration time for the same type of power metering equipment; the calibration work of power metering equipment includes several steps, but considering the work scenario, it should be regarded as a work procedure to avoid the extra time consumption caused by splitting it into multiple work procedures for calibration on different calibration lines; different power metering equipment has the same priority, that is, they are all in the normal scheduling priority in the first task scheduling priority; it is expected that the estimated completion time of the last calibration task in the task sequence of each calibration line is close to each other to avoid some calibration lines having completed all calibration tasks while other calibration lines still have many calibration tasks to be completed.
[0092] Based on the above characteristics, the traditional genetic algorithm model can be improved. In this embodiment, in the initialization stage of the genetic algorithm, the initialization population is limited using specific limiting conditions. In this embodiment, based on the above characteristics, the estimated completion time of the last verification task in the task sequence of each verification line can be compared with the earliest estimated completion time, and the difference between the estimated completion time of the last verification task in the task sequence of each verification line and the earliest estimated completion time can be minimized, so that the estimated completion time of the last verification task in the task sequence of each verification line is close, and each verification line completes its own verification task at a close time point.
[0093] In the process of solving FJSP, the quality of the task scheduling scheme can be judged by a specific objective function. The objective function is a commonly used evaluation indicator, which includes the minimum maximum completion time, the minimum maximum machine load, the minimum total machine load, the minimum advance / delay, etc.
[0094] In the test, the results of the objective functions of the individual with the highest fitness obtained in a fewer rounds (within 10 rounds) and the individual with the highest fitness obtained after executing 10,000 rounds are basically the same, indicating that by improving the traditional genetic algorithm model, the number of rounds can be significantly reduced while ensuring the correctness of the results, thereby reducing the calculation time.
[0095] In some embodiments, task scheduling is performed on the verification tasks in the task set of each task type corresponding to the priority scheduling according to the second task scheduling priority based on the task type.
[0096] Specifically, for the three task types corresponding to the priority scheduling, a sub-priority level, namely the second task scheduling priority level, can be set between the three types to sort the task scheduling of the three task types. For example, among the three task types, the task scheduling of the verification task that is assigned both the task execution line and the task deadline is first performed, then the task scheduling of the verification task that is assigned the task deadline is performed, and finally the task scheduling of the verification task that is assigned the task execution line is performed.
[0097] Figure 5 A structural block diagram of a task scheduling electronic device according to an embodiment of the present disclosure is shown.
[0098] like Figure 5 As shown, an electronic device for task scheduling includes: a processor configured to execute program instructions; and a memory configured to store program instructions; wherein, when the program instructions are loaded and executed by the processor, the electronic device executes the task scheduling method of any one of the embodiments of the present disclosure.
[0099] Specifically, the electronic device 500 can be implemented as various types of devices, including but not limited to mainframes, personal computers (PCs), mobile devices, etc. The electronic device 500 includes a processor 501 and a memory 502. The processor 501 controls the operation of the electronic device 500 by executing the program stored in the memory 502. The processor 501 can be implemented using, including but not limited to, a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an artificial intelligence processor chip (IPU), etc. The memory 502 can be used to store various data and instructions processed in the electronic device 500, including the method for task scheduling for calibrating the power metering device in the embodiment of the present disclosure. The memory 502 may include at least one of a volatile memory or a non-volatile memory. The non-volatile memory may include a read-only memory (ROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), etc. The volatile memory may include a dynamic RAM (DRAM), a static RAM (SRAM), a synchronous DRAM (SDRAM), etc. In addition, the memory 502 may also include at least one of a hard disk drive (HDD), a solid state drive (SSD), a high-density flash memory (CF), a secure digital (SD) card, a micro secure digital (Micro-SD) card, a mini secure digital (Mini-SD) card, an extreme digital (xD) card, a cache, or a memory stick.
[0100] In the embodiments of the present disclosure, by classifying the verification tasks according to the task type and scheduling the tasks according to the first task scheduling priority, it is achieved to automatically schedule the verification tasks according to the priority; by dividing the entire task scheduling method into two stages, task scheduling and task adjustment, it is achieved to combine computer task scheduling and manual task scheduling, and improve the applicability of the task scheduling method; by classifying the verification tasks according to the task type and scheduling the tasks according to the first task scheduling priority, the function of scheduling the verification tasks according to different priorities is achieved to meet the needs of actual work.
[0101] Although multiple embodiments of the present disclosure have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art may think of many changes, modifications, and alternatives without departing from the thought and spirit of the present disclosure. It should be understood that in the process of practicing the present disclosure, various alternatives to the embodiments of the present disclosure described herein may be adopted. The attached claims are intended to define the scope of protection of the present disclosure, and therefore cover equivalents or alternatives within the scope of these claims.
Claims
1. A task scheduling method for calibrating power metering equipment, characterized in that: The method comprises the following steps: Filter the verification tasks that need to be scheduled from the task database; According to the task information of each verification task, setting task scheduling parameters for each verification task; Classifying each of the verification tasks according to the task scheduling parameters of each of the verification tasks, and storing the verification tasks of the same task type into a task set corresponding to the task type; According to a first task scheduling priority based on the task type, the verification tasks in the task set of each task type are scheduled to obtain a first task sequence table; According to the verification task adjustment information, the first task sequence table is adjusted to obtain a second task sequence table; issuing the second task sequence list, and updating the second task sequence list when the verification task in the second task sequence list is completed; The first task sequence table and the second task sequence table contain the task sequence of the task execution line.
2. The method according to claim 1, characterized in that The task scheduling parameters include task execution line and task deadline.
3. The method according to claim 2, characterized in that The task types include: the task execution line and the task deadline are both specified, the task execution line is specified, the task deadline is specified, and the task execution line and the task deadline are not specified at the same time; The first task scheduling priority includes priority scheduling and normal scheduling, wherein: The task type corresponding to the priority scheduling includes the task execution line and the task deadline being designated at the same time, the task execution line being designated, and the task deadline being designated, The task type corresponding to the normal schedule includes the task execution line and the task deadline that are not specified at the same time.
4. The method according to claim 3, characterized in that The verification task may be divided into one or more sub-verification tasks. When one or more of the sub-verification tasks are completed, the verification task is considered to be completed.
5. The method according to claim 4, characterized in that When the task type is the designated task execution line, the method for scheduling the verification task includes: When the number of the task execution line bodies designated for the verification task is 1, adding the verification task to the task sequence of the designated task execution line body; When the number of the task execution lines designated for the verification task is multiple, the verification task is divided into multiple sub-verification tasks according to the actual production efficiency of the task execution line and the task sequence, and the multiple sub-verification tasks are respectively added to the task sequence of the specified multiple task execution lines.
6. The method according to claim 4, characterized in that When the task type is the task deadline specified, the method for scheduling the verification task includes: Select one of the task execution lines, and add the verification task to the task sequence corresponding to the task execution line; Select one of the task execution lines, and insert the verification task into the task sequence corresponding to the task execution line; Calculate the minimum number m of the task execution lines, split the verification task into m sub-verification tasks, and add the m sub-verification tasks to the task sequence of the m task execution lines respectively; Calculate the minimum number n of the task execution lines, split the verification task into n sub-verification tasks, and insert the n sub-verification tasks into the task sequence of the n task execution lines respectively; The number p of all the task execution lines is obtained, the verification task is split into p sub-verification tasks, and the p sub-verification tasks are respectively inserted into the task sequence of all the p task execution lines.
7. The method according to claim 4, characterized in that When the task type is specified with both the task execution line and the task deadline, the method for scheduling the verification task includes: Adding the verification task to the task sequence of the specified task execution line; Insert the verification task into the task sequence of the specified task execution line.
8. The method according to claim 4, characterized in that When the task type is that the task execution line and the task deadline are not specified at the same time, a genetic algorithm is used to schedule the verification task.
9. The method according to claim 3, characterized in that: According to a second task scheduling priority based on the task type, the verification tasks in the task set of each task type corresponding to the priority scheduling are scheduled.
10. An electronic device for task scheduling, comprising: a processor configured to execute program instructions; as well as a memory configured to store the program instructions; It is characterized in that when the program instructions are loaded and executed by the processor, the electronic device executes the method according to any one of claims 1-9.