Disclosure of Invention
The purpose of the present disclosure is to provide a task scheduling method, a task scheduling device, an electronic device, and a storage medium, which can quickly determine a feasible optimal task scheduling table.
In one aspect, the present disclosure provides a task scheduling method, including:
according to the task attributes of the tasks to be arranged, lambda sample task arrangement tables y conforming to multivariate normal distribution are obtainedjScheduling table y for each task based on the samplejAccording to the mean value m, the step length sigma and the sample task scheduling table yjDetermining the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj(ii) a Wherein j is 1,2, … … lambda and is a positive integer;
for the set task limiting conditions, arranging the table x according to each initial taskjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofj;
Cost according to the loss valuejUpdating the step length sigma, the covariance matrix C of the multivariate normal distribution and the mean value m;
if the updated step length sigma is in the preset range and the loss value costjAnd if the minimum value is reached, taking the initial task scheduling table at the moment as a target task scheduling table.
Optionally, the set task limiting conditions are arranged according to each initial task schedule xjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofjThe method comprises the following steps:
constructing an ordered forbidden class scheduling list pattern, wherein elements in the scheduling list pattern comprise a general type task and a wildcard type task;
analyzing the order of the eyesWhether the standard task scheduling list is matched with the forbidden scheduling list pattern is judged, and if the standard task scheduling list is matched with the forbidden scheduling list pattern, the rule loss value emp _ cost of the employee is countedi;
Calculating the loss value costjWith a value of schedule x for each initial taskjRegular loss value emp _ cost of all persons iniAnd (4) summing.
Optionally, the set task limiting conditions are arranged according to each initial task schedule xjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofjThe method comprises the following steps:
performing a first screening step by setting conditions of non-target employees, wherein the conditions of the non-target employees comprise: gender, job number, proficiency, or job category.
Optionally, the method further includes:
cost according to the loss valuejUpdating the covariance matrix C and the mean value m of the multivariate normal distribution;
if the updated step length sigma is not in the preset range or the updating times of the step length sigma are smaller than the preset times, repeatedly executing the steps to obtain the lambda sample task scheduling tables y conforming to the multivariate normal distribution according to the updated step length sigma, the updated covariance matrix C and the updated mean value mjDetermining and the sample task scheduling table yjCorresponding initial task scheduling table xjDetermining each initial task scheduling list xjLoss value cost ofjCost according to the loss valuejAnd updating the step length sigma, the covariance matrix C of the multivariate normal distribution and the mean value m until the step length sigma is in a preset range or the updating times of the step length sigma are equal to preset times.
Optionally, said cost is based on said loss valuejUpdating the step size σ, updating the covariance matrix C of the multivariate normal distribution, and the mean value m, including:
scheduling tables x at multiple initial tasksjLoss value cost ofjIn (1), the minimum loss value cos of μ is selectedtjAnd determining the minimum loss values costjCorresponding initial task scheduling table xjWeight w ofiWherein i is 1,2, … … μ, less than or equal to j;
sample task scheduling table y corresponding to ith element after being sequenced according to loss valueiAnd the weight wiDetermining a first parameter ywAnd according to said first parameter ywA first dimension parameter c related to the dimension nσParameter mu related to the number of task scheduleswAnd a covariance matrix C, determining an update parameter p for the update stepσ(ii) a According to the parameter mu related to the number of task scheduleswAnd dimension n, determining a second parameter dσAnd according to the second parameter dσAnd update parameter p of update step sizeσThe step size σ is updated.
Optionally, said cost is based on said loss valuejAnd updating the covariance matrix C, including:
according to a second dimension parameter c related to the dimension ncParameter mu related to the number of task scheduleswAnd a first parameter ywDetermining an update parameter p of an update covariance matrixc;
According to the first parameter ywAnd updating the update parameter p of the covariance matrixcAnd updating the covariance matrix C.
Optionally, said cost is based on said loss valuejUpdating the mean value m, including:
scheduling tables x at multiple initial tasksjLoss value cost ofjIn (1), the minimum loss value cost of μ is selectedjAnd determining the minimum loss values costjCorresponding initial task scheduling table xjWeight w ofi;
Sample task scheduling table y corresponding to ith element after being sequenced according to loss valueiAnd the weight wiDetermining a first parameter ywAnd according to said first parameter ywAnd an initial task scheduling table x corresponding to the ith element after being sequenced according to the loss valueiAnd the above-mentionedWeight wiAnd updating the mean value m.
Optionally, the λ sample task scheduling table y conforming to the multivariate normal distribution is obtainedjScheduling table y for each task based on the samplejAccording to the mean value m, the step length sigma and the sample task scheduling table yjDetermining the task scheduling table y associated with the samplejCorresponding initial task scheduling table xjThe method comprises the following steps:
using the following formula, a sample task Schedule y is determinedj:
yj~N(0,C);
The following formula is used to determine the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj:
xj=m+σyj;
Wherein C is a covariance matrix of multivariate normal distribution, and m belongs to Rn,σ∈R+。
Optionally, the schedule x is arranged according to each initial task according to the set task limiting conditionjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofjThe method comprises the following steps:
schedule x for each initial taskjScheduling table x according to each initial taskjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSum, determine the initial task scheduling table xjA penalty value corresponding to each task constraint;
acquiring the weight corresponding to each task limiting condition, and arranging the table x according to the initial taskjDetermining the initial task scheduling table x corresponding to the loss value of each task limiting condition and the weight corresponding to the task limiting conditionjLoss value cost ofj。
In a second aspect, the present disclosure provides a task scheduling apparatus comprising:
a first determining unit for obtaining the task attribute of the task to be scheduledIndividual sample task scheduling table y conforming to multivariate normal distributionjScheduling table y for each task based on the samplejAccording to the mean value m, the step length sigma and the sample task scheduling table yjDetermining the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj(ii) a Wherein j is 1,2, … … lambda, lambda is a positive integer;
a loss value determining unit for setting a task limit condition according to each initial task schedule xjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofj;
An updating unit for updating the loss value costjUpdating the step length sigma, the covariance matrix C of the multivariate normal distribution and the mean value m;
a second determining unit, configured to determine the initial task scheduling table x when the updated step σ is within a preset rangejAs a target task schedule.
In a third aspect, the present disclosure provides an electronic device comprising a processor and a memory, the memory storing computer program instructions executable by the processor, the processor implementing the method steps as described in any one of the above when executing the computer program instructions.
In a fourth aspect, the present disclosure provides a computer readable storage medium storing computer program instructions which, when invoked and executed by a processor, implement the method steps of any of the above.
Compared with the prior art, the beneficial effects of the embodiment of the disclosure are that:
the disclosed embodiments aim to reduce the overall time required for task scheduling and provide a more fair and reasonable task scheduling table. In addition, under the constraint of multiple conditions, a feasible task scheduling table is not likely to exist, the embodiment of the disclosure finds the optimal task scheduling table which satisfies the conditions to the maximum extent under the condition of the feasible task scheduling table, and approaches the optimal task scheduling table step by step through the optimization principle to provide the feasible task scheduling table when the feasible task scheduling table does not exist. Aiming at the list with task-specified problems, the rules are described on the basis of an evolutionary strategy algorithm, the task arrangement under the specific rules can be modeled and optimized, and the evaluation speed is improved by utilizing a cache acceleration technology.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in the presently disclosed embodiments and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a plurality" typically includes at least two, but does not exclude the presence of at least one.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe technical names in embodiments of the present disclosure, the technical names should not be limited to the terms. These terms are only used to distinguish between technical names. For example, a first check signature may also be referred to as a second check signature, and similarly, a second check signature may also be referred to as a first check signature, without departing from the scope of embodiments of the present disclosure.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.
In the process of researching the present disclosure, the inventor finds that the prior art has problems: at present, many enterprises or organizations set a task schedule to arrange fixed tasks to be processed, and the task schedule is about the same as the workload arranged for each employee, according to the principle of fairness and reasonability. And the scheme of determining the task scheduling list by adopting integer programming of operational research often needs a large amount of time to debug the rules if a more complex rule combination is met, and the initial purpose of reducing scheduling time is violated by the great increase of the time needed for task scheduling. Therefore, how to quickly determine a feasible task schedule is an urgent problem to be solved due to various limiting conditions.
In view of the above, the inventors propose an idea to reduce the overall time required for task scheduling and provide a more fair and reasonable task scheduling table. In addition, under the constraint of multiple conditions, a feasible task scheduling table is not likely to exist, the embodiment of the disclosure finds the optimal task scheduling table which satisfies the conditions to the maximum extent under the condition of the feasible task scheduling table, and approaches the optimal task scheduling table step by step through the optimization principle to provide the feasible task scheduling table when the feasible task scheduling table does not exist. The embodiment of the disclosure can quickly determine a feasible task schedule as much as possible under the constraint of multiple conditions.
Referring to fig. 1, an embodiment of the present disclosure provides a task scheduling method, which includes the following steps.
Step 101, according to task attributes of tasks to be scheduled, obtaining lambda sample task scheduling tables y conforming to multivariate normal distributionjScheduling table y for each task based on the samplejAccording to the mean value m, the step length sigma and the sample task scheduling table yjDetermining the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj. Wherein j is 1,2, … … lambda, lambda is a positive integer.
In the present embodiment, the task attribute may be various parameters in describing an actual task.
Illustratively, assuming that the actual task is to schedule a number of jobs for a headcount N over a period of time (e.g., days D), where the total number of jobs per person over the days D is S, the actual task is converted to a mathematical representation as a task schedule x having a search space size SN×DX is a code with length of NxD, namely dimension N is NxD, each code is a real number, and is automatically rounded when not being an integer, and the value range is [0, S-1 ]]In the meantime. The parameters N, D, S may be considered to be task attributes.
In one example, it is assumed that the actual task is 2 tasks (first task and second task) for 2 employees arranged on 2 days, and the codes of the two tasks are 0 first task and 1 second task, respectively. The solved task schedule x will be denoted (1,0,0,1) where the first code represents the first day of tasks (1 second task) for the first employee, the second code represents the second day of tasks (0 first task) for the first employee, the third code represents the first day of tasks (0 first task) for the second employee, and the fourth code represents the second day of tasks (1 second task) for the second employee.
In one example, yjThe multivariate normal distribution fitted may be: y isjN (0, C), where C is the covariance matrix and the initial value is the unit matrix.
According to the task scheduling table y of each samplejDetermining a task scheduling table y for each sample according to the mean value m and the step length sigmajCorresponding initial task scheduling table xjSpecifically, the following may be mentioned: x is the number ofj=m+σyjWherein m ∈ Rn,σ∈R+And m is initially 0.
102, for the set task limiting conditions, arranging the table x according to each initial taskjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofj;
The elements in each solution x are real numbers, and rounding down each element can be mapped to each list, and each element represents the tabulation condition of a certain person.
X is represented as a matrix from a vector, with a total number of people N per row and a total number of days D per column.
First, a portion of clearly unsatisfactory solutions is rejected, e.g., non-target employees are filtered, and for employees not belonging to the target category, no subsequent calculations are performed. The employee categories include: gender, job number, proficiency, job category.
Secondly, calculating a loss value, specifically:
a task type sequence pattern is defined, which represents a prohibited scheduling mode and is called a subsequence definition. There are two elements in this sequence: the specific type, or generic type, the former represents a certain task type, and the latter represents any task type. The length of the sequence is denoted by k
pattern∈[*,0,1,...,S-1]k。
An operation line is defined, which functions to match whether the former sequence (which is a solution of the schedule table) conforms to the latter mode. Applying this operation to all sequences to be detected, the following formula can be obtained
Calculating a total loss cost having a value of the sum of the number of times that all employees meet the task type sequence pattern on all task types
For the above operations, the matching operation is buffered, and when a series of shifts and sequences are input to be the same, the loss caused by the sequence does not need to be calculated repeatedly.
seq_cost=cache(pattern,seq)。
In one example, step 102 is specifically implemented by the following process.
Step 1021, schedule table x for each initial taskjScheduling table x according to each initial taskjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSum, determine the initial task scheduling table xjA penalty value corresponding to each task constraint.
For example, assume an initial task schedule xjIf the number of times of the initial task scheduling table that does not satisfy the task limiting condition 1 is 2 and the number of times of the initial task scheduling table that does not satisfy the task limiting condition 2 is 1, the loss value corresponding to the task limiting condition 1 in the initial task scheduling table is determined to be 2 and the loss value corresponding to the task limiting condition 2 is determined to be 1.
Step 1022, obtain the weight corresponding to each task constraint condition, and arrange table x according to the initial taskjDetermining the initial task scheduling table x corresponding to the loss value of each task limiting condition and the weight corresponding to the task limiting conditionjLoss value cost ofj。
In this embodiment, a weight may be set for each task limitation condition to represent the importance degree of each task limitation condition, and it can be understood that the weight may be customized and adjusted according to actual situations.
In one example, table x is scheduled for each initial taskjThe initial task scheduling table x may be obtained by multiplying the loss value of each task constraint by the weight corresponding to the task constraint and adding the productsjLoss value cost ofj。
For example, assume an initial task schedule xjThe number of times of not meeting the task limiting condition 1 is 2, and the number of times of not meeting the task limiting condition 2 is 1, the initial task scheduling table x is determinedjThe penalty value for the mission limit condition 1 is 2 and the penalty value for the mission limit condition 2 is 1. Wherein, the weight of the task limitation condition 1 is 0.3, the weight of the task limitation condition 2 is 0.7, then the initial task scheduling table xjLoss value cost ofj0.3 × 2+0.7 × 1 ═ 1.3.
Step 103, cost according to the loss valuejAnd updating the step length sigma, and updating the covariance matrix C and the mean value m of the multivariate normal distribution.
In one example, step 103 is specifically as follows:
step 1031, scheduling table x in multiple initial tasksjLoss value cost ofjIn (1), the minimum loss value cost of μ is selectediAnd determining the minimum loss values costiCorresponding initial task scheduling table xjWeight w ofiWherein i is 1,2, … … μ, μ is less than or equal to j.
In this embodiment, table x is scheduled for each initial taskjThere is a loss value costjFrom the loss value costjIn (1), the minimum loss value cost of μ is selectediOptionally, cost can be determined according to the loss valuejSorting from small to large, the first mu loss values cost are selected from the lambda samplesiI.e. the loss cost with the minimum value of mui。
Mu minimum loss values costiCorresponding initial task scheduling table xiIs small, indicates that for a number of task constraints, the mu initial task schedule xiThe satisfaction degree of (2) is higher, and the task scheduling table is the mu best and feasible task scheduling tables. Alternatively, μ ═ λ/2.
In this example, table x is scheduled for each initial taskjA weight w is constructediThe weight wiCapable of measuring an initial task schedule xjOf importance, wherein the weight wiThe following formula is satisfied:
step 1032, determine the update parameter p of the update step using the following formulaσ:
Wherein, cσFor parameters related to dimension n, optionally, cσCan be set to 4/n; mu.swFor parameters related to the number of task schedules, C is the covariance matrix of the multivariate normal distribution, yi:λY corresponding to the first element after sorting according to the loss valuei. In one example, pσThe initial value is a vector with elements all 0.
Step 1033, update the step size σ using the following formula:
step 104, if the updated step length sigma is in the preset range, the plurality of initial task scheduling tables x are setjAs a target task schedule.
In this embodiment, the step size is attenuated every time the update is performed, and when the attenuation reaches a preset range, it can be considered that the initial task scheduling tables x obtained according to the updated step size σjHas approached the optimal solution to the maximum extent. Optionally, the preset range σ is smaller than or equal to S/8. It should be understood that the preset range can be customized, and the scheme does not do soIs particularly limited.
The embodiment of the disclosure can find the optimal task scheduling table which can meet various conditions to the maximum under the constraint of the multi-task limiting conditions and under the condition of a feasible task scheduling table, and gradually approaches the optimal task scheduling table through the optimization principle to provide the feasible task scheduling table when the feasible task scheduling table does not exist. The embodiment of the disclosure can determine the feasible task scheduling list as fast as possible.
Referring to fig. 2, an embodiment of the present disclosure provides a task scheduling method, which includes the following steps.
Step 201, according to task attributes of tasks to be scheduled, obtaining lambda sample task scheduling tables y conforming to multivariate normal distributionjScheduling table y for each task based on the samplejAccording to the mean value m, the step length sigma and the sample task scheduling table yjDetermining the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj. This step can correspond to step 101, and is not described herein again.
Step 202, aiming at the set task limiting conditions, arranging the table x according to each initial taskjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofj. This step can correspond to step 102, and is not described herein again.
Step 203, cost according to the loss valuejAnd updating the step size sigma, the covariance matrix C of the multivariate normal distribution and the mean value m.
The step of updating the step size in step 203 may correspond to step 104, and is not described herein again. The process for updating the covariance matrix C, mean m of the multivariate normal distribution is as follows.
First, cost according to the loss valuejAnd updating the covariance matrix C, including:
determining an update parameter p for updating the covariance matrix using the following equationc:
Wherein, ccFor parameters related to dimension n, optionally, ccAnd may be 4/n. In one example, pcThe initial value is a vector with elements all 0.
Updating the covariance matrix C using the following equation:
wherein, c1≈2/n2、cμ≈μw/n2Satisfy c1+cμLess than or equal to 1. The update principle of this formula is to increase the variance in the successful search directions, i.e. to increase the probability of sampling in these directions, so that the result of sampling is closer to the optimum value.
Secondly, cost is determined according to the loss valuejUpdating the mean value m, including:
scheduling tables x at multiple initial tasksiLoss value cost ofjIn (1), the minimum loss value cost of μ is selectedjAnd determining the minimum loss values costjCorresponding initial task scheduling table xjWeight w ofi;
Updating the mean value m using the following equation:
wherein, yi:λY corresponding to the ith element after sorting according to the loss valuei,xi:λX corresponding to the ith element after sorting according to loss valuei。
Step 204, if updated, the data is updatedIf the step length sigma is in a preset range or the updating times of the updated step length sigma are not less than the preset times, the plurality of initial task scheduling tables xjAs a target task schedule. This step can correspond to step 104, and will not be described herein.
Step 205, if the updated step σ is not within the preset range, or the update frequency of the step σ is smaller than the preset frequency, repeatedly executing the step σ to obtain λ sample task scheduling tables y conforming to the multivariate normal distribution according to the updated step σ, the updated covariance matrix C and the updated mean mjDetermining and the sample task scheduling table yjCorresponding initial task scheduling table xjDetermining each initial task scheduling list xjLoss value cost ofjCost according to the loss valuejAnd updating the step length sigma until the sigma is in a preset range or the updating times of the step length sigma are equal to preset times.
This is an update iteration process, which keeps the last updated step σ in a preset range. The termination condition of the update iteration can also be that a certain number of updates is reached to control the calculation time, and the initial purpose of reducing the arrangement time is met.
The embodiment of the disclosure uses the evolutionary strategy algorithm for the first time to be applied to task arrangement, such as personnel scheduling, and provides a task arrangement method, which can obtain a final result faster than a traditional integer programming method and has performance advantages. Under the limitation of multiple rules, an approximate optimal scheme can be given on the premise of having solution based on an evolutionary strategy algorithm. Therefore, the embodiment of the disclosure can find the optimal task scheduling table which satisfies the conditions to the maximum under the constraint of the multi-task limiting conditions and under the condition of the feasible task scheduling table, and gradually approaches the optimal task scheduling table through the optimization principle to provide the feasible task scheduling table when the feasible task scheduling table does not exist. The embodiment of the disclosure can rapidly and gradually obtain a task scheduling list which can satisfy each task attribute and most task limiting conditions (namely rules) as much as possible, and determine a feasible task scheduling list. Aiming at the shift table with task-specified problems, the rules are described on the basis of an evolutionary strategy algorithm, certain specific rules can be modeled and optimized, and the evaluation speed is improved by utilizing a cache acceleration technology.
To better understand the advantages of the embodiments of the present disclosure, we use the data "number of people: 175 persons, days: 15 days, rule: 15 kinds of "tests were carried out.
The conclusion finally obtained by adopting the traditional integer programming method is that no solution exists, namely no feasible task scheduling table exists, and the total time is consumed by 4 hours. With the scheme provided by the disclosed embodiments, a feasible schedule of tasks with overall satisfaction of 90% is obtained, and overall time consumption is reduced from 4 hours to 1 hour.
Therefore, the scheme provided by the embodiment of the disclosure can finally obtain a task scheduling table meeting most of task limiting conditions (namely rules), and the time consumption is greatly reduced.
Referring to fig. 3, an embodiment of the present disclosure provides a task scheduling apparatus, including: a first determination unit 302, a loss value determination unit 304, an update unit 306, and a second determination unit 308, the description of each unit being as follows.
A first determining unit 302, configured to obtain λ sample task scheduling tables y conforming to multivariate normal distribution according to task attributes of tasks to be scheduledjScheduling table y for each task based on the samplejAccording to the mean value m, the step length and the sample task scheduling table yjDetermining the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj(ii) a Wherein j is 1,2, … … lambda, lambda is a positive integer;
a loss value determining unit 304, configured to schedule the table x according to each initial task according to the set task limiting conditionjRule loss value emp _ cost determined whether pattern matches with forbidden class scheduleiSumming, determining each initial task schedule xjLoss value cost ofj;
An updating unit 306 for updating the cost according to the loss value costjUpdating the step length sigma, the covariance matrix C of the multivariate normal distribution and the mean value m;
second confirmation sheetElement 308, configured to schedule the plurality of initial tasks x when the updated step σ is within a preset rangejAs a target task schedule.
Referring to fig. 4, the update unit 306 is further configured to update the loss value cost according to the loss value costjUpdating the covariance matrix C and the mean value m of the multivariate normal distribution;
the second determining unit 308 is further configured to, when the updated step σ is not within the preset range, or the update frequency of the step σ is smaller than the preset frequency, repeatedly execute the λ sample task scheduling tables y according to the updated step σ, the updated covariance matrix C, and the updated mean m to obtain the λ sample task scheduling tables y conforming to the multivariate normal distributionjDetermining and the sample task scheduling table yjCorresponding initial task scheduling table xjDetermining each initial task scheduling list xjLoss value cost ofjCost according to the loss valuejAnd updating the step length sigma until the sigma is in a preset range or the updating times of the step length sigma are equal to preset times.
Optionally, the updating unit 306 is specifically configured to:
scheduling tables x at multiple initial tasksjLoss value cost ofjIn (1), the minimum loss value cost of μ is selectedjAnd determining the minimum loss values costjCorresponding initial task scheduling table xjWeight w ofi(ii) a Wherein i is 1,2, … … μ, and j is less than or equal to j.
The update parameter p for the update step is determined using the following formulaσ:
Wherein, cσFor parameters related to the dimension n, μwFor parameters relating to the number of task schedules, C is multivariateCovariance matrix of state distribution, yi:λY corresponding to the ith element after sorting according to the loss valuei;
The step size σ is updated using the following equation:
optionally, the updating unit 306 is specifically configured to:
determining an update parameter p for updating the covariance matrix using the following equationc:
Wherein, ccIs a parameter related to the dimension n;
updating the covariance matrix C using the following equation:
wherein, c1≈2/n2、cμ≈μw/n2Satisfy c1+cμ≤1。
Optionally, the updating unit 306 is specifically configured to: scheduling tables x at multiple initial tasksjLoss value cost ofjIn (1), the minimum loss value cost of μ is selectedjAnd determining the minimum loss values costjCorresponding initial task scheduling table xjWeight w ofi;
Updating the mean value m using the following equation:
wherein, yi:λY corresponding to the ith element after sorting according to the loss valuei,xi:λX corresponding to the ith element after sorting according to loss valuei。
Optionally, the first determining unit 302 is specifically configured to:
using the following formula, a sample task Schedule y is determinedj:
yj~N(0,C);
The following formula is used to determine the task scheduling table y associated with the samplejCorresponding initial task scheduling table xj:
xj=m+σyj;
Wherein C is a covariance matrix of multivariate normal distribution, and m belongs to Rn,σ∈R+。
Optionally, the loss value determining unit 304 is specifically configured to:
aiming at each initial task scheduling table, according to the initial task scheduling table xjThe number of times of not meeting the limiting conditions of each task in the task scheduling list x is determinedjA penalty value corresponding to each task constraint;
acquiring the weight corresponding to each task limiting condition, and arranging the table x according to the initial taskjDetermining the initial task scheduling table x corresponding to the loss value of each task limiting condition and the weight corresponding to the task limiting conditionjLoss value cost ofj。
An embodiment of the present disclosure further provides an electronic device, which includes a processor and a memory, where the memory stores computer program instructions capable of being executed by the processor, and when the processor executes the computer program instructions, the method implements any of the foregoing method steps.
Embodiments of the present disclosure also provide a computer-readable storage medium, in which computer program instructions are stored, and when the computer program instructions are called and executed by a processor, the computer program instructions implement any of the method steps described in the foregoing.
Referring now to FIG. 5, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, the electronic device may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".