CN110730101B - Resource allocation method, terminal, device and readable storage medium - Google Patents
Resource allocation method, terminal, device and readable storage medium Download PDFInfo
- Publication number
- CN110730101B CN110730101B CN201911007764.2A CN201911007764A CN110730101B CN 110730101 B CN110730101 B CN 110730101B CN 201911007764 A CN201911007764 A CN 201911007764A CN 110730101 B CN110730101 B CN 110730101B
- Authority
- CN
- China
- Prior art keywords
- model
- resource
- predicted value
- allocated
- constraint condition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000013468 resource allocation Methods 0.000 title claims abstract description 43
- 238000003860 storage Methods 0.000 title claims abstract description 12
- 238000012549 training Methods 0.000 claims abstract description 45
- 238000009826 distribution Methods 0.000 claims abstract description 41
- 230000006870 function Effects 0.000 claims description 80
- 238000012545 processing Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000005457 optimization Methods 0.000 abstract description 11
- 230000008901 benefit Effects 0.000 description 13
- 238000004891 communication Methods 0.000 description 6
- 238000010801 machine learning Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000009825 accumulation Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000003066 decision tree Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007477 logistic regression Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/067—Enterprise or organisation modelling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0893—Assignment of logical groups to network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/147—Network analysis or design for predicting network behaviour
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Operations Research (AREA)
- Marketing (AREA)
- Game Theory and Decision Science (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Development Economics (AREA)
- Educational Administration (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a resource allocation method, which comprises the following steps: the method comprises the steps of carrying out model training based on a training sample to obtain a first model and a second model, then determining a target function corresponding to resources to be distributed and constraint conditions corresponding to the resources to be distributed based on the first model and the second model, then obtaining a first predicted value corresponding to the resources to be distributed based on the first model, obtaining a second predicted value corresponding to the resources to be distributed based on the second model, and finally determining an optimal distribution result corresponding to the resources to be distributed based on the first predicted value, the second predicted value, the target function, the constraint conditions and an integer programming algorithm. The invention also discloses a device, a terminal and a readable storage medium. By determining the objective function and the constraint condition corresponding to the resources to be distributed, the optimal distribution result is determined by using the integer programming algorithm in the optimization algorithm, so that the resource distribution efficiency is improved, and the system resource consumption is saved.
Description
Technical Field
The present invention relates to the field of machine learning technologies, and in particular, to a resource allocation method, a terminal, a device, and a readable storage medium.
Background
Resource allocation is one of important production links in many industries, and resources are often limited, so that the resources need to be split and allocated to different individuals by a certain strategy, and the risk is increased, the resources are wasted, and the effect maximization cannot be achieved due to the fact that the resources allocated by the individuals are too high.
Currently, a common resource allocation method adopts an expert rule, machine learning, or a combination of the two, wherein the expert rule: obtaining the resource size of each individual through the experience of experts; machine learning: obtaining the resource size of each individual through a machine learning regression algorithm, such as a decision tree, a logistic regression and other methods; the combination method comprises the following steps: combining the expert rules and the machine learning results according to a certain proportion. However, these methods are only for a single individual, and may yield optimal results for a single individual, but do not address optimal resource allocation in the case of a total quota of resources. Especially, under the condition that a plurality of individuals needing to distribute resources exist, the existing algorithm cannot guarantee reasonable distribution of the resources and achieve the optimal result.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a resource allocation method, a terminal, a device and a readable storage medium, and aims to solve the technical problem that the resource allocation efficiency is low when the total quota of resources and the number of individuals needing to allocate resources is large.
In order to achieve the above object, the present invention provides a resource allocation method, including the following steps:
performing model training based on a training sample to obtain a first model and a second model;
determining an objective function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated based on the first model and the second model;
obtaining a first predicted value corresponding to the resource to be allocated based on the first model, and obtaining a second predicted value corresponding to the resource to be allocated based on the second model;
and determining an optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition and an integer programming algorithm.
Further, in an embodiment, the step of determining, based on the first model and the second model, an objective function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated includes:
acquiring a preset target function and constraint condition relation table;
and acquiring the objective function and the constraint condition from the objective function and constraint condition relation table according to the first model and the second model.
Further, in an embodiment, the obtaining a first predicted value corresponding to the resource to be allocated based on the first model, and obtaining a second predicted value corresponding to the resource to be allocated based on the second model includes:
acquiring a configuration relation table corresponding to the resources to be allocated;
determining the first predicted value based on the configuration relationship table and the first model;
determining the second predicted value based on the configuration relationship table and the second model.
Further, in an embodiment, the integer programming algorithm includes a 0-1 integer programming algorithm, and the step of determining the optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition, and the integer programming algorithm includes:
and calculating to obtain the optimal distribution result by utilizing the 0-1 integer programming algorithm based on the first predicted value, the second predicted value, the target function and the constraint condition.
Further, in an embodiment, the step of calculating the optimal distribution result by using the 0-1 integer programming algorithm based on the first predicted value, the second predicted value, the objective function and the constraint condition includes:
inputting the first predicted value, the second predicted value, the target function and the constraint condition into the 0-1 integer programming algorithm, and calculating based on the first predicted value and the target function to obtain an allocation result summary table corresponding to the resource to be allocated;
searching the distribution result summary table based on the second predicted value and the constraint condition to obtain an optional distribution result list meeting the constraint condition;
and inputting the data in the optional distribution result list into the objective function, comparing the output data of the objective function, and determining the optimal distribution result according to the comparison result.
Further, in an embodiment, after the step of determining the optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition, and an integer programming algorithm, the method includes:
updating the first model and the second model based on the optimal allocation result;
determining a first target predicted value corresponding to the resource to be allocated based on the resource to be allocated and the updated first model;
and determining a second target predicted value corresponding to the resource to be allocated based on the resource to be allocated and the updated second model.
Further, in an embodiment, the training samples include a first sample set and a second sample set, and the step of performing model training based on the training samples to obtain the first model and the second model includes:
training a first initial prediction model based on the first sample set, the first initial prediction model being taken as the first model when the first initial prediction model converges;
training a second initial prediction model based on the second sample set, and taking the second initial prediction model as the second model when the second initial prediction model converges.
Further, in an embodiment, the resource allocation apparatus includes:
the training module is used for carrying out model training based on a training sample to obtain a first model and a second model;
a determining module, configured to determine, based on the first model and the second model, an objective function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated;
the calculation module is used for obtaining a first predicted value corresponding to the resource to be distributed based on the first model and obtaining a second predicted value corresponding to the resource to be distributed based on the second model;
and the processing module is used for determining an optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition and an integer programming algorithm.
In addition, to achieve the above object, the present invention also provides a terminal, including: a memory, a processor and a resource allocation program stored on the memory and executable on the processor, the resource allocation program when executed by the processor implementing the steps of the resource allocation method of any of the above.
In addition, to achieve the above object, the present invention further provides a readable storage medium, which stores a resource allocation program, wherein the resource allocation program, when executed by a processor, implements the steps of the resource allocation method according to any one of the above.
The method comprises the steps of carrying out model training based on a training sample to obtain a first model and a second model, then determining a target function corresponding to resources to be distributed and a constraint condition corresponding to the resources to be distributed based on the first model and the second model, then obtaining a first predicted value corresponding to the resources to be distributed based on the first model, obtaining a second predicted value corresponding to the resources to be distributed based on the second model, and finally determining an optimal distribution result corresponding to the resources to be distributed based on the first predicted value, the second predicted value, the target function, the constraint condition and an integer planning algorithm. By determining the objective function and the constraint condition corresponding to the resources to be allocated, the optimal allocation result corresponding to the resources to be allocated is quickly determined by using an integer programming algorithm in the optimization algorithm, so that the optimal resource allocation under the condition of the total quota of the resources is realized. The integer programming algorithm limits the allocation result to be an integer, so that the speed is higher compared with other optimization algorithms, and when the total quota of resources is determined and the number of individuals needing to allocate resources is large, the speed and the quality of resource allocation can be improved by using the integer programming algorithm, and the resource consumption of a system is further saved.
Drawings
Fig. 1 is a schematic structural diagram of a terminal in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a resource allocation method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a resource allocation method according to a second embodiment of the present invention;
fig. 4 is a functional block diagram of a resource allocation apparatus according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a terminal in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the object detection system shown in FIG. 1 does not constitute a limitation of the terminal, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a resource allocation program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting a background server and communicating data with the background server; the user interface 1003 is mainly used for connecting a user terminal and performing data communication with the user terminal; and the processor 1001 may be used to invoke a resource allocation program stored in the memory 1005.
In this embodiment, the terminal includes: the system comprises a memory 1005, a processor 1001 and a resource allocation program stored in the memory 1005 and capable of running on the processor 1001, wherein the steps of the resource allocation method provided by each embodiment of the present application are executed when the processor 1001 calls the resource allocation program stored in the memory 1005.
Referring to fig. 2, fig. 2 is a flowchart illustrating a resource allocation method according to a first embodiment of the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown.
In this embodiment, the resource allocation method includes:
s10, performing model training based on a training sample to obtain a first model and a second model;
in this embodiment, the resource allocation means that the scarcity of resources determines that limited resources need to be reasonably allocated to different fields in a certain manner, so as to achieve the optimal utilization of resources, that is, the least resource consumption, the most suitable commodities and labor are produced, and the best benefit is obtained. Resource allocation is one of important production links in many industries, and resources are often limited, so that the resources need to be allocated to different individuals by a certain strategy, and over-allocation can cause risk increase, resource waste and the like; too low an allocation does not maximize the effect. The invention provides a resource allocation method, which determines an optimal allocation result by determining a target function and a constraint condition corresponding to a resource to be allocated and further utilizing an integer programming algorithm in an optimization algorithm, thereby improving the resource allocation efficiency and saving the resource consumption of a system.
Specifically, model training is performed to obtain a first model and a second model, wherein the first model is used for predicting benefits generated after the individuals are allocated to the resources, and the second model is used for predicting risks generated after the individuals are allocated to the resources. The different domains have different definitions of benefit and risk, for example, bandwidth resource allocation in the communication domain, the benefit can be defined as system throughput, and the risk can be defined as bit error rate; in the field of financial department store goods distribution, benefit can be defined as profit of the store, risk can be defined as probability of stock accumulation, and the like.
Specifically, step S10 includes:
training a first initial prediction model based on the first sample set, the first initial prediction model being taken as the first model when the first initial prediction model converges;
in the present embodiment, model training is performed by using training samples, where the training samples may be obtained from a historical database, for example, the historical data of store shop distribution includes store passenger flow volume, historical sales data, historical shop records, probability of stock accumulation, probability of return complaints, and the like, and these historical data may be obtained from the historical database of each store. The training samples comprise a first sample set and a second sample set, wherein the first sample set is used for training a first model, specifically, a first initial prediction model is trained according to the first sample set, then whether the first initial prediction model converges is judged, when the first initial prediction model converges, the first initial prediction model is used as the first model, wherein if the loss function value of the first initial prediction model is less than a preset value, the first initial prediction model can be considered to converge, the preset value is determined according to the actual situation and is not limited in the invention, and another method for judging the convergence of the first initial prediction model is that when the loss function value of the first initial prediction model does not change in the next round of model training, the convergence of the first initial prediction model at the moment is explained.
Training a second initial prediction model based on the second sample set, and taking the second initial prediction model as the second model when the second initial prediction model converges.
In this embodiment, the second sample set is used for training the second model, specifically, the second initial prediction model is trained according to the second sample set, and then whether the second initial prediction model converges or not is determined, and when the second initial prediction model converges, the first initial prediction model is taken as the second model. The other method for judging the convergence of the second initial prediction model is that when the loss function value of the second initial prediction model does not change in the next round of model training, the second initial prediction model at the moment is explained to be converged.
Step S20, based on the first model and the second model, determining a target function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated;
in this embodiment, the integer programming algorithm is adopted, and the integer programming algorithm is one of linear optimization algorithms, so that the method is faster than other optimization algorithms, and can be suitable for large-scale data calculation. Integer programming algorithms require the determination of constraints and objective functions. It should be noted that the constraint condition and the objective function need to consider factors such as resource type, field, historical data, and the like, and are related to the first model and the second model, and need to be determined by combining actual conditions.
Specifically, step S20 includes:
acquiring a preset target function and constraint condition relation table;
and acquiring the objective function and the constraint condition from the objective function and constraint condition relation table according to the first model and the second model.
In this embodiment, the first predicted value corresponding to the first model refers to a benefit predicted value obtained by processing the sub-resources as input parameters of the first model when the sub-resources are allocated to different individuals through the first model, and determining the objective function by using the first predicted value. The second predicted value corresponding to the second model means that when each sub-resource is allocated to different individuals, the sub-resource is used as an input parameter of the second model, the risk predicted value is obtained through processing of the second model, and the constraint condition is determined by the second predicted value. The objective function and constraint condition relation table stores commonly used objective functions and constraint conditions under different fields, different resource types and the like, and the required objective functions and constraint conditions can be obtained by inquiring the objective function and constraint condition relation table.
For illustration, for convenience of description, the following variables are defined:
n is the total number of sub-resources;
m is the total number of individuals requiring the resource;
a k represents the kth sub-resource, k ∈ (1, n);
x ik whether the individual i selects the kth sub-resource is represented, the value is 0 or 1,1 represents that the individual i selects the kth sub-resource, 0 represents that the individual i does not select the kth sub-resource, k belongs to (1, n), i belongs to (1, m);
a represents a first model;
b represents a second model;
A(a ik ) Representing the benefit predicted value of the individual i at the kth sub-resource, k belongs to (1, n), i belongs to (1, m);
B(a ik ) And (3) representing the risk prediction value of the individual i at the kth sub-resource, k belongs to (1, n), and i belongs to (1, m).
According to A (a) ik ) First predicted value, B (a) ik ) The second predicted value and the resource field can be obtained by inquiring the objective function in the objective function and constraint condition relation table as follows:
and determining 3 constraints:
constraint 1 is as follows, limiting each individual to only select one resource size:
constraint 2 is a risk constraint:
where p is a preset maximum risk value, this constraint limits the overall average risk size to p.
Constraint 3 is a total resource quantity constraint:
where q is the total resource size, this constraint means that the sum of all individual resource quotas must not be greater than the quota q.
Step S30, obtaining a first predicted value corresponding to the resource to be distributed based on the first model, and obtaining a second predicted value corresponding to the resource to be distributed based on the second model;
in this embodiment, a preset resource to be allocated is substituted into the first model as an input parameter, and is processed by the first model to obtain a first predicted value corresponding to the resource to be allocated, and meanwhile, the preset resource to be allocated is substituted into the second model as an input parameter, and is processed by the second model to obtain a second predicted value corresponding to the resource to be allocated.
Specifically, step S30 includes:
acquiring a configuration relation table corresponding to the resources to be allocated;
in this embodiment, the resource to be allocated is divided into a plurality of parts, the amount of each part is determined according to actual conditions, the resource to be allocated can be divided according to historical data or expert experience, the preset resource to be allocated comprises a plurality of sub-resources, and the resource allocation refers to allocating the sub-resourcesThe resources are reasonably distributed to the individuals needing the resources, and the best benefit is obtained integrally after all the individuals are distributed to the resources. The configuration relation table corresponding to the resources to be allocated means that each sub-resource is in traversal matching with all individuals needing the resources, for example, there are 3 sub-resources, and a is used respectively 1 ,a 2 ,a 3 If 3 individuals needing resources are represented by the individuals 1, 2 and 3, the configuration relationship table is as follows:
determining the first predicted value based on the configuration relationship table and the first model;
in this embodiment, the first model is used to predict benefits generated after the individuals are allocated to the resources, and according to the matching conditions of the sub-resources in the configuration relationship table, when each sub-resource is allocated to different individuals, the sub-resource is respectively calculated as an input parameter of the first model, and the predicted value of the benefits when each sub-resource is allocated to different individuals is obtained through the processing of the first model.
Determining the second predicted value based on the configuration relationship table and the second model.
In this embodiment, the second model is used to predict risks generated after the individuals are allocated to the resources, and according to the matching conditions of the sub-resources in the configuration relationship table, when each sub-resource is allocated to different individuals, the sub-resource is respectively calculated as an input parameter of the second model, and is processed by the second model, so as to obtain a risk prediction value when each sub-resource is allocated to different individuals.
And S40, determining an optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition and an integer programming algorithm.
In this embodiment, after the objective function and the constraint condition are determined according to the first model and the second model, an integer programming algorithm is further used to determine an optimal allocation result of the sub-resources according to the first predicted value, the second predicted value, the objective function, and the constraint condition.
Specifically, step S40 includes:
and calculating to obtain the optimal distribution result by utilizing the 0-1 integer programming algorithm based on the first predicted value, the second predicted value, the target function and the constraint condition.
In the present embodiment, the linear programming refers to an optimization problem in which both the objective function and the constraint condition are linear. Linear programming is an important area in the optimization problem. Many practical problems faced in job research can be addressed with linear programming, particularly in certain special cases, such as: network flow, multi-commodity flow, and the like are considered to be very important. There is currently a great deal of research directed to linear programming algorithms. Many optimization problem algorithms can be decomposed into linear programming subproblems and then solved one by one. The linear programming problem that requires all unknowns to be integers is called the integer programming or integer linear programming problem. The worst case of the integer programming problem is uncertain, and in some practical cases (those with constrained variables) is an NP-hard problem, relative to a linear programming problem that can be solved efficiently even in the worst case. The 0-1 integer program is a special case of the integer program, all variables are 0 or 1 (not any integer).
Specifically, according to a first predicted value, the second predicted value, an objective function and a constraint condition, the 0-1 integer programming algorithm is used for calculating to obtain an optimal distribution result, namely after the objective function and the constraint condition are determined, the 0-1 integer programming algorithm is further used for solving x ik To indicate which sub-resource each individual selects, that is to say x ik The value of (A) is the embodiment of the optimal allocation result, x ik Equal to 1 denotes that the individual i selects the kth sub-resource, x ik Equal to 0 indicates that the individual i does not select the kth sub-resource.
Specifically, step S41 includes:
step a, inputting the first predicted value, the second predicted value, the objective function and the constraint condition into the 0-1 integer programming algorithm, and calculating to obtain an allocation result summary table corresponding to the resource to be allocated based on the first predicted value and the objective function;
b, searching the distribution result summary table based on the second predicted value and the constraint condition to obtain an optional distribution result list meeting the constraint condition;
and c, inputting the data in the optional distribution result list into the objective function, comparing the output data of the objective function, and determining the optimal distribution result according to the comparison result.
In this embodiment, first, the first predicted value, the second predicted value, the objective function and the constraint condition are input into the 0-1 integer programming algorithm, and then, all possible situations of the resource to be allocated are solved according to the first predicted value and the objective function by using an exhaustion method, and are summarized into an allocation result summary table.
Then, screening data in the distribution result summary table by using constraint conditions, taking effective distribution results meeting the constraint conditions as optional results, and storing the optional distribution results in an optional distribution result list; the allocation results that do not satisfy the constraint condition may be directly deleted from the allocation result summary table. And finally, inputting the data in the selectable distribution result list to the target function again, comparing the output data of the target function, and selecting a maximum value or a minimum value as an optimal distribution result in the comparison result according to the actual situation.
In the resource allocation method provided in this embodiment, model training is performed based on a training sample to obtain a first model and a second model, then an objective function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated are determined based on the first model and the second model, then a first predicted value corresponding to the resource to be allocated is obtained based on the first model, a second predicted value corresponding to the resource to be allocated is obtained based on the second model, and finally an optimal allocation result corresponding to the resource to be allocated is determined based on the first predicted value, the second predicted value, the objective function, the constraint condition, and an integer programming algorithm. By determining the objective function and the constraint condition corresponding to the resources to be allocated, and further utilizing an integer programming algorithm in the optimization algorithm to quickly determine the optimal allocation result corresponding to the resources to be allocated, the optimal resource allocation under the condition of the total quota of the resources is realized. The integer programming algorithm limits the allocation result to be an integer, so that the speed is higher compared with other optimization algorithms, and when the total quota of resources is determined and the number of individuals needing to allocate resources is large, the speed and the quality of resource allocation can be improved by using the integer programming algorithm, and the resource consumption of a system is further saved.
Based on the first embodiment, referring to fig. 3, a second embodiment of the resource allocation method of the present invention is proposed, in this embodiment, after step S40, the method includes:
step S50, updating the first model and the second model based on the optimal distribution result.
Step S60, determining a first target predicted value corresponding to the resource to be distributed based on the resource to be distributed and the updated first model;
and step S70, determining a second target predicted value corresponding to the resource to be distributed based on the resource to be distributed and the updated second model.
In this embodiment, after determining an optimal allocation result by determining an objective function and a constraint condition corresponding to a resource to be allocated and further using a 0-1 integer programming algorithm, first updating the first model and the second model according to the optimal allocation result.
Respectively predicting benefit predicted values generated after the individuals are allocated to the sub-resources by using the updated first model, namely the sub-resources are used as input parameters of the first model, and obtaining the benefit predicted values of the individuals when the individuals are allocated to the sub-resources through the processing of the first model; and in a similar way, the updated second model is used for respectively predicting the risk prediction values generated after the individuals are allocated to the sub-resources, namely the sub-resources are used as input parameters of the second model, and the risk prediction values of the individuals when the individuals are allocated to the sub-resources are obtained through the processing of the second model.
In the resource allocation method provided in this embodiment, the first model and the second model are updated based on the optimal allocation result, then the first target predicted value corresponding to the resource to be allocated is determined based on the resource to be allocated and the updated first model, and then the second target predicted value corresponding to the resource to be allocated is determined based on the resource to be allocated and the updated second model. And updating the first model and the second model according to the optimal distribution result, and obtaining the optimal target prediction value through reasonable resource distribution.
The invention further provides a resource allocation apparatus, referring to fig. 4, fig. 4 is a functional module schematic diagram of an embodiment of the resource allocation apparatus of the invention.
The training module 10 is used for performing model training based on a training sample to obtain a first model and a second model;
a determining module 20, configured to determine, based on the first model and the second model, an objective function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated;
a calculating module 30, configured to obtain a first predicted value corresponding to the resource to be allocated based on the first model, and obtain a second predicted value corresponding to the resource to be allocated based on the second model;
and the processing module 40 is configured to determine an optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition, and an integer programming algorithm.
Further, the determining module 20 is further configured to:
acquiring a preset target function and constraint condition relation table;
and acquiring the objective function and the constraint condition from the objective function and constraint condition relation table according to the first model and the second model.
Further, the calculation module 30 is further configured to:
acquiring a configuration relation table corresponding to the resources to be distributed;
determining the first predicted value based on the configuration relationship table and the first model;
determining the second predicted value based on the configuration relationship table and the second model.
Further, the processing module 40 is further configured to:
and calculating to obtain the optimal distribution result by utilizing the 0-1 integer programming algorithm based on the first predicted value, the second predicted value, the target function and the constraint condition.
Further, the processing module 40 is further configured to:
inputting the first predicted value, the second predicted value, the target function and the constraint condition into the 0-1 integer programming algorithm, and calculating based on the first predicted value and the target function to obtain an allocation result summary table corresponding to the resource to be allocated;
searching the distribution result summary table based on the second predicted value and the constraint condition to obtain an optional distribution result list meeting the constraint condition;
and inputting the data in the optional distribution result list into the objective function, comparing the output data of the objective function, and determining the optimal distribution result according to the comparison result.
Further, the resource allocation apparatus further includes:
an update module that updates the first model and the second model based on the optimal allocation result;
the first submodule determines a first target predicted value corresponding to the resource to be allocated based on the resource to be allocated and the updated first model;
and the second submodule determines a second target predicted value corresponding to the resource to be allocated based on the resource to be allocated and the updated second model.
Further, the training module 10 is further configured to:
training a first initial prediction model based on the first sample set, the first initial prediction model being taken as the first model when the first initial prediction model converges;
training a second initial prediction model based on the second sample set, and taking the second initial prediction model as the second model when the second initial prediction model converges.
In addition, an embodiment of the present invention further provides a readable storage medium, where a resource allocation program is stored on the readable storage medium, and the resource allocation program, when executed by a processor, implements the steps of the resource allocation method in the foregoing embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, 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 process, method, article, or system. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a readable storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, and includes several instructions for enabling a system device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (8)
1. A resource allocation method is characterized in that the resource allocation method comprises the following steps:
performing model training based on a training sample to obtain a first model and a second model;
determining an objective function corresponding to the resource to be allocated and a constraint condition corresponding to the resource to be allocated based on the first model and the second model;
obtaining a first predicted value corresponding to the resource to be allocated based on the first model, and obtaining a second predicted value corresponding to the resource to be allocated based on the second model, wherein the integer programming algorithm comprises a 0-1 integer programming algorithm;
inputting the first predicted value, the second predicted value, the target function and the constraint condition into the 0-1 integer programming algorithm, and calculating based on the first predicted value and the target function to obtain an allocation result summary table corresponding to the resource to be allocated;
searching the distribution result summary table based on the second predicted value and the constraint condition to obtain an optional distribution result list meeting the constraint condition;
and inputting the data in the optional distribution result list into the objective function, comparing the output data of the objective function, and determining the optimal distribution result according to the comparison result.
2. The method of claim 1, wherein the step of determining the objective function corresponding to the resource to be allocated and the constraint condition corresponding to the resource to be allocated based on the first model and the second model comprises:
acquiring a preset target function and constraint condition relation table;
and acquiring the objective function and the constraint condition from the objective function and constraint condition relation table according to the first model and the second model.
3. The method for allocating resources according to claim 1, wherein the step of obtaining a first predicted value corresponding to the resources to be allocated based on the first model and obtaining a second predicted value corresponding to the resources to be allocated based on the second model comprises:
acquiring a configuration relation table corresponding to the resources to be allocated;
determining the first predicted value based on the configuration relationship table and the first model;
determining the second predicted value based on the configuration relationship table and the second model.
4. The resource allocation method according to any one of claims 1 to 3, wherein the step of determining the optimal allocation result corresponding to the resource to be allocated based on the first predicted value, the second predicted value, the objective function, the constraint condition and an integer programming algorithm is followed by:
updating the first model and the second model based on the optimal allocation result;
determining a first target predicted value corresponding to the resource to be allocated based on the resource to be allocated and the updated first model;
and determining a second target predicted value corresponding to the resource to be allocated based on the resource to be allocated and the updated second model.
5. The method of claim 1, wherein the training samples comprise a first sample set and a second sample set, and the step of performing model training based on the training samples to obtain the first model and the second model comprises:
training a first initial prediction model based on the first sample set, the first initial prediction model being taken as the first model when the first initial prediction model converges;
training a second initial prediction model based on the second sample set, and taking the second initial prediction model as the second model when the second initial prediction model converges.
6. A resource allocation apparatus, characterized in that the resource allocation apparatus comprises:
the training module is used for carrying out model training based on a training sample to obtain a first model and a second model;
a determining module, configured to determine, based on the first model and the second model, an objective function corresponding to a resource to be allocated and a constraint condition corresponding to the resource to be allocated;
the calculation module is used for obtaining a first predicted value corresponding to the resource to be distributed based on the first model and obtaining a second predicted value corresponding to the resource to be distributed based on the second model, and the integer programming algorithm comprises a 0-1 integer programming algorithm;
the processing module is used for inputting the first predicted value, the second predicted value, the target function and the constraint condition into the 0-1 integer programming algorithm, and obtaining an allocation result summary table corresponding to the resources to be allocated through calculation based on the first predicted value and the target function; searching the distribution result summary table based on the second predicted value and the constraint condition to obtain an optional distribution result list meeting the constraint condition; and inputting the data in the optional distribution result list into the objective function, comparing the output data of the objective function, and determining the optimal distribution result according to the comparison result.
7. A terminal, characterized in that the terminal comprises: memory, processor and a resource allocation program stored on the memory and executable on the processor, the resource allocation program when executed by the processor implementing the steps of the resource allocation method according to any one of claims 1 to 5.
8. A readable storage medium, having stored thereon a resource allocation program which, when executed by a processor, implements the steps of the resource allocation method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911007764.2A CN110730101B (en) | 2019-10-22 | 2019-10-22 | Resource allocation method, terminal, device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911007764.2A CN110730101B (en) | 2019-10-22 | 2019-10-22 | Resource allocation method, terminal, device and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110730101A CN110730101A (en) | 2020-01-24 |
CN110730101B true CN110730101B (en) | 2023-04-07 |
Family
ID=69222779
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911007764.2A Active CN110730101B (en) | 2019-10-22 | 2019-10-22 | Resource allocation method, terminal, device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110730101B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111310933B (en) * | 2020-02-11 | 2024-02-02 | 深圳前海微众银行股份有限公司 | Feature dependency graph calculation optimization method, device, equipment and readable storage medium |
CN111724037B (en) * | 2020-05-21 | 2024-03-05 | 口碑(上海)信息技术有限公司 | Method and device for allocating operation resources, computer equipment and readable storage medium |
CN113780699B (en) * | 2020-06-17 | 2024-07-19 | 北京沃东天骏信息技术有限公司 | Resource allocation method, resource allocation device and electronic equipment |
CN113191546A (en) * | 2021-04-29 | 2021-07-30 | 远光软件股份有限公司 | Resource allocation prediction method, resource management device and storage medium |
CN117217644B (en) * | 2023-11-06 | 2024-01-12 | 华清科盛(北京)信息技术有限公司 | Resource allocation method and device for logistics operation task |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8359223B2 (en) * | 2010-07-20 | 2013-01-22 | Nec Laboratories America, Inc. | Intelligent management of virtualized resources for cloud database systems |
CN107798410B (en) * | 2016-09-05 | 2021-09-03 | 阿里巴巴集团控股有限公司 | Method and device for product planning and electronic equipment |
TWI650714B (en) * | 2018-01-19 | 2019-02-11 | 財團法人工業技術研究院 | Dynamic intelligent scheduling method and device |
CN108924221B (en) * | 2018-06-29 | 2020-08-25 | 华为技术有限公司 | Method and device for allocating resources |
CN110086650B (en) * | 2019-03-20 | 2020-07-10 | 武汉大学 | Cloud resource online scheduling method and device for distributed machine learning task |
US11396103B2 (en) * | 2020-03-10 | 2022-07-26 | Samsung Electronics Co., Ltd. | Method and apparatus for manipulating a tool to control in-grasp sliding of an object held by the tool |
-
2019
- 2019-10-22 CN CN201911007764.2A patent/CN110730101B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110730101A (en) | 2020-01-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110730101B (en) | Resource allocation method, terminal, device and readable storage medium | |
US10360517B2 (en) | Distributed hyperparameter tuning system for machine learning | |
US9336493B2 (en) | Systems and methods for clustering time series data based on forecast distributions | |
US7885848B2 (en) | Resource optimization system, method and computer program for business transformation outsourcing with reoptimization on demand | |
CN112540849B (en) | Parameter configuration optimization method and system for distributed computing operation | |
CN113037877B (en) | Optimization method for time-space data and resource scheduling under cloud edge architecture | |
US20070299835A1 (en) | Search engine for software components and a search program for software components | |
CN110322143B (en) | Model materialization management method, device, equipment and computer storage medium | |
CN106095582A (en) | The task executing method of cloud platform | |
CN110362611A (en) | A kind of data base query method, device, electronic equipment and storage medium | |
CN111626497B (en) | People flow prediction method, device, equipment and storage medium | |
CN115220882A (en) | Data processing method and device | |
CN113191533A (en) | Warehouse employment prediction method, device, equipment and storage medium | |
CN112784212B (en) | Inventory optimization method and device | |
CN115640278A (en) | Method and system for intelligently optimizing database performance | |
CN117687774A (en) | Task model training method for computing power scheduling and computing power scheduling method and system | |
CN112860736A (en) | Big data query optimization method and device and readable storage medium | |
CN113205128A (en) | Distributed deep learning performance guarantee method based on serverless computing | |
CN116578924A (en) | Network task optimization method and system for machine learning classification | |
CN112214521A (en) | Rule query method, device, equipment and computer storage medium | |
CN116361546A (en) | Method and device for processing search request, electronic equipment and storage medium | |
CN112769942B (en) | QoS-based micro-service dynamic arranging method | |
CN113256192B (en) | Warehouse article planning method and device | |
CN113591979A (en) | Industry category identification method, equipment, medium and computer program product | |
CN113612777A (en) | Training method, traffic classification method, device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |