CN116933908A - Computer task processing method and related equipment thereof - Google Patents

Computer task processing method and related equipment thereof Download PDF

Info

Publication number
CN116933908A
CN116933908A CN202210333041.7A CN202210333041A CN116933908A CN 116933908 A CN116933908 A CN 116933908A CN 202210333041 A CN202210333041 A CN 202210333041A CN 116933908 A CN116933908 A CN 116933908A
Authority
CN
China
Prior art keywords
integer programming
mixed integer
equation
programming equation
operator
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.)
Pending
Application number
CN202210333041.7A
Other languages
Chinese (zh)
Inventor
陆梦
甄慧玲
李希君
朱方舟
袁明轩
曾嘉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210333041.7A priority Critical patent/CN116933908A/en
Priority to PCT/CN2023/084027 priority patent/WO2023185714A1/en
Publication of CN116933908A publication Critical patent/CN116933908A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/04Manufacturing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Development Economics (AREA)
  • Quality & Reliability (AREA)
  • Game Theory and Decision Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Optimization (AREA)
  • Geometry (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Educational Administration (AREA)
  • Manufacturing & Machinery (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a computer task processing method and related equipment, which are applied to the technical field of computers, can effectively reduce the time consumed in the equation preprocessing process and improve the performance of an equation solving process. The method of the application comprises the following steps: after the mixed integer programming equation describing the task to be processed is obtained, structure identification may be performed on the mixed integer programming equation, thereby obtaining information related to the structure of the mixed integer programming equation. Then, at least one operator for realizing preprocessing can be selected from the operator resource pool based on the information, and the selected part of operators are target operators. Then, preprocessing (presolve) for the mixed integer programming equation can be realized based on the target operator, and the preprocessed mixed integer programming equation is solved to obtain a corresponding solution, wherein the solution can be used as a processing result of the task.

Description

Computer task processing method and related equipment thereof
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method for processing a computer task and related devices thereof.
Background
Many practical problems faced in many fields can be addressed with mixed integer programming, which typically includes both linear programming and nonlinear programming. For example, a task to be processed is set to obtain a production plan of a factory, and the generation plan needs to meet the goals of maximizing the demand of the factory, minimizing the total cost of the factory, and the like, and also needs to meet the hard constraint and the soft constraint specified by an actual business scene, and the mathematical model abstracted according to the demand required to be met by the production plan can be simplified into a corresponding linear programming equation. Then, by solving the linear programming equation, the production plan for the plant can be obtained.
Because the data volume involved in the mixed integer programming equation is often huge, for example, the scale of the variable and constraint matrix in the mixed integer programming equation is usually over millions or even tens of millions, the mixed integer programming equation can be preprocessed (presolve) by using a solver provided by the related technology, so that the scale of the variable and constraint matrix in the equation is reduced, the preprocessed (simplified) mixed integer programming equation is obtained, and then the preprocessed mixed integer programming equation is solved, so that the difficulty in solving the equation can be reduced.
In the solver, a plurality of operators for implementing preprocessing are provided, so the solver can execute all operators on the mixed integer programming equation according to a certain sequence to implement preprocessing of the mixed integer programming equation. However, different mixed integer programming equations may be used to describe the task to be processed in different fields, and some mixed integer programming equations may not require all operators to implement preprocessing, so that the existing solver considers a relatively single factor in the preprocessing process, resulting in excessive time consumed by the preprocessing process.
Disclosure of Invention
The embodiment of the application provides a computer task processing method and related equipment thereof, which can effectively reduce the time consumed in the equation preprocessing process and improve the performance of an equation solving process.
A first aspect of an embodiment of the present application provides a method for processing a computer task, including:
when a task needs to be processed, a mixed integer programming equation (mixed integer programming refers to that in some programming problems, elements in variables can be either integers or non-integers) describing the task to be processed can be obtained, and the mixed integer programming equation generally comprises two general types of equations, namely a linear programming equation and a non-linear programming equation. For example, the task to be processed is set as a production plan to be solved of a certain factory in the field of supply chain, and the production plan to be solved needs to meet not only the targets of maximizing the demand of the factory and minimizing the total cost of the factory, but also the hard constraint and the soft constraint specified by the actual business scene. Then, according to the production plan to be solved and the mathematical model abstracted out by the requirement to be satisfied by the production plan to be solved, the mathematical model can be simplified into a corresponding linear programming equation. As variables in the equation, the production plan to be solved is typically presented in the form of vectors, so the elements contained in the production plan to be solved may be integers or non-integers. For example, the production plan to be solved contains 10 elements, the 1 st element representing the number of raw materials to be produced by the plant on day 1 and the 2 nd element representing the number of raw materials to be produced by the plant on day 2..10 th element representing the number of raw materials to be produced by the plant on day 10. So that the values of these elements may be either integers (e.g., 1 ton of raw materials to be produced by the plant on day 1) or non-integers (e.g., 0.5 tons of raw materials to be produced by the plant on day 2).
After the mixed integer programming equation is obtained, structure identification can be performed on the mixed integer programming equation, so that information related to the structure of the mixed integer programming equation is obtained and used for indicating the structure of the mixed integer programming equation. Notably, the operation of structure identification is focused mainly on analyzing the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation to determine the structural composition of the mixed integer programming equation, so that the obtained information related to the structure of the mixed integer programming equation is associated with at least one of the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation.
After obtaining information related to the structure of the mixed integer programming equation, a target operator may be determined from the operator resource pool based on the information. It should be noted that the operator resource pool provides a plurality of optional operators, so that at least one operator for implementing preprocessing on the mixed integer programming equation can be selected from the operator resource pool according to the information related to the structure of the mixed integer programming equation, and the selected part of operators are target operators.
After the target operator is determined, preprocessing (presolve) for the mixed integer programming equation can be achieved based on the target operator, so that a preprocessed mixed integer programming equation is obtained.
The pre-processed mixed integer programming equation is obtained, and the pre-processed mixed integer programming equation can be solved to obtain a corresponding solution, and the solution can be used as a processing result of the task (for example, a solved production plan of a certain factory).
From the above method, it can be seen that: after obtaining the mixed integer programming equation describing the task to be processed, a target operator may be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation, the information related to at least one of: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. Finally, the mixed integer programming equation after pretreatment can be solved, and the obtained solution can be used as a task processing result. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., to which type of mixed integer programming equation the mixed integer programming equation belongs (for describing tasks of a specific class), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of an equation solving process.
In one possible implementation, since the information related to the structure of the mixed-integer programming equation is associated with at least one of a variable of the mixed-integer programming equation and a constraint matrix of the mixed-integer programming equation, the information related to the structure of the mixed-integer programming equation may include at least one of: (1) The dimensions of the variables of the mixed integer programming equation, i.e., the number of elements contained in the variables of the mixed integer programming equation. (2) Sparsity of constraint matrix of the mixed integer programming equation, that is, the number of elements with zero value in constraint matrix of the mixed integer programming equation. (3) The block information of the constraint matrix of the mixed integer programming equation is used for indicating that the element contained in the constraint matrix of the mixed integer programming equation is zero, namely the block information is used for indicating that the element in a certain region (a plurality of regions) in the constraint matrix of the mixed integer programming equation is zero. (4) The method comprises the steps that a row with a calculation relation with a variable of a mixed integer programming equation exists in a constraint matrix of the mixed integer programming equation, each row in the constraint matrix of the mixed integer programming equation is multiplied by the variable of the mixed integer programming equation, if (all elements of) a certain row in the constraint matrix of the mixed integer programming equation are zero, the row is not in the calculation relation with the variable of the mixed integer programming equation, and if (any element of) the certain row in the constraint matrix of the mixed integer programming equation is not zero, the row is in the calculation relation with the variable of the mixed integer programming equation.
In one possible implementation, determining the target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation includes: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; in the operator resource pool, an operator used for preprocessing of a preset equation is determined as a target operator. In the foregoing implementation, the equation resource pool contains a plurality of preset equations with different structures (may also be understood as equation templates with different structures set in advance), and the information related to the structures of the mixed integer programming equations is used to indicate the structure types of the mixed integer programming equations, so, as compared with traversing in the equation resource pool, the preset equations matched with the information related to the structures of the mixed integer programming equations are found, then, the preset equations and the mixed integer programming equations are two equations with similar or identical structures. After determining the preset equation that is structurally similar or identical to the mixed integer programming equation, since the preset equation is set in advance, it is possible to determine which operators in the operator resource pool are used in the preprocessing for the preset equation, and determine this part of operators as the operators for implementing the preprocessing of the mixed integer programming equation, that is, the target operators. It can be seen that, after determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, the embodiment of the application provides an equation resource pool, that is, a certain preset equation (which may also be referred to as a certain equation template in the equation resource pool) in the equation resource pool, an operator used for preprocessing the preset equation may be used as an operator used for preprocessing the mixed integer programming equation, so as to reduce the influence of human intervention on the preprocessing, thereby optimizing the preprocessing effect of the equation.
In one possible implementation manner, in preprocessing a mixed integer programming equation, the number of target operators is n, the number of iterations of the n target operators is k, n and k are integers greater than or equal to 1, preprocessing the mixed integer programming equation based on the target operators, and obtaining the preprocessed mixed integer programming equation includes: in the jth iteration of the n target operators, before the ith operator is executed on the updated mixed integer programming equation, whether the sum of the indexes of the ith target operator in the 1 st iteration and the indexes of the ith target operator in the j-1 st iteration is smaller than a first threshold value (the first threshold value is generally determined based on the iteration number k, generally increases with the increase of the iteration number k, namely, the two are in positive correlation relation) can be detected. Where i=1, …, n, j=1, …, k. If the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 st iteration is smaller than the first threshold, which means that the ith target operator needs to be continuously executed after that, further detecting whether the index of the ith target operator in the j-1 st iteration is smaller than the second threshold (the second threshold is generally determined based on the iteration number k, and generally increases with the increase of the iteration number k, that is, the two are in positive correlation). If the sum of the indexes of the ith target operator in the 1 st iteration to the indexes of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold value, indicating that the ith target operator does not need to be continuously executed any more, skipping the ith target operator in the j-1 th iteration. If the index of the ith target operator in the j-1 th iteration is smaller than the second threshold, the ith target operator can be executed currently, and the index of the ith target operator in the j-1 th iteration is generated. Notably, the index of the ith target operator in the jth iteration may be generated by: first, the duty ratio of the deleted row in the updated mixed integer programming equation in the 1 st iteration to the j-th iteration is determined for the ith target operator. Then, calculation is performed based on the duty ratio, so that an index of the ith target operator in the jth iteration is obtained. If the index of the ith target operator in the j-1 th iteration is greater than or equal to a second threshold value, indicating that the ith operator cannot be executed currently, jumping to the (i+1) th target operator, and executing the steps on the (i+1) th target operator until the j-th iteration of the n target operators is completed. And continuously executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation. In the foregoing implementation, the preprocessing procedure is implemented with a certain iteration strategy, that is, in the iteration procedure, when the effect exerted by an operator becomes smaller, the benefit of the operator for continuing to execute in the subsequent iteration is considered to be limited, and execution of the operator is stopped in time. Also, for the cycle of preprocessing, a corresponding stopping mechanism is also designed. Therefore, the mixed integer programming equation can be effectively simplified, and unnecessary preprocessing flow can be reduced, so that the time cost of preprocessing is reduced.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation. Further, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the execution order of the n target operators is the same. In the foregoing implementation manner, after determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, that is, one preset equation in the equation resource pool, the operator iteration number and the operator execution sequence used for preprocessing the preset equation may be used as the operator iteration number and the operator execution sequence used for preprocessing the mixed integer programming equation, so as to reduce the influence of human intervention on the preprocessing, thereby optimizing the preprocessing effect of the equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty ratio of the rows deleted by the ith target operator in the mixed integer programming equation; further, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the method further includes, before preprocessing the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation: combining the rows of the multiple relations in the constraint matrix, or setting the columns of the multiple relations in the constraint matrix into the same columns to obtain a redundancy-removed constraint matrix; updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; preprocessing the mixed integer programming equation based on the target operator, wherein the obtaining the preprocessed mixed integer programming equation comprises the following steps: and preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation. In the foregoing implementation manner, in order to implement better preprocessing, the mixed integer programming equation may be subjected to redundancy removing operation in advance, where the operation may be any one of the following three cases: (1) In the constraint matrix of the mixed integer programming equation, the rows with the multiple relation can be determined in a certain mode, and the rows are combined to obtain the constraint matrix after the combination. In the constraint matrix after the rows are combined, the columns with the multiple relation can be determined in the same way, and the columns are set to be the same columns, so that the constraint matrix after redundancy removal is obtained. (2) In the constraint matrix of the mixed integer programming equation, the rows with the multiple relation can be determined in a certain mode, and the rows are combined to obtain the constraint matrix after redundancy elimination. (3) In the constraint matrix of the mixed integer programming equation, the columns with the multiple relation can be determined in a certain mode, and the columns are set to be the same columns, so that the constraint matrix after redundancy removal is obtained. After the constraint matrix after redundancy removal is obtained based on the redundancy removal operation, the original mixed integer programming equation can be updated after the constraint matrix after redundancy removal, and the updated mixed integer programming equation is obtained. In this way, the preprocessed object is transformed from the original mixed integer programming equation to the updated mixed integer programming equation, so that the preprocessing effect can be optimized.
A second aspect of an embodiment of the present application provides a production plan acquisition method, including: acquiring a mixed integer programming equation, wherein the mixed integer programming equation is used for describing a production plan to be solved; determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation to obtain a solved production plan.
From the above method, it can be seen that: after obtaining the mixed integer programming equation describing the production plan to be solved, a target operator may be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation, the information related to at least one of: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. And finally, solving the preprocessed mixed integer programming equation to obtain a solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., which type of mixed integer programming equation the mixed integer programming equation belongs to (for solving production plans of factories and enterprises in the supply chain field), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of the equation solving process.
In one possible implementation, the variables of the mixed integer programming equation are the production plan to be solved, and the constraint matrix of the mixed integer programming equation comprises at least one of: the production plan to be solved is required to meet processing constraints such as material constraints, productivity constraints, time constraints or traffic constraints, wherein the material constraints can comprise an upper limit of materials and material proportions which can be used in production, the productivity constraints can comprise an upper limit of the number of production workers and the work efficiency which are required in production, the time constraints can comprise the delivery date of products, the traffic constraints can comprise an upper limit of traffic cost required in production and an upper limit of the number of vehicles required in production, and the like.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the dimension of the variable, the sparsity of the constraint matrix, the blocking information of the constraint matrix or the rows in the constraint matrix with the calculation relation with the variable, wherein the blocking information is used for indicating the submatrices with zero elements contained in the constraint matrix.
In one possible implementation, determining the target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation includes: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; and determining an operator corresponding to the preprocessing of the preset equation as a target operator in the operator resource pool.
In one possible implementation manner, in preprocessing a mixed integer programming equation, the number of target operators is n, the number of iterations of the n target operators is k, n and k are integers greater than or equal to 1, preprocessing the mixed integer programming equation based on the target operators, and obtaining the preprocessed mixed integer programming equation includes: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum is smaller than the first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than the second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the method further includes, before preprocessing the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation: combining the rows of the multiple relations in the constraint matrix, or setting the columns of the multiple relations in the constraint matrix into the same columns to obtain a redundancy-removed constraint matrix; updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; preprocessing the mixed integer programming equation based on the target operator, wherein the obtaining the preprocessed mixed integer programming equation comprises the following steps: and preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
A third aspect of the embodiment of the present application provides a power grid dispatching method, including: acquiring a mixed integer programming equation, wherein the mixed integer programming equation is used for describing a power consumption scheduling plan to be solved; determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation to obtain a solved power consumption scheduling plan.
A fourth aspect of an embodiment of the present application provides a method for central location, including: acquiring a mixed integer programming equation, wherein the mixed integer programming equation is used for describing an address selection plan to be solved; determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation to obtain a solved address selection plan.
A fifth aspect of an embodiment of the present application provides a computer task processing device, including: the acquisition module is used for acquiring a mixed integer programming equation, wherein the mixed integer programming equation is used for describing a task to be processed; the determining module is used for determining a target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; the preprocessing module is used for preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; and the solving module is used for solving the preprocessed mixed integer programming equation, and the obtained solution is used as a task processing result.
From the above device, it can be seen that: after obtaining the mixed integer programming equation describing the task to be processed, a target operator may be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation, the information related to at least one of: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. Finally, the mixed integer programming equation after pretreatment can be solved, and the obtained solution can be used as a task processing result. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., to which type of mixed integer programming equation the mixed integer programming equation belongs (for describing tasks of a specific class), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of an equation solving process.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the method comprises the steps of dimension of variables, sparsity of constraint matrixes, blocking information of the constraint matrixes and rows in the constraint matrixes, wherein the rows have a calculation relation with the variables, and the blocking information is used for indicating sub-matrixes with zero elements contained in the constraint matrixes.
In one possible implementation, the determining module is configured to: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; in the operator resource pool, an operator used for preprocessing of a preset equation is determined as a target operator.
In one possible implementation manner, in preprocessing for the mixed integer programming equation, the number of target operators is n, and the number of iterations of the n target operators is k, where n and k are integers greater than or equal to 1, and the preprocessing module is configured to: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum of the index of the ith target operator in the 1 st iteration and the index of the ith target operator in the j-1 th iteration is smaller than a first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than a second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the apparatus further includes: the redundancy elimination module is used for merging the rows with the multiple relations in the constraint matrix or setting the columns with the multiple relations in the constraint matrix into the same columns to obtain a constraint matrix with redundancy elimination; the updating module is used for updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; and the preprocessing module is used for preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
A sixth aspect of the embodiments of the present application provides a production plan acquisition apparatus including: the system comprises an acquisition module, a calculation module and a calculation module, wherein the acquisition module is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a production plan to be solved in the field of supply chains; the determining module is used for determining a target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; the preprocessing module is used for preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; and the solving module is used for solving the preprocessed mixed integer programming equation to obtain a solved production plan.
From the above device, it can be seen that: after obtaining the mixed integer programming equation describing the production plan to be solved, a target operator may be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation, the information related to at least one of: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. And finally, solving the preprocessed mixed integer programming equation to obtain a solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., which type of mixed integer programming equation the mixed integer programming equation belongs to (for solving production plans of factories and enterprises in the supply chain field), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of the equation solving process.
In one possible implementation, the variables of the mixed integer programming equation are the production plan to be solved, and the constraint matrix of the mixed integer programming equation comprises at least one of: the production plan to be solved is required to meet material constraints, productivity constraints, time constraints or traffic constraints.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the dimension of the variable, the sparsity of the constraint matrix, the blocking information of the constraint matrix or the rows in the constraint matrix with the calculation relation with the variable, wherein the blocking information is used for indicating the submatrices with zero elements contained in the constraint matrix.
In one possible implementation, the determining module is configured to: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; and determining an operator corresponding to the preprocessing of the preset equation as a target operator in the operator resource pool.
In one possible implementation manner, in preprocessing for the mixed integer programming equation, the number of target operators is n, and the number of iterations of the n target operators is k, where n and k are integers greater than or equal to 1, and the preprocessing module is configured to: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum is smaller than the first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than the second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the apparatus further includes: the redundancy elimination module is used for merging the rows with the multiple relations in the constraint matrix or setting the columns with the multiple relations in the constraint matrix into the same columns to obtain a constraint matrix with redundancy elimination; the updating module is used for updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; and the preprocessing module is used for preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
A seventh aspect of the embodiments of the present application provides a power grid dispatching apparatus, including: the system comprises an acquisition module, a calculation module and a calculation module, wherein the acquisition module is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a power consumption scheduling plan to be solved; the determining module is used for determining a target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; the preprocessing module is used for preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; and the solving module is used for solving the preprocessed mixed integer programming equation to obtain a solved power consumption scheduling plan.
An eighth aspect of the embodiment of the present application provides a center location method, where the apparatus includes: the system comprises an acquisition module, a calculation module and a calculation module, wherein the acquisition module is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing an address selection plan to be solved; the determining module is used for determining a target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; the preprocessing module is used for preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; and the solving module is used for solving the preprocessed mixed integer programming equation to obtain a solved address selection plan.
A ninth aspect of an embodiment of the present application provides a computer task processing device, including: the device comprises a processor, a memory, a bus and input and output equipment, wherein the processor is connected with the memory and the input and output equipment, and the bus is respectively connected with the processor, the memory and the input and output equipment; the input/output equipment is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a task to be processed; the memory stores an operator resource pool; the processor is used for: acquiring an operator resource pool from a memory, and determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation, wherein the obtained solution is used as a task processing result.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the method comprises the steps of mixing the dimension of a variable of an integer programming equation, the sparseness of a constraint matrix of the integer programming equation, blocking information of the constraint matrix or rows, which have a calculation relation with the variable, in the constraint matrix, wherein the blocking information is used for indicating a submatrix with zero elements contained in the constraint matrix.
In one possible implementation, the processor is configured to: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; and determining an operator corresponding to the preprocessing of the preset equation as a target operator in the operator resource pool.
In one possible implementation, in the preprocessing for the mixed integer programming equation, the number of target operators is n, and the number of iterations of the n target operators is k, where n and k are integers greater than or equal to 1, and the processor is configured to: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum is smaller than the first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than the second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the processor is further configured to: combining the rows of the multiple relations in the constraint matrix, or setting the columns of the multiple relations in the constraint matrix into the same columns to obtain a redundancy-removed constraint matrix; updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; a processor for: and preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
A tenth aspect of the embodiment of the present application provides a production plan acquisition apparatus including: the device comprises a processor, a memory, a bus and input and output equipment, wherein the processor is connected with the memory and the input and output equipment, and the bus is respectively connected with the processor, the memory and the input and output equipment; the input-output equipment is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a production plan to be solved in the field of supply chains; the memory stores an operator resource pool; the processor is used for: acquiring an operator resource pool from a memory, and determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation to obtain a solved production plan.
In one possible implementation, the variables of the mixed integer programming equation are the production plan to be solved, and the constraint matrix of the mixed integer programming equation comprises at least one of: the production plan to be solved is required to meet material constraints, productivity constraints, time constraints or traffic constraints.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the method comprises the steps of mixing the dimension of a variable of an integer programming equation, the sparseness of a constraint matrix of the integer programming equation, blocking information of the constraint matrix or rows, which have a calculation relation with the variable, in the constraint matrix, wherein the blocking information is used for indicating a submatrix with zero elements contained in the constraint matrix.
In one possible implementation, the processor is configured to: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; and determining an operator corresponding to the preprocessing of the preset equation as a target operator in the operator resource pool.
In one possible implementation, in the preprocessing for the mixed integer programming equation, the number of target operators is n, and the number of iterations of the n target operators is k, where n and k are integers greater than or equal to 1, and the processor is configured to: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum is smaller than the first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than the second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the processor is further configured to: combining the rows of the multiple relations in the constraint matrix, or setting the columns of the multiple relations in the constraint matrix into the same columns to obtain a redundancy-removed constraint matrix; updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; a processor for: and preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
An eleventh aspect of the embodiment of the present application provides a power grid dispatching apparatus, including: the device comprises a processor, a memory, a bus and input and output equipment, wherein the processor is connected with the memory and the input and output equipment, and the bus is respectively connected with the processor, the memory and the input and output equipment; the input and output equipment is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a power consumption scheduling plan to be solved in the power field; the memory stores an operator resource pool; the processor is used for: acquiring an operator resource pool from a memory, and determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation to obtain the solved power consumption schedule.
A twelfth aspect of an embodiment of the present application provides a central location apparatus, including: the device comprises a processor, a memory, a bus and input and output equipment, wherein the processor is connected with the memory and the input and output equipment, and the bus is respectively connected with the processor, the memory and the input and output equipment; the input and output equipment is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing an address selection plan to be solved in the cloud technical field; the memory stores an operator resource pool; the processor is used for: acquiring an operator resource pool from a memory, and determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool; preprocessing the mixed integer programming equation based on a target operator to obtain a preprocessed mixed integer programming equation; and solving the preprocessed mixed integer programming equation to obtain a solved address selection plan.
A thirteenth aspect of the embodiments of the present application provides a computer storage medium storing a computer program which, when executed by a computer, causes the computer to carry out a method according to the first aspect, any one of the possible implementations of the first aspect, the second aspect or any one of the possible implementations of the second aspect.
A fourteenth aspect of embodiments of the application provides a computer program product storing instructions which, when executed by a computer, cause the computer to carry out the method according to the first aspect, any one of the possible implementations of the first aspect, the second aspect or any one of the possible implementations of the second aspect.
In the embodiment of the application, after the mixed integer programming equation for describing the task to be processed is acquired, a target operator can be determined in an operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the information is related to at least one of the following: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. Finally, the mixed integer programming equation after pretreatment can be solved, and the obtained solution can be used as a task processing result. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., to which type of mixed integer programming equation the mixed integer programming equation belongs (for describing tasks of a specific class), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of an equation solving process.
Drawings
FIG. 1 is a schematic diagram of a task processing system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another architecture of a task processing system according to an embodiment of the present application;
fig. 3a shows an exemplary structural diagram of a terminal device 300;
FIG. 3b is a schematic diagram of a solver according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a method for processing a computer task according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of preprocessing according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an application of a method for processing a task of a computer according to an embodiment of the present application;
FIG. 7 is a schematic diagram of the material assembly relationship in the production process according to the embodiment of the present application;
FIG. 8 is a schematic diagram of a comparison result provided by an embodiment of the present application;
FIG. 9 is a schematic diagram of a task processing device according to an embodiment of the present application;
fig. 10 is a schematic structural view of a production plan acquiring apparatus according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a computer task processing method and related equipment thereof, which can effectively reduce the time consumed in the equation preprocessing process and improve the performance of an equation solving process.
The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely illustrative of the manner in which embodiments of the application have been described in connection with the description of the objects having the same attributes. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Many practical problems faced in many fields can be addressed with mixed integer programming, which typically includes both linear programming and nonlinear programming. For example, a task to be processed is set to obtain a production plan of a factory, and the generation plan needs to meet the goals of maximizing the demand of the factory, minimizing the total cost of the factory, and the like, and also needs to meet the hard constraint and the soft constraint specified by an actual business scene, and the mathematical model abstracted according to the demand required to be met by the production plan can be simplified into a corresponding linear programming equation. Then, by solving the linear programming equation, the production plan for the plant can be obtained.
Because the data volume involved in the mixed integer programming equation itself is often huge, for example, the scale of the variables and the constraint matrix in the mixed integer programming equation (i.e., the number of elements in the variables and the constraint matrix) is often over a million order, even up to a ten-million order, etc., the mixed integer programming equation can be preprocessed (presolve) by using a solver provided by the related technology, so as to reduce the scale of the variables and the constraint matrix in the equation, thereby obtaining a preprocessed (simplified) mixed integer programming equation, and then solving the preprocessed mixed integer programming equation, thereby obtaining a corresponding solution. Based on the solving mode, the difficulty of solving the mixed integer programming equation can be effectively reduced.
In the solver, a plurality of operators for implementing preprocessing are provided, so the solver can execute all operators on the mixed integer programming equation according to a certain sequence to implement preprocessing of the mixed integer programming equation. However, different mixed integer programming equations may be used to describe tasks to be processed in different fields, some mixed integer programming equations may not need to use all operators to implement preprocessing, i.e., some mixed integer programming equations require a relatively large number of operators when implementing preprocessing, and some mixed integer programming equations require a relatively small number of operators when implementing preprocessing, so that in the process of preprocessing the mixed integer programming equations, the factors considered by the existing solver are relatively single, resulting in excessive time consumed by the preprocessing process.
Further, when a solver executes a plurality of operators on a mixed integer programming equation, the solver is typically looped multiple times, and the number of iterations of the operators is typically set by human beings. However, the manual setting often depends on expert experience, and different mixed integer programming equations may be used to describe the task to be processed in different fields, and for different mixed integer programming equations, the iteration number of the operator is often set manually, which is often not accurate enough, resulting in an insufficient preprocessing effect of the equation.
In order to solve the above problems, the embodiment of the present application provides a computer task processing method (which may also be considered as providing a new solver), and the method is improved to a certain extent on the solver of the related art, so that a mixed integer programming equation (including a linear programming equation and a nonlinear programming equation) for describing tasks in different fields can be preprocessed and solved in a good quality, so as to obtain a task processing result. The method provided by the embodiment of the application can be applied to various scenes, and the application scenes of the method are respectively described below:
fig. 1 is a schematic structural diagram of a computer task processing system according to an embodiment of the present application, where the computer task processing system includes a user device and a data processing device. The user equipment comprises intelligent terminals such as a mobile phone, a personal computer or an information processing center. The user equipment is an initiator of data sequence processing, and is used as an initiator of data sequence processing request, and the user usually initiates the request through the user equipment.
The data processing device may be a device or a server having a data processing function, such as a cloud server, a web server, an application server, and a management server. The data processing equipment receives a task processing request from the intelligent terminal through the interactive interface, abstracts the task into a mixed data planning equation through a memory for storing data and a processor link for data processing, and performs task processing in the forms of equation preprocessing, solving and the like. The memory in the data processing device may be a generic term comprising a database storing the history data locally, either on the data processing device or on another network server.
In the computer task processing system shown in fig. 1, the user device may receive an instruction from a user, for example, the user device may obtain a task input/selected by the user, and then initiate a request (typically including various parameters of the task, for example, variables of the task and various constraints to be satisfied by the task, etc.) to the data processing device, so that the data processing device executes a task processing application for the task obtained by the user device, thereby obtaining a processing result for the task. The user equipment may acquire a task and related parameters of the task, and then initiate a processing request of the task to the data processing equipment, so that the data processing equipment abstracts the task into a mixed integer equation, performs preprocessing on the mixed integer equation, and then solves the preprocessed mixed integer equation, thereby obtaining a corresponding solution, and the solution can be used as a processing result of the task.
In fig. 1, a data processing apparatus may execute a computer task processing method or a production plan acquisition method of an embodiment of the present application.
Fig. 2 is another schematic structural diagram of a computer task processing system according to an embodiment of the present application, in fig. 2, a user device directly serves as a data processing device, and the user device can directly obtain an input from a user and directly process the input by hardware of the user device, and a specific process is similar to that of fig. 1, and reference is made to the above description and will not be repeated here.
In the computer task processing system shown in fig. 2, the user device may receive an instruction of a user, for example, the user device may obtain a task selected by the user in the user device, and then the user device itself executes a task processing application (for example, abstract generation of text) for the task, that is, abstracts the task into a mixed integer equation, performs preprocessing on the mixed integer equation, and then solves the preprocessed mixed integer equation, so as to obtain a corresponding solution, which may be used as a processing result of the task.
In fig. 2, the user equipment itself may execute the computer task processing method or the production plan acquisition method according to the embodiment of the present application.
Further, for the user equipment in fig. 1 and 2, it may be a terminal device used by a user, for example, a mobile phone, a notebook, a personal computer, or the like. To facilitate understanding of the terminal device used by the user, the terminal device is further described below in conjunction with fig. 3a (fig. 3a shows an exemplary structural schematic diagram of the terminal device 300). As shown in fig. 3a, the terminal device 300 includes: an application processor 301, a microcontroller unit (microcontroller unit, MCU) 303, a memory 305, a modem 307, a Radio Frequency (RF) module 309, a Wireless-Fidelity (Wi-Fi) module 311, a bluetooth module 313, a sensor 314, a positioning module 350, an input/output (I/O) device 335, and the like. The components may communicate via one or more communication buses or signal lines. Those skilled in the art will appreciate that the hardware architecture shown in fig. 1 does not constitute a limitation of the terminal device, and that the terminal device 300 may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The various components of the terminal device 300 are described in detail below in connection with fig. 3 a:
The application processor 301 is a control center of the terminal device 300, and connects the respective components of the terminal device 300 using various interfaces and buses. In some embodiments, processor 301 may include one or more processing units.
The memory 305 has stored therein computer programs such as the operating system 361 and application programs 363 shown in fig. 3 a. The application processor 301 is configured to execute a computer program in the memory 305 to perform functions defined by the computer program, for example, the application processor 301 executes the operating system 361 to perform various functions of the operating system on the terminal device 300. Memory 305 also stores data other than computer programs, such as data generated during the operation of operating system 361 and application programs 363. The memory 305 is a non-volatile storage medium and typically includes memory and external storage. Memory includes, but is not limited to, random access Memory (Random Access Memory, RAM), read-Only Memory (ROM), or cache, among others. External memory includes, but is not limited to, flash memory (flash memory), hard disk, optical disk, universal serial bus (universal serial bus, USB) disk, and the like. Computer programs are typically stored on a memory, from which a processor loads the program into memory before executing the computer program.
The memory 305 may be separate and connected to the application processor 301 by a bus; memory 305 may also be integrated with application processor 301 into one chip subsystem.
The MCU303 is a coprocessor for acquiring and processing data from the sensor 314, and the processing power and power consumption of the MCU303 is smaller than the application processor 301, but has the characteristic of "always on" (always on), so that the sensor data can be continuously collected and processed when the application processor 301 is in the sleep mode, and the normal operation of the sensor can be ensured with extremely low power consumption. In one embodiment, MCU303 may be a sensor hub chip. The sensor 314 may include a light sensor, a motion sensor. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display 351 according to the brightness of ambient light, and a proximity sensor that may turn off the power of the display when the terminal device 300 moves to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in all directions (typically three axes), and can detect the magnitude and direction of gravity when stationary; the sensor 314 may also include other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein. The MCU303 and the sensor 314 may be integrated on the same chip or may be separate components connected by a bus.
Modem 307 and RF module 309 form a communication subsystem of terminal device 300 for implementing main functions of wireless communication standard protocols such as 3GPP and ETSI. The Modem 307 is used for codec, modulation and demodulation of signals, equalization, and the like. The radio frequency module 309 is used for receiving and transmitting wireless signals, and the radio frequency module 309 includes, but is not limited to, an antenna, at least one amplifier, a coupler, a duplexer, and the like. The radio frequency module 309 cooperates with the Modem 307 to implement a wireless communication function. Modem 307 may be implemented as a stand-alone chip or may be formed together with other chips or circuits to form a system-on-a-chip or integrated circuit. These chips or integrated circuits are applicable to all terminal devices implementing wireless communication functions, including: cell phones, computers, notebooks, tablets, routers, wearable devices, automobiles, home appliances, etc.
The terminal device 300 may also use a Wi-Fi module 311, a bluetooth module 313, etc. for wireless communication. The Wi-Fi module 311 is configured to provide network access to the terminal device 300 according to a Wi-Fi related standard protocol, and the terminal device 300 may access to a Wi-Fi access point through the Wi-Fi module 311, thereby accessing the internet. In other embodiments, wi-Fi module 311 may also act as a Wi-Fi wireless access point, and may provide Wi-Fi network access to other terminal devices. The bluetooth module 313 is used to implement short-range communication between the terminal device 300 and other terminal devices (e.g., a mobile phone, a smart watch, etc.). The Wi-Fi module 311 in the embodiment of the present application may be an integrated circuit or a Wi-Fi chip, and the bluetooth module 313 may be an integrated circuit or a bluetooth chip.
The positioning module 350 is configured to determine a geographic location of the terminal device 300. It is understood that the positioning module 350 may be a receiver of a global positioning system (global position system, GPS) or a positioning system such as a Beidou satellite navigation system, russian GLONASS, etc.
The Wi-Fi module 311, the bluetooth module 313, and the positioning module 350 may be separate chips or integrated circuits, or may be integrated together. For example, in one embodiment, wi-Fi module 311, bluetooth module 313, and location module 350 may be integrated on the same chip. In another embodiment, wi-Fi module 311, bluetooth module 313, positioning module 350, and MCU 303 may also be integrated into the same chip.
Input/output devices 335 include, but are not limited to: a display 351, a touch screen 353, audio circuitry 355, and the like.
Wherein the touch screen 353 may collect touch events on or near the user of the terminal device 300 (such as the user's manipulation of any suitable object on the touch screen 353 or near the touch screen 353 using a finger, stylus, etc.), and send the collected touch events to other devices (e.g., the application processor 301). Wherein, the operation of the user near the touch screen 353 may be referred to as hover touch; by hovering touch, the user may select, move, or drag an object (e.g., an icon, etc.) without directly contacting the touch screen 353. In addition, the touch screen 353 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave.
A display (also referred to as a display screen) 351 is used to display information entered by a user or presented to a user. The display may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The touch screen 353 may be overlaid on the display 351 and, upon detection of a touch event by the touch screen 353, passed to the application processor 301 to determine the type of touch event, whereupon the application processor 301 may provide a corresponding visual output on the display 351 in accordance with the type of touch event. Although in fig. 3a the touch screen 353 and the display 351 are two separate components to implement the input and output functions of the terminal device 300, in some embodiments the touch screen 353 may be integrated with the display 351 to implement the input and output functions of the handset 300. In addition, the touch screen 353 and the display 351 may be configured on the front surface of the terminal device 300 in a full panel form to realize a bezel-free structure.
The audio circuitry 3355, speaker 336, microphone 317 may provide an audio interface between the user and the terminal device 300. The audio circuit 309 may transmit the received electrical signal after audio data conversion to the speaker 313, and the electrical signal is converted into a sound signal by the speaker 313 and output; on the other hand, the microphone 314 converts the collected sound signal into an electrical signal, which is received by the audio circuit 309 and converted into audio data, which is then transmitted to, for example, another terminal device through the Modem 307 and the radio frequency module 309, or output to the memory 305 for further processing.
In addition, the terminal device 300 may also have a fingerprint recognition function. For example, the fingerprint acquisition device may be configured on the back side of the terminal device 300 (e.g., below the rear camera) or on the front side of the terminal device 300 (e.g., below the touch screen 353). For another example, a fingerprint sensing device may be configured in the touch screen 353 to implement the fingerprint recognition function, i.e. the fingerprint sensing device may be integrated with the touch screen 353 to implement the fingerprint recognition function of the terminal device 300. In this case, the fingerprint acquisition device is arranged in the touch screen 353, may be part of the touch screen 353, or may be arranged in other ways in the touch screen 353. The primary component of the fingerprint acquisition device in embodiments of the present application is a fingerprint sensor that may employ any type of sensing technology, including but not limited to optical, capacitive, piezoelectric, or ultrasonic sensing technologies, and the like.
Further, the operating system 361 installed on the terminal device 300 may beOr other operating system, to which embodiments of the application are not limited in any way.
To be carried onThe terminal device 300 of the operating system is, for example, as shown in fig. 3a, the terminal device 300 can be logically divided into a hardware layer, an operating system 361, and an application layer. The hardware layer includes hardware resources such as the hardware processor 301, the microcontroller unit 305, the Modem 307, the Wi-Fi module 311, the sensor 314, the positioning module 350, and the like, as described above. The application layer includes one or more application programs, such as application program 363, and application program 363 may be a social class application, an e-commerce class application Any type of application such as a browser. The operating system 361 is a computer program that manages and controls hardware and software resources as software middleware between a hardware layer and an application layer.
In one embodiment, operating system 361 includes a kernel, a hardware abstraction layer (hardware abstraction layer, HAL), libraries and runtime (libraries and runtime), and a framework (framework). Wherein the kernel is used to provide underlying system components and services, such as: power management, memory management, thread management, hardware drivers, etc.; the hardware drivers include Wi-Fi drivers, sensor drivers, positioning module drivers, and the like. The hardware abstraction layer is the encapsulation of the kernel driver, providing an interface to the framework, shielding the implementation details of the lower layers. The hardware abstraction layer 25 runs in user space, while the kernel driver runs in kernel space.
Libraries and runtimes, also called runtime libraries, provide the executable programs with the required library files and execution environments at runtime. In one embodiment, the library and Runtime includes Android Runtime (ART), library, and scene package Runtime. ART is a virtual machine or virtual machine instance that is capable of converting the bytecode of an application into machine code. Libraries are libraries that provide support for executable programs at runtime, including browser engines (such as webkit), script execution engines (such as JavaScript engines), graphics processing engines, and the like. The scene package runtime is the running environment of the scene package, mainly comprising a page execution environment (page context) and a script execution environment (script context), wherein the page execution environment analyzes the page codes in html, css and other formats by calling the corresponding library, and the script execution environment analyzes and executes the codes or executable files realized by script languages such as JavaScript and the like by calling the corresponding function library.
The framework is used to provide various underlying common components and services, such as window management, location management, etc., for individual applications in the application layer. In one embodiment, the framework may include a geofence service, a policy service, a notification manager, and the like.
The functions of the various components of the operating system 361 described above may be implemented by the application processor 301 executing programs stored in the memory 305.
It should be noted that the embodiments of the present application may be implemented based on a solver, which may be deployed in the aforementioned data processing device or user equipment (terminal equipment). To facilitate the introduction of the solver, the following is schematically presented in terms of a solver capable of handling linear programming problems in mixed integer programming. Fig. 3b is a schematic diagram of an architecture of a solver according to an embodiment of the present application), as shown in fig. 3b, the solver includes: an equation construction module, a pre-processing (presive) module, a generation (crash) module, a pre-solution module, a post-processing (postsolve) module, and a recovery (clean up) module.
Specifically, the equation construction module may construct a mixed integer programming equation based on the task to be processed. The preprocessing module can perform structural simplification on the mixed integer programming equation to obtain a preprocessed mixed integer programming equation. The generation module may generate an initial point of solution based on the preprocessed mixed integer programming equation. The pre-solving module can utilize a dual simplex method to solve the pre-processed mixed integer programming equation from the initial point to obtain an optimal solution of the pre-processed mixed integer programming equation. The post-processing module may convert the optimal solution of the preprocessed mixed integer programming equation to an approximate solution of the original mixed integer programming equation. The recovery module recovers the approximate solution as the optimal solution of the original mixed integer programming equation if it is determined that the approximate solution is not the optimal solution of the original mixed integer programming equation.
It should be noted that, the computer task processing method or the production plan obtaining method provided by the embodiment of the application can be realized through the architecture of the solver, and the preprocessing module in the solver is improved, so that better preprocessing can be realized on the original mixed integer programming equation, and the equation can be solved conveniently. In order to further understand the method provided by the embodiment of the present application, the method is further described below with reference to fig. 4. Fig. 4 is a schematic flow chart of a method for processing a computer task according to an embodiment of the present application, as shown in fig. 4, where the method includes:
401. a mixed integer programming equation is obtained, the mixed integer programming equation describing the task to be processed.
In this embodiment, when a task needs to be processed, a mixed integer programming equation describing the task to be processed may be obtained, where the mixed integer programming equation generally includes two general equations, i.e., a linear programming equation and a nonlinear programming equation. For example, the task to be processed is to obtain a production plan to be solved (which may also be understood as a scheduling plan) of a certain plant, where the production plan to be solved of the plant needs to meet not only the goals of maximizing the plant requirement and minimizing the total cost of the plant, but also the hard constraint and the soft constraint specified by the actual business scenario. Then, according to the production plan to be solved of the plant and the mathematical model abstracted out by the requirements to be satisfied by the generation plan, the production plan can be simplified into a corresponding linear programming equation, and the linear programming equation is shown in the formula (1):
minc T x
Ax=b
x≥0 (1)
In the above formula, x is a variable of a linear programming equation (i.e. the production plan to be solved in the plant), and is a matrix of m rows and 1 column (each element in the matrix can be regarded as the amount to be solved in the production plan, for example, the matrix contains 10 elements, and the 10 elements are the amount of raw materials required to be produced every day in 10 days of the plant, and the 10 elements can be integers or non-integers); a is a constraint matrix of a linear programming equation (including various constraints required to be satisfied by the production plan to be solved of the plant, such as material constraints, productivity constraints, time constraints, traffic constraints, and the like), and is a matrix of h rows and m columns, and each row in the constraint matrix a can be regarded as one constraint required to be satisfied by the plant; c is a matrix corresponding to the number of elements in the variable, and is also a matrix of m rows and 1 column; b is a matrix corresponding to the constraint number, and is a matrix of h rows and 1 column. Wherein h and m are integers greater than or equal to 1.
It should be noted that tasks in different fields may be described by mixed integer programming equations, for example, production planning of factories in the supply chain field, vehicle path optimization in the logistics field, center location (facility location) in the cloud technology field, grid scheduling in the electric power field, and so on, and these tasks may be described by mixed integer programming equations. Different mixed integer programming equations used to describe tasks in different fields often have different variables and different constraint matrices.
402. Determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, the information related to at least one of: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation.
After the mixed integer programming equation is obtained, structure identification may be performed on the mixed integer programming equation, so as to obtain information related to the structure of the mixed integer programming equation (may also be referred to as structure information of the mixed integer programming equation, which may be used to indicate the structure of the mixed integer programming equation). Notably, the operation of structure identification is focused mainly on analyzing the variables of the mixed-integer programming equation and the constraint matrix of the mixed-integer programming equation to determine the structural composition of the mixed-integer programming equation (i.e., the structural composition of the task to be processed), so that the resulting information related to the structure of the mixed-integer programming equation is associated with at least one of the variables of the mixed-integer programming equation and the constraint matrix of the mixed-integer programming equation.
In particular, since the information related to the structure of the mixed integer programming equation is associated with at least one of the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation, the information related to the structure of the mixed integer programming equation may include at least one of: (1) The dimensions of the variables of the mixed integer programming equation, i.e. the number of elements comprised by the variables of the mixed integer programming equation, e.g. the number of elements comprised by the variables x of the linear programming equation. (2) Sparseness of constraint matrix of the mixed integer programming equation, that is, the number of elements with value zero in constraint matrix of the mixed integer programming equation, for example, the number of elements with value 0 in constraint matrix a of the linear programming equation. (3) The block information of the constraint matrix of the mixed integer programming equation is used to indicate the sub-matrix with zero elements contained in the constraint matrix of the mixed integer programming equation, for example, the first three rows of the constraint matrix a of the linear programming equation are all set to be 0, then the first three rows of the constraint matrix a can be regarded as a sub-matrix, and the block information of the linear programming equation is used to indicate the sub-matrix. (4) The method comprises the steps that a row with a calculation relation with a variable of a mixed integer programming equation exists in a constraint matrix of the mixed integer programming equation, each row in the constraint matrix of the mixed integer programming equation is multiplied by the variable of the mixed integer programming equation, if (all elements of) a certain row in the constraint matrix of the mixed integer programming equation are zero, the row is not in the calculation relation with the variable of the mixed integer programming equation, and if (any element of) the certain row in the constraint matrix of the mixed integer programming equation is not zero, the row is in the calculation relation with the variable of the mixed integer programming equation. For example, if the first three rows of the constraint matrix a of the linear programming equation are all 0, then there is no calculation relationship between these three rows and the variable x of the linear programming equation.
After obtaining information related to the structure of the mixed integer programming equation, a target operator may be determined from the operator resource pool based on the information. It should be noted that, the operator resource pool includes a plurality of operators that can be used to implement preprocessing, as shown in table 1 in detail:
TABLE 1
Based on Table 1, it can be seen that the operator resource pool includes, but is not limited to, a plurality of alternative operators shown in Table 1, so that at least one operator for preprocessing the mixed integer programming equation can be selected from the operator resource pool according to information related to the structure of the mixed integer programming equation, and the selected operator can be referred to as a target operator.
Specifically, the target operator may be obtained by:
(1) In the equation resource pool, a preset equation is determined that matches information related to the structure of the mixed integer programming equation. It should be noted that, the equation resource pool includes a plurality of preset equations with different structures (may also be understood as equation templates with different structures set in advance), and the information related to the structures of the mixed integer programming equation is used to indicate the structure types of the mixed integer programming equation, so, as compared with traversing in the equation resource pool, the preset equation matching the information related to the structures of the mixed integer programming equation is found, then, the preset equation and the mixed integer programming equation are two equations with similar or identical structures.
(2) In the operator resource pool, an operator used for preprocessing of a preset equation is determined as a target operator. It should be noted that, after determining the preset equation similar to or identical to the structure of the mixed integer programming equation, since the preset equation is set in advance, it is possible to determine which operators in the operator resource pool are used in the preprocessing for the preset equation, and determine this portion of operators as the operators for implementing the preprocessing of the mixed integer programming equation, that is, the target operators. It is noted that, typically, there are a plurality of target operators, each of which can be cyclically used a plurality of times in the preprocessing for the preset equation, so that the number of iterations of each of the target operators in the preprocessing for the preset equation can be determined. The plurality of target operators may then be divided into a plurality of operator sets by the number of iterations, each operator set containing at least one target operator of the plurality of target operators. Of the plurality of operator sets, the number of iterations of the target operator in the 1 st operator set is 1, the number of iterations of the target operator in the 2 nd operator set is 2, …, the number of iterations of the target operator in the kth operator set is k, and k is an integer greater than or equal to 1.
It should be appreciated that the present embodiment is schematically illustrated with only information related to the structure of the mixed integer programming equation associated with at least one of the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation, and in practical applications, the information related to the structure of the mixed integer programming equation may also be associated with other terms of the mixed integer programming equation, for example, a matrix corresponding to the number of elements in the variables, a matrix corresponding to the number of constraints, and so on.
Further, based on the above example, the information related to the structure of the mixed integer programming equation may further include at least one of: sparseness of a matrix corresponding to the number of elements in the variable, sparseness of a matrix corresponding to the number of constraints, and so forth.
It should also be understood that the structure of the preset equation is similar or identical to the structure of the mixed integer programming equation, which generally means that the constraint matrix of the preset equation is similar or identical to the constraint matrix of the mixed integer programming equation.
Further, the structure of the preset equation may be similar or identical to the structure of the mixed integer programming equation, and further include: the matrices of the two equations corresponding to the number of elements in the variable are similar or identical, and/or the matrices of the two equations corresponding to the number of constraints are similar or identical, etc.
403. And merging the rows with the multiple relations in the constraint matrix, or setting the columns with the multiple relations in the constraint matrix into the same columns to obtain the redundancy-removed constraint matrix.
After the target operator is determined, preprocessing for the mixed integer programming equation can be achieved based on the target operator, so that a preprocessed mixed integer programming equation is obtained. In order to realize better preprocessing, the mixed integer programming equation can be subjected to redundancy elimination operation in advance, wherein the operation comprises the following steps:
(1) In the constraint matrix of the mixed integer programming equation, the rows with the multiple relation can be determined in a certain mode, and the rows are combined to obtain the constraint matrix after the combination. As still described aboveSon, let a 1 And a 2 The first and second rows of constraint matrix A, respectively, then the relation a 1 And a 2 The following calculations were performed:
in the above, a 11 Is a as 1 Is 1 st element, a 12 Is a as 1 2 nd element of (a), …, a 1m Is a as 1 And similarly, a 21 、a 22 And a 2m And will not be described in detail herein. Lambda and lambda' are preset parameter matrices, and each element in the two matrices is a preset value.
Based on equation (2), one ratio may be set for each row of constraint matrix a, where the ratio of row x (i.e., ratio) =sum' [ x ]/sum[x]X=1, …, h. If ratio=ratio, description a x And a y Possibly in a multiple relationship, i.e. a x =qa y That is to say a x And a y Is a potential parallel row. Then, the ratio of all the rows in the constraint matrix a can be calculated, and the ratio of all the rows is sorted according to the size (meanwhile, all the rows in the constraint matrix a are sorted according to the size of the ratio), and the rows corresponding to the same ratio are potential parallel rows. Then a further determination may be made as to whether the potential parallel lines are truly parallel lines (i.e., whether the potential parallel lines are truly multiplicative. After determining the true parallel rows, the row with larger elements may be deleted, the row with the smallest elements may be reserved (of course, the row with smaller elements may be deleted, the row with the largest elements may be reserved, etc.), so that the parallel rows of the constraint matrix a are combined to obtain a constraint matrix a after the combination. As an example shown in formula (4), after ordering the ratio of all rows of matrix a, where ratio 1=sum' 1]/sum[1],ratio2=sum`[2]/sum[2],…,ratioh=sum`[h]/sum[h]. Let ratio 1=ratio 2, specify a 1 And a 2 Possibly in a multiple relationship, i.e. a 1 May be equal to qa 2 That is to say a 1 And a 2 Is a potential parallel row. Then a can be further judged 1 And a 2 Whether the relationship is true is a multiple relationship, if the relationship is a multiple relationship, a is described 1 And a 2 Is truly parallel, and keeps smaller rows, if the two are not multiplied, the operation is not performed on the two rows.
(2) In the constraint matrix after the rows are combined, the columns in the multiple relationship can be determined in the same way, and the columns are set to be the same columns, so as to obtain a constraint matrix after redundancy removal (which can also be called as a constraint matrix after transformation). As still the above example, let A 1 And A 2 The first column and the second column of the constraint matrix a after the merging of the rows are respectively, and likewise, a ratio may be set for each column of the constraint matrix a after the merging of the rows, so as to determine a real parallel column based on the ratios of all the rows (the process of obtaining the real parallel column may refer to the process of obtaining the real parallel row, which is not described herein again), and after determining the real parallel column, these parallel columns may be set as one column of the two columns, so as to obtain the constraint matrix a after redundancy elimination. For example, let A 1 And A 2 Is truly parallel and has A 1 =qA 2 Let the element of the first row in variable x be from x 1 Conversion to qx 1 The first column in the constraint matrix A after the combination and the parallel can be led to be from A 1 Conversion to A 2 As shown in formula (3):
min c 1 x 1 +c 2 x 2 +…=c 1 /q*(qx 1 )+c 1 x 2 +…
s.t.x 1 A 1 +x 2 A 2 +…=(qx 1 +x 2 )A 2 +…(3)
Based on the above equation, when the constraint matrix A and the variable x are transformed as in equation (3), the element of row 1 in the matrix c corresponding to the number of elements in the variable is transformed from c 1 Conversion to c 1 And/q. Correspondingly, x also needs to be changed 1 Is a range of values:
in the above, clo 1 Is x 1 Is the maximum value of (cup) 1 Is x 1 Is a minimum of (2).
404. And updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation.
After the constraint matrix after redundancy removal is obtained, the original mixed integer programming equation can be updated after the constraint matrix after redundancy removal, and the updated mixed integer programming equation is obtained. Based on the foregoing formula (4), in the original mixed integer programming equation, the original constraint matrix is replaced by the constraint matrix after redundancy removal, the original variable is also required to be replaced by the variable after transformation, and the original matrix corresponding to the number of elements in the variable is also required to be replaced by the matrix corresponding to the number of elements in the variable after transformation, so as to obtain the updated mixed integer programming equation.
It should be appreciated that steps 403 and 404 are optional steps. In practical applications, after determining the target operator, the redundancy elimination operation and the updating operation may not be performed on the mixed integer programming equation (i.e. step 403 and step 404 are not performed), and then the processing object of step 405 is the original mixed integer programming equation.
405. And preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
After the updated mixed integer programming equation is obtained, the target operator can be utilized to realize the preprocessing of the updated mixed integer programming equation, and the preprocessed mixed integer programming equation is obtained.
Specifically, the updated mixed integer programming equation may be preprocessed by the following iterative strategy:
since k operator sets have been acquired, in the present embodiment, the operations performed for each operator set are similar, and the kth operator set is taken as an example for schematic description hereinafter. Assuming that the kth operator set includes n target operators (n is an integer greater than or equal to 1), then the number of iterations of the n target operators is k, then the steps shown in fig. 5 (fig. 5 is a schematic flow chart of preprocessing provided by the embodiment of the present application) may be performed on the updated mixed integer programming equation:
(1) In the jth iteration of the n target operators, before the ith operator is executed on the updated mixed integer programming equation, whether the sum of the indexes of the ith target operator in the 1 st iteration and the indexes of the ith target operator in the j-1 st iteration is smaller than a first threshold value (the first threshold value is generally determined based on the iteration number k, generally increases with the increase of the iteration number k, namely, the two are in positive correlation relation) can be detected. Where i=1, …, n, j=1, …, k.
(2) If the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 st iteration is smaller than the first threshold, which means that the ith target operator needs to be continuously executed after that, further detecting whether the index of the ith target operator in the j-1 st iteration is smaller than the second threshold (the second threshold is generally determined based on the iteration number k, and generally increases with the increase of the iteration number k, that is, the two are in positive correlation).
(3) If the sum of the indexes of the ith target operator in the 1 st iteration to the indexes of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold value, indicating that the ith target operator does not need to be continuously executed any more, skipping the ith target operator in the j-1 th iteration.
(4) If the index of the ith target operator in the j-1 th iteration is smaller than the second threshold, the ith target operator can be executed currently, and the index of the ith target operator in the j-1 th iteration is generated. Notably, the index of the ith target operator in the jth iteration may be generated by: first, the duty ratio of the deleted row in the updated mixed integer programming equation in the 1 st iteration to the j-th iteration is determined for the ith target operator. Then, calculation is performed based on the duty ratio, so that an index of the ith target operator in the jth iteration is obtained.
(5) If the index of the ith target operator in the j-1 th iteration is greater than or equal to a second threshold value, indicating that the ith operator cannot be executed currently, jumping to the (i+1) th target operator, and executing the steps on the (i+1) th target operator until the j-th iteration of the n target operators is completed.
(6) And (3) continuing to execute the j+1th iteration of the n target operators (namely repeatedly executing the steps (1) to (5)) until the kth iteration of the n target operators is completed, and obtaining the preprocessed mixed integer programming equation.
It will be appreciated that in the kth set of operators, the n target operators have been ordered in an order in which they were executed in the pre-processing for the preset equation, so in the mixed integer programming equation for the update, the n operators can be executed in that order in each iteration.
It should be appreciated that operations as performed on the kth operator set may also be performed on the remaining operator sets other than the kth operator set, which are not described in detail herein, resulting in a preprocessed mixed integer programming equation.
406. And solving the preprocessed mixed integer programming equation, wherein the obtained solution is used as a task processing result.
The mixed integer programming equation after pretreatment is obtained, the mixed integer programming equation after pretreatment can be solved, and a corresponding solution is obtained, and can be used as a processing result of the task.
In order to further understand the above process, the computer task processing method provided by the embodiment of the present application is further described below in conjunction with a plurality of application examples. In a first application example, let the task to be processed be a scheduling plan of a certain factory in the supply chain field, fig. 6 shows the effect of the scheduling plan in the whole supply chain joint (fig. 6 is a schematic diagram of an application of the computer task processing method provided in the embodiment of the present application), namely, as shown in a production plan module in fig. 6. From a mathematical model perspective, this problem is a typical large-scale, multi-objective, constrained sparsity, multivariate distribution problem. The input of the problem is the customer's order demand and existing processing resources (raw materials, capacity, etc.), the output is a processing production schedule (process volume, delivery volume, etc.) arranged according to the order demand, the desired output results are minimizing processing costs, processing time, maximizing order satisfaction rate (i.e., delivering customer's demand on time and volume), etc., and all processing constraints need to be satisfied.
In the problem of obtaining a production schedule, the production schedule needs to meet different constraints, including material constraints, transportation constraints, inventory constraints, production capacity upper limit constraints, and the like. For example: the customer demand is to make 2000 PCs, 1000 hosts, 800 notebooks in three days. Fig. 7 is a schematic diagram of a material assembly relationship (BOM) in a production process according to an embodiment of the present application, and as shown in fig. 7, taking a PC generation process as an example, how the BOM affects the production process is described as follows: it is assumed that each PC needs to be configured with one host, and each notebook can be configured separately. Two factories A and B exist, wherein the factory A can process a PC and a host, the factory B can process a host and a notebook, and the daily processing capacity of the two factories is limited, namely, the factory A can only process at most 1000 PCs or hosts each day, and the factory B can only process at most 1000 hosts or notebooks each day. Then, a legal, preferred production plan is: on the first day, a factory A schedules 1000 hosts to be produced, a factory B schedules 1000 hosts to be produced, and the 1000 hosts are sent to the factory A after the factory B finishes production; the next day, factory A utilizes 1000 hosts already produced to finish the assembly production of 1000 PCs, factory B continues to arrange 1000 hosts to be produced; on the third day, factory A completed the assembly of 1000 PCs using 1000 hosts sent from factory B on the first day, and factory B arranged to produce 800 notebooks. With the arrangement described above, both factories will fulfill all of the customer's order needs on the third day and meet various constraints on materials, productivity, time, and traffic. The above examples have not considered various conflicting objectives (cost, order delivery satisfaction rate, etc.), and are far more complex than the example problem in a real industrial scenario.
Then, the production plan of the plant to be solved can be obtained by:
step 1: an equation is constructed. According to the business requirements, a mixed integer programming equation is set, which may comprise a mathematical relationship between a variable, which is a production plan to be solved for the plant, and a constraint matrix, which is a process constraint to be satisfied by the production plan to be solved, which may comprise at least one of: material constraints, productivity constraints, time constraints, or traffic constraints, etc., wherein a material constraint may include an upper limit of materials and material proportions that can be used at the time of production, a productivity constraint may include an upper limit of the number of production workers and the work efficiency required at the time of production, etc., a time constraint may include a delivery date of a product, etc., and a traffic constraint may include an upper limit of traffic costs required at the time of production and an upper limit of the number of vehicles required at the time of production, etc. It can be seen that solving this equation is equivalent to obtaining the production plan for the plant.
Step 2: reading the constructed mixed integer programming equation into a solver, calling a designated interface of the solver, and executing preprocessing of the mixed integer programming equation. The pretreatment process can be completed by the following steps:
(1) And (3) identifying a problem structure: and carrying out structure identification on the mixed integer programming equation so as to acquire information related to the structure of the mixed integer programming equation.
(2) Redundancy is deleted: and determining parallel rows and parallel columns for constraint matrixes of the mixed integer programming equation, so that corresponding redundancy elimination processing is realized for the parallel rows and the parallel columns. In the process of redundancy elimination, the mixed integer programming equation can be traversed according to the upper and lower layer dependency relationship of the BOM, and a better simplification effect can be brought. The main reason is that the solution of the upper-layer variable is strictly dependent on the lower-layer variable, and the simplification of the upper-layer variable can be more convenient when the lower-layer variable is processed first in space.
(3) Operator selection: matching the target operators according to the structural information obtained by the structural identification, opening the execution parameters (such as iteration times, iteration sequences, adaptive indexes and the like) of each target operator, and executing the target operators on the mixed integer programming equation according to a certain strategy so as to realize the preprocessing of the equation. The goals that this strategy needs to achieve are: if the index indicates that the operator cannot simplify the variable and constraint matrix after executing a certain number of times, early stop is executed.
(4) Continuous simplification: the above processes, i.e., steps (1) to (3), may be re-executed, i.e., the preprocessing is executed multiple times until the equation satisfies the preset convergence judgment condition, thereby obtaining the preprocessed mixed integer programming equation.
It should be noted that, the substep (2) in the step 2 is an optional step, and may or may not be executed in practical application, and may be selected according to practical requirements, which is not limited herein.
Step 3: the method is selected. Different methods are selected from the algorithm library, including an original simplex method, a dual simplex method, an interior point method and the like.
Step 4: and (3) based on the method selected in the step (3), solving the preprocessed mixed integer programming equation.
In addition, in the multi-plant scheduling problem in the supply chain field, the solver provided by the embodiment of the present application and the solver of the related art may be compared, the comparison result is shown in fig. 8 (fig. 8 is a schematic diagram of the comparison result provided by the embodiment of the present application), and the calculation result applying the related art and the calculation result applying the embodiment of the present application may be reduced by 18% or more in end-to-end compared with the first related art, and by 60% or more in comparison with the second related art and the third related art.
In the second application example, the task to be processed is set to solve a certain public data set, and the solver provided by the related technology and the solver provided by the embodiment of the application can be used to solve and compare the mixed integer programming equation describing the task, where the comparison result is shown in table 2:
TABLE 2
Number of constraints Number of variables Solving time
Related art 1 91572 69846 1394s
Embodiments of the application 81172 69846 99.9s
Related art II 81172 80246 125s
Related artsThree operations 81172 69846 283s
Based on table 2, compared with the first related art, the solving time of the embodiment of the application can be reduced from 1394s to less than 100s, which exceeds the solving time of the second related art and the third related art, and therefore, the preprocessing module in the solver of the embodiment of the application has excellent performance.
In a third application example, the task to be processed is set as a problem of optimizing the vehicle path in the logistics field. The problem of vehicle routing was first addressed in 1959, which is to specify a certain number of customers, each having a different number of cargo demands, the distribution center providing the customers with cargo, and a fleet of vehicles responsible for distributing the cargo, organizing the appropriate driving routes, with the goal of satisfying the customer demands and achieving the goals such as shortest distance, minimum cost, and least time consumption under certain constraints.
The problem is to find the optimal solution in a limited set of possible solutions, and the problem is to solve the problem of the optimal value (maximum value or minimum value) of the objective function meeting given constraint conditions, also called discrete optimization problem, on a discrete and limited mathematical structure, and the problem is related to the sequence.
Unlike the multi-plant scheduling problem, which requires more consideration of the loading capacity of different kinds of vehicles, there is a need to take into consideration chronological consideration between variables when constructing mathematical models (i.e., mixed integer programming equations that describe the problem). It should be noted that, in the mixed integer programming equation describing the problem, the variable is a plan adopted by the vehicle to be solved, different elements in the variable represent numbers of different types of vehicles (because the vehicle path is often difficult to be represented by numerical values, a certain vehicle refers to a vehicle running along a certain path), the constraint matrix includes one or more of capacity constraint, product constraint, time constraint and road condition constraint which are required to be satisfied by the vehicle to be solved by the plan, wherein the capacity constraint includes an upper capacity limit and the like when the vehicle is transported, the product constraint includes a product type and the like which can be reloaded when the vehicle is transported, the time constraint includes a time sequence and the like when the different types of vehicles reach a destination, and the road condition constraint includes road conditions and the like when the different types of vehicles can run.
Therefore, in the problems, obvious mathematical structures are often arranged in the time dimension of the variables, so that the equation can be simplified by the preprocessing method provided by the embodiment of the application, and the solving of the equation is accelerated.
In a fourth application example, the task to be processed is set as a central site selection problem in the cloud technology field. In practical applications, the enterprise should consider opponent competition when making the site selection decision. Generally, users need to consider a discrete network, with two service providers (a leader and a follower) opening a certain number of facilities in succession to compete for market share. Each user seeks service from the nearest facility.
Unlike the previous example, this application requires solving a two-layer linear programming equation, where the upper problem represents the leader's decision, with the goal of maximum coverage, and the lower problem is the follower's corresponding NP-hard problem. Assuming that the follower employs a greedy strategy, the follower's response may be integrated into the constraints of the leader problem.
Considering the difference of two layers, when the preprocessing method provided by the embodiment of the application is used, the execution flow needs to be executed from the bottom layer to the upper layer, and the iteration strategy (early stopping of certain operators and the like) is realized, so that the time consumption of preprocessing is further reduced.
It should be noted that, a mixed integer programming equation is constructed based on the central addressing problem, where variables are address selection plans to be solved, different elements in the variables represent addresses (e.g., longitude and latitude, etc.) of different objects (e.g., enterprises, factories, etc.), and constraint matrices include one or more of distribution constraints, traffic environment constraints, and rule constraints that need to be satisfied by the address selection plans to be solved, where the distribution constraints include current distribution situations of different objects, future distribution predictions of different objects, traffic growth rates of objects, area distribution of interactions between objects, etc., the traffic environment constraints include transportation conditions, distribution conditions, and land conditions during interactions between objects, etc., and the rule constraints include rules that need to be complied with during interactions between objects, etc.
In a fifth application example, the task to be processed is set as a power grid scheduling problem in the electric power field. The grid scheduling problem mainly includes two phases:
in the first stage, converting the economic scheduling problem of the non-convex power system into a mixed integer programming equation by using linearization processing and mixed integer coding technology, and then solving the mixed integer programming equation by using an optimization software package to obtain a satisfactory feasible solution;
in the second stage, compressing the output interval of the unit according to the feasible solution obtained in the first stage, and re-solving the mixed integer programming equation to obtain the final power system economic dispatching scheme. Thus, grid scheduling is a multi-stage mathematical model.
In this application example, the multi-stage model needs to consider more boundary constraints of different time periods, so that in the process of using the preprocessing method provided by the embodiment of the application, the segmentation of the time periods needs to be considered.
It should be noted that, the variable of the mixed integer programming equation constructed based on the power grid scheduling problem is the power consumption scheduling plan to be solved, different elements in the variable represent the power consumption of different areas, and the constraint matrix includes one or more of a quantity constraint and a price constraint which are required to be satisfied by the power consumption scheduling plan to be solved, where the quantity constraint includes an upper limit of the power consumption of each area, and the price constraint includes an upper limit of the total price when the power is consumed by each area.
In the embodiment of the application, after the mixed integer programming equation for describing the task to be processed is acquired, a target operator can be determined in an operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the information is related to at least one of the following: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. Finally, the mixed integer programming equation after pretreatment can be solved, and the obtained solution can be used as a task processing result. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., to which type of mixed integer programming equation the mixed integer programming equation belongs (for describing tasks of a specific class), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of an equation solving process.
Further, the embodiment of the application provides an equation resource pool, after determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, namely, a certain preset equation (which may also be called a certain equation template in the equation resource pool) in the equation resource pool can use an operator used for preprocessing the preset equation, the iteration times of the operator and the execution sequence of the operator as an operator used for preprocessing the mixed integer programming equation, so as to reduce the influence of human intervention on preprocessing, and optimize the preprocessing effect of the equation.
Furthermore, the embodiment of the application also provides an iteration strategy, namely, when the action exerted by an operator becomes smaller in the iteration process, the operator can be considered to have limited benefit in the continuous execution of the operator in the subsequent iteration, and the operator is stopped executing in time. Also, for the cycle of preprocessing, a corresponding stopping mechanism is also designed. Therefore, the mixed integer programming equation can be effectively simplified, and unnecessary preprocessing flow can be reduced, so that the time cost of preprocessing is reduced.
The foregoing is a detailed description of a method for processing a computer task according to an embodiment of the present application, and the following describes a device for processing a computer task according to an embodiment of the present application. Fig. 9 is a schematic structural diagram of a computer task processing device according to an embodiment of the present application, where the device includes:
The acquiring module 901 is configured to acquire a mixed integer programming equation, where the mixed integer programming equation is used to describe a task to be processed;
a determining module 902, configured to determine a target operator in the operator resource pool based on information related to a structure of the mixed integer programming equation, where the target operator is a part of operators in the operator resource pool;
the preprocessing module 903 is configured to preprocess the mixed integer programming equation based on the target operator, so as to obtain a preprocessed mixed integer programming equation;
and the solving module 904 is used for solving the preprocessed mixed integer programming equation, and the obtained solution is used as a task processing result.
In the embodiment of the application, after the mixed integer programming equation for describing the task to be processed is acquired, a target operator can be determined in an operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the information is related to at least one of the following: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. Finally, the mixed integer programming equation after pretreatment can be solved, and the obtained solution can be used as a task processing result. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., to which type of mixed integer programming equation the mixed integer programming equation belongs (for describing tasks of a specific class), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of an equation solving process.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the method comprises the steps of dimension of variables, sparsity of constraint matrixes, blocking information of the constraint matrixes and rows in the constraint matrixes, wherein the rows have a calculation relation with the variables, and the blocking information is used for indicating sub-matrixes with zero elements contained in the constraint matrixes.
In one possible implementation, the determining module 902 is configured to: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; in the operator resource pool, an operator used for preprocessing of a preset equation is determined as a target operator.
In one possible implementation, in the preprocessing for the mixed integer programming equation, the number of target operators is n, and the number of iterations of the n target operators is k, where n and k are integers greater than or equal to 1, and the preprocessing module 903 is configured to: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum of the index of the ith target operator in the 1 st iteration and the index of the ith target operator in the j-1 th iteration is smaller than a first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than a second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
In one possible implementation, the apparatus further includes: the redundancy elimination module is used for merging the rows with the multiple relations in the constraint matrix or setting the columns with the multiple relations in the constraint matrix into the same columns to obtain a constraint matrix with redundancy elimination; the updating module is used for updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; the preprocessing module 903 is configured to preprocess the updated mixed integer programming equation based on the target operator, and obtain a preprocessed mixed integer programming equation.
Fig. 10 is a schematic structural view of a production plan acquiring apparatus provided by the embodiment of the present application, as shown in fig. 10, the apparatus includes:
An obtaining module 1001, configured to obtain a mixed integer programming equation, where the mixed integer programming equation is used to describe a production plan to be solved in the supply chain field;
a determining module 1002, configured to determine a target operator in the operator resource pool based on information related to a structure of the mixed integer programming equation, where the target operator is a part of operators in the operator resource pool;
a preprocessing module 1003, configured to preprocess the mixed integer programming equation based on the target operator, to obtain a preprocessed mixed integer programming equation;
and a solving module 1004, configured to solve the preprocessed mixed integer programming equation, thereby obtaining a solved production plan.
In the embodiment of the present application, after the mixed integer programming equation for describing the production plan to be solved is acquired, a target operator may be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation, where the information is related to at least one of the following: variables of the mixed integer programming equation and constraint matrices of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained. And finally, solving the preprocessed mixed integer programming equation to obtain a solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation may be identified, so that information related to the structure of the mixed integer programming equation may be determined, based on the information, the structure of the mixed integer programming equation, i.e., which type of mixed integer programming equation the mixed integer programming equation belongs to (for solving production plans of factories and enterprises in the supply chain field), so as to select a specific target operator for the mixed integer programming equation, thereby implementing preprocessing of the mixed integer programming equation, effectively reducing time consumed in the equation preprocessing process, and improving performance of the equation solving process.
In one possible implementation, the variables of the mixed integer programming equation are the production plan to be solved, and the constraint matrix of the mixed integer programming equation comprises at least one of: the production plan to be solved is required to meet material constraints, productivity constraints, time constraints or traffic constraints.
In one possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of: the dimension of the variable, the sparsity of the constraint matrix, the blocking information of the constraint matrix or the rows in the constraint matrix with the calculation relation with the variable, wherein the blocking information is used for indicating the submatrices with zero elements contained in the constraint matrix.
In one possible implementation, the determining module 1002 is configured to: determining a preset equation matched with information related to the structure of the mixed integer programming equation in an equation resource pool; and determining an operator corresponding to the preprocessing of the preset equation as a target operator in the operator resource pool.
In one possible implementation, in the preprocessing for the mixed integer programming equation, the number of target operators is n, and the number of iterations of the n target operators is k, where n and k are integers greater than or equal to 1, and the preprocessing module 1003 is configured to: in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or if the sum is smaller than the first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than the second threshold value; or if the index of the ith target operator in the jth-1 iteration is smaller than the second threshold, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or if the index of the ith target operator in the jth-1 iteration is greater than or equal to the second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed; and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
In one possible implementation, the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
In one possible implementation, the index of the ith target operator in the jth iteration is determined based on the duty cycle of the row deleted by the ith target operator in the mixed integer programming equation.
In one possible implementation, the first threshold and the second threshold are determined based on the number of iterations of the n target operators. In one possible implementation, the apparatus further includes: the redundancy elimination module is used for merging the rows with the multiple relations in the constraint matrix or setting the columns with the multiple relations in the constraint matrix into the same columns to obtain a constraint matrix with redundancy elimination; the updating module is used for updating the mixed integer programming equation based on the constraint matrix after redundancy elimination to obtain an updated mixed integer programming equation; the preprocessing module 1003 is configured to preprocess the updated mixed integer programming equation based on the target operator, and obtain a preprocessed mixed integer programming equation.
It should be noted that, because the content of information interaction and implementation process between the modules/units of the above-mentioned device and the method embodiment of the present application are based on the same concept, the technical effects brought by the content are the same as those brought by the method embodiment of the present application, and specific content may refer to the description in the foregoing illustrated method embodiment of the present application, and will not be repeated herein.
Embodiments of the present application also relate to a computer storage medium comprising computer readable instructions which, when executed, implement the method steps of the embodiment shown in fig. 4.
Embodiments of the application also relate to a computer program product containing instructions which, when run on a computer, cause the computer to perform the method steps of the embodiment as shown in fig. 4.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.

Claims (18)

1. A production plan acquisition method, characterized in that the method comprises:
acquiring a mixed integer programming equation, wherein the mixed integer programming equation is used for describing a production plan to be solved;
determining a target operator in an operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool;
preprocessing (presolve) the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation;
and solving the preprocessed mixed integer programming equation to obtain a solved production plan.
2. The method of claim 1, wherein the variable of the mixed integer programming equation is the production plan to be solved, and the constraint matrix of the mixed integer programming equation comprises at least one of: and the production plan to be solved is required to meet material constraint, productivity constraint, time constraint or traffic constraint.
3. The method of claim 2, wherein the information comprises at least one of: the dimension of the variable, the sparsity of the constraint matrix, the blocking information of the constraint matrix or the row with a calculation relation with the variable in the constraint matrix, wherein the blocking information is used for indicating the submatrix with zero element contained in the constraint matrix.
4. A method according to any one of claims 1 to 3, wherein said determining a target operator in an operator resource pool based on said information related to the structure of the mixed integer programming equation comprises:
determining a preset equation matched with the information related to the structure of the mixed integer programming equation in an equation resource pool;
and in the operator resource pool, determining an operator corresponding to the preprocessing of the preset equation as a target operator.
5. The method according to claim 4, wherein in the preprocessing of the mixed integer programming equation, the number of the target operators is n, the number of iterations of the n target operators is k, n and k are integers greater than or equal to 1, the preprocessing of the mixed integer programming equation based on the target operators, and the obtaining the preprocessed mixed integer programming equation includes:
in the jth iteration of the n target operators, if the sum of the index of the ith target operator in the 1 st iteration to the index of the ith target operator in the j-1 th iteration is greater than or equal to a first threshold, skipping the ith target operator in the jth iteration to the kth iteration, wherein i=1, …, n, j=1, …, k; or (b)
If the sum is smaller than the first threshold value, detecting whether the index of the ith target operator in the j-1 th iteration is smaller than a second threshold value; or alternatively, the first and second heat exchangers may be,
if the index of the ith target operator in the jth-1 iteration is smaller than a second threshold value, executing the ith target operator on the mixed integer programming equation, and generating the index of the ith target operator in the jth iteration; or alternatively, the first and second heat exchangers may be,
if the index of the ith target operator in the jth-1 iteration is greater than or equal to a second threshold, executing the steps on the (i+1) th target operator until the jth iteration of the n target operators is completed;
and executing the j+1th iteration of the n target operators until the k iteration of the n target operators is completed, and obtaining a preprocessed mixed integer programming equation.
6. The method of claim 5, wherein the number of iterations of the n target operators is the same in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation.
7. The method of claim 5 or 6, wherein the index of the ith target operator in the jth iteration is determined based on the ratio of rows deleted by the ith target operator in the mixed integer programming equation.
8. The method of any one of claims 5 to 7, wherein the first threshold and the second threshold are determined based on the number of iterations of the n target operators.
9. The method according to any one of claims 1 to 8, wherein the preprocessing of the mixed integer programming equation based on the target operator further comprises, before the preprocessing of the mixed integer programming equation:
combining the rows of the multiple relations in the constraint matrix, or setting the columns of the multiple relations in the constraint matrix into the same columns to obtain a redundancy-removed constraint matrix;
updating the mixed integer programming equation based on the redundant constraint matrix to obtain an updated mixed integer programming equation;
preprocessing the mixed integer programming equation based on the target operator, wherein the obtaining the preprocessed mixed integer programming equation comprises the following steps:
and preprocessing the updated mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation.
10. A method of computer task processing, the method comprising:
Acquiring a mixed integer programming equation, wherein the mixed integer programming equation is used for describing a task to be processed;
determining a target operator in an operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool;
preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation;
and solving the preprocessed mixed integer programming equation, wherein the obtained solution is used as a processing result of the task.
11. The method of claim 10, wherein the information comprises at least one of: the method comprises the steps of determining the dimension of a variable of a mixed integer programming equation, the sparsity of a constraint matrix of the mixed integer programming equation, the blocking information of the constraint matrix or a row with a calculation relation with the variable in the constraint matrix, wherein the blocking information is used for indicating a submatrix with zero elements contained in the constraint matrix.
12. The method of claim 10 or 11, wherein the determining a target operator in an operator resource pool based on the information related to the structure of the mixed integer programming equation comprises:
Determining a preset equation matched with the information related to the structure of the mixed integer programming equation in an equation resource pool;
and in the operator resource pool, determining an operator corresponding to the preprocessing of the preset equation as a target operator.
13. A computer task processing device, the device comprising:
the system comprises an acquisition module, a calculation module and a calculation module, wherein the acquisition module is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a task to be processed;
a determining module, configured to determine a target operator in an operator resource pool based on information related to a structure of the mixed integer programming equation, where the target operator is a part of operators in the operator resource pool;
the preprocessing module is used for preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation;
and the solving module is used for solving the preprocessed mixed integer programming equation, and the obtained solution is used as a processing result of the task.
14. A computer task processing device, comprising: the device comprises a processor, a memory, a bus and input and output equipment, wherein the processor is connected with the memory and the input and output equipment, and the bus is respectively connected with the processor, the memory and the input and output equipment;
The input and output equipment is used for acquiring a mixed integer programming equation, and the mixed integer programming equation is used for describing a task to be processed;
the memory stores an operator resource pool;
the processor is configured to:
acquiring an operator resource pool from the memory, and determining a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, wherein the target operator is a part of operators in the operator resource pool;
preprocessing the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation;
and solving the preprocessed mixed integer programming equation, wherein the obtained solution is used as a processing result of the task.
15. The apparatus of claim 14, wherein the information comprises at least one of: the method comprises the steps of determining the dimension of a variable of a mixed integer programming equation, the sparsity of a constraint matrix of the mixed integer programming equation, the blocking information of the constraint matrix or a row with a calculation relation with the variable in the constraint matrix, wherein the blocking information is used for indicating a submatrix with zero elements contained in the constraint matrix.
16. The apparatus of claim 14 or 15, wherein the processor is configured to:
determining a preset equation matched with the information related to the structure of the mixed integer programming equation in an equation resource pool;
and in the operator resource pool, determining an operator corresponding to the preprocessing of the preset equation as a target operator.
17. A computer storage medium storing a computer program which, when executed by a computer, causes the computer to carry out the method of any one of claims 1 to 12.
18. A computer program product, characterized in that it stores instructions that, when executed by a computer, cause the computer to implement the method of any one of claims 1 to 12.
CN202210333041.7A 2022-03-31 2022-03-31 Computer task processing method and related equipment thereof Pending CN116933908A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210333041.7A CN116933908A (en) 2022-03-31 2022-03-31 Computer task processing method and related equipment thereof
PCT/CN2023/084027 WO2023185714A1 (en) 2022-03-31 2023-03-27 Computer task processing method and related device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210333041.7A CN116933908A (en) 2022-03-31 2022-03-31 Computer task processing method and related equipment thereof

Publications (1)

Publication Number Publication Date
CN116933908A true CN116933908A (en) 2023-10-24

Family

ID=88199365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210333041.7A Pending CN116933908A (en) 2022-03-31 2022-03-31 Computer task processing method and related equipment thereof

Country Status (2)

Country Link
CN (1) CN116933908A (en)
WO (1) WO2023185714A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117852842A (en) * 2024-03-07 2024-04-09 山东豪泉软件技术有限公司 Order scheduling method and device, electronic equipment and medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8463729B2 (en) * 2009-12-01 2013-06-11 International Business Machines Corporation LP relaxation modification and cut selection in a MIP solver
CN106875056A (en) * 2017-02-17 2017-06-20 国网天津市电力公司 A kind of metering device production planning optimization method based on mixed integer programming
CN110518591B (en) * 2019-08-22 2021-06-15 中国农业大学 Load flow calculation method for uncertain power system
CN112818280B (en) * 2019-11-18 2023-07-21 华为技术有限公司 Information processing method and related equipment
US12051110B2 (en) * 2020-09-09 2024-07-30 Chicago Mercantile Exchange Inc. Linear model partitioner

Also Published As

Publication number Publication date
WO2023185714A1 (en) 2023-10-05

Similar Documents

Publication Publication Date Title
US11900478B2 (en) Digitally cross-referencing community transaction data to determine commodity types and automatically assign tax codes to an invoice
KR20180121466A (en) Personalized product recommendation using deep learning
WO2023091275A1 (en) Intelligence driven method and system for multi-factor optimization of schedules and resource recommendations for smart construction
US11620690B2 (en) Using transaction data to identify computing devices capable of performing transactions subject to transaction parameters
CN109298840A (en) Data integrating method, server and storage medium based on data lake
US10740832B2 (en) Computer-implemented method and systems for using transaction data to generate optimized event templates based on a requested event type
US20240289737A1 (en) Touchless supplier information management
US11762701B2 (en) Computer system providing numeric calculations with less resource usage
US20200050984A1 (en) Automatic computer prediction of resource attrition
US20230298063A1 (en) Localized Facility-Specific Presentation of Digital Temporary Offer Data
US8190461B2 (en) Logically centralized scrap management using planning operations
CN114626752A (en) Automatic vehicle scheduling method and device, computer equipment and storage medium
WO2023185714A1 (en) Computer task processing method and related device therefor
CN115809777A (en) Scheduling method and system for agricultural machine, storage medium and processor
WO2021033338A1 (en) Analysis system, device, control method, and program
CN110650170A (en) Method and device for pushing information
CN116341838A (en) Computer task processing method and related equipment thereof
US20220291949A1 (en) Software service integration in a central software platform
US20190318311A1 (en) System and methods for accurate price quoting and generation
US11769093B2 (en) Systems and methods for determining path solutions associated with a supply chain network
US11562265B2 (en) Intelligent data analytics
US11100555B1 (en) Anticipatory and responsive federated database search
US20230342632A1 (en) Time-series forecasting based on detected downtime
CN113918122A (en) Demand acquisition method and device, storage medium and electronic equipment
CN111325582A (en) Advertisement recall method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication