Disclosure of Invention
The embodiment of the specification aims to provide a task processing method and device based on a genetic algorithm and electronic equipment, and the execution efficiency and the optimal solution probability of selecting the to-be-processed risk task by a business system can be improved.
In order to achieve the above object, the embodiments of the present specification are implemented as follows:
in a first aspect, a task processing method based on a genetic algorithm is provided, which includes:
determining at least two risk task processing arrangement results in a candidate risk task set based on a processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset processing cost coefficient upper limit as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the processing cost coefficient upper limit;
carrying out gene coding on the at least two risk task processing and arranging results to obtain an initial population formed by the at least two risk task processing and arranging result gene codes;
performing multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting a target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual;
and processing the candidate risk tasks in the candidate risk task set according to the risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
In a second aspect, there is provided a genetic algorithm-based task processing apparatus including:
the processing and arranging module is used for determining at least two risk task processing and arranging results in the candidate risk task set based on a processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset upper limit of the processing cost coefficient as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the upper limit of the processing cost coefficient;
the system comprises a gene coding module, a task scheduling module and a task scheduling module, wherein the gene coding module is used for carrying out gene coding on at least two task processing scheduling results to obtain an initial population formed by at least two task processing scheduling result gene codes, individuals in the initial population correspond to the at least two task processing scheduling results one by one, genes contained in each individual correspond to candidate risk tasks in a candidate risk task set one by one, and the values of the genes are used for representing whether the corresponding candidate risk tasks are determined as target tasks or not;
the genetic operation module is used for carrying out multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting the target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual;
and the task processing module is used for processing the candidate risk tasks in the candidate risk task set according to a risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
In a third aspect, an electronic device is provided that includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
determining at least two risk task processing arrangement results in a candidate risk task set based on a processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset processing cost coefficient upper limit as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the processing cost coefficient upper limit;
carrying out gene coding on the at least two risk task processing and arranging results to obtain an initial population formed by the at least two risk task processing and arranging result gene codes;
performing multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting a target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual;
and processing the candidate risk tasks in the candidate risk task set according to the risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
In a fourth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:
determining at least two risk task processing arrangement results in a candidate risk task set based on a processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset processing cost coefficient upper limit as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the processing cost coefficient upper limit;
carrying out gene coding on the at least two risk task processing and arranging results to obtain an initial population formed by the at least two risk task processing and arranging result gene codes;
performing multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting a target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual;
and processing the candidate risk tasks in the candidate risk task set according to the risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
The scheme of the embodiment of the specification sets a corresponding processing cost coefficient and a corresponding processing benefit coefficient for the candidate risk tasks planned and output by the business system. Firstly, determining several initially selected risk task processing arrangement results by taking the upper limit of the processing cost coefficient which accords with the processing capacity of the business system as a constraint. And then, performing multi-round iterative genetic operation on the initially selected risk task processing and arranging results based on a genetic algorithm, and efficiently deriving other feasible risk task processing and arranging results. In the operation process, the higher the total processing cost coefficient of the risk task processing and scheduling result is, the lower the fitness is, so that the risk task processing and scheduling result which can meet the upper limit of the processing cost coefficient can be more easily survived. Finally, after the genetic operation is finished, screening a high-quality task processing arrangement result according to the total processing benefit coefficient, and applying the result, so that the service system utilizes limited resources and realizes higher task processing benefit.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
As described above, in many scenarios, when the business system has no capability to completely process the risk tasks in planning the output, only a part of the valuable tasks can be selected from the risk tasks for preferential processing. The traditional selection method mainly comprises two types: the selection of exhaustive search is characterized in that each risk task is traversed and compared, then the optimal solution is calculated, and when the number of the risk tasks is large, the execution efficiency is too low. The other is searching based on a greedy algorithm, the method always selects the direction of the nearest target in the neighbors of the current point for searching, although the execution efficiency is high, the method usually falls into a local extreme value, and the global optimal solution cannot be accurately searched. In this context, a solvable solution is provided herein.
FIG. 1 is a flowchart of a task processing method based on a genetic algorithm according to an embodiment of the present disclosure. The method shown in fig. 1 may be performed by a corresponding apparatus, comprising:
step S102, determining at least two risk task processing arrangement results in the candidate risk task set based on the processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset processing cost coefficient upper limit as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the processing cost coefficient upper limit.
It should be understood that the set of candidate risk tasks contains candidate risk tasks that have not been processed by the business system. Each candidate risk task corresponds to a processing cost coefficient, which characterizes resources, such as time resources and/or human resources, consumed by processing the corresponding candidate risk task.
In an embodiment of the present specification, the business system cannot process all candidate risk tasks in the set of candidate risk tasks. Therefore, the candidate risk tasks needing to be processed are selectively selected from the candidate risk tasks according to the processing capacity of the business system.
As an exemplary introduction, it is assumed that the current candidate risk task set has candidate risk task 1 (processing cost coefficient is 4), candidate risk task 2 (processing cost coefficient is 2), candidate risk task 3 (processing cost coefficient is 2), candidate risk task 4 (processing cost coefficient is 5), and candidate risk task 5 (processing cost coefficient is 1). If the upper limit of the processing cost coefficient is quantized to 6 according to the processing capacity of the service system, under the premise that the upper limit of the processing cost coefficient is not exceeded, the following task processing arrangement results are determined to be obtained:
risk task processing arrangement result 1: the candidate risk task 1 and the candidate risk task 2 need to be processed, and the corresponding total processing cost coefficient is as follows: 6.
risk task processing arrangement result 2: the candidate risk task 1 and the candidate risk task 3 need to be processed, and the corresponding total processing cost coefficients are as follows: 6.
task processing scheduling result 3: the candidate risk task 1 and the candidate risk task 5 need to be processed, and the corresponding total processing cost coefficients are as follows: 5.
risk task processing arrangement result 4: the candidate risk task 2, the candidate risk task 3 and the candidate risk task 5 need to be processed, and the corresponding total processing cost coefficient is as follows: 5.
risk task processing arrangement result 5: the candidate risk task 2 and the candidate risk task 5 need to be processed, and the corresponding total processing cost coefficients are as follows: 3.
risk task processing arrangement result 6: the candidate risk task 3 and the candidate risk task 5 need to be processed, and the corresponding total processing cost coefficients are as follows: 3.
of course, in practical application, constraints can be further added on the basis of the above to simplify the task processing scheduling result.
For example, the target task to be processed is selected from the candidate risk task set and solved according to a strategy of maximizing the total processing benefit coefficient of the selected target task. None of the task processing schedule results 5, 6 like those in the above task processing schedule results 4, 5, 6 maximizes the overall processing benefit coefficient and can therefore be excluded.
And step S104, carrying out gene coding on the at least two risk task processing and arranging results to obtain an initial population formed by the at least two risk task processing and arranging result gene codes.
And the value of the gene is used for representing whether the corresponding candidate task is determined to be processed or not.
For ease of understanding, one task process is presented as an example:
assuming that a certain risk task processing scheduling result includes candidate risk task 1, candidate risk task 2, candidate risk task 3 and candidate risk task 4, wherein only candidate risk tasks 1 and 4 determine that processing is required, if the candidate risk tasks need to be processed or not is sequentially represented by binary, the risk task processing scheduling result is genetically encoded as (1001) as an individual in the initial population.
And S106, performing multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of the target individual selected as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual.
It should be understood that based on the above-mentioned multiple iterative genetic operations, the survival probability of the individual with lower fitness is smaller, so that the possible risk task processing arrangement result is searched in the direction of meeting the upper limit of the processing cost coefficient.
Specifically, the genetic operations for each iteration include: selecting parent individuals from the population of the round based on a fitness roulette selection method; performing cross operation based on the parent individuals to obtain new individuals; if the total processing cost coefficient of the target new-born individuals does not exceed the upper limit of the processing cost coefficient, determining whether the total processing benefit coefficient is smaller than the target original individuals of the target new-born individuals in the population of the round or not; if the new target individuals exist, the original target individuals in the population of the current round are replaced by the new target individuals, and the population of the next round is obtained; if the total treatment cost coefficient of all the newborn individuals does not exist or exceeds the upper limit of the treatment cost coefficient, the population of the current round is used as the population of the next round.
Based on the genetic operation method, individuals in the population are eliminated preferentially according to the total processing cost coefficient and the total processing benefit coefficient, and the number of the individuals is not increased, so that the method ensures that each round of genetic operation does not occupy more processing resources, and has higher practicability.
In addition, in order to avoid the situation that the genetic operation falls into the local optimal solution, in the at least one iteration of genetic operation process, individuals with a preset proportion can be selected from the population of the current round to carry out genetic variation. It is to be understood that the manner of genetic variation is not exclusive and is not specifically limited herein.
And S108, processing the candidate risk tasks in the candidate risk task set according to the risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
It should be understood that after multiple iterations, individuals in the target population approach to a strategy of maximizing a total processing benefit coefficient of the selected candidate risk tasks to be processed by using the processing cost upper limit as a constraint, and an optimal solution of a risk task processing arrangement result in the candidate risk task set is determined.
Specifically, in this step, the individual with the largest total processing benefit coefficient may be selected from the high-quality individuals of the target population as the target high-quality individual, so as to maximize the risk task processing benefit.
The task processing method in the embodiment of the present description sets a corresponding processing cost coefficient and a corresponding processing benefit coefficient for candidate risk tasks planned and output by a business system. Firstly, determining several initially selected risk task processing arrangement results by taking the upper limit of the processing cost coefficient which accords with the processing capacity of the business system as a constraint. And then, performing multi-round iterative genetic operation on the initially selected risk task processing and arranging results based on a genetic algorithm, and efficiently deriving other feasible risk task processing and arranging results. In the operation process, the higher the total processing cost coefficient of the risk task processing and scheduling result is, the lower the fitness is, so that the risk task processing and scheduling result which can meet the upper limit of the processing cost coefficient can be more easily survived. Finally, after the genetic operation is finished, screening a high-quality task processing arrangement result according to the total processing benefit coefficient, and applying the result, so that the service system utilizes limited resources and realizes higher task processing benefit.
Therefore, the method in the embodiment of the specification can enable the business system to perform self-adaptive selection processing on the current planning generated task set according to the processing capacity of the business system.
For a more detailed understanding of the method of the embodiments of the present disclosure, the following is a schematic description of the principles of the embodiments of the present disclosure in conjunction with a practical application scenario.
In the application scenario, the business system is specifically an anti-money laundering system, and the candidate risk tasks all belong to financial risk tasks. After the anti-money laundering system regularly outputs the risk tasks, the risk tasks cannot be processed completely due to the limitation of the operation manpower, so that the risk task processing income maximization needs to be realized within the operation manpower processing range. Wherein, the corresponding flow comprises the following steps:
and determining a processing cost coefficient of the risk task according to the manpower required by the risk task, and determining a processing benefit coefficient of the risk task according to the risk weight of the risk task.
And the processing cost coefficient is calculated according to the average processing time of the service type corresponding to the risk task. The processing benefit coefficient can be obtained by comprehensively scoring the risk degree of the risk task according to a multidimensional risk assessment system.
Suppose that the anti-money laundering system plans the risk task of output in the scene and is shown in the following table:
| item
|
Coefficient of processing yield
|
Number of processing cost
|
| Risk task |
| 1
|
15
|
15
|
| Risk task 2
|
3
|
7
|
| Risk task 3
|
2
|
10
|
| Risk task 4
|
5
|
5
|
| Risk task 5
|
9
|
8
|
| Risk task 6
|
20
|
17 |
Problem modeling is performed based on the above table: and assuming that the upper limit of the processing cost coefficient is 30, and selecting the target risk task needing to be processed by the maximized processing benefit coefficient.
And solving according to the model (without exhaustive list) to obtain the following initial task processing arrangement results:
a1: risk task 1 (processing), risk task 2 (not processing), risk task 3 (not processing), risk task 4 (processing), risk task 5 (processing), and risk task 6 (not processing).
A2: risk task 1 (no processing), risk task 2 (no processing), risk task 3 (processing), risk task 4 (processing), risk task 5 (processing), and risk task 6 (no processing).
A3: risk task 1 (no processing), risk task 2 (processing), risk task 3 (no processing), risk task 4 (processing), risk task 5 (no processing), and risk task 6 (no processing).
A4: risk task 1 (no processing), risk task 2 (processing), risk task 3 (processing), risk task 4 (no processing), risk task 5 (no processing), and risk task 6 (processing).
After determining the initial task processing arrangement result, carrying out gene coding on A1-A4 to obtain an initial population before genetic calculation:
A1:(100110)、A2:(001110)、A3:(010100)、A4:(011001)。
wherein, A1-A4 are used as individuals of the initial population. The genes in these individuals were ranked in the order of risk task 1 to risk task 6, with 1 indicating treatment and 0 indicating no treatment.
The ratio of A1: (100110) for example, it can be determined from the genes that the risk task 1, the risk task 4, and the risk task 5 need to be processed, in accordance with the task processing scheduling result indicated by a1 described above.
Next, fitness of a1 to a4 is calculated. Assuming that the fitness of the individual is the reciprocal of the total processing cost of the tasks that need to be processed in the individual (as long as the fitness of the individual is inversely related to the total processing cost of the tasks that need to be processed in the individual), then:
the fitness of a1 (100110) is 1/(15 × 1+7 × 0+10 × 0+5 × 1+8 × 1+17 × 0) 1/28.
The fitness of a2 (001110) is 1/(15 × 0+7 × 0+10 × 1+5 × 1+8 × 1+17 × 0) 1/23.
The fitness of a3 (010100) is 1/(15 × 0+7 × 1+10 × 0+5 × 1+8 × 0+17 × 0) 1/12.
The fitness of a4 (011001) is 1/(15 × 0+7 × 1+10 × 1+5 × 0+8 × 0+17 × 1) 1/34.
Thereafter, genetic operations are performed on the initial population based on fitness. It is assumed that the present application scenario is based on Roulette Wheel Selection (Roulette Wheel Selection method) to pick parent individuals from the starting population.
Here, the probability of each individual being selected as a parent individual by the roulette selection method is positively correlated with the fitness, that is, the higher the fitness of the individual is, the higher the probability of each individual being selected as a parent individual by the roulette selection method is.
The probability of a1 as parent individual is (1/28)/(1/28+1/23+1/12+1/34) ≈ 18.4%.
The probability of a2 as parent individual is (1/23)/(1/28+1/23+1/12+1/34) ≈ 22.6%.
The probability of a3 as parent individual (1/12)/(1/28+1/23+1/12+1/34) ≈ 43.7%.
The probability of a4 as parent individual (1/34)/(1/28+1/23+1/12+1/34) ≈ 15.3%.
The individuals A1 to A4 were converted into the carousel shown in FIG. 2 according to the probability of being parent individuals. Based on roulette selection, the wheel may be made two spins, and the individual pointed to by the pointer after the two spins are completed is identified as the parent individual.
In this way, two parent individuals can be selected in the present round of genetic calculation.
Assuming that A2 and A3 are selected as parent individuals in the round, the 2 nd to 4 th genes in A2 and A3 are crossed (the genes needing to be exchanged can be freely arranged) as shown in FIG. 3, and the individuals A5A 5 (010110) and A6 (001100) of the new generation are obtained.
Then, the total processing cost coefficient of A5 (010110) is 20, the total processing profit coefficient is 17, the total processing cost coefficient of A6 (001100) is 15, and the total processing profit coefficient is 5.
Comparing and finding that the total processing cost coefficient of A5 is smaller than the upper limit of the processing cost coefficient (30) and the total processing benefit coefficient is larger than A3(7), replacing A3 with A5; and A6 (001100) if the total processing cost coefficient is smaller than the upper limit (30) of the processing cost coefficient but the total processing benefit coefficient is smaller than both A2 and A3, then A5 is omitted in the current round.
That is, the population of the current new crop is (A1, A2, A4 and A5).
Then, entering a next round of genetic algorithm, selecting a new parent individual from the current population to perform gene crossing operation so as to derive a new population until the following genetic operation ending conditions are reached:
the fitness of the optimal individual of the population in the current round reaches the preset fitness requirement;
the fitness of the optimal individual in the population close to the preset turn is not changed any more;
the iteration times reach the preset iteration times.
Of course, in the at least one iterative genetic calculation, genetic variation may be performed on individuals in the population, for example, individuals requiring variation may be selected based on roulette selection, and if a2 requires variation, the 2 nd and 3 rd genes may be varied as shown in fig. 4, and after the a2 gene variation, it is determined whether the total processing cost coefficient always exceeds the upper limit of the processing cost coefficient (30), and if the total processing cost coefficient does not exceed the upper limit of the processing cost coefficient, it is determined whether the total processing benefit coefficient after variation is greater than the total processing benefit coefficient before variation. If the total processing income coefficient after the variation is larger than that before the variation, the variation takes effect, otherwise, the A2 is restored to the state before the genetic variation.
Obviously, based on the above-mentioned multiple rounds of iterative genetic operations, a task processing arrangement result with a total processing cost coefficient meeting the upper limit of the processing cost coefficient and a greater total processing profit coefficient can be finally propagated.
And after the iteration is finished, selecting an individual with the maximum total processing income coefficient from the current-period population to determine as a target task processing arrangement result, and processing the candidate risk task set by the anti-money laundering system according to the target task processing arrangement result.
In summary, when the method of the embodiments of the present specification is applied to an anti-money laundering system, the anti-money laundering system can be controlled to utilize current processing resources under the condition of high concurrency of risk tasks, and the risk tasks can be processed efficiently and maximally.
Corresponding to the task processing method, the embodiment of the specification further provides a task processing device. Fig. 5 is a schematic structural diagram of a task processing device 500 according to an embodiment of the present disclosure, including:
the processing scheduling module 510 determines at least two risk task processing scheduling results in the candidate risk task set based on the processing cost coefficients corresponding to the candidate risk tasks in the candidate risk task set, with a preset upper limit of the processing cost coefficients as a constraint, where a total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the upper limit of the processing cost coefficients.
And a gene coding module 520, configured to perform gene coding on the at least two task processing arrangement results to obtain an initial population formed by the at least two task processing arrangement results after the gene coding, where individuals in the initial population correspond to the at least two task processing arrangement results one to one, and a gene included in each individual corresponds to a candidate risk task in the candidate risk task set one to one, and a value of the gene is used to represent whether the corresponding candidate risk task is determined as a target task.
And the genetic operation module 530 performs multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting the target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is negatively correlated with the total processing cost coefficient of the target individual.
The task processing module 540 is configured to process the candidate risk tasks in the candidate risk task set according to a risk task processing arrangement result represented by the target high-quality individual in the target population, where each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual whose total processing benefit coefficient meets a preset processing benefit requirement.
The task processing device in the embodiment of the present description sets a corresponding processing cost coefficient and a corresponding processing benefit coefficient for candidate risk tasks planned and output by a business system. Firstly, determining several initially selected risk task processing arrangement results by taking the upper limit of the processing cost coefficient which accords with the processing capacity of the business system as a constraint. And then, performing multi-round iterative genetic operation on the initially selected risk task processing and arranging results based on a genetic algorithm, and efficiently deriving other feasible risk task processing and arranging results. In the operation process, the higher the total processing cost coefficient of the risk task processing and scheduling result is, the lower the fitness is, so that the risk task processing and scheduling result which can meet the upper limit of the processing cost coefficient can be more easily survived. Finally, after the genetic operation is finished, screening a high-quality task processing arrangement result according to the total processing benefit coefficient, and applying the result, so that the service system utilizes limited resources and realizes higher task processing benefit.
Optionally, when executing, the processing scheduling module 510 specifically uses a preset processing cost upper limit as a constraint, and determines at least two risk task processing scheduling results in the candidate risk task set according to a policy that a total processing benefit coefficient of the selected candidate risk tasks to be processed is maximized, based on the processing cost coefficients corresponding to the candidate risk tasks in the candidate risk task set.
Optionally, each candidate risk task in the candidate risk task set is a financial risk task, the processing cost coefficient of the candidate risk task is determined based on time and/or manpower required for processing the candidate risk task, and the processing benefit coefficient of the candidate risk task is determined based on a financial risk level corresponding to the candidate risk task.
Optionally, the target high-quality individual is a high-quality individual with the largest total processing benefit coefficient in the target population.
Optionally, the genetic operations for each iteration include: selecting parent individuals from the population of the round based on a fitness roulette selection method; performing cross operation based on the parent individuals to obtain new individuals; if the total processing cost coefficient of the target new-born individuals does not exceed the upper limit of the processing cost coefficient, determining whether the total processing benefit coefficient is smaller than the target original individuals of the target new-born individuals in the population of the round or not; if the new target individuals exist, the original target individuals in the population of the current round are replaced by the new target individuals, and the population of the next round is obtained; and if the total treatment cost coefficient of all the newborn individuals does not exist or exceeds the upper limit of the treatment cost coefficient, using the population of the current round as the population of the next round.
Optionally, the at least one iterative round of genetic operations comprises:
and selecting individuals with a preset proportion from the population of the round to perform genetic variation.
Optionally, the end condition of the genetic operation of the plurality of iterations comprises at least one of:
the fitness of the optimal individual of the population in the current round reaches the preset fitness requirement;
the fitness of the optimal individual in the population close to the preset turn is not changed any more;
the iteration times reach the preset iteration times.
Obviously, the task processing device according to the embodiment of the present specification can be used as the execution main body of the task processing method shown in fig. 1, and therefore, the task processing device can implement the functions of the method implemented in fig. 1 to 4. Since the principle is the same, the detailed description is omitted here.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to fig. 6, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the task processing device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
determining at least two risk task processing arrangement results in a candidate risk task set based on a processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset processing cost coefficient upper limit as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the processing cost coefficient upper limit;
carrying out gene coding on the at least two risk task processing and arranging results to obtain an initial population formed by the at least two risk task processing and arranging result gene codes;
performing multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting a target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual;
and processing the candidate risk tasks in the candidate risk task set according to the risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
The task processing method disclosed in the embodiment shown in fig. 1 in this specification can be applied to a processor, or can be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
It should be understood that the electronic device according to the embodiment of the present disclosure may implement the functions of the task processing apparatus according to the embodiments shown in fig. 1 to fig. 4, which are not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Furthermore, the present specification embodiments also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular to perform the following method:
the processing and arranging module is used for determining at least two risk task processing and arranging results in the candidate risk task set based on a processing cost coefficient corresponding to each candidate risk task in the candidate risk task set by taking a preset upper limit of the processing cost coefficient as a constraint, wherein the total processing cost coefficient of all candidate risk tasks in the candidate risk task set is greater than the upper limit of the processing cost coefficient;
the system comprises a gene coding module, a task scheduling module and a task scheduling module, wherein the gene coding module is used for carrying out gene coding on at least two task processing scheduling results to obtain an initial population formed by at least two task processing scheduling result gene codes, individuals in the initial population correspond to the at least two task processing scheduling results one by one, genes contained in each individual correspond to candidate risk tasks in a candidate risk task set one by one, and the values of the genes are used for representing whether the corresponding candidate risk tasks are determined as target tasks or not;
the genetic operation module is used for carrying out multiple rounds of iterative genetic operations on the initial population based on a genetic algorithm to obtain a target population, wherein in each round of genetic operations, the probability of selecting the target individual as a parent individual is matched with the fitness of the target individual, and the fitness of the target individual is in negative correlation with the total processing cost coefficient of the target individual;
and the task processing module is used for processing the candidate risk tasks in the candidate risk task set according to a risk task processing arrangement result represented by the target high-quality individual in the target population, wherein each candidate risk task in the candidate risk task set corresponds to a processing benefit coefficient, and the high-quality individual is an individual of which the total processing benefit coefficient meets the preset processing benefit requirement.
It should be understood that the above-mentioned instructions, when executed by the portable electronic device including a plurality of application programs, can enable the above-mentioned task processing device based on genetic algorithm to implement the functions of the embodiments shown in fig. 1 to 3, and will not be described in detail herein.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification. Moreover, all other embodiments obtained by a person skilled in the art without making any inventive step shall fall within the scope of protection of this document.