[go: up one dir, main page]

WO2023185714A1 - Computer task processing method and related device therefor - Google Patents

Computer task processing method and related device therefor Download PDF

Info

Publication number
WO2023185714A1
WO2023185714A1 PCT/CN2023/084027 CN2023084027W WO2023185714A1 WO 2023185714 A1 WO2023185714 A1 WO 2023185714A1 CN 2023084027 W CN2023084027 W CN 2023084027W WO 2023185714 A1 WO2023185714 A1 WO 2023185714A1
Authority
WO
WIPO (PCT)
Prior art keywords
mixed integer
integer programming
equation
operator
programming equation
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.)
Ceased
Application number
PCT/CN2023/084027
Other languages
French (fr)
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
Publication of WO2023185714A1 publication Critical patent/WO2023185714A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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 OR CALCULATING; 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

Definitions

  • the present application relates to the field of computer technology, and in particular, to a computer task processing method and related equipment.
  • Mixed integer programming usually includes two types of problems: linear programming and nonlinear programming.
  • linear programming For example, assuming that a task to be processed is to obtain the factory's production plan, the generated plan not only needs to meet the goals of maximizing factory demand and minimizing the total factory cost, but also needs to meet the hard constraints and soft constraints specified by the actual business scenario. etc., the mathematical model abstracted based on the requirements that the production plan needs to meet can be simplified into the corresponding linear programming equation. Then, by solving the linear programming equation, the production plan of the factory can be obtained.
  • the processor preprocesses (presolve) the mixed integer programming equation to reduce the size of the variables and constraint matrices in the equation, thereby obtaining the preprocessed (simplified) mixed integer programming equation, and then performs the preprocessed mixed integer programming equation Solve, which makes solving the equation less difficult.
  • the solver multiple operators for preprocessing are provided, so the solver can execute all operators on the mixed integer programming equation in a certain order to achieve preprocessing of the mixed integer programming equation.
  • different mixed integer programming equations may be used to describe the tasks to be processed in different fields.
  • Some mixed integer programming equations may not require the use of all operators to achieve preprocessing. Therefore, existing solvers are in the process of preprocessing. , the factors considered are relatively single, causing the preprocessing process to consume too much time.
  • Embodiments of the present application provide a computer task processing method and related equipment, which can effectively reduce the time consumed in the equation preprocessing process and improve the performance of the equation solving process.
  • a first aspect of the embodiments of the present application provides a computer task processing method, which method includes:
  • mixed integer programming equations When a task needs to be processed, the mixed integer programming equation used to describe the task to be processed can be obtained (mixed integer programming refers to that in some planning problems, the elements in the variables can be either integers or non-integers)
  • mixed integer programming equations usually include two major types of equations, namely linear programming equations and nonlinear programming equations.
  • linear programming equations namely linear programming equations and nonlinear programming equations.
  • the mathematical model abstracted based on the production plan to be solved and the requirements that the production plan to be solved can be simplified into the corresponding linear programming equation.
  • the The production plan to be solved is usually presented in the form of a vector, so the elements contained in the production plan to be solved can be integers or non-integers.
  • the production plan to be solved contains 10 elements.
  • the first element represents the quantity of raw materials that the factory needs to produce on day 1
  • the second element represents the quantity of raw materials that the factory needs to produce on day 2
  • the 10th element represents the quantity of raw materials that the factory needs to produce on the 10th day. Therefore, the values of these elements can be either integers (for example, the factory needs to produce 1 ton of raw materials on the 1st day) or non-integers (for example, on the 2nd day The factory needs to produce 0.5 tons of raw materials per day).
  • the structure of the mixed integer programming equation can be identified, thereby obtaining information related to the structure of the mixed integer programming equation, which is used to indicate the structure of the mixed integer programming equation. It is worth noting that the operation of structure identification mainly focuses on analyzing the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation, thereby determining the structural composition of the mixed integer programming equation. Therefore, the obtained results are consistent with those of the mixed integer programming equation.
  • the structure-related information is also 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 target operator can be determined from the operator resource pool based on this information. It should be noted that the operator resource pool provides multiple operators for selection. Therefore, based on the information related to the structure of the mixed integer programming equation, the operator resource pool can be selected to implement the prediction of the mixed integer programming equation. At least one operator is processed, and the selected operators are the target operators.
  • preprocessing (presolve) of the mixed integer programming equation can be implemented based on the target operator, thereby obtaining the preprocessed mixed integer programming equation.
  • the preprocessed mixed integer programming equation can be solved to obtain the corresponding solution, which can be used as the processing result of the aforementioned task (for example, the solved production plan of a certain factory) .
  • the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • This information is related to At least one of the following is relevant: the variables of a mixed integer programming equation and the constraint matrix of a mixed integer programming equation.
  • the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation.
  • the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task.
  • the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.
  • the structure-related information may include at least one of the following: (1) The dimensions of the variables of the mixed integer programming equation, that is, the number of elements contained in the variables of the mixed integer programming equation. (2) The sparsity of the constraint matrix of the mixed integer programming equation, that is, the number of zero-valued elements in the constraint matrix of the mixed integer programming equation. (3) Block information of the constraint matrix of the mixed integer programming equation. The block information of the mixed integer programming equation is used to indicate the submatrix with zero elements contained in the constraint matrix of the mixed integer programming equation.
  • the block information is used In the constraint matrix indicating the mixed integer programming equation, there is a certain region (several regions) in which the elements are all zero.
  • the rows in the constraint matrix of the mixed integer programming equation have a calculation relationship with the variables of the mixed integer programming equation. Since each row in the constraint matrix of the mixed integer programming equation will be multiplied by the variables of the mixed integer programming equation, if the mixed integer programming equation is mixed A row (all elements) of a row in the constraint matrix of an integer programming equation is zero, It means that there is no calculation relationship between this row and the variables of the mixed integer programming equation. If a certain row (any element) in the constraint matrix of the mixed integer programming equation is not zero, it means that there is no calculation relationship between this row and the variables of the mixed integer programming equation. There is a calculation relationship between them.
  • determining the target operator in the operator resource pool includes: in the equation resource pool, determining the information related to the structure of the mixed integer programming equation.
  • the equation resource pool contains multiple preset equations with different structures (which can also be understood as equation templates with different structures set in advance), and information related to the structure of the mixed integer programming equation is used to indicate mixed integer programming.
  • the structural category of the equation therefore, is to traverse the equation resource pool to find a preset equation that matches the information related to the structure of the mixed integer programming equation.
  • the preset equation and the mixed integer programming equation have a similar structure or The same two equations.
  • the preset equations since the preset equations are set in advance, it can be determined which operators in the operator resource pool are used in the preprocessing of the preset equations, and This part of the operators is determined as the operators used to realize the preprocessing of the mixed integer programming equation, that is, the target operator. It can be seen that the embodiment of the present application provides an equation resource pool.
  • the operator used for preprocessing of the preset equation can be used as the operator used for preprocessing of the mixed integer programming equation to reduce the impact of human intervention on preprocessing, thereby Preprocessing effects of optimization equations.
  • the number of target operators is n
  • the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1.
  • the second threshold is usually determined based on the number of iterations k, and generally increases with the increase of the number of iterations k, That is, there is a positive correlation between the two).
  • the sum of the index of the i-th target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is greater than or equal to the first threshold, it means that there is no need to continue executing the i-th operation in the future. target operator, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped. If the index of the i-th target operator in the j-1th iteration is less than the second threshold, it means that the i-th operator can currently be executed, then the i-th target operator is executed on the updated mixed integer programming equation, and Generate the index of the i-th target operator in the j-th iteration.
  • the index of the i-th target operator in the j-th iteration can be generated in the following way: first, determine the rows deleted by the i-th target operator in the 1st iteration to the j-th iteration. in the updated mixed integer programming equation. Then, calculation is performed based on this proportion to obtain the index of the i-th target operator in the j-th iteration. If the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, it means that the i-th operator cannot be executed currently, then jump to the i+1-th target operator, and perform the operation of the i-th target operator.
  • i+1 target operators execute the above steps until the jth iteration of n target operators is completed. Continue to execute the j+1th iteration of n target operators until the kth iteration of n target operators is completed, and obtain the preprocessed mixed integer programming equation.
  • a certain iteration strategy that is, during the iteration process, when the role of an operator becomes smaller, it can be considered that the benefit of continuing to execute the operator in subsequent iterations is limited, and the execution of the operator should be stopped in time .
  • a corresponding stopping mechanism is also designed for the preprocessing cycle. In this way, not only the mixed integer programming equation can be effectively simplified, but also unnecessary preprocessing processes can be reduced, thereby reducing the time overhead of preprocessing.
  • the number of iterations of the n target operators is the same. Furthermore, 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.
  • the algorithm used for preprocessing of the preset equation can be The number of sub-iterations and the order of operator execution are used as the number of operator iterations and the order of operator execution used for preprocessing of the mixed integer programming equation to reduce the impact of human intervention on preprocessing and thereby optimize the preprocessing effect of the equation.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation; further, as mentioned above
  • the first threshold and the aforementioned second threshold are determined based on the number of iterations of n target operators.
  • the mixed integer programming equation is preprocessed based on the target operator, and before the preprocessed mixed integer programming equation is obtained, the method further includes: merging rows with a multiple relationship in the constraint matrix, or , set the multiple columns in the constraint matrix to the same column to obtain the constraint matrix after the redundancy is removed; update the mixed integer programming equation based on the constraint matrix after the redundancy is removed, and obtain the updated mixed integer programming equation; Preprocessing the mixed integer programming equation based on the objective operator to obtain the preprocessed mixed integer programming equation includes: preprocessing the updated mixed integer programming equation based on the objective operator to obtain the preprocessed mixed integer programming equation.
  • the mixed integer programming equation in order to achieve better preprocessing, can be deredundant in advance.
  • This operation can be any of the following three situations: (1) In the constraints of the mixed integer programming equation In the matrix, the rows with a multiple relationship can be determined in a certain way, and these rows can be merged to obtain the constraint matrix after the merged rows. In the constraint matrix after merging rows, the columns with multiple relationships can be determined in the same way, and these columns are set to the same columns to obtain the constraint matrix after redundancy is removed. (2) In the constraint matrix of the mixed integer programming equation, the rows with multiple relationships can be determined in a certain way, and these rows can be merged to obtain the constraint matrix after removing redundancy.
  • the columns with a multiple relationship can be determined in a certain way, and these columns are set to the same column to obtain the constraint matrix after redundancy is removed.
  • the original mixed integer programming equation can be updated with the redundancy removal constraint matrix to obtain the updated mixed integer programming equation.
  • the preprocessing object is transformed from the original mixed integer programming equation to the updated mixed integer programming equation, which can optimize the preprocessing effect.
  • the second aspect of the embodiment of the present application provides a method for obtaining a production plan.
  • the method includes: obtaining a mixed integer programming equation, which is used to describe the production plan to be solved; based on the structure related to the mixed integer programming equation. information, determine the target operator in the operator resource pool, and the target operator is part of the operators in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation; The preprocessed mixed integer programming equation is solved to obtain the solved production plan.
  • the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • This information Related to at least one of the following: variables of a mixed integer programming equation and constraint matrices of a mixed integer programming equation. Then, based on the goals The operator preprocesses the mixed integer programming equation and obtains the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved to obtain the solved production plan.
  • the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to solve the production plan of factories and enterprises in the field of supply chain), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the preprocessing of this mixed integer programming equation, can be effective Reduce the time consumed by the equation preprocessing process and improve the performance of the equation solving process.
  • variable of the mixed integer programming equation is the production plan to be solved
  • constraint matrix of the mixed integer programming equation includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy.
  • Processing constraints such as constraints or traffic constraints.
  • material constraints can include the upper limit of materials that can be used in production and material ratios, etc.
  • Productivity constraints can include the upper limit of the number of production workers required during production, the upper limit of work efficiency, etc.
  • time Constraints may include the delivery date of the product, etc.
  • Transportation constraints may include the upper limit of transportation costs required during production and the upper limit of the number of transportation vehicles required during production, etc.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, or the existence of a computational relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.
  • determining the target operator in the operator resource pool includes: in the equation resource pool, determining the information related to the structure of the mixed integer programming equation.
  • the preset equation that matches the information; in the operator resource pool, the operator corresponding to the preprocessing of the preset equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. Integer of If the sum of indicators from the indicators in the iteration to the i-th target operator in the j-1 iteration is greater than or equal to the first threshold, then the i-th target is skipped in the j-th iteration to the k-th iteration.
  • index in iterations or, if the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, then perform the above steps for the i+1th target operator until n The jth iteration of the target operator; execute the j+1 iteration of the n target operators until the kth iteration of the n target operators is completed, and obtain the preprocessed mixed integer programming equation.
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the mixed integer programming equation is preprocessed based on the target operator, and before the preprocessed mixed integer programming equation is obtained, the method further includes: merging rows with a multiple relationship in the constraint matrix, or , set the multiple columns in the constraint matrix to the same column to obtain the constraint matrix after the redundancy is removed; based on the constraints after the redundancy is removed
  • the matrix updates the mixed integer programming equation to obtain the updated mixed integer programming equation; the mixed integer programming equation is preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained, including: based on the target operator, the updated mixed integer programming equation is obtained
  • the mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.
  • the third aspect of the embodiment of the present application provides a power grid dispatching method.
  • the method includes: obtaining a mixed integer programming equation, which is used to describe the power consumption dispatch plan to be solved; based on the structure of the mixed integer programming equation Relevant information, determine the target operator in the operator resource pool, and the target operator is part of the operators in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming Equation; solve the preprocessed mixed integer programming equation to obtain the solved power consumption dispatch plan.
  • the fourth aspect of the embodiment of the present application provides a central site selection method, which method includes: obtaining a mixed integer programming equation, which is used to describe the address selection plan to be solved; based on the structural correlation with the mixed integer programming equation information, determine the target operator in the operator resource pool, and the target operator is some of the operators in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation ; Solve the preprocessed mixed integer programming equation to obtain the solved address selection plan.
  • the fifth aspect of the embodiment of the present application provides a computer task processing device.
  • the device includes: an acquisition module for acquiring a mixed integer programming equation, which is used to describe the task to be processed; and a determination module for based on Information related to the structure of the mixed integer programming equation, determine the target operator in the operator resource pool, and the target operator is part of the operators in the operator resource pool; the preprocessing module is used to perform mixed integer planning based on the target operator
  • the equation is preprocessed to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.
  • the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • This information is related to At least one of the following is relevant: the variables of a mixed integer programming equation and the constraint matrix of a mixed integer programming equation.
  • the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation.
  • the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task.
  • the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, and the existence of a calculation relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.
  • the determination module is used to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator used in the preprocessing of the equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1.
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed; the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module is used to update the mixture based on the target operator The final mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.
  • a redundancy removal module used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed
  • the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation
  • the preprocessing module is used to update the mixture based on the target operator
  • the final mixed integer programming equation is preprocessed to obtain the pre
  • the sixth aspect of the embodiment of the present application provides a production plan acquisition device.
  • the device includes: an acquisition module for acquiring a mixed integer programming equation.
  • the mixed integer programming equation is used to describe the production plan to be solved in the field of supply chain; determine
  • the module is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • the target operator is part of the operators in the operator resource pool;
  • the preprocessing module is used to determine the target operator based on the target operator resource pool.
  • the module preprocesses the mixed integer programming equation to obtain the preprocessed mixed integer programming equation;
  • the solving module is used to solve the preprocessed mixed integer programming equation to obtain the solved production plan.
  • the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • This information Related to at least one of the following: variables of a mixed integer programming equation and constraint matrices of a mixed integer programming equation.
  • the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation.
  • the preprocessed mixed integer programming equation can be solved to obtain the solved production plan.
  • the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to solve the production plan of factories and enterprises in the field of supply chain), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the preprocessing of this mixed integer programming equation, can be effective Reduce the time consumed by the equation preprocessing process and improve the performance of the equation solving process.
  • variable of the mixed integer programming equation is the production plan to be solved
  • constraint matrix of the mixed integer programming equation includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. restraints or traffic constraints.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: 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 that have a computational relationship with the variable, where the blocking information is used to indicate the submatrix whose elements are zero contained in the constraint matrix.
  • the determination module is used to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1.
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed; the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module is used to update the mixture based on the target operator The final mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.
  • a redundancy removal module used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed
  • the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation
  • the preprocessing module is used to update the mixture based on the target operator
  • the final mixed integer programming equation is preprocessed to obtain the pre
  • the seventh aspect of the embodiment of the present application provides a power grid dispatching device.
  • the device includes: an acquisition module, used to obtain a mixed integer programming equation, which is used to describe the power consumption dispatch plan to be solved; a determination module, It is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • the target operator is a part of the operators in the operator resource pool; the preprocessing module is used to determine the target operator based on the target operator.
  • the mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation to obtain the solved power consumption dispatch plan.
  • the eighth aspect of the embodiment of the present application provides a center site selection method.
  • the device includes: an acquisition module, used to obtain a mixed integer programming equation, which is used to describe the address selection plan to be solved; a determination module, using Based on the information related to the structure of the mixed integer programming equation, the target operator is determined in the operator resource pool, and the target operator is part of the operators in the operator resource pool; the preprocessing module is used to pair the mixture based on the target operator
  • the integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation to obtain the solved address selection plan.
  • a ninth aspect of the embodiment of the present application provides a computer task processing device.
  • the device includes: a processor, a memory, a bus, and an input and output device.
  • the processor is connected to the memory and the input and output devices.
  • the bus is connected to the processor, the memory, and the input and output devices respectively.
  • the input and output devices are connected; the input and output devices are used to obtain mixed integer programming equations, and the mixed integer programming equations are used to describe the tasks to be processed; an operator resource pool is stored in the memory; the processor is used to: obtain the operator resource pool from the memory , and based on the information related to the structure of the mixed integer programming equation, determine the target operator in the operator resource pool, and the target operator is some of the operators in the operator resource pool; predict the mixed integer planning equation based on the target operator Process to obtain the preprocessed mixed integer programming equation; solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: dimensions of variables of the mixed integer programming equation, sparsity of the constraint matrix of the mixed integer programming equation, and block partitioning of the constraint matrix.
  • the processor is configured to: in the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1.
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the processor is also used to: merge rows that are in a multiple relationship in the constraint matrix, or set columns that are in a multiple relationship in the constraint matrix to the same column to obtain the deredundant Constraint matrix; update the mixed integer programming equation based on the redundantly removed constraint matrix to obtain the updated mixed integer programming equation; processor, used for: preprocessing the updated mixed integer programming equation based on the target operator, Obtain the preprocessed mixed integer programming equation.
  • the tenth aspect of the embodiment of the present application provides a production plan acquisition device.
  • the device includes: a processor, a memory, a bus, and an input and output device.
  • the processor is connected to the memory and the input and output devices.
  • the bus is connected to the processor, the memory, and the input and output devices respectively.
  • the input and output devices are connected; the input and output devices are used to obtain mixed integer programming equations, which are used to describe the production plan to be solved in the field of supply chain; an operator resource pool is stored in the memory; the processor is used to:
  • the operator resource pool from the memory, and determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • the target operator is some of the operators in the operator resource pool; based on the target
  • the operator preprocesses the mixed integer programming equation to obtain the preprocessed mixed integer programming equation; it solves the preprocessed mixed integer programming equation to obtain the solved production plan.
  • variable of the mixed integer programming equation is the production plan to be solved
  • constraint matrix of the mixed integer programming equation includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. restraints or traffic constraints.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: dimensions of variables of the mixed integer programming equation, sparsity of the constraint matrix of the mixed integer programming equation, and block partitioning of the constraint matrix.
  • the processor is configured to: in the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1.
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the processor is also used to: merge rows that are in a multiple relationship in the constraint matrix, or set columns that are in a multiple relationship in the constraint matrix to the same column to obtain the deredundant Constraint matrix; update the mixed integer programming equation based on the redundantly removed constraint matrix to obtain the updated mixed integer programming equation; processor, used for: preprocessing the updated mixed integer programming equation based on the target operator, Obtain the preprocessed mixed integer programming equation.
  • the eleventh aspect of the embodiment of the present application provides a power grid dispatching device.
  • the device includes: a processor, a memory, a bus, and an input and output device.
  • the processor is connected to the memory and the input and output devices.
  • the bus is connected to the processor, the memory, and the input and output devices respectively.
  • the input and output devices are connected; the input and output devices are used to obtain mixed integer programming equations, and the mixed integer programming equations are used to describe the power consumption scheduling plan to be solved in the power field; an operator resource pool is stored in the memory; the processor is used to: obtain from the memory Obtain the operator resource pool in the operator resource pool, and based on the information related to the structure of the mixed integer programming equation, in the operator resource pool Determine the target operator, which is part of the operator in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation; perform the preprocessed mixed integer The planning equation is solved to obtain the solved power consumption schedule.
  • a twelfth aspect of the embodiment of the present application provides a central address selection device.
  • the device includes: a processor, a memory, a bus, and an input and output device.
  • the processor is connected to the memory and the input and output devices, and the bus is connected to the processor and the memory respectively. It is connected to the input and output devices; the input and output devices are used to obtain mixed integer programming equations, and the mixed integer programming equations are used to describe the address selection plan to be solved in the field of cloud technology; an operator resource pool is stored in the memory; the processor is used to:
  • the operator resource pool from the memory, and determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation.
  • the target operator is some of the operators in the operator resource pool; based on the target
  • the operator preprocesses the mixed integer programming equation to obtain the preprocessed mixed integer programming equation; it solves the preprocessed mixed integer programming equation to obtain the solved address selection plan.
  • a thirteenth aspect of the embodiments of the present application provides a computer storage medium.
  • the computer storage medium stores a computer program.
  • the program When the program is executed by a computer, the computer implements the first aspect and any possible implementation manner of the first aspect. , the method described in the second aspect or any possible implementation of the second aspect.
  • a fourteenth aspect of the embodiments of the present application provides a computer program product.
  • the computer program product stores instructions.
  • the instructions When the instructions are executed by a computer, the computer implements the first aspect and any possible implementation manner of the first aspect. , the method described in the second aspect or any possible implementation of the second aspect.
  • the target operator after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation. This information is related to the following At least one item is relevant: the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.
  • Figure 1 is a schematic structural diagram of a computer task processing system provided by an embodiment of the present application.
  • Figure 2 is another structural schematic diagram of a computer task processing system provided by an embodiment of the present application.
  • Figure 3a shows an exemplary structural diagram of the terminal device 300
  • Figure 3b is an architectural schematic diagram of a solver provided by an embodiment of the present application.
  • Figure 4 is a schematic flowchart of a computer task processing method provided by an embodiment of the present application.
  • Figure 5 is a schematic flow chart of preprocessing provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of an application example of the computer task processing method provided by the embodiment of the present application.
  • Figure 7 is a schematic diagram of the material assembly relationship in the production process provided by the embodiment of the present application.
  • Figure 8 is a schematic diagram of the comparison results provided by the embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a computer task processing device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a production plan acquisition device provided by an embodiment of the present application.
  • Embodiments of the present application provide a computer task processing method and related equipment, which can effectively reduce the time consumed in the equation preprocessing process and improve the performance of the equation solving process.
  • Mixed integer programming usually includes two types of problems: linear programming and nonlinear programming.
  • linear programming For example, assuming that a task to be processed is to obtain the factory's production plan, the generated plan not only needs to meet the goals of maximizing factory demand and minimizing the total factory cost, but also needs to meet the hard constraints and soft constraints specified by the actual business scenario. etc., the mathematical model abstracted based on the requirements that the production plan needs to meet can be simplified into the corresponding linear programming equation. Then, by solving the linear programming equation, the production plan of the factory can be obtained.
  • the solver provided by the relevant technology can be used to preprocess (presolve) the mixed integer programming equation to reduce the size of the variables and constraint matrices in the equation, thereby obtaining the preprocessed (simplified) mixed integer programming equation. , and then solve the preprocessed mixed integer programming equation to obtain the corresponding solution. Based on this solution method, the difficulty of solving mixed integer programming equations can be effectively reduced.
  • the solver multiple operators for preprocessing are provided, so the solver can execute all operators on the mixed integer programming equation in a certain order to achieve preprocessing of the mixed integer programming equation.
  • different mixed integer programming equations may be used to describe tasks to be processed in different fields.
  • Some mixed integer programming equations may not require the use of all operators to implement preprocessing. More operators are required, and some mixed integer programming equations require fewer operators when implementing preprocessing. Therefore, existing solvers consider only a single factor when preprocessing mixed integer programming equations. This causes the preprocessing process to consume too much time.
  • the solver executes multiple operators on the mixed integer programming equation, it is usually executed multiple times in a loop, and the number of iterations of the operators is usually set artificially.
  • artificial settings often rely on expert experience, and different mixed integer programming equations may be used to describe tasks to be processed in different fields.
  • artificially setting the number of operator iterations is often not enough. Accurate, resulting in insufficient preprocessing effect of the equation.
  • embodiments of the present application provide a computer task processing method (which can also be considered to provide a new solver).
  • This method makes certain improvements on the solvers of related technologies, so that it can Mixed integer programming equations (including linear programming equations, nonlinear programming equations, etc.) used to describe tasks in different fields are preprocessed and solved with high quality to obtain the processing results of the tasks.
  • the methods provided by the embodiments of this application can be applied in a variety of scenarios, The application scenarios of this method will be introduced below:
  • FIG. 1 is a schematic structural diagram of a computer task processing system provided by an embodiment of the present application.
  • the computer task processing system includes user equipment and data processing equipment.
  • user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers.
  • the user equipment is the initiator of the data sequence processing. As the initiator of the data sequence processing request, the user usually initiates the request through the user equipment.
  • the above-mentioned data processing equipment may be a cloud server, a network server, an application server, a management server, and other equipment or servers with data processing functions.
  • the data processing device receives the task processing request from the smart terminal through the interactive interface, and then abstracts the task into a mixed data planning equation through the memory for storing data and the processor for data processing, and performs task processing in the form of equation preprocessing and solving.
  • the memory in the data processing device can be a general term, including local storage and a database that stores historical data.
  • the database can be on the data processing device or on other network servers.
  • the user device can receive instructions from the user. For example, the user device can obtain a task input/selected by the user, and then initiate a request to the data processing device (usually including various parameters of the task, For example, variables of the task and various constraints that the task needs to satisfy, etc.), 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 device can obtain a task input by the user and related parameters of the task, and then initiate a task processing request to the data processing device, so that the data processing device abstracts the task into a mixed integer equation and performs the processing on the mixed integer equation. Preprocessing, and then solving the preprocessed mixed integer equation to obtain the corresponding solution, which can be used as the processing result of the task.
  • the data processing device can execute the computer task processing method or the production plan obtaining method according to the embodiment of the present application.
  • FIG 2 is another structural schematic diagram of a computer task processing system provided by an embodiment of the present application.
  • the user equipment directly serves as a data processing equipment.
  • the user equipment can directly obtain input from the user and directly use the hardware of the user equipment itself.
  • the specific process is similar to Figure 1. Please refer to the above description and will not be repeated here.
  • the user equipment can receive instructions from the user. For example, the user equipment can obtain a task selected by the user in the user equipment, and then the user equipment itself executes a task processing application for the task. (For example, text summary generation, etc.), that is, abstract the task into a mixed integer equation, preprocess the mixed integer equation, and then solve the preprocessed mixed integer equation to obtain the corresponding solution, which can be used as the task processing results.
  • a task processing application for the task For example, text summary generation, etc.
  • the user equipment itself can execute the computer task processing method or the production plan obtaining method according to the embodiment of the present application.
  • the user equipment in Figures 1 and 2 can usually be a terminal equipment used by the user, such as a mobile phone, a notebook, a personal computer, etc.
  • the terminal device will be further introduced below in conjunction with Figure 3a ( Figure 3a shows an exemplary structural schematic diagram of the terminal device 300).
  • the terminal device 300 includes: an application processor 301, a microcontroller unit (MCU) 303, a memory 305, a modem (modem) 307, a radio frequency (radio frequency, RF) module 309, and wireless fidelity.
  • MCU microcontroller unit
  • modem modem
  • RF radio frequency
  • End device 300 may include more or fewer components than illustrated, or combinations of certain components, or different component arrangements.
  • the application processor 301 is the control center of the terminal device 300 and connects various components of the terminal device 300 using various interfaces and buses.
  • processor 301 may include one or more processing units.
  • Computer programs are stored in the memory 305, such as the operating system 361 and application programs 363 shown in Figure 3a.
  • the application processor 301 is configured to execute the computer program in the memory 305 to implement functions defined by the computer program.
  • the application processor 301 executes the operating system 361 to implement various functions of the operating system on the terminal device 300 .
  • the memory 305 also stores other data in addition to computer programs, such as data generated during the operation of the operating system 361 and the application program 363.
  • Memory 305 is a non-volatile storage medium, generally including internal memory and external memory. Memory includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), or cache (cache), etc.
  • External storage includes but is not limited to flash memory, hard disk, optical disk, universal serial bus (USB) disk, etc.
  • Computer programs are usually stored on external memory, and the processor loads the computer program from external memory into memory before executing it.
  • the memory 305 can be independent and connected to the application processor 301 through a bus; the memory 305 can also be integrated with the application processor 301 into a chip subsystem.
  • the MCU 303 is a co-processor used to obtain and process data from the sensor 314.
  • the MCU 303 has less processing power and power consumption than the application processor 301, but has the feature of "always on" and can be used in the application processor.
  • MCU 303 may be a sensor hub chip.
  • Sensors 314 may include light sensors, motion sensors.
  • the light sensor can include an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display 351 according to the brightness of the ambient light.
  • the proximity sensor can turn off the power of the display screen when the terminal device 300 moves to the ear. .
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three axes), and can detect the magnitude and direction of gravity when stationary; the sensor 314 can also include a gyroscope, a barometer, a hygrometer, Other sensors such as thermometers and infrared sensors will not be described in detail here.
  • the MCU 303 and the sensor 314 can be integrated on the same chip, or they can be separate components connected through a bus.
  • Modem 307 and radio frequency module 309 constitute the terminal equipment 300 communication subsystem, which is used to implement the main functions of wireless communication standard protocols such as 3GPP and ETSI. Among them, Modem 307 is used for encoding and decoding, signal modulation and demodulation, equalization, etc.
  • the radio frequency module 309 is used for receiving and transmitting wireless signals.
  • the radio frequency module 309 includes but is not limited to an antenna, at least one amplifier, coupler, duplexer, etc.
  • the radio frequency module 309 cooperates with the Modem 307 to implement wireless communication functions.
  • Modem 307 can be used as a separate chip or can be combined with other chips or circuits to form a system-on-chip or integrated circuit. These chips or integrated circuits can be applied to all terminal devices that implement wireless communication functions, including: mobile phones, computers, notebooks, tablets, routers, wearable devices, cars, home appliances, etc.
  • the terminal device 300 can also use the Wi-Fi module 311, the Bluetooth module 313, etc. to perform wireless communication.
  • the Wi-Fi module 311 is used to provide the terminal device 300 with network access that complies with Wi-Fi related standard protocols.
  • the terminal device 300 can access the Wi-Fi access point through the Wi-Fi module 311 and then access the Internet.
  • the Wi-Fi module 311 can also serve as a Wi-Fi wireless access point and can provide Wi-Fi network access for other terminal devices.
  • the Bluetooth module 313 is used to implement short-distance communication between the terminal device 300 and other terminal devices (such as mobile phones, smart watches, etc.).
  • the Wi-Fi module 311 in the embodiment of the present application may be an integrated circuit or a Wi-Fi chip, etc.
  • the Bluetooth module 313 may be an integrated circuit or a Wi-Fi chip. Bluetooth chip, etc.
  • the positioning module 350 is used to determine the geographical location of the terminal device 300 . It can be understood that the positioning module 350 may be a receiver of a global positioning system (GPS) or a positioning system such as the Beidou Satellite Navigation System or the Russian GLONASS.
  • GPS global positioning system
  • GLONASS Russian GLONASS
  • the Wi-Fi module 311, the Bluetooth module 313 and the positioning module 350 can be separate chips or integrated circuits, or they can be integrated together.
  • the Wi-Fi module 311, the Bluetooth module 313 and the positioning module 350 can be integrated on the same chip.
  • the Wi-Fi module 311, the Bluetooth module 313, the positioning module 350 and the MCU 303 can also be integrated into the same chip.
  • Input/output devices 335 include but are not limited to: display 351, touch screen 353, audio circuit 355, and so on.
  • the touch screen 353 can collect touch events on or near the user of the terminal device 300 (such as the user's operations on the touch screen 353 or near the touch screen 353 using any suitable object such as a finger or a stylus), and Send the collected touch events to other devices (eg, application processor 301).
  • the user's operation near the touch screen 353 can be called floating touch; through floating touch, the user can select, move or drag targets (such as icons, etc.) without directly touching the touch screen 353 .
  • touch screens 353 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the display (also called a display screen) 351 is used to display information input by the user or information presented to the user. Displays can be configured in the form of LCD screens, organic light-emitting diodes, etc.
  • the touch screen 353 can be overlaid on the display 351. When the touch screen 353 detects a touch event, it is sent to the application processor 301 to determine the type of the touch event. Then the application processor 301 can provide corresponding information on the display 351 according to the type of the touch event. Visual output.
  • the touch screen 353 and the display 351 are used as two independent components to implement the input and output functions of the terminal device 300, in some embodiments, the touch screen 353 and the display 351 can be integrated to implement the input and output functions of the mobile phone 300. Input and output functions. In addition, the touch screen 353 and the display 351 can be configured in the form of a full panel on the front of the terminal device 300 to achieve a frameless structure.
  • the audio circuit 3355, speaker 336, and microphone 317 can provide an audio interface between the user and the terminal device 300.
  • the audio circuit 309 can transmit the electrical signal converted from the received audio data to the speaker 313, and the speaker 313 converts it into a sound signal for output; on the other hand, the microphone 314 converts the collected sound signal into an electrical signal, and the audio circuit 309 After receiving, it is converted into audio data, and then the audio data is sent to another terminal device through the Modem 307 and the radio frequency module 309, or the audio data is output to the memory 305 for further processing.
  • the terminal device 300 may also have a fingerprint recognition function.
  • the fingerprint collection device may be configured on the back of the terminal device 300 (for example, below the rear camera), or the fingerprint collection device may be configured on the front of the terminal device 300 (for example, below the touch screen 353).
  • a fingerprint collection device can be configured in the touch screen 353 to implement the fingerprint identification function, that is, the fingerprint collection device can be integrated with the touch screen 353 to implement the fingerprint identification function of the terminal device 300 .
  • the fingerprint collection device is configured in the touch screen 353, may be a part of the touch screen 353, or may be configured in the touch screen 353 in other ways.
  • the main component of the fingerprint collection device in the embodiment of the present application is a fingerprint sensor.
  • the fingerprint sensor can use any type of sensing technology, including but not limited to optical, capacitive, piezoelectric or ultrasonic sensing technology.
  • the operating system 361 installed on the terminal device 300 may be or other operating systems, the embodiments of this application do not impose any restrictions on this.
  • the terminal device 300 can be logically divided into a hardware layer, an operating system 361, and an application layer.
  • the hardware layer includes the hardware processor 301, microcontroller unit 305, Modem 307, Wi-Fi module 311, sensor 314, positioning module 350 and other hardware resources as mentioned above.
  • the application layer includes one or more applications, such as application 363.
  • the application 363 can be any type of application such as a social application, an e-commerce application, or a browser.
  • the operating system 361 is a computer program that manages and controls hardware and software resources.
  • operating system 361 includes a kernel, a hardware abstraction layer (HAL), libraries and runtime, and a framework.
  • the kernel is used to provide underlying system components and services, such as power management, memory management, thread management, hardware drivers, etc.; hardware drivers include Wi-Fi drivers, sensor drivers, positioning module drivers, etc.
  • the hardware abstraction layer encapsulates the kernel driver, provides an interface to the framework, and shields low-level implementation details.
  • the hardware abstraction layer 25 runs in user space, while the kernel driver runs in kernel space.
  • libraries and runtime are also called runtime libraries, which provide the library files and execution environment required for executable programs to run.
  • the libraries and runtimes include Android Runtime (ART), libraries, and scenario package runtimes.
  • ART is a virtual machine or virtual machine instance that can convert an application's bytecode into machine code.
  • a library is a program library that provides support for executable programs at runtime, including browser engines (such as webkit), script execution engines (such as JavaScript engines), graphics processing engines, etc.
  • the scene package runtime is the running environment of the scene package, which mainly includes the page execution environment (page context) and the script execution environment (script context).
  • the page execution environment parses the page code in html, css and other formats by calling the corresponding library, and the script
  • the execution environment parses and executes code or executable files implemented in scripting languages such as JavaScript by calling the corresponding function library.
  • the framework is used to provide various basic public components and services for each application in the application layer, such as window management, location management, etc.
  • the framework may include geofencing services, policy services, notification managers, and the like.
  • each component of the operating system 361 can be implemented by the application processor 301 executing programs stored in the memory 305 .
  • Figure 3b is an architectural schematic diagram of a solver provided by an embodiment of the present application).
  • the solver includes: an equation building module, a preprocessing (presolve) module, a generation (crash) module, a pre-solving module, and a post-processing module. Processing (postsolve) module and recovery (clean up) module.
  • the equation building module can construct a mixed integer programming equation based on the task to be processed.
  • the preprocessing module can structurally simplify the mixed integer programming equation and obtain the preprocessed mixed integer programming equation.
  • the generation module can generate initial points for solution based on the preprocessed mixed integer programming equation.
  • the pre-solving module can use the dual simplex method to solve the pre-processed mixed integer programming equation starting from this initial point, and obtain the optimal solution of the pre-processed mixed integer programming equation.
  • the post-processing module can convert the optimal solution of the preprocessed mixed integer programming equation into an approximate solution of the original mixed integer programming equation. If the restoration module determines that the approximate solution is not the optimal solution of the original mixed integer programming equation, it restores the approximate solution to the optimal solution of the original mixed integer programming equation.
  • FIG. 4 is a schematic flow chart of a computer task processing method provided by an embodiment of the present application. As shown in Figure 4, the method includes:
  • the mixed integer programming equation is used to describe the task to be processed.
  • a mixed integer programming equation describing the task to be processed can be obtained.
  • Mixed integer programming equations usually include two major types of equations, namely linear programming equations and nonlinear programming equations.
  • the task to be processed is to obtain a production plan to be solved for a certain factory (which can also be understood as a production scheduling plan)
  • the production plan to be solved for the factory must not only satisfy the maximization of the demand of the factory and the total number of the factory.
  • Goals such as cost minimization also need to meet the hard constraints and soft constraints specified by the actual business scenario, etc.
  • x is the variable of the linear programming equation (that is, the production plan to be solved for the factory mentioned above), and is a matrix with m rows and 1 column (each element in this matrix can be regarded as each quantity to be solved in the production plan , for example, this matrix contains 10 elements, which are the amount of raw materials that the factory needs to produce every day within 10 days, etc., and these 10 elements can be either integers or non-integers);
  • A is linear programming
  • the constraint matrix of the equation (including the aforementioned constraints that need to be satisfied by the production plan to be solved for the factory, such as material constraints, productivity constraints, time constraints, traffic constraints, etc.) is a matrix with h rows and m columns, and the constraint matrix A Each row in can be regarded as a constraint that the factory needs to satisfy;
  • c is a matrix corresponding to the number of elements in the variable, also a matrix with m rows and 1 column;
  • b is a matrix corresponding to the number of constraints, with h rows and 1
  • tasks in different fields can be described by mixed integer programming equations, such as factory production planning in the supply chain field, vehicle route optimization in the logistics field, and facility location in the cloud technology field. , grid dispatching in the electric power field, etc., these tasks can be described by mixed integer programming equations.
  • Mixed integer programming equations used to describe tasks in different fields often have different variables and different constraint matrices.
  • the 402. Determine the target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation.
  • the information is related to at least one of the following: variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be identified, thereby obtaining information related to the structure of the mixed integer programming equation (it can also be called the structure information of the mixed integer programming equation, which can be used to indicate the structure of the mixed integer programming equation. structure).
  • the operation of structure identification mainly focuses on analyzing the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation, thereby determining the structural composition of the mixed integer programming equation (that is, the structural composition of the task to be processed) , so 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.
  • the information related to the structure of the mixed integer programming equation may be Contains at least one of the following: (1) The dimension of the variable of the mixed integer programming equation, that is, the number of elements contained in the variable of the mixed integer programming equation, for example, the number of elements contained in the variable x of the linear programming equation. (2) The sparsity of the constraint matrix of the mixed integer programming equation, that is, the number of elements with a value of zero in the constraint matrix of the mixed integer programming equation, for example, the number of elements with a value of 0 in the constraint matrix A of the linear programming equation quantity.
  • the block information of the constraint matrix of the mixed integer programming equation is used to indicate the submatrix whose elements are zero contained in the constraint matrix of the mixed integer programming equation. For example, assuming a linear programming equation The first three rows of the constraint matrix A are all 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.
  • the rows in the constraint matrix of the mixed integer programming equation have a calculation relationship with the variables of the mixed integer programming equation.
  • each row in the constraint matrix of the mixed integer programming equation will be multiplied by the variables of the mixed integer programming equation, if the mixed integer programming equation is mixed If (all the elements of) a certain row in the constraint matrix of the integer programming equation are zero, it means that there is no calculation relationship between the row and the variables of the mixed integer programming equation. If any of the rows (of any elements) in the constraint matrix of the mixed integer programming equation An element) is not zero, indicating that there is a computational relationship between the row and the variables of the mixed integer programming equation. For example, assuming that 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.
  • the target operator can be determined from the operator resource pool based on this information. It should be noted that the operator resource pool contains multiple operators that can be used to implement preprocessing, as shown in Table 1:
  • the operator resource pool includes but is not limited to multiple optional operators shown in Table 1. Therefore, the operator resource pool can be selected from the operator resource pool based on the information related to the structure of the mixed integer programming equation. At least one operator is used to preprocess the mixed integer programming equation. This selected operator can be later called the target operator.
  • the target operator can be obtained in the following ways:
  • the equation resource pool determine the preset equation that matches the information related to the structure of the mixed integer programming equation.
  • the equation resource pool contains multiple preset equations with different structures (can also be understood as equation templates with different structures set in advance), and the information related to the structure of the mixed integer programming equation is used to indicate the mixed integer programming
  • the structural category of the equation therefore, is to traverse the equation resource pool to find a preset equation that matches the information related to the structure of the mixed integer programming equation. Then, the preset equation and the mixed integer programming equation have a similar structure or The same two equations.
  • the operator resource pool determine the operator used for preprocessing of the preset equation as the target operator. It should be noted that after determining the preset equation with a similar or identical structure to the mixed integer programming equation, since the preset equation is set in advance, it can be determined that the preprocessing of the preset equation has used the operator resource pool Which operators are determined and these operators are determined as operators used to implement preprocessing of mixed integer programming equations, that is, target operators. It is worth noting that there are usually multiple target operators. In the preprocessing for the preset equation, each target operator can be recycled multiple times, so it can be determined that each target operator is used for the preset equation. The number of iterations in preprocessing.
  • the multiple target operators can be divided into multiple operator sets according to the number of iterations, and each operator set contains at least one target operator among the multiple target operators.
  • the number of iterations of the target operator in the first operator set is 1
  • the number of iterations of the target operator in the second operator set is 2
  • the kth The number of iterations of the target operator in the operator set is k times
  • k is an integer greater than or equal to 1.
  • this embodiment is only schematically illustrated by associating information related to the structure of the mixed integer programming equation with at least one of the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation.
  • 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, etc.
  • the information related to the structure of the mixed integer programming equation may also include at least one of the following: the sparsity of the matrix corresponding to the number of elements in the variable, the sparsity of the matrix corresponding to the number of constraints, and so on.
  • the structure of the preset equation is similar or the same as the structure of the mixed integer programming equation, which usually means that the constraint matrix of the preset equation is similar or the same as the constraint matrix of the mixed integer programming equation.
  • the structure of the preset equation and the structure of the mixed integer programming equation may also include: the matrices corresponding to the number of elements in the variables of the two equations are similar or the same, and/or the AND constraints of the two equations The matrices corresponding to the quantities are similar or the same, etc.
  • preprocessing of the mixed integer programming equation can be implemented based on the target operator to obtain the preprocessed mixed integer programming equation.
  • the mixed integer programming equation can be deredundant in advance, which includes:
  • the rows with multiple relationships can be determined in a certain way, and these rows can be merged to obtain the constraint matrix after the merged rows. Still as in the above example, assuming a 1 and a 2 are the first and second rows of the constraint matrix A respectively, then the following calculations can be performed for a 1 and a 2 respectively:
  • a 11 is the first element of a 1
  • a 12 is the second element of a 1
  • a 1m is the m-th element of a 1
  • ⁇ and ⁇ are both preset parameter matrices, and each element in these two matrices is a preset value.
  • ratio1 ratio2
  • a 1 and a 2 may be in a multiple relationship, that is, a 1 may be equal to qa 2 , that is to say, a 1 and a 2 are Potential parallel rows.
  • the columns with multiple relationships can be determined in the same way, and these columns are set to the same columns to obtain the constraint matrix after redundancy removal (which can also be called the transformed constraint matrix).
  • a 1 and A 2 be respectively the first and second columns of the constraint matrix A after merging rows.
  • a ratio can be set for each column of the constraint matrix A after merging rows, based on ratio of all rows to determine the real parallel columns (for the process of obtaining real parallel columns, please refer to the aforementioned process of obtaining real parallel rows, which will not be repeated here). After determining the real parallel columns, these parallel columns can be Set to one of the columns to obtain the constraint matrix A after redundancy removal.
  • a 1 qA 2
  • transforming the elements of the first row in the variable x from x 1 to qx 1 can make the constraint matrix after merging the rows
  • clo 1 is the maximum value of x 1
  • cup 1 is the minimum value of x 1 .
  • the original mixed integer programming equation After obtaining the constraint matrix after removing redundancy, the original mixed integer programming equation can be updated with the constraint matrix after removing redundancy to obtain the updated mixed integer programming equation.
  • the original variables After replacing the original constraint matrix with the constraint matrix after removing redundancy, the original variables also need to be replaced with the transformed variables accordingly.
  • the original The matrix corresponding to the number of elements in the variable also needs to be replaced with the transformed matrix corresponding to the number of elements in the variable, so as to obtain the updated mixed integer programming equation.
  • steps 403 and 404 are optional steps. In practical applications, after the target operator is determined, the mixed integer programming equation does not need to be deredundant and updated (that is, steps 403 and 404 are not performed). Then, the processing object in step 405 is the original mixed Integer programming equations.
  • the objective operator can be used to implement preprocessing for the updated mixed integer programming equation, and the preprocessed mixed integer programming equation is obtained.
  • the updated mixed integer programming equation can be preprocessed through the following iteration strategy:
  • the second threshold is usually determined based on the number of iterations k, and generally increases as the number of iterations k increases. increases, that is, there is a positive correlation between the two).
  • the index of the i-th target operator in the j-1th iteration is less than the second threshold, it means that the i-th operator can currently be executed, and the i-th target operator is executed on the updated mixed integer programming equation. operator, and generate the index of the i-th target operator in the j-th iteration. It is worth noting that the index of the i-th target operator in the j-th iteration can be generated in the following way: first, determine the rows deleted by the i-th target operator in the 1st iteration to the j-th iteration. in the updated mixed integer programming equation. Then, calculation is performed based on this proportion to obtain the index of the i-th target operator in the j-th iteration.
  • the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, it means that the i-th operator cannot be executed currently, and then jump to the i+1-th target operator. And perform the above steps for the i+1th target operator until the jth iteration of the n target operators is completed.
  • the n target operators have been sorted in a certain order (the order is the execution order of the n target operators in the preprocessing of the preset equation), so in the In the updated mixed integer programming equation, these n operators can be executed in this order in each iteration.
  • the preprocessed mixed integer programming equation After obtaining the preprocessed mixed integer programming equation, the preprocessed mixed integer programming equation can be solved to obtain the corresponding solution, which can be used as the processing result of the aforementioned task.
  • the output is the processing production plan (processing volume, transportation volume, delivery volume, etc.) arranged according to the order demand.
  • the expected output result is the ability to Minimize processing cost, processing time and maximize order fulfillment rate (that is, deliver customer needs on time and quantity), etc., and all processing constraints need to be met.
  • FIG. 7 is a schematic diagram of the bill of material (BOM) in the production process provided by the embodiment of the present application. As shown in Figure 7, the PC generation process is taken as an example to illustrate how the BOM affects the production process: It is assumed that each PC needs to be configured with a host, and each laptop can be configured individually. There are two factories A and B. Factory A can process PCs and mainframes, while factory B can process mainframes and laptops.
  • BOM bill of material
  • factory A can only process up to 1,000 PCs or mainframes per day.
  • Factory B can only process up to 1,000 hosts or laptops per day.
  • a legal and better production plan is: on the first day, factory A arranges to produce 1,000 hosts, and factory B arranges to produce 1,000 hosts. After factory B completes production, the 1,000 hosts are sent to factory A; on the second day, factory A arranges to produce 1,000 hosts.
  • Factory A uses the 1,000 hosts it has already produced to complete the assembly and production of 1,000 PCs, while Factory B continues to arrange the production of 1,000 hosts; on the third day, Factory A uses the 1,000 hosts sent by Factory B on the first day to complete the assembly and production. For the assembly of 1,000 PCs, Factory B arranges to produce 800 laptops.
  • the two factories will complete all customer order requirements on the third day and comply with various constraints such as materials, productivity, time, and transportation.
  • the above example does not take into account multiple conflicting objectives (cost, order delivery fulfillment rate, etc.), and real industrial scenarios are far more complex than the example problem.
  • Step 1 Construct the equation.
  • This equation can include mathematical relationships between variables and constraint matrices.
  • the variables are the factory's production plan to be solved, and the constraint matrix is the processing required for the production plan to be solved.
  • Constraints, processing constraints can include at least one of the following: material constraints, productivity constraints, time constraints or traffic constraints, etc., where material constraints can include the upper limit of materials that can be used in production, material ratios, etc.
  • Productivity constraints can include The upper limit of the number of production workers required during production, the upper limit of work efficiency, etc.
  • the time constraints can include the delivery date of the product, etc.
  • the transportation constraints can include the upper limit of the transportation cost required during production and the upper limit of the number of transportation vehicles required during production. wait. It can be seen that solving this equation is equivalent to obtaining the production plan of the factory.
  • Step 2 Read the constructed mixed integer programming equation into the solver, call the specified interface of the solver, and perform preprocessing of the mixed integer programming equation.
  • This preprocessing process can be divided into the following steps:
  • sub-step (2) in step 2 is an optional step. In actual applications, it may or may not be executed. The selection can be made according to actual needs and is not limited here.
  • Step 3 Method selection. Choose from different methods in the algorithm library, including primitive simplex method, dual simplex method, interior point method, etc.
  • Step 4 Based on the method selected in step 3, complete the solution of the preprocessed mixed integer programming equation.
  • the solver provided by the embodiment of the present application and the solver of the related technology can also be compared.
  • the comparison result is shown in Figure 8 ( Figure 8 is provided by the embodiment of the present application A schematic diagram of the comparison results).
  • the solver provided by the relevant technology and the solver provided by the embodiment of the present application can be used to respectively solve the mixed integer programming equation describing the task. Solve and compare. The comparison results are shown in Table 2:
  • the solving time of the embodiment of the present application can be reduced from 1394s to less than 100s, surpassing the solving time of related technology 2 and related technology 3. It can be seen that in the solver of the embodiment of the present application Preprocessing module with excellent performance.
  • the task to be processed is the vehicle route optimization problem in the logistics field.
  • the vehicle routing problem was first proposed in 1959. The problem is to designate a certain number of customers, each with different quantities of goods requirements.
  • the distribution center provides goods to the customers, and a fleet is responsible for distributing the goods and organizing appropriate driving routes.
  • the goal is to satisfy customer needs and achieve goals such as the shortest distance, the lowest cost, and the least time consuming under certain constraints.
  • This problem requires finding the optimal solution among a limited set of feasible solutions.
  • This type of problem requires finding the optimal value (maximum or minimum value) of the objective function that satisfies the given constraints on a discrete and finite mathematical structure.
  • Problems, also called discrete optimization problems, are all related to order.
  • the variable is the vehicle adoption plan to be solved, and different elements in this variable represent different types of vehicles (since vehicle paths are often difficult to express numerically, so here a certain refers to the number of vehicles traveling along a certain route), and the constraint matrix contains one or more of the capacity constraints, product constraints, time constraints and road condition constraints that the vehicle adoption plan to be solved needs to satisfy, where , the capacity constraint includes the upper capacity limit of the vehicle during transportation, etc., the product constraint includes the product categories that the vehicle can transport during transportation, etc., the time constraint includes the time sequence of different types of vehicles arriving at the destination, etc., and the road condition constraint includes different types of vehicles. The road conditions that the vehicle can travel on, etc.
  • the preprocessing method provided by the embodiment of the present application can be relied on to simplify the equation, thereby accelerating the solution of the equation.
  • the task to be processed is the center location problem in the field of cloud technology.
  • enterprises Companies need to consider rival competition when making location decisions.
  • users need to consider a discrete network where two service providers (leader and follower) open a certain number of facilities one after another to compete for market share. Each user seeks services from the nearest facility.
  • this application case requires solving a two-level linear programming equation, where the upper-level problem represents the leader's decision-making, and its goal is maximum coverage, while the lower-level problem is the corresponding NP-hard problem for the follower. Assuming that the follower adopts a greedy strategy, the follower's response can be integrated into the constraints of the leader's problem.
  • the execution process needs to be executed from the bottom layer to the upper layer, and the aforementioned iteration strategy (implementing early stopping of certain operators, etc.) needs to be implemented, so as to more Further reduce the time-consuming preprocessing.
  • variable of the mixed integer programming equation constructed based on the central location problem is the address selection plan to be solved.
  • Different elements in the variable represent the addresses of different objects (for example, enterprises, factories, etc.) (for example, , longitude, latitude, etc.)
  • the constraint matrix contains one or more of the distribution constraints, traffic environment constraints and rule constraints that the address selection plan to be solved needs to satisfy, where the distribution constraints include the current distribution of different objects, Future distribution predictions of different objects, business volume growth rates of objects, regional distribution of interactions between objects, etc.
  • Traffic environment constraints include transportation conditions, distribution conditions, land use conditions, etc. when objects interact with each other.
  • Rule constraints include the relationship between objects. regulations that need to be followed for interactions, etc.
  • the power grid dispatching problem mainly includes two stages:
  • the economic dispatch problem of the non-convex power system is converted into a mixed integer programming equation through linearization processing and mixed integer coding technology, and then an optimization software package is used to solve the mixed integer programming equation to obtain a satisfactory feasible solution;
  • power grid dispatching is a multi-stage mathematical model.
  • the multi-stage model needs to consider more boundary constraints of different time periods. Therefore, in the process of using the preprocessing method provided by the embodiment of this application, it is necessary to consider the segmentation of time periods.
  • variable of the mixed integer programming equation constructed based on the power grid dispatch problem is the power consumption dispatch plan to be solved. Different elements in this variable represent the power consumption in different regions, and the constraint matrix contains the power consumption to be solved.
  • the quantity constraints and price constraints that the electricity consumption dispatch plan needs to satisfy include the upper limit of electricity consumption in each region, etc.
  • the price constraints include the upper limit of the total price of electricity in each region. etc.
  • the target operator after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation. This information is related to the following At least one item is relevant: the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific class of tasks), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the mixed integer programming equation.
  • the preprocessing of integrated integer programming equations can effectively reduce the time consumed in the equation preprocessing process and improve the performance of the equation solving process.
  • the embodiment of the present application provides an equation resource pool. After determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, that is, a certain preset equation in the equation resource pool (which can also be called an equation An equation template in the resource pool), the operator used for preprocessing of the preset equation, the number of operator iterations and the order of operator execution can be used as the operator used for preprocessing of the mixed integer programming equation , the number of operator iterations and the order of operator execution to reduce the impact of human intervention on preprocessing, thereby optimizing the preprocessing effect of the equation.
  • a certain preset equation in the equation resource pool which can also be called an equation An equation template in the resource pool
  • the operator used for preprocessing of the preset equation, the number of operator iterations and the order of operator execution can be used as the operator used for preprocessing of the mixed integer programming equation , the number of operator iterations and the order of operator execution to reduce the impact of human intervention on preprocessing, thereby optimizing the preprocessing effect of
  • the embodiments of this application also provide an iterative strategy, that is, during the iterative process, when the role of an operator becomes smaller, it can be considered that the benefit of continuing to execute the operator in subsequent iterations is limited, and it will be stopped in time. Execute this operator.
  • a corresponding stopping mechanism is also designed for the preprocessing cycle. In this way, not only the mixed integer programming equation can be effectively simplified, but also unnecessary preprocessing processes can be reduced, thereby reducing the time overhead of preprocessing.
  • Figure 9 is a schematic structural diagram of a computer task processing device provided by an embodiment of the present application.
  • the device includes:
  • the acquisition module 901 is used to obtain the mixed integer programming equation, which is used to describe the task to be processed;
  • the determination module 902 is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, where the target operator is a part of the operators in the operator resource pool;
  • the preprocessing module 903 is used to preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation;
  • the solving module 904 is used to solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.
  • the target operator after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation. This information is related to the following At least one item is relevant: the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, and the existence of a calculation relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.
  • the determination module 902 is configured to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine for The operator used in the preprocessing of the preset equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of n target operators is k times
  • n and k are both integers greater than or equal to 1.
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed; the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module 903 is used to update the mixed integer programming equation based on the target operator pair The updated mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.
  • a redundancy removal module used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed
  • the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation
  • the preprocessing module 903 is used to update the mixed integer programming equation based on the target operator pair
  • Figure 10 is a schematic structural diagram of a production plan acquisition device provided by the implementation method of this application. As shown in Figure 10, the device includes:
  • the acquisition module 1001 is used to obtain the mixed integer programming equation, which is used to describe the production plan to be solved in the supply chain field;
  • the determination module 1002 is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, where the target operator is a part of the operators in the operator resource pool;
  • the preprocessing module 1003 is used to preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation;
  • the solving module 1004 is used to solve the preprocessed mixed integer programming equation to obtain the solved production plan.
  • the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation. This information is related to At least one of the following is relevant: the variables of a mixed integer programming equation and the constraint matrix of a mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved to obtain the solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation.
  • the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to solve the production plan of factories and enterprises in the field of supply chain), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the preprocessing of this mixed integer programming equation, can be effective Reduce the time consumed by equation preprocessing and Improve the performance of the equation solving process.
  • variable of the mixed integer programming equation is the production plan to be solved
  • constraint matrix of the mixed integer programming equation includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. restraints or traffic constraints.
  • the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, or the existence of a computational relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.
  • the determination module 1002 is configured to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the preset equation is determined as the target operator.
  • the number of target operators is n
  • the number of iterations of the n target operators is the same.
  • the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.
  • the first threshold and the second threshold are determined based on the number of iterations of n target operators.
  • the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy has been removed; the update module is used to update the mixed integer programming equation based on the redundancy removal constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module 1003 is used to update the mixed integer programming equation based on the target operator pair The updated mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.
  • Embodiments of the present application also relate to a computer storage medium, which includes computer-readable instructions. When the computer-readable instructions are executed, the method steps of the embodiment shown in Figure 4 are implemented.
  • Embodiments of the present application also relate to a computer program product containing instructions that, when run on a computer, cause the computer to execute the method steps of the embodiment shown in FIG. 4 .
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .

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

Provided in the present application are a computer task processing method and a related device therefor, which are applied to the technical field of computers, and can effectively reduce the time consumed during an equation presolving process, and can also improve the performance of an equation solving process. The method of the present application comprises: acquiring a mixed integer programming equation, which is used for describing a task to be processed, and then performing structure identification on the mixed integer programming equation, so as to obtain information related to the structure of the mixed integer programming equation; subsequently, on the basis of the information, selecting from an operator resource pool at least one operator, which is used for implementing presolving, wherein these selected operators are target operators; and then, implementing presolving for the mixed integer programming equation on the basis of the target operators, and solving the presolved mixed integer programming equation, so as to obtain a corresponding solution, wherein the solution may serve as a processing result of the task.

Description

一种计算机任务处理方法及其相关设备A computer task processing method and related equipment

本申请要求于2022年3月31日提交中国专利局、申请号为202210333041.7、发明名称为“一种计算机任务处理方法及其相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on March 31, 2022, with the application number 202210333041.7 and the invention title "A computer task processing method and related equipment", the entire content of which is incorporated by reference. in this application.

技术领域Technical field

本申请涉及计算机技术领域,尤其涉及一种计算机任务处理方法及其相关设备。The present application relates to the field of computer technology, and in particular, to a computer task processing method and related equipment.

背景技术Background technique

在很多领域中所面临的许多实际问题都可以用混合整数规划来处理,混合整数规划通常包括线性规划和非线性规划这两类问题。例如,设某个待处理的任务为获取工厂的生产计划,生成计划不仅需要满足工厂需求的最大化以及工厂总成本的最小化等目标,还需满足实际业务场景指定的硬约束与软约束等等,根据生产计划所需满足的要求抽象出来的数学模型,可以简化为相应的线性规划方程。那么,通过对该线性规划方程进行求解,可得到该工厂的生产计划。Many practical problems faced in many fields can be handled by mixed integer programming. Mixed integer programming usually includes two types of problems: linear programming and nonlinear programming. For example, assuming that a task to be processed is to obtain the factory's production plan, the generated plan not only needs to meet the goals of maximizing factory demand and minimizing the total factory cost, but also needs to meet the hard constraints and soft constraints specified by the actual business scenario. etc., the mathematical model abstracted based on the requirements that the production plan needs to meet can be simplified into the corresponding linear programming equation. Then, by solving the linear programming equation, the production plan of the factory can be obtained.

由于混合整数规划方程自身涉及的数据量往往很庞大,例如,混合整数规划方程中的变量和约束矩阵的规模通常超过百万数量级,甚至达到千万数量级等等,故可使用相关技术提供的求解器对混合整数规划方程进行预处理(presolve),以缩小方程中变量和约束矩阵的规模,从而得到预处理后(化简后)的混合整数规划方程,再对预处理后的混合整数规划方程进行求解,如此一来,可降低求解方程的难度。Since the amount of data involved in the mixed integer programming equation itself is often very large, for example, the size of the variables and constraint matrices in the mixed integer programming equation usually exceeds the order of millions, or even reaches the order of tens of millions, etc., so solutions provided by related technologies can be used The processor preprocesses (presolve) the mixed integer programming equation to reduce the size of the variables and constraint matrices in the equation, thereby obtaining the preprocessed (simplified) mixed integer programming equation, and then performs the preprocessed mixed integer programming equation Solve, which makes solving the equation less difficult.

在求解器中,提供了多个用于实现预处理的算子,故求解器可按照一定的顺序,对混合整数规划方程执行所有算子,以实现混合整数规划方程的预处理。然而,不同的混合整数规划方程可能用于描述不同领域中的待处理的任务,有些混合整数规划方程可能不需要使用所有算子来实现预处理,故现有的求解器在预处理的过程中,考虑的因素较为单一,导致预处理过程所消耗的时间过多。In the solver, multiple operators for preprocessing are provided, so the solver can execute all operators on the mixed integer programming equation in a certain order to achieve preprocessing of the mixed integer programming equation. However, different mixed integer programming equations may be used to describe the tasks to be processed in different fields. Some mixed integer programming equations may not require the use of all operators to achieve preprocessing. Therefore, existing solvers are in the process of preprocessing. , the factors considered are relatively single, causing the preprocessing process to consume too much time.

发明内容Contents of the invention

本申请实施例提供了一种计算机任务处理方法及其相关设备,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。Embodiments of the present application provide a computer task processing method and related equipment, which can effectively reduce the time consumed in the equation preprocessing process and improve the performance of the equation solving process.

本申请实施例的第一方面提供了一种计算机任务处理方法,该方法包括:A first aspect of the embodiments of the present application provides a computer task processing method, which method includes:

当需要处理某个任务时,可获取用于描述该待处理的任务的混合整数规划方程(混合整数规划指,在某些规划问题中,变量中的元素既可以是整数,也可以是非整数),混合整数规划方程通常包含两大类方程,即线性规划方程和非线性规划方程。例如,设该待处理的任务为供应链领域中,获取(求解)某个工厂的待求解的生产计划,该待求解的生成计划不仅需要满足该工厂需求的最大化以及该工厂总成本的最小化等目标,还需满足实际业务场景指定的硬约束与软约束等等。那么,根据该待求解的生产计划以及该待求解的生产计划所需满足的要求抽象出来的数学模型,可以简化为相应的线性规划方程。作为该方程中的变量,该待 求解的生产计划通常以向量的形式呈现,故该待求解的生产计划所包含的元素可以是整数或非整数。例如,待求解的生产计划包含10个元素,第1个元素表示该工厂第1天所需生产的原材料数量,第2个元素表示该工厂第2天所需生产的原材料数量,...,第10个元素表示该工厂第10天所需生产的原材料数量,故这些元素的取值既可以是整数(如,第1天工厂需生产1吨原材料),也可以是非整数(如,第2天工厂需生产0.5吨原材料)。When a task needs to be processed, the mixed integer programming equation used to describe the task to be processed can be obtained (mixed integer programming refers to that in some planning problems, the elements in the variables can be either integers or non-integers) , mixed integer programming equations usually include two major types of equations, namely linear programming equations and nonlinear programming equations. For example, assume that the task to be processed is to obtain (solve) a production plan to be solved for a certain factory in the supply chain field. The generated plan to be solved not only needs to maximize the demand of the factory and minimize the total cost of the factory. ization and other goals, and also need to meet the hard constraints and soft constraints specified by the actual business scenario, etc. Then, the mathematical model abstracted based on the production plan to be solved and the requirements that the production plan to be solved can be simplified into the corresponding linear programming equation. As a variable in this equation, the The production plan to be solved is usually presented in the form of a vector, so the elements contained in the production plan to be solved can be integers or non-integers. For example, the production plan to be solved contains 10 elements. The first element represents the quantity of raw materials that the factory needs to produce on day 1, the second element represents the quantity of raw materials that the factory needs to produce on day 2,..., The 10th element represents the quantity of raw materials that the factory needs to produce on the 10th day. Therefore, the values of these elements can be either integers (for example, the factory needs to produce 1 ton of raw materials on the 1st day) or non-integers (for example, on the 2nd day The factory needs to produce 0.5 tons of raw materials per day).

得到混合整数规划方程后,可对混合整数规划方程进行结构识别,从而得到与混合整数规划方程的结构相关的信息,用于指示混合整数规划方程的结构。值得注意的是,结构识别的操作主要集中于对混合整数规划方程的变量和混合整数规划方程的约束矩阵进行分析,从而确定混合整数规划方程的结构组成,故所得到的与混合整数规划方程的结构相关的信息,也就与混合整数规划方程的变量和混合整数规划方程的约束矩阵中的至少一项相关联。After the mixed integer programming equation is obtained, the structure of the mixed integer programming equation can be identified, thereby obtaining information related to the structure of the mixed integer programming equation, which is used to indicate the structure of the mixed integer programming equation. It is worth noting that the operation of structure identification mainly focuses on analyzing the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation, thereby determining the structural composition of the mixed integer programming equation. Therefore, the obtained results are consistent with those of the mixed integer programming equation. The structure-related information is also 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, the target operator can be determined from the operator resource pool based on this information. It should be noted that the operator resource pool provides multiple operators for selection. Therefore, based on the information related to the structure of the mixed integer programming equation, the operator resource pool can be selected to implement the prediction of the mixed integer programming equation. At least one operator is processed, and the selected operators are the target operators.

确定目标算子后,基于目标算子可实现针对混合整数规划方程的预处理(presolve),从而得到预处理后的混合整数规划方程。After the target operator is determined, preprocessing (presolve) of the mixed integer programming equation can be implemented based on the target operator, thereby obtaining the preprocessed mixed integer programming equation.

得到预处理后的混合整数规划方程,可对预处理后的混合整数规划方程进行求解,得到相应的解,该解可作为前述任务的处理结果(例如,某个工厂的已求解的生产计划)。After obtaining the preprocessed mixed integer programming equation, the preprocessed mixed integer programming equation can be solved to obtain the corresponding solution, which can be used as the processing result of the aforementioned task (for example, the solved production plan of a certain factory) .

从上述方法可以看出:在获取用于描述待处理的任务的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到的解可作为任务的处理结果。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于描述特定类的任务),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。It can be seen from the above method that after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation. This information is related to At least one of the following is relevant: the variables of a mixed integer programming equation and the constraint matrix of a mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.

在一种可能的实现方式中,由于与混合整数规划方程的结构相关的信息与混合整数规划方程的变量和混合整数规划方程的约束矩阵中的至少一项相关联,故与混合整数规划方程的结构相关的信息可包含以下至少一项:(1)混合整数规划方程的变量的维度,也就是混合整数规划方程的变量所包含的元素的数量。(2)混合整数规划方程的约束矩阵的稀疏度,也就是混合整数规划方程的约束矩阵中取值为零的元素的数量。(3)混合整数规划方程的约束矩阵的分块信息,混合整数规划方程的分块信息用于指示混合整数规划方程的约束矩阵中所包含的元素为零的子矩阵,即该分块信息用于指示混合整数规划方程的约束矩阵中,存在某一区域(某几个区域)中的元素均为零。(4)混合整数规划方程的约束矩阵中与混合整数规划方程的变量存在计算关系的行,由于混合整数规划方程的约束矩阵中的每一行均会与混合整数规划方程的变量相乘,若混合整数规划方程的约束矩阵中的某一行(的所有元素)为零, 说明该行与混合整数规划方程的变量之间不存在计算关系,若混合整数规划方程的约束矩阵中的某一行(的任意一个元素)不为零,说明该行与混合整数规划方程的变量之间存在计算关系。In a possible implementation, 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 structure-related information may include at least one of the following: (1) The dimensions of the variables of the mixed integer programming equation, that is, the number of elements contained in the variables of the mixed integer programming equation. (2) The sparsity of the constraint matrix of the mixed integer programming equation, that is, the number of zero-valued elements in the constraint matrix of the mixed integer programming equation. (3) Block information of the constraint matrix of the mixed integer programming equation. The block information of the mixed integer programming equation is used to indicate the submatrix with zero elements contained in the constraint matrix of the mixed integer programming equation. That is, the block information is used In the constraint matrix indicating the mixed integer programming equation, there is a certain region (several regions) in which the elements are all zero. (4) The rows in the constraint matrix of the mixed integer programming equation have a calculation relationship with the variables of the mixed integer programming equation. Since each row in the constraint matrix of the mixed integer programming equation will be multiplied by the variables of the mixed integer programming equation, if the mixed integer programming equation is mixed A row (all elements) of a row in the constraint matrix of an integer programming equation is zero, It means that there is no calculation relationship between this row and the variables of the mixed integer programming equation. If a certain row (any element) in the constraint matrix of the mixed integer programming equation is not zero, it means that there is no calculation relationship between this row and the variables of the mixed integer programming equation. There is a calculation relationship between them.

在一种可能的实现方式中,基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子包括:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所使用的算子确定为目标算子。前述实现方式中,方程资源池包含不同结构的多个预置方程(也可以理解为是提前设置的不同结构的方程模板),而与混合整数规划方程的结构相关的信息用于指示混合整数规划方程的结构类别,因此,与在方程资源池中遍历,寻找与与混合整数规划方程的结构相关的信息相匹配的预置方程,那么,该预置方程与混合整数规划方程即为结构相似或相同的两个方程。确定与混合整数规划方程结构相似或相同的预置方程后,由于预置方程是提前设置的,故可以确定在针对预置方程的预处理中使用了算子资源池中的哪些算子,并将这部分算子确定为用于实现混合整数规划方程的预处理的算子,即目标算子。可见,本申请实施例提供了方程资源池,在确定该混合整数规划方程属于哪一类预置混合整数规划方程后,即方程资源池中的某一个预置方程(也可以称为方程资源池中的某一个方程模板),可将针对该预置方程的预处理所使用的算子作为针对该混合整数规划方程的预处理所使用的算子,以减少人为干预对预处理的影响,从而优化方程的预处理效果。In a possible implementation, based on information related to the structure of the mixed integer programming equation, determining the target operator in the operator resource pool includes: in the equation resource pool, determining the information related to the structure of the mixed integer programming equation. The preset equation that matches the information; in the operator resource pool, determine the operator used for preprocessing of the preset equation as the target operator. In the aforementioned implementation, the equation resource pool contains multiple preset equations with different structures (which can also be understood as equation templates with different structures set in advance), and information related to the structure of the mixed integer programming equation is used to indicate mixed integer programming. The structural category of the equation, therefore, is to traverse the equation resource pool to find a preset equation that matches the information related to the structure of the mixed integer programming equation. Then, the preset equation and the mixed integer programming equation have a similar structure or The same two equations. After determining the preset equations with similar or identical structures to the mixed integer programming equations, since the preset equations are set in advance, it can be determined which operators in the operator resource pool are used in the preprocessing of the preset equations, and This part of the operators is determined as the operators used to realize the preprocessing of the mixed integer programming equation, that is, the target operator. It can be seen that the embodiment of the present application provides an equation resource pool. After determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, that is, a certain preset equation in the equation resource pool (which can also be called an equation resource pool) (an equation template in ), the operator used for preprocessing of the preset equation can be used as the operator used for preprocessing of the mixed integer programming equation to reduce the impact of human intervention on preprocessing, thereby Preprocessing effects of optimization equations.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程包括:在n个目标算子的第j次迭代中,在对更新后的混合整数规划方程执行第i个算子之前,可先检测第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和是否小于第一阈值(第一阈值通常基于迭代次数k确定,一般随着迭代次数k的增大而增大,即二者呈正相关关系)。其中,i=1,…,n,j=1,…,k。若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和小于第一阈值,说明此后还需继续执行第i个目标算子,则进一步检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值(第二阈值通常基于迭代次数k确定,一般随着迭代次数k的增大而增大,即二者呈正相关关系)。若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,说明此后不再需要继续执行第i个目标算子,则在第j次迭代至第k次迭代中,跳过第i个目标算子。若第i个目标算子在第j-1次迭代中的指标小于第二阈值,说明当前可执行第i个算子,则对更新后的混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标。值得注意的是,第i个目标算子在第j次迭代中的指标可通过以下方式生成:首先,确定第i个目标算子在第1次迭代至第j次迭代中,所删除的行在更新后的混合整数规划方程中的占比。然后,基于该占比进行计算,从而得到第i个目标算子在第j次迭代中的指标。若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,说明当前不可执行第i个算子,则跳转至第i+1个目标算子,并对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代。继续执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。前述实现方式中, 以一定的迭代策略实现预处理过程,即在迭代过程中,当一个算子所发挥的作用变小时,可认为该算子在之后的迭代中继续执行的收益有限,并及时停止执行该算子。并且,对于预处理的循环,也设计相应的停止机制。如此一来,不仅可有效地简化混合整数规划方程,还能减少不必要的预处理流程,从而降低预处理的时间开销。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. Integer of Before the i-th operator, you can first detect whether the sum of the indicators from the i-th target operator in the first iteration to the i-th target operator in the j-1th iteration is less than the first threshold (th A threshold is usually determined based on the number of iterations k, and generally increases with the increase of the number of iterations k, that is, there is a positive correlation between the two). Among them, i=1,...,n, j=1,...,k. If the sum of the index of the i-th target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is less than the first threshold, it means that the i-th target operator needs to continue to be executed thereafter. , then further detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold (the second threshold is usually determined based on the number of iterations k, and generally increases with the increase of the number of iterations k, That is, there is a positive correlation between the two). If the sum of the index of the i-th target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is greater than or equal to the first threshold, it means that there is no need to continue executing the i-th operation in the future. target operator, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped. If the index of the i-th target operator in the j-1th iteration is less than the second threshold, it means that the i-th operator can currently be executed, then the i-th target operator is executed on the updated mixed integer programming equation, and Generate the index of the i-th target operator in the j-th iteration. It is worth noting that the index of the i-th target operator in the j-th iteration can be generated in the following way: first, determine the rows deleted by the i-th target operator in the 1st iteration to the j-th iteration. in the updated mixed integer programming equation. Then, calculation is performed based on this proportion to obtain the index of the i-th target operator in the j-th iteration. If the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, it means that the i-th operator cannot be executed currently, then jump to the i+1-th target operator, and perform the operation of the i-th target operator. i+1 target operators execute the above steps until the jth iteration of n target operators is completed. Continue to execute the j+1th iteration of n target operators until the kth iteration of n target operators is completed, and obtain the preprocessed mixed integer programming equation. In the aforementioned implementation, Implement the preprocessing process with a certain iteration strategy, that is, during the iteration process, when the role of an operator becomes smaller, it can be considered that the benefit of continuing to execute the operator in subsequent iterations is limited, and the execution of the operator should be stopped in time . Moreover, a corresponding stopping mechanism is also designed for the preprocessing cycle. In this way, not only the mixed integer programming equation can be effectively simplified, but also unnecessary preprocessing processes can be reduced, thereby reducing the time overhead of preprocessing.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。进一步地,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的执行顺序相同。前述实现方式中,在确定该混合整数规划方程属于哪一类预置混合整数规划方程后,即方程资源池中的某一个预置方程,可将针对该预置方程的预处理所使用的算子迭代次数以及算子执行顺序作为针对该混合整数规划方程的预处理所使用的算子迭代次数以及算子执行顺序,以减少人为干预对预处理的影响,从而优化方程的预处理效果。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same. Furthermore, 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 aforementioned implementation method, after determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, that is, a certain preset equation in the equation resource pool, the algorithm used for preprocessing of the preset equation can be The number of sub-iterations and the order of operator execution are used as the number of operator iterations and the order of operator execution used for preprocessing of the mixed integer programming equation to reduce the impact of human intervention on preprocessing and thereby optimize the preprocessing effect of the equation.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定;进一步地,前述的第一阈值和前述的第二阈值基于n个目标算子的迭代次数确定。In one possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation; further, as mentioned above The first threshold and the aforementioned second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程之前,该方法还包括:将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程包括:基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。前述实现方式中,为了实现更加优质的预处理,可提前对混合整数规划方程进行去冗余操作,该操作可为以下三种情况中的任意一种:(1)在混合整数规划方程的约束矩阵中,可通过一定的方式确定成倍数关系的行,并将这些行进行合并,得到合并行后的约束矩阵。在合并行后的约束矩阵中,可通过相同的方式确定成倍数关系的列,并将这些列设置成相同的列,得到去冗余后的约束矩阵。(2)在混合整数规划方程的约束矩阵中,可通过一定的方式确定成倍数关系的行,并将这些行进行合并,得到去冗余后的约束矩阵。(3)在混合整数规划方程的约束矩阵中,可通过一定的方式确定成倍数关系的列,并将这些列设置成相同的列,得到去冗余后的约束矩阵。基于前述的去冗余操作得到去冗余后的约束矩阵后,可将去冗余后的约束矩阵后对原始的混合整数规划方程进行更新,得到更新后的混合整数规划方程。如此一来,预处理的对象从原始的混合整数规划方程变换为更新后的混合整数规划方程,可优化预处理的效果。In one possible implementation, the mixed integer programming equation is preprocessed based on the target operator, and before the preprocessed mixed integer programming equation is obtained, the method further includes: merging rows with a multiple relationship in the constraint matrix, or , set the multiple columns in the constraint matrix to the same column to obtain the constraint matrix after the redundancy is removed; update the mixed integer programming equation based on the constraint matrix after the redundancy is removed, and obtain the updated mixed integer programming equation; Preprocessing the mixed integer programming equation based on the objective operator to obtain the preprocessed mixed integer programming equation includes: preprocessing the updated mixed integer programming equation based on the objective operator to obtain the preprocessed mixed integer programming equation. In the aforementioned implementation method, in order to achieve better preprocessing, the mixed integer programming equation can be deredundant in advance. This operation can be any of the following three situations: (1) In the constraints of the mixed integer programming equation In the matrix, the rows with a multiple relationship can be determined in a certain way, and these rows can be merged to obtain the constraint matrix after the merged rows. In the constraint matrix after merging rows, the columns with multiple relationships can be determined in the same way, and these columns are set to the same columns to obtain the constraint matrix after redundancy is removed. (2) In the constraint matrix of the mixed integer programming equation, the rows with multiple relationships can be determined in a certain way, and these rows can be merged to obtain the constraint matrix after removing redundancy. (3) In the constraint matrix of the mixed integer programming equation, the columns with a multiple relationship can be determined in a certain way, and these columns are set to the same column to obtain the constraint matrix after redundancy is removed. After obtaining the constraint matrix after redundancy removal based on the aforementioned redundancy removal operation, the original mixed integer programming equation can be updated with the redundancy removal constraint matrix to obtain the updated mixed integer programming equation. In this way, the preprocessing object is transformed from the original mixed integer programming equation to the updated mixed integer programming equation, which can optimize the preprocessing effect.

本申请实施例的第二方面提供了一种生产计划获取方法,该方法包括:获取混合整数规划方程,混合整数规划方程用于描述待求解的生产计划;基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。The second aspect of the embodiment of the present application provides a method for obtaining a production plan. The method includes: obtaining a mixed integer programming equation, which is used to describe the production plan to be solved; based on the structure related to the mixed integer programming equation. information, determine the target operator in the operator resource pool, and the target operator is part of the operators in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation; The preprocessed mixed integer programming equation is solved to obtain the solved production plan.

从上述方法可以看出:在获取用于描述待求解的生产计划的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标 算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于求解供应链领域中工厂和企业的生产计划),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。It can be seen from the above method that after obtaining the mixed integer programming equation used to describe the production plan to be solved, the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation. This information Related to at least one of the following: variables of a mixed integer programming equation and constraint matrices of a mixed integer programming equation. Then, based on the goals The operator preprocesses the mixed integer programming equation and obtains the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved to obtain the solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to solve the production plan of factories and enterprises in the field of supply chain), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the preprocessing of this mixed integer programming equation, can be effective Reduce the time consumed by the equation preprocessing process and improve the performance of the equation solving process.

在一种可能的实现方式中,混合整数规划方程的变量为待求解的生产计划,混合整数规划方程的约束矩阵包含以下至少一项:待求解的生产计划需满足的材料约束、生产力约束、时间约束或交通约束等加工约束,其中,材料约束可包括生产时所能使用的材料上限和材料配比等等,生产力约束可包括生产时所需生产工人的人数上限和工作效率上限等等,时间约束可包括产品的交付日期等等,交通约束可包括生产时所需交通成本的上限和生产时所需交通工具的数量上限等等。In a possible implementation, 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 includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. Processing constraints such as constraints or traffic constraints. Among them, material constraints can include the upper limit of materials that can be used in production and material ratios, etc. Productivity constraints can include the upper limit of the number of production workers required during production, the upper limit of work efficiency, etc., time Constraints may include the delivery date of the product, etc. Transportation constraints may include the upper limit of transportation costs required during production and the upper limit of the number of transportation vehicles required during production, etc.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项:变量的维度、约束矩阵的稀疏度、约束矩阵的分块信息或约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, or the existence of a computational relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.

在一种可能的实现方式中,基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子包括:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所对应的算子确定为目标算子。In a possible implementation, based on information related to the structure of the mixed integer programming equation, determining the target operator in the operator resource pool includes: in the equation resource pool, determining the information related to the structure of the mixed integer programming equation. The preset equation that matches the information; in the operator resource pool, the operator corresponding to the preprocessing of the preset equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程包括:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或若和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. Integer of If the sum of indicators from the indicators in the iteration to the i-th target operator in the j-1 iteration is greater than or equal to the first threshold, then the i-th target is skipped in the j-th iteration to the k-th iteration. Operator, i=1,...,n,j=1,...,k; or if the sum is less than the first threshold, detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold ; Or, if the index of the i-th objective operator in the j-1th iteration is less than the second threshold, execute the i-th objective operator on the mixed integer programming equation and generate the i-th objective operator in the j-th iteration. index in iterations; or, if the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, then perform the above steps for the i+1th target operator until n The jth iteration of the target operator; execute the j+1 iteration of the n target operators until the kth iteration of the n target operators is completed, and obtain the preprocessed mixed integer programming equation.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程之前,该方法还包括:将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;基于去冗余后的约束 矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程包括:基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In one possible implementation, the mixed integer programming equation is preprocessed based on the target operator, and before the preprocessed mixed integer programming equation is obtained, the method further includes: merging rows with a multiple relationship in the constraint matrix, or , set the multiple columns in the constraint matrix to the same column to obtain the constraint matrix after the redundancy is removed; based on the constraints after the redundancy is removed The matrix updates the mixed integer programming equation to obtain the updated mixed integer programming equation; the mixed integer programming equation is preprocessed based on the target operator, and the preprocessed mixed integer programming equation is obtained, including: based on the target operator, the updated mixed integer programming equation is obtained The mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.

本申请实施例的第三方面提供了一种电网调度方法,该方法包括:获取混合整数规划方程,混合整数规划方程用于描述待求解的用电量调度计划;基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到已求解的用电量调度计划。The third aspect of the embodiment of the present application provides a power grid dispatching method. The method includes: obtaining a mixed integer programming equation, which is used to describe the power consumption dispatch plan to be solved; based on the structure of the mixed integer programming equation Relevant information, determine the target operator in the operator resource pool, and the target operator is part of the operators in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming Equation; solve the preprocessed mixed integer programming equation to obtain the solved power consumption dispatch plan.

本申请实施例的第四方面提供了一种中心选址方法,该方法包括:获取混合整数规划方程,混合整数规划方程用于描述待求解的地址选取计划;基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到已求解的地址选取计划。The fourth aspect of the embodiment of the present application provides a central site selection method, which method includes: obtaining a mixed integer programming equation, which is used to describe the address selection plan to be solved; based on the structural correlation with the mixed integer programming equation information, determine the target operator in the operator resource pool, and the target operator is some of the operators in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation ; Solve the preprocessed mixed integer programming equation to obtain the solved address selection plan.

本申请实施例的第五方面提供了一种计算机任务处理装置,该装置包括:获取模块,用于获取混合整数规划方程,混合整数规划方程用于描述待处理的任务;确定模块,用于基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;预处理模块,用于基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;求解模块,用于对预处理后的混合整数规划方程进行求解,得到的解作为任务的处理结果。The fifth aspect of the embodiment of the present application provides a computer task processing device. The device includes: an acquisition module for acquiring a mixed integer programming equation, which is used to describe the task to be processed; and a determination module for based on Information related to the structure of the mixed integer programming equation, determine the target operator in the operator resource pool, and the target operator is part of the operators in the operator resource pool; the preprocessing module is used to perform mixed integer planning based on the target operator The equation is preprocessed to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.

从上述装置可以看出:在获取用于描述待处理的任务的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到的解可作为任务的处理结果。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于描述特定类的任务),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。It can be seen from the above device that after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation. This information is related to At least one of the following is relevant: the variables of a mixed integer programming equation and the constraint matrix of a mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项:变量的维度、约束矩阵的稀疏度、约束矩阵的分块信息、约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, and the existence of a calculation relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.

在一种可能的实现方式中,确定模块,用于:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所使用的算子确定为目标算子。In a possible implementation, the determination module is used to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator used in the preprocessing of the equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,预处理模块,用于:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算 子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. Integer of If the sum of the indicators in the j-1 iteration is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped, i=1,...,n, j=1,...,k; or, if the sum of the index of the i-th target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is less than the first threshold, then Detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold; or, if the index of the i-th target operator in the j-1th iteration is less than the second threshold, then The integer programming equation executes the i-th objective operator and generates the indicator of the i-th objective operator in the j-th iteration; or, if the indicator of the i-th objective operator in the j-1 iteration is greater than or equal to second threshold, then perform the above steps for the i+1th target operator until the jth iteration of the n target operators is completed; perform the j+1th iteration of the n target operators until the n targets are completed. After the kth iteration of the operator, the preprocessed mixed integer programming equation is obtained.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,该装置还包括:去冗余模块,用于将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;更新模块,用于基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;预处理模块,用于基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In a possible implementation, the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed; the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module is used to update the mixture based on the target operator The final mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.

本申请实施例的第六方面提供了一种生产计划获取装置,该装置包括:获取模块,用于获取混合整数规划方程,混合整数规划方程用于描述供应链领域中待求解的生产计划;确定模块,用于基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;预处理模块,用于基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;求解模块,用于对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。The sixth aspect of the embodiment of the present application provides a production plan acquisition device. The device includes: an acquisition module for acquiring a mixed integer programming equation. The mixed integer programming equation is used to describe the production plan to be solved in the field of supply chain; determine The module is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation. The target operator is part of the operators in the operator resource pool; the preprocessing module is used to determine the target operator based on the target operator resource pool. The module preprocesses the mixed integer programming equation to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation to obtain the solved production plan.

从上述装置可以看出:在获取用于描述待求解的生产计划的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于求解供应链领域中工厂和企业的生产计划),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。It can be seen from the above device that after obtaining the mixed integer programming equation used to describe the production plan to be solved, the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation. This information Related to at least one of the following: variables of a mixed integer programming equation and constraint matrices of a mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved to obtain the solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to solve the production plan of factories and enterprises in the field of supply chain), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the preprocessing of this mixed integer programming equation, can be effective Reduce the time consumed by the equation preprocessing process and improve the performance of the equation solving process.

在一种可能的实现方式中,混合整数规划方程的变量为待求解的生产计划,混合整数规划方程的约束矩阵包含以下至少一项:待求解的生产计划需满足的材料约束、生产力约束、时间约束或交通约束。In a possible implementation, 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 includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. restraints or traffic constraints.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项: 变量的维度、约束矩阵的稀疏度、约束矩阵的分块信息或约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: 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 that have a computational relationship with the variable, where the blocking information is used to indicate the submatrix whose elements are zero contained in the constraint matrix.

在一种可能的实现方式中,确定模块,用于:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所对应的算子确定为目标算子。In a possible implementation, the determination module is used to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,预处理模块,用于:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或若和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. is an integer, preprocessing module, used for: in the j-th iteration of n target operators, if the index of the i-th target operator in the 1st iteration to the i-th target operator is in the j-1 If the sum of indicators in the iteration is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped, i=1,...,n,j=1,..., k; or if the sum is less than the first threshold, then detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold; or, if the i-th target operator in the j-1th iteration If the index in is less than the second threshold, execute the i-th target operator on the mixed integer programming equation and generate the index of the i-th target operator in the j-th iteration; or, if the i-th target operator is in the j-th iteration If the indicator in j-1 iterations is greater than or equal to the second threshold, perform the above steps for the i+1th target operator until the jth iteration of n target operators is completed; execute the nth iteration of n target operators. j+1 iterations until the k-th iteration of n target operators is completed, and the preprocessed mixed integer programming equation is obtained.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,该装置还包括:去冗余模块,用于将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;更新模块,用于基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;预处理模块,用于基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In a possible implementation, the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed; the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module is used to update the mixture based on the target operator The final mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.

本申请实施例的第七方面提供了一种电网调度装置,该装置包括:获取模块,用于获取混合整数规划方程,混合整数规划方程用于描述待求解的用电量调度计划;确定模块,用于基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;预处理模块,用于基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;求解模块,用于对预处理后的混合整数规划方程进行求解,得到已求解的用电量调度计划。The seventh aspect of the embodiment of the present application provides a power grid dispatching device. The device includes: an acquisition module, used to obtain a mixed integer programming equation, which is used to describe the power consumption dispatch plan to be solved; a determination module, It is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation. The target operator is a part of the operators in the operator resource pool; the preprocessing module is used to determine the target operator based on the target operator. The mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation to obtain the solved power consumption dispatch plan.

本申请实施例的第八方面提供了一种中心选址方法,该装置包括:获取模块,用于获取混合整数规划方程,混合整数规划方程用于描述待求解的地址选取计划;确定模块,用于基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;预处理模块,用于基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;求解模块,用于对预处理后的混合整数规划方程进行求解,得到已求解的地址选取计划。 The eighth aspect of the embodiment of the present application provides a center site selection method. The device includes: an acquisition module, used to obtain a mixed integer programming equation, which is used to describe the address selection plan to be solved; a determination module, using Based on the information related to the structure of the mixed integer programming equation, the target operator is determined in the operator resource pool, and the target operator is part of the operators in the operator resource pool; the preprocessing module is used to pair the mixture based on the target operator The integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation; the solving module is used to solve the preprocessed mixed integer programming equation to obtain the solved address selection plan.

本申请实施例的第九方面提供了一种计算机任务处理装置,该装置包括:处理器、存储器、总线、输入输出设备,处理器与存储器、输入输出设备相连,总线分别连接处理器、存储器以及输入输出设备相连;输入输出设备用于获取混合整数规划方程,混合整数规划方程用于描述待处理的任务;存储器中存储有算子资源池;处理器用于:从存储器中获取获取算子资源池,并基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到的解作为任务的处理结果。A ninth aspect of the embodiment of the present application provides a computer task processing device. The device includes: a processor, a memory, a bus, and an input and output device. The processor is connected to the memory and the input and output devices. The bus is connected to the processor, the memory, and the input and output devices respectively. The input and output devices are connected; the input and output devices are used to obtain mixed integer programming equations, and the mixed integer programming equations are used to describe the tasks to be processed; an operator resource pool is stored in the memory; the processor is used to: obtain the operator resource pool from the memory , and based on the information related to the structure of the mixed integer programming equation, determine the target operator in the operator resource pool, and the target operator is some of the operators in the operator resource pool; predict the mixed integer planning equation based on the target operator Process to obtain the preprocessed mixed integer programming equation; solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项:混合整数规划方程的变量的维度、混合整数规划方程的约束矩阵的稀疏度、约束矩阵的分块信息或约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: dimensions of variables of the mixed integer programming equation, sparsity of the constraint matrix of the mixed integer programming equation, and block partitioning of the constraint matrix. The rows in the information or constraint matrix that have a computational relationship with the variables, where the blocking information is used to indicate that the constraint matrix contains a submatrix with zero elements.

在一种可能的实现方式中,处理器,用于:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所对应的算子确定为目标算子。In a possible implementation, the processor is configured to: in the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,处理器,用于:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或若和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. is an integer, processor, used for: in the j-th iteration of n target operators, if the index of the i-th target operator in the 1st iteration to the i-th target operator in the j-1th iteration If the sum of indicators in the iteration is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped, i=1,...,n, j=1,...,k ; Or if the sum is less than the first threshold, then detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold; or, if the i-th target operator in the j-1th iteration The index of is less than the second threshold, then execute the i-th target operator on the mixed integer programming equation and generate the index of the i-th target operator in the j-th iteration; or, if the i-th target operator is in the j-th iteration If the indicator in the -1 iteration is greater than or equal to the second threshold, perform the above steps for the i+1th target operator until the jth iteration of n target operators is completed; execute the jth iteration of n target operators +1 iterations until the k-th iteration of n target operators is completed, and the preprocessed mixed integer programming equation is obtained.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,处理器,还用于:将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;处理器,用于:基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In a possible implementation, the processor is also used to: merge rows that are in a multiple relationship in the constraint matrix, or set columns that are in a multiple relationship in the constraint matrix to the same column to obtain the deredundant Constraint matrix; update the mixed integer programming equation based on the redundantly removed constraint matrix to obtain the updated mixed integer programming equation; processor, used for: preprocessing the updated mixed integer programming equation based on the target operator, Obtain the preprocessed mixed integer programming equation.

本申请实施例的第十方面提供了一种生产计划获取装置,该装置包括:处理器、存储器、总线、输入输出设备,处理器与存储器、输入输出设备相连,总线分别连接处理器、存储器以及输入输出设备相连;输入输出设备用于获取混合整数规划方程,混合整数规划方程用于描述供应链领域中待求解的生产计划;存储器中存储有算子资源池;处理器用于: The tenth aspect of the embodiment of the present application provides a production plan acquisition device. The device includes: a processor, a memory, a bus, and an input and output device. The processor is connected to the memory and the input and output devices. The bus is connected to the processor, the memory, and the input and output devices respectively. The input and output devices are connected; the input and output devices are used to obtain mixed integer programming equations, which are used to describe the production plan to be solved in the field of supply chain; an operator resource pool is stored in the memory; the processor is used to:

从存储器中获取获取算子资源池,并基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。Obtain the operator resource pool from the memory, and determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation. The target operator is some of the operators in the operator resource pool; based on the target The operator preprocesses the mixed integer programming equation to obtain the preprocessed mixed integer programming equation; it solves the preprocessed mixed integer programming equation to obtain the solved production plan.

在一种可能的实现方式中,混合整数规划方程的变量为待求解的生产计划,混合整数规划方程的约束矩阵包含以下至少一项:待求解的生产计划需满足的材料约束、生产力约束、时间约束或交通约束。In a possible implementation, 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 includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. restraints or traffic constraints.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项:混合整数规划方程的变量的维度、混合整数规划方程的约束矩阵的稀疏度、约束矩阵的分块信息或约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: dimensions of variables of the mixed integer programming equation, sparsity of the constraint matrix of the mixed integer programming equation, and block partitioning of the constraint matrix. The rows in the information or constraint matrix that have a computational relationship with the variables, where the blocking information is used to indicate that the constraint matrix contains a submatrix with zero elements.

在一种可能的实现方式中,处理器,用于:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所对应的算子确定为目标算子。In a possible implementation, the processor is configured to: in the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,处理器,用于:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或若和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. is an integer, processor, used for: in the j-th iteration of n target operators, if the index of the i-th target operator in the 1st iteration to the i-th target operator in the j-1th iteration If the sum of indicators in the iteration is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped, i=1,...,n, j=1,...,k ; Or if the sum is less than the first threshold, then detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold; or, if the i-th target operator in the j-1th iteration The index of is less than the second threshold, then execute the i-th target operator on the mixed integer programming equation and generate the index of the i-th target operator in the j-th iteration; or, if the i-th target operator is in the j-th iteration If the indicator in the -1 iteration is greater than or equal to the second threshold, perform the above steps for the i+1th target operator until the jth iteration of n target operators is completed; execute the jth iteration of n target operators +1 iterations until the k-th iteration of n target operators is completed, and the preprocessed mixed integer programming equation is obtained.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,处理器,还用于:将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;处理器,用于:基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In a possible implementation, the processor is also used to: merge rows that are in a multiple relationship in the constraint matrix, or set columns that are in a multiple relationship in the constraint matrix to the same column to obtain the deredundant Constraint matrix; update the mixed integer programming equation based on the redundantly removed constraint matrix to obtain the updated mixed integer programming equation; processor, used for: preprocessing the updated mixed integer programming equation based on the target operator, Obtain the preprocessed mixed integer programming equation.

本申请实施例的第十一方面提供了一种电网调度装置,该装置包括:处理器、存储器、总线、输入输出设备,处理器与存储器、输入输出设备相连,总线分别连接处理器、存储器以及输入输出设备相连;输入输出设备用于获取混合整数规划方程,混合整数规划方程用于描述电力领域中待求解的用电量调度计划;存储器中存储有算子资源池;处理器用于:从存储器中获取获取算子资源池,并基于与混合整数规划方程的结构相关的信息,在算子资源池 中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到已求解的用电量调度。The eleventh aspect of the embodiment of the present application provides a power grid dispatching device. The device includes: a processor, a memory, a bus, and an input and output device. The processor is connected to the memory and the input and output devices. The bus is connected to the processor, the memory, and the input and output devices respectively. The input and output devices are connected; the input and output devices are used to obtain mixed integer programming equations, and the mixed integer programming equations are used to describe the power consumption scheduling plan to be solved in the power field; an operator resource pool is stored in the memory; the processor is used to: obtain from the memory Obtain the operator resource pool in the operator resource pool, and based on the information related to the structure of the mixed integer programming equation, in the operator resource pool Determine the target operator, which is part of the operator in the operator resource pool; preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation; perform the preprocessed mixed integer The planning equation is solved to obtain the solved power consumption schedule.

本申请实施例的第十二方面提供了一种中心选址装置,该装置包括:处理器、存储器、总线、输入输出设备,处理器与存储器、输入输出设备相连,总线分别连接处理器、存储器以及输入输出设备相连;输入输出设备用于获取混合整数规划方程,混合整数规划方程用于描述云技术领域中待求解的地址选取计划;存储器中存储有算子资源池;处理器用于:A twelfth aspect of the embodiment of the present application provides a central address selection device. The device includes: a processor, a memory, a bus, and an input and output device. The processor is connected to the memory and the input and output devices, and the bus is connected to the processor and the memory respectively. It is connected to the input and output devices; the input and output devices are used to obtain mixed integer programming equations, and the mixed integer programming equations are used to describe the address selection plan to be solved in the field of cloud technology; an operator resource pool is stored in the memory; the processor is used to:

从存储器中获取获取算子资源池,并基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;对预处理后的混合整数规划方程进行求解,得到已求解的地址选取计划。Obtain the operator resource pool from the memory, and determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation. The target operator is some of the operators in the operator resource pool; based on the target The operator preprocesses the mixed integer programming equation to obtain the preprocessed mixed integer programming equation; it solves the preprocessed mixed integer programming equation to obtain the solved address selection plan.

本申请实施例的第十三方面提供了一种计算机存储介质,计算机存储介质存储有计算机程序,该程序由计算机执行时,使得计算机实施如第一方面、第一方面任意一种可能的实现方式、第二方面或第二方面任意一种可能的实现方式所述的方法。A thirteenth aspect of the embodiments of the present application provides a computer storage medium. The computer storage medium stores a computer program. When the program is executed by a computer, the computer implements the first aspect and any possible implementation manner of the first aspect. , the method described in the second aspect or any possible implementation of the second aspect.

本申请实施例的第十四方面提供了一种计算机程序产品,计算机程序产品存储有指令,该指令在由计算机执行时,使得计算机实施如第一方面、第一方面任意一种可能的实现方式、第二方面或第二方面任意一种可能的实现方式所述的方法。A fourteenth aspect of the embodiments of the present application provides a computer program product. The computer program product stores instructions. When the instructions are executed by a computer, the computer implements the first aspect and any possible implementation manner of the first aspect. , the method described in the second aspect or any possible implementation of the second aspect.

本申请实施例中,在获取用于描述待处理的任务的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到的解可作为任务的处理结果。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于描述特定类的任务),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。In the embodiment of the present application, after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation. This information is related to the following At least one item is relevant: the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.

附图说明Description of drawings

图1为本申请实施例提供的计算机任务处理系统的一个结构示意图;Figure 1 is a schematic structural diagram of a computer task processing system provided by an embodiment of the present application;

图2为本申请实施例提供的计算机任务处理系统的另一结构示意图;Figure 2 is another structural schematic diagram of a computer task processing system provided by an embodiment of the present application;

图3a示出了终端设备300的一个示例性的结构示意图;Figure 3a shows an exemplary structural diagram of the terminal device 300;

图3b为本申请实施例提供的求解器的一个架构示意图;Figure 3b is an architectural schematic diagram of a solver provided by an embodiment of the present application;

图4为本申请实施例提供的计算机任务处理方法的一个流程示意图;Figure 4 is a schematic flowchart of a computer task processing method provided by an embodiment of the present application;

图5为本申请实施例提供的预处理的一个流程示意图;Figure 5 is a schematic flow chart of preprocessing provided by the embodiment of the present application;

图6为本申请实施例提供的计算机任务处理方法的一个应用例示意图;Figure 6 is a schematic diagram of an application example of the computer task processing method provided by the embodiment of the present application;

图7为本申请实施例提供的生产过程中的物料组装关系的一个示意图;Figure 7 is a schematic diagram of the material assembly relationship in the production process provided by the embodiment of the present application;

图8为本申请实施例提供的比较结果的一个示意图; Figure 8 is a schematic diagram of the comparison results provided by the embodiment of the present application;

图9为本申请实施例提供的计算机任务处理装置的一个结构示意图;Figure 9 is a schematic structural diagram of a computer task processing device provided by an embodiment of the present application;

图10为本申请实施例提供的生产计划获取装置的一个结构示意图。Figure 10 is a schematic structural diagram of a production plan acquisition device provided by an embodiment of the present application.

具体实施方式Detailed ways

本申请实施例提供了一种计算机任务处理方法及其相关设备,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。Embodiments of the present application provide a computer task processing method and related equipment, which can effectively reduce the time consumed in the equation preprocessing process and improve the performance of the equation solving process.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”并他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。The terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances, and are merely a way of distinguishing objects with the same attributes in describing the embodiments of the present application. Furthermore, the terms "include" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product or apparatus comprising a series of elements need not be limited to those elements, but may include any other elements specifically listed or inherent to such processes, methods, products or equipment.

在很多领域中所面临的许多实际问题都可以用混合整数规划来处理,混合整数规划通常包括线性规划和非线性规划这两类问题。例如,设某个待处理的任务为获取工厂的生产计划,生成计划不仅需要满足工厂需求的最大化以及工厂总成本的最小化等目标,还需满足实际业务场景指定的硬约束与软约束等等,根据生产计划所需满足的要求抽象出来的数学模型,可以简化为相应的线性规划方程。那么,通过对该线性规划方程进行求解,可得到该工厂的生产计划。Many practical problems faced in many fields can be handled by mixed integer programming. Mixed integer programming usually includes two types of problems: linear programming and nonlinear programming. For example, assuming that a task to be processed is to obtain the factory's production plan, the generated plan not only needs to meet the goals of maximizing factory demand and minimizing the total factory cost, but also needs to meet the hard constraints and soft constraints specified by the actual business scenario. etc., the mathematical model abstracted based on the requirements that the production plan needs to meet can be simplified into the corresponding linear programming equation. Then, by solving the linear programming equation, the production plan of the factory can be obtained.

由于混合整数规划方程自身涉及的数据量往往很庞大,例如,混合整数规划方程中的变量和约束矩阵的规模(即变量和约束矩阵中元素的数量)通常超过百万数量级,甚至达到千万数量级等等,故可使用相关技术提供的求解器对混合整数规划方程进行预处理(presolve),以缩小方程中变量和约束矩阵的规模,从而得到预处理后(化简后)的混合整数规划方程,再对预处理后的混合整数规划方程进行求解,从而得到相应的解。基于此种求解方式,可有效降低求解混合整数规划方程的难度。Since the amount of data involved in the mixed integer programming equation itself is often very large, for example, the size of the variables and constraint matrices in the mixed integer programming equation (that is, the number of elements in the variable and constraint matrices) usually exceeds the order of millions, or even reaches the order of tens of millions. etc. Therefore, the solver provided by the relevant technology can be used to preprocess (presolve) the mixed integer programming equation to reduce the size of the variables and constraint matrices in the equation, thereby obtaining the preprocessed (simplified) mixed integer programming equation. , and then solve the preprocessed mixed integer programming equation to obtain the corresponding solution. Based on this solution method, the difficulty of solving mixed integer programming equations can be effectively reduced.

在求解器中,提供了多个用于实现预处理的算子,故求解器可按照一定的顺序,对混合整数规划方程执行所有算子,以实现混合整数规划方程的预处理。然而,不同的混合整数规划方程可能用于描述不同领域中的待处理的任务,有些混合整数规划方程可能不需要使用所有算子来实现预处理,即有些混合整数规划方程在实现预处理时所需的算子比较多,有些混合整数规划方程在实现预处理时所需的算子比较少,故现有的求解器在对混合整数规划方程进行预处理的过程中,考虑的因素较为单一,导致预处理过程所消耗的时间过多。In the solver, multiple operators for preprocessing are provided, so the solver can execute all operators on the mixed integer programming equation in a certain order to achieve 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 require the use of all operators to implement preprocessing. More operators are required, and some mixed integer programming equations require fewer operators when implementing preprocessing. Therefore, existing solvers consider only a single factor when preprocessing mixed integer programming equations. This causes the preprocessing process to consume too much time.

进一步地,求解器在对混合整数规划方程执行多个算子时,通常是循环多次执行的,算子的迭代次数通常由人为设定。然而,人为设定往往依赖于专家经验,而不同的混合整数规划方程可能用于描述不同领域中的待处理的任务,针对不同的混合整数规划方程,人为设定算子的迭代次数,往往不够准确,导致方程的预处理效果不够良好。Furthermore, when the solver executes multiple operators on the mixed integer programming equation, it is usually executed multiple times in a loop, and the number of iterations of the operators is usually set artificially. However, artificial settings often rely on expert experience, and different mixed integer programming equations may be used to describe tasks to be processed in different fields. For different mixed integer programming equations, artificially setting the number of operator iterations is often not enough. Accurate, resulting in insufficient preprocessing effect of the equation.

为了解决上述问题,本申请实施例提供了一种计算机任务处理方法(也可以认为提供了一种新的求解器),该方法在相关技术的求解器上,进行了一定的改进,从而可对用于描述不同领域的任务的混合整数规划方程(包含线性规划方程和非线性规划方程等等)进行优质的预处理并求解,从而得到任务的处理结果。本申请实施例提供的方法可应用于多种场景中, 下文将分别对该方法的应用场景进行介绍:In order to solve the above problems, embodiments of the present application provide a computer task processing method (which can also be considered to provide a new solver). This method makes certain improvements on the solvers of related technologies, so that it can Mixed integer programming equations (including linear programming equations, nonlinear programming equations, etc.) used to describe tasks in different fields are preprocessed and solved with high quality to obtain the processing results of the tasks. The methods provided by the embodiments of this application can be applied in a variety of scenarios, The application scenarios of this method will be introduced below:

图1为本申请实施例提供的计算机任务处理系统的一个结构示意图,该计算机任务处理系统包括用户设备以及数据处理设备。其中,用户设备包括手机、个人电脑或者信息处理中心等智能终端。用户设备为数据序列处理的发起端,作为数据序列处理请求的发起方,通常由用户通过用户设备发起请求。Figure 1 is a schematic structural diagram of a computer task processing system provided by an embodiment of the present application. The computer task processing system includes user equipment and data processing equipment. Among them, user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers. The user equipment is the initiator of the data sequence processing. As the initiator of the data sequence processing request, the user usually initiates the request through the user equipment.

上述数据处理设备可以是云服务器、网络服务器、应用服务器以及管理服务器等具有数据处理功能的设备或服务器。数据处理设备通过交互接口接收来自智能终端的任务处理请求,再通过存储数据的存储器以及数据处理的处理器环节将该任务抽象成混合数据规划方程,并进行方程预处理和求解等形式的任务处理。数据处理设备中的存储器可以是一个统称,包括本地存储以及存储历史数据的数据库,数据库可以在数据处理设备上,也可以在其它网络服务器上。The above-mentioned data processing equipment may be a cloud server, a network server, an application server, a management server, and other equipment or servers with data processing functions. The data processing device receives the task processing request from the smart terminal through the interactive interface, and then abstracts the task into a mixed data planning equation through the memory for storing data and the processor for data processing, and performs task processing in the form of equation preprocessing and solving. . The memory in the data processing device can be a general term, including local storage and a database that stores historical data. The database can be on the data processing device or on other network servers.

在图1所示的计算机任务处理系统中,用户设备可以接收用户的指令,例如用户设备可以获取用户输入/选择的一个任务,然后向数据处理设备发起请求(通常包含该任务的各种参数,例如,该任务的变量和该任务需满足的各种约束等等),使得数据处理设备针对用户设备得到的该任务执行任务处理应用,从而得到针对该任务的处理结果。示例性的,用户设备可以获取用户输入的一个任务以及该任务的相关参数,然后向数据处理设备发起任务的处理请求,使得数据处理设备将该任务抽象成混合整数方程,并对混合整数方程进行预处理,再对预处理后的混合整数方程进行求解,从而得到相应的解,可作为该任务的处理结果。In the computer task processing system shown in Figure 1, the user device can receive instructions from the user. For example, the user device can obtain a task input/selected by the user, and then initiate a request to the data processing device (usually including various parameters of the task, For example, variables of the task and various constraints that the task needs to satisfy, etc.), 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. For example, the user device can obtain a task input by the user and related parameters of the task, and then initiate a task processing request to the data processing device, so that the data processing device abstracts the task into a mixed integer equation and performs the processing on the mixed integer equation. Preprocessing, and then solving the preprocessed mixed integer equation to obtain the corresponding solution, which can be used as the processing result of the task.

在图1中,数据处理设备可以执行本申请实施例的计算机任务处理方法或生产计划获取方法。In Figure 1, the data processing device can execute the computer task processing method or the production plan obtaining method according to the embodiment of the present application.

图2为本申请实施例提供的计算机任务处理系统的另一结构示意图,在图2中,用户设备直接作为数据处理设备,该用户设备能够直接获取来自用户的输入并直接由用户设备本身的硬件进行处理,具体过程与图1相似,可参考上面的描述,在此不再赘述。Figure 2 is another structural schematic diagram of a computer task processing system provided by an embodiment of the present application. In Figure 2, the user equipment directly serves as a data processing equipment. The user equipment can directly obtain input from the user and directly use the hardware of the user equipment itself. The specific process is similar to Figure 1. Please refer to the above description and will not be repeated here.

在图2所示的计算机任务处理系统中,用户设备可以接收用户的指令,例如,用户设备可以获取用户在用户设备中所选择的一个任务,然后再由用户设备自身针对该任务执行任务处理应用(例如,文本的摘要生成等),即将该任务抽象成混合整数方程,并对混合整数方程进行预处理,再对预处理后的混合整数方程进行求解,从而得到相应的解,可作为该任务的处理结果。In the computer task processing system shown in Figure 2, the user equipment can receive instructions from the user. For example, the user equipment can obtain a task selected by the user in the user equipment, and then the user equipment itself executes a task processing application for the task. (For example, text summary generation, etc.), that is, abstract the task into a mixed integer equation, preprocess the mixed integer equation, and then solve the preprocessed mixed integer equation to obtain the corresponding solution, which can be used as the task processing results.

在图2中,用户设备自身就可以执行本申请实施例的计算机任务处理方法或生产计划获取方法。In Figure 2, the user equipment itself can execute the computer task processing method or the production plan obtaining method according to the embodiment of the present application.

进一步地,对于图1和图2中的用户设备,通常可以是用户所使用的终端设备,例如,手机、笔记本、个人电脑等等。为了便于了解用户所使用的终端设备,下文结合图3a对终端设备作进一步的介绍(图3a示出了终端设备300的一个示例性的结构示意图)。如图3a所示,终端设备300包括:应用处理器301、微控制器单元(microcontroller unit,MCU)303、存储器305、调制解调器(modem)307、射频(radio frequency,RF)模块309、无线保真(Wireless-Fidelity,简称Wi-Fi)模块311、蓝牙模块313、传感器314、定位模块350、输入/输出(input/output,I/O)设备335等部件。这些部件可通过一根或多根通信总线或信号线进行通信。本领域技术人员可以理解,图1中示出的硬件结构并不构成对终端设备的限定,终 端设备300可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Further, the user equipment in Figures 1 and 2 can usually be a terminal equipment used by the user, such as a mobile phone, a notebook, a personal computer, etc. In order to facilitate understanding of the terminal device used by the user, the terminal device will be further introduced below in conjunction with Figure 3a (Figure 3a shows an exemplary structural schematic diagram of the terminal device 300). As shown in Figure 3a, the terminal device 300 includes: an application processor 301, a microcontroller unit (MCU) 303, a memory 305, a modem (modem) 307, a radio frequency (radio frequency, RF) module 309, and wireless fidelity. (Wireless-Fidelity, Wi-Fi for short) module 311, Bluetooth module 313, sensor 314, positioning module 350, input/output (input/output, I/O) device 335 and other components. These components communicate via one or more communication buses or signal lines. Those skilled in the art can understand that the hardware structure shown in Figure 1 does not constitute a limitation on the terminal equipment. End device 300 may include more or fewer components than illustrated, or combinations of certain components, or different component arrangements.

下面结合图3a对终端设备300的各个部件进行具体的介绍:The following is a detailed introduction to each component of the terminal device 300 in conjunction with Figure 3a:

应用处理器301是终端设备300的控制中心,利用各种接口和总线连接终端设备300的各个部件。在一些实施例中,处理器301可包括一个或多个处理单元。The application processor 301 is the control center of the terminal device 300 and connects various components of the terminal device 300 using various interfaces and buses. In some embodiments, processor 301 may include one or more processing units.

存储器305中存储有计算机程序,诸如图3a所示的操作系统361和应用程序363。应用处理器301被配置用于执行存储器305中的计算机程序,从而实现该计算机程序定义的功能,例如应用处理器301执行操作系统361从而在终端设备300上实现操作系统的各种功能。存储器305还存储有除计算机程序之外的其他数据,诸如操作系统361和应用程序363运行过程中产生的数据。存储器305为非易失性存储介质,一般包括内存和外存。内存包括但不限于随机存取存储器(Random Access Memory,RAM),只读存储器(Read-Only Memory,ROM),或高速缓存(cache)等。外存包括但不限于闪存(flash memory)、硬盘、光盘、通用串行总线(universal serial bus,USB)盘等。计算机程序通常被存储在外存上,处理器在执行计算机程序前会将该程序从外存加载到内存。Computer programs are stored in the memory 305, such as the operating system 361 and application programs 363 shown in Figure 3a. The application processor 301 is configured to execute the computer program in the memory 305 to implement functions defined by the computer program. For example, the application processor 301 executes the operating system 361 to implement various functions of the operating system on the terminal device 300 . The memory 305 also stores other data in addition to computer programs, such as data generated during the operation of the operating system 361 and the application program 363. Memory 305 is a non-volatile storage medium, generally including internal memory and external memory. Memory includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), or cache (cache), etc. External storage includes but is not limited to flash memory, hard disk, optical disk, universal serial bus (USB) disk, etc. Computer programs are usually stored on external memory, and the processor loads the computer program from external memory into memory before executing it.

存储器305可以是独立的,通过总线与应用处理器301相连接;存储器305也可以和应用处理器301集成到一个芯片子系统。The memory 305 can be independent and connected to the application processor 301 through a bus; the memory 305 can also be integrated with the application processor 301 into a chip subsystem.

MCU 303是用于获取并处理来自传感器314的数据的协处理器,MCU 303的处理能力和功耗小于应用处理器301,但具有“永久开启(always on)”的特点,可以在应用处理器301处于休眠模式时持续收集以及处理传感器数据,以极低的功耗保障传感器的正常运行。在一个实施例中,MCU303可以为sensor hub芯片。传感器314可以包括光传感器、运动传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示器351的亮度,接近传感器可在终端设备300移动到耳边时,关闭显示屏的电源。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向;传感器314还可以包括陀螺仪、气压计、湿度计、温度计、红外线传感器等其它传感器,在此不再赘述。MCU 303和传感器314可以集成到同一块芯片上,也可以是分离的元件,通过总线连接。The MCU 303 is a co-processor used to obtain and process data from the sensor 314. The MCU 303 has less processing power and power consumption than the application processor 301, but has the feature of "always on" and can be used in the application processor. When the 301 is in sleep mode, it continues to collect and process sensor data, ensuring the normal operation of the sensor with extremely low power consumption. In one embodiment, MCU 303 may be a sensor hub chip. Sensors 314 may include light sensors, motion sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display 351 according to the brightness of the ambient light. The proximity sensor can turn off the power of the display screen when the terminal device 300 moves to the ear. . As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three axes), and can detect the magnitude and direction of gravity when stationary; the sensor 314 can also include a gyroscope, a barometer, a hygrometer, Other sensors such as thermometers and infrared sensors will not be described in detail here. The MCU 303 and the sensor 314 can be integrated on the same chip, or they can be separate components connected through a bus.

Modem 307以及射频模块309构成了终端设备300通信子系统,用于实现3GPP、ETSI等无线通信标准协议的主要功能。其中,Modem 307用于编解码、信号的调制解调、均衡等。射频模块309用于无线信号的接收和发送,射频模块309包括但不限于天线、至少一个放大器、耦合器、双工器等。射频模块309配合Modem 307实现无线通信功能。Modem 307可以作为单独的芯片,也可以与其他芯片或电路在一起形成系统级芯片或集成电路。这些芯片或集成电路可应用于所有实现无线通信功能的终端设备,包括:手机、电脑、笔记本、平板、路由器、可穿戴设备、汽车、家电设备等。Modem 307 and radio frequency module 309 constitute the terminal equipment 300 communication subsystem, which is used to implement the main functions of wireless communication standard protocols such as 3GPP and ETSI. Among them, Modem 307 is used for encoding and decoding, signal modulation and demodulation, equalization, etc. The radio frequency module 309 is used for receiving and transmitting wireless signals. The radio frequency module 309 includes but is not limited to an antenna, at least one amplifier, coupler, duplexer, etc. The radio frequency module 309 cooperates with the Modem 307 to implement wireless communication functions. Modem 307 can be used as a separate chip or can be combined with other chips or circuits to form a system-on-chip or integrated circuit. These chips or integrated circuits can be applied to all terminal devices that implement wireless communication functions, including: mobile phones, computers, notebooks, tablets, routers, wearable devices, cars, home appliances, etc.

终端设备300还可以使用Wi-Fi模块311,蓝牙模块313等来进行无线通信。Wi-Fi模块311用于为终端设备300提供遵循Wi-Fi相关标准协议的网络接入,终端设备300可以通过Wi-Fi模块311接入到Wi-Fi接入点,进而访问互联网。在其他一些实施例中,Wi-Fi模块311也可以作为Wi-Fi无线接入点,可以为其他终端设备提供Wi-Fi网络接入。蓝牙模块313用于实现终端设备300与其他终端设备(例如手机、智能手表等)之间的短距离通信。本申请实施例中的Wi-Fi模块311可以是集成电路或Wi-Fi芯片等,蓝牙模块313可以是集成电路或者 蓝牙芯片等。The terminal device 300 can also use the Wi-Fi module 311, the Bluetooth module 313, etc. to perform wireless communication. The Wi-Fi module 311 is used to provide the terminal device 300 with network access that complies with Wi-Fi related standard protocols. The terminal device 300 can access the Wi-Fi access point through the Wi-Fi module 311 and then access the Internet. In some other embodiments, the Wi-Fi module 311 can also serve as a Wi-Fi wireless access point and can provide Wi-Fi network access for other terminal devices. The Bluetooth module 313 is used to implement short-distance communication between the terminal device 300 and other terminal devices (such as mobile phones, smart watches, etc.). The Wi-Fi module 311 in the embodiment of the present application may be an integrated circuit or a Wi-Fi chip, etc., and the Bluetooth module 313 may be an integrated circuit or a Wi-Fi chip. Bluetooth chip, etc.

定位模块350用于确定终端设备300的地理位置。可以理解的是,定位模块350具体可以是全球定位系统(global position system,GPS)或北斗卫星导航系统、俄罗斯GLONASS等定位系统的接收器。The positioning module 350 is used to determine the geographical location of the terminal device 300 . It can be understood that the positioning module 350 may be a receiver of a global positioning system (GPS) or a positioning system such as the Beidou Satellite Navigation System or the Russian GLONASS.

Wi-Fi模块311,蓝牙模块313和定位模块350分别可以是单独的芯片或集成电路,也可以集成到一起。例如,在一个实施例中,Wi-Fi模块311,蓝牙模块313和定位模块350可以集成到同一芯片上。在另一个实施例中,Wi-Fi模块311,蓝牙模块313、定位模块350以及MCU 303也可以集成到同一芯片中。The Wi-Fi module 311, the Bluetooth module 313 and the positioning module 350 can be separate chips or integrated circuits, or they can be integrated together. For example, in one embodiment, the Wi-Fi module 311, the Bluetooth module 313 and the positioning module 350 can be integrated on the same chip. In another embodiment, the Wi-Fi module 311, the Bluetooth module 313, the positioning module 350 and the MCU 303 can also be integrated into the same chip.

输入/输出设备335包括但不限于:显示器351、触摸屏353,以及音频电路355等等。Input/output devices 335 include but are not limited to: display 351, touch screen 353, audio circuit 355, and so on.

其中,触摸屏353可采集终端设备300的用户在其上或附近的触摸事件(比如用户使用手指、触控笔等任何适合的物体在触摸屏353上或在触控屏触摸屏353附近的操作),并将采集到的触摸事件发送给其他器件(例如应用处理器301)。其中,用户在触摸屏353附近的操作可以称之为悬浮触控;通过悬浮触控,用户可以在不直接接触触摸屏353的情况下选择、移动或拖动目标(例如图标等)。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型来实现触摸屏353。Among them, the touch screen 353 can collect touch events on or near the user of the terminal device 300 (such as the user's operations on the touch screen 353 or near the touch screen 353 using any suitable object such as a finger or a stylus), and Send the collected touch events to other devices (eg, application processor 301). The user's operation near the touch screen 353 can be called floating touch; through floating touch, the user can select, move or drag targets (such as icons, etc.) without directly touching the touch screen 353 . In addition, touch screens 353 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave.

显示器(也称为显示屏)351用于显示用户输入的信息或展示给用户的信息。可以采用液晶显示屏、有机发光二极管等形式来配置显示器。触摸屏353可以覆盖在显示器351之上,当触摸屏353检测到触摸事件后,传送给应用处理器301以确定触摸事件的类型,随后应用处理器301可以根据触摸事件的类型在显示器351上提供相应的视觉输出。虽然在图3a中,触摸屏353与显示器351是作为两个独立的部件来实现终端设备300的输入和输出功能,但是在某些实施例中,可以将触摸屏353与显示器351集成而实现手机300的输入和输出功能。另外,触摸屏353和显示器351可以以全面板的形式配置在终端设备300的正面,以实现无边框的结构。The display (also called a display screen) 351 is used to display information input by the user or information presented to the user. Displays can be configured in the form of LCD screens, organic light-emitting diodes, etc. The touch screen 353 can be overlaid on the display 351. When the touch screen 353 detects a touch event, it is sent to the application processor 301 to determine the type of the touch event. Then the application processor 301 can provide corresponding information on the display 351 according to the type of the touch event. Visual output. Although in Figure 3a, the touch screen 353 and the display 351 are used as two independent components to implement the input and output functions of the terminal device 300, in some embodiments, the touch screen 353 and the display 351 can be integrated to implement the input and output functions of the mobile phone 300. Input and output functions. In addition, the touch screen 353 and the display 351 can be configured in the form of a full panel on the front of the terminal device 300 to achieve a frameless structure.

音频电路3355、扬声器336、麦克风317可提供用户与终端设备300之间的音频接口。音频电路309可将接收到的音频数据转换后的电信号,传输到扬声器313,由扬声器313转换为声音信号输出;另一方面,麦克风314将收集的声音信号转换为电信号,由音频电路309接收后转换为音频数据,再通过Modem 307和射频模块309将音频数据发送给比如另一终端设备,或者将音频数据输出至存储器305以便进一步处理。The audio circuit 3355, speaker 336, and microphone 317 can provide an audio interface between the user and the terminal device 300. The audio circuit 309 can transmit the electrical signal converted from the received audio data to the speaker 313, and the speaker 313 converts it into a sound signal for output; on the other hand, the microphone 314 converts the collected sound signal into an electrical signal, and the audio circuit 309 After receiving, it is converted into audio data, and then the audio data is sent to another terminal device through the Modem 307 and the radio frequency module 309, or the audio data is output to the memory 305 for further processing.

另外,终端设备300还可以具有指纹识别功能。例如,可以在终端设备300的背面(例如后置摄像头的下方)配置指纹采集器件,或者在终端设备300的正面(例如触摸屏353的下方)配置指纹采集器件。又例如,可以在触摸屏353中配置指纹采集器件来实现指纹识别功能,即指纹采集器件可以与触摸屏353集成在一起来实现终端设备300的指纹识别功能。在这种情况下,该指纹采集器件配置在触摸屏353中,可以是触摸屏353的一部分,也可以以其他方式配置在触摸屏353中。本申请实施例中的指纹采集器件的主要部件是指纹传感器,该指纹传感器可以采用任何类型的感测技术,包括但不限于光学式、电容式、压电式或超声波传感技术等。In addition, the terminal device 300 may also have a fingerprint recognition function. For example, the fingerprint collection device may be configured on the back of the terminal device 300 (for example, below the rear camera), or the fingerprint collection device may be configured on the front of the terminal device 300 (for example, below the touch screen 353). For another example, a fingerprint collection device can be configured in the touch screen 353 to implement the fingerprint identification function, that is, the fingerprint collection device can be integrated with the touch screen 353 to implement the fingerprint identification function of the terminal device 300 . In this case, the fingerprint collection device is configured in the touch screen 353, may be a part of the touch screen 353, or may be configured in the touch screen 353 in other ways. The main component of the fingerprint collection device in the embodiment of the present application is a fingerprint sensor. The fingerprint sensor can use any type of sensing technology, including but not limited to optical, capacitive, piezoelectric or ultrasonic sensing technology.

进一步地,终端设备300搭载的操作系统361可以为或者其它操作系统,本申请实施例对此不作任何限制。 Further, the operating system 361 installed on the terminal device 300 may be or other operating systems, the embodiments of this application do not impose any restrictions on this.

以搭载操作系统的终端设备300为例,如图3a所示,终端设备300从逻辑上可划分为硬件层、操作系统361,以及应用层。硬件层包括如上所述的硬件处理器301、微控制器单元305、Modem 307、Wi-Fi模块311、传感器314、定位模块350等硬件资源。应用层包括一个或多个应用程序,比如应用程序363,应用程序363可以为社交类应用、电子商务类应用、浏览器等任意类型的应用程序。操作系统361作为硬件层和应用层之间的软件中间件,是管理和控制硬件与软件资源的计算机程序。to carry Taking the terminal device 300 of the operating system as an example, as shown in Figure 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 the hardware processor 301, microcontroller unit 305, Modem 307, Wi-Fi module 311, sensor 314, positioning module 350 and other hardware resources as mentioned above. The application layer includes one or more applications, such as application 363. The application 363 can be any type of application such as a social application, an e-commerce application, or a browser. As a software middleware between the hardware layer and the application layer, the operating system 361 is a computer program that manages and controls hardware and software resources.

在一个实施例中,操作系统361包括内核,硬件抽象层(hardware abstraction layer,HAL)、库和运行时(libraries and runtime)以及框架(framework)。其中,内核用于提供底层系统组件和服务,例如:电源管理、内存管理、线程管理、硬件驱动程序等;硬件驱动程序包括Wi-Fi驱动、传感器驱动、定位模块驱动等。硬件抽象层是对内核驱动程序的封装,向框架提供接口,屏蔽低层的实现细节。硬件抽象层25运行在用户空间,而内核驱动程序运行在内核空间。In one embodiment, operating system 361 includes a kernel, a hardware abstraction layer (HAL), libraries and runtime, and a framework. Among them, the kernel is used to provide underlying system components and services, such as power management, memory management, thread management, hardware drivers, etc.; hardware drivers include Wi-Fi drivers, sensor drivers, positioning module drivers, etc. The hardware abstraction layer encapsulates the kernel driver, provides an interface to the framework, and shields low-level implementation details. The hardware abstraction layer 25 runs in user space, while the kernel driver runs in kernel space.

库和运行时也叫做运行时库,它为可执行程序在运行时提供所需要的库文件和执行环境。在一个实施例中,库与运行时包括安卓运行时(Android Runtime,ART),库,以及场景包运行时。ART是能够把应用程序的字节码转换为机器码的虚拟机或虚拟机实例。库是为可执行程序在运行时提供支持的程序库,包括浏览器引擎(比如webkit)、脚本执行引擎(比如JavaScript引擎)、图形处理引擎等。场景包运行时是场景包的运行环境,主要包括页面执行环境(page context)和脚本执行环境(script context),其中,页面执行环境通过调用相应的库解析html、css等格式的页面代码,脚本执行环境通过调用相应的功能库解析执行JavaScript等脚本语言实现的代码或可执行文件。Libraries and runtime are also called runtime libraries, which provide the library files and execution environment required for executable programs to run. In one embodiment, the libraries and runtimes include Android Runtime (ART), libraries, and scenario package runtimes. ART is a virtual machine or virtual machine instance that can convert an application's bytecode into machine code. A library is a program library that provides support for executable programs at runtime, including browser engines (such as webkit), script execution engines (such as JavaScript engines), graphics processing engines, etc. The scene package runtime is the running environment of the scene package, which mainly includes the page execution environment (page context) and the script execution environment (script context). Among them, the page execution environment parses the page code in html, css and other formats by calling the corresponding library, and the script The execution environment parses and executes code or executable files implemented in scripting languages such as JavaScript by calling the corresponding function library.

框架用于为应用层中的各个应用程序提供各种基础的公共组件和服务,比如,窗口管理、位置管理等等。在一个实施例中,框架可包括地理围栏服务,策略服务,通知管理器等等。The framework is used to provide various basic public components and services for each application in the application layer, such as window management, location management, etc. In one embodiment, the framework may include geofencing services, policy services, notification managers, and the like.

以上描述的操作系统361的各个组件的功能均可以由应用处理器301执行存储器305中存储的程序来实现。The above-described functions of each component of the operating system 361 can be implemented by the application processor 301 executing programs stored in the memory 305 .

需要说明的是,本申请实施例可基于某种求解器实现,该求解器可部署于前述的数据处理设备或用户设备(终端设备)中。为了便于介绍该求解器,下文以能够处理混合整数规划中的线性规划问题的求解器进行示意性介绍。图3b为本申请实施例提供的求解器的一个架构示意图),如图3b所示,该求解器包括:方程构建模块、预处理(presolve)模块、生成(crash)模块、预求解模块、后处理(postsolve)模块以及恢复(clean up)模块。It should be noted that the embodiments of the present application can be implemented based on a certain solver, and the solver can be deployed in the aforementioned data processing equipment or user equipment (terminal equipment). In order to facilitate the introduction of this solver, a solver capable of handling linear programming problems in mixed integer programming is schematically introduced below. Figure 3b is an architectural schematic diagram of a solver provided by an embodiment of the present application). As shown in Figure 3b, the solver includes: an equation building module, a preprocessing (presolve) module, a generation (crash) module, a pre-solving module, and a post-processing module. Processing (postsolve) module and recovery (clean up) module.

具体地,方程构建模块可基于待处理的任务,构建混合整数规划方程。预处理模块可对混合整数规划方程进行结构上的化简,得到预处理后的混合整数规划方程。生成模块可基于预处理后的混合整数规划方程,生成求解的初始点。预求解模块可利用对偶单纯形法,从该初始点开始,对预处理后的混合整数规划方程进行求解,得到预处理后的混合整数规划方程的最优解。后处理模块可将预处理后的混合整数规划方程的最优解,转化为原始的的混合整数规划方程的近似解。恢复模块若确定该近似解并非为原始的的混合整数规划方程的最优解,则将该近似解恢复为原始的的混合整数规划方程的最优解。Specifically, the equation building module can construct a mixed integer programming equation based on the task to be processed. The preprocessing module can structurally simplify the mixed integer programming equation and obtain the preprocessed mixed integer programming equation. The generation module can generate initial points for solution based on the preprocessed mixed integer programming equation. The pre-solving module can use the dual simplex method to solve the pre-processed mixed integer programming equation starting from this initial point, and obtain the optimal solution of the pre-processed mixed integer programming equation. The post-processing module can convert the optimal solution of the preprocessed mixed integer programming equation into an approximate solution of the original mixed integer programming equation. If the restoration module determines that the approximate solution is not the optimal solution of the original mixed integer programming equation, it restores the approximate solution to the optimal solution of the original mixed integer programming equation.

值得注意的是,本申请实施例提供的计算机任务处理方法或生产计划获取方法,可通过上述求解器的架构实现,且对该求解器中的预处理模块进行了改进,能对原始的的混合整数 规划方程实现更优质的预处理,以便于方程的求解。为了进一步了解本申请实施例提供的方法,下文结合图4对该方法做进一步的介绍。图4为本申请实施例提供的计算机任务处理方法的一个流程示意图,如图4所示,该方法包括:It is worth noting that the computer task processing method or the production plan acquisition method provided by the embodiments of the present application can be implemented through the architecture of the above solver, and the preprocessing module in the solver has been improved to enable the original hybrid integer Planning equations implement better preprocessing to facilitate equation solving. In order to further understand the method provided by the embodiment of the present application, the method will be further introduced below in conjunction with Figure 4. Figure 4 is a schematic flow chart of a computer task processing method provided by an embodiment of the present application. As shown in Figure 4, the method includes:

401、获取混合整数规划方程,混合整数规划方程用于描述待处理的任务。401. Obtain a mixed integer programming equation. The mixed integer programming equation is used to describe the task to be processed.

本实施例中,当需要处理某个任务时,可获取用于描述该待处理的任务的混合整数规划方程,混合整数规划方程通常包含两大类方程,即线性规划方程和非线性规划方程。例如,设该待处理的任务为获取某个工厂的待求解的生产计划(也可以理解为排产计划),该工厂的待求解的生成计划不仅需要满足该工厂需求的最大化以及该工厂总成本的最小化等目标,还需满足实际业务场景指定的硬约束与软约束等等。那么,根据该工厂的待求解的生产计划以及该生成计划所需满足的要求抽象出来的数学模型,可以简化为相应的线性规划方程,该线性规划方程如公式(1)所示:
mincTx
Ax=b
x≥0.         (1)
In this embodiment, when a certain task needs to be processed, a mixed integer programming equation describing the task to be processed can be obtained. Mixed integer programming equations usually include two major types of equations, namely linear programming equations and nonlinear programming equations. For example, assuming that the task to be processed is to obtain a production plan to be solved for a certain factory (which can also be understood as a production scheduling plan), the production plan to be solved for the factory must not only satisfy the maximization of the demand of the factory and the total number of the factory. Goals such as cost minimization also need to meet the hard constraints and soft constraints specified by the actual business scenario, etc. Then, the mathematical model abstracted based on the factory's production plan to be solved and the requirements that the generated plan needs to meet can be simplified into the corresponding linear programming equation, which is shown in formula (1):
xx
Ax=b
x≥0. (1)

上式中,x为线性规划方程的变量(即前述该工厂的待求解的生产计划),为m行1列的矩阵(该矩阵中每个元素可视为生产计划中每个待求解的量,例如,该矩阵包含10个元素,这10个元素即为该工厂10天内每天所需生产的原材料量等等,且这10个元素既可以是整数,也可以是非整数);A为线性规划方程的约束矩阵(包含前述该工厂的待求解的生产计划所需满足的各个约束,例如,材料约束、生产力约束、时间约束以及交通约束等等),为h行m列的矩阵,约束矩阵A中的每一行可以视为该工厂所需满足的一个约束;c为与变量中元素数量对应的矩阵,也为m行1列的矩阵;b为与约束数量对应的矩阵,为h行1列的矩阵。其中,h和m均为大于或等于1的整数。In the above formula, x is the variable of the linear programming equation (that is, the production plan to be solved for the factory mentioned above), and is a matrix with m rows and 1 column (each element in this matrix can be regarded as each quantity to be solved in the production plan , for example, this matrix contains 10 elements, which are the amount of raw materials that the factory needs to produce every day within 10 days, etc., and these 10 elements can be either integers or non-integers); A is linear programming The constraint matrix of the equation (including the aforementioned constraints that need to be satisfied by the production plan to be solved for the factory, such as material constraints, productivity constraints, time constraints, traffic constraints, etc.) is a matrix with h rows and m columns, and the constraint matrix A Each row in can be regarded as a constraint that the factory needs to satisfy; c is a matrix corresponding to the number of elements in the variable, also a matrix with m rows and 1 column; b is a matrix corresponding to the number of constraints, with h rows and 1 column matrix. Among them, h and m are both integers greater than or equal to 1.

需要说明的是,不同领域中的任务均可用混合整数规划方程进行描述,例如,供应链领域中工厂的生产计划、物流领域中的车辆路径优化、云技术领域中的中心选址(facility location)、电力领域中的电网调度等等,这些任务均可通过混合整数规划方程进行描述。在用于描述不同领域的任务的不同混合整数规划方程,往往具备不同的变量和不同的约束矩阵。It should be noted that tasks in different fields can be described by mixed integer programming equations, such as factory production planning in the supply chain field, vehicle route optimization in the logistics field, and facility location in the cloud technology field. , grid dispatching in the electric power field, etc., these tasks can 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、基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。402. Determine the target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation. The information is related to at least one of the following: variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation.

得到混合整数规划方程后,可对混合整数规划方程进行结构识别,从而得到与混合整数规划方程的结构相关的信息(也可以称为混合整数规划方程的结构信息,可用于指示混合整数规划方程的结构)。值得注意的是,结构识别的操作主要集中于对混合整数规划方程的变量和混合整数规划方程的约束矩阵进行分析,从而确定混合整数规划方程的结构组成(也就是待处理的任务的结构组成),故所得到的与混合整数规划方程的结构相关的信息,也就与混合整数规划方程的变量和混合整数规划方程的约束矩阵中的至少一项相关联。After the mixed integer programming equation is obtained, the structure of the mixed integer programming equation can be identified, thereby obtaining information related to the structure of the mixed integer programming equation (it can also be called the structure information of the mixed integer programming equation, which can be used to indicate the structure of the mixed integer programming equation. structure). It is worth noting that the operation of structure identification mainly focuses on analyzing the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation, thereby determining the structural composition of the mixed integer programming equation (that is, the structural composition of the task to be processed) , so 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.

具体地,由于与混合整数规划方程的结构相关的信息与混合整数规划方程的变量和混合整数规划方程的约束矩阵中的至少一项相关联,故与混合整数规划方程的结构相关的信息可 包含以下至少一项:(1)混合整数规划方程的变量的维度,也就是混合整数规划方程的变量所包含的元素的数量,例如,线性规划方程的变量x所包含的元素的数量。(2)混合整数规划方程的约束矩阵的稀疏度,也就是混合整数规划方程的约束矩阵中取值为零的元素的数量,例如,线性规划方程的约束矩阵A中取值为0的元素的数量。(3)混合整数规划方程的约束矩阵的分块信息,混合整数规划方程的分块信息用于指示混合整数规划方程的约束矩阵中所包含的元素为零的子矩阵,例如,设线性规划方程的约束矩阵A前三行均为0,那么,可将约束矩阵A前三行视为一个子矩阵,线性规划方程的分块信息用于指示该子矩阵。(4)混合整数规划方程的约束矩阵中与混合整数规划方程的变量存在计算关系的行,由于混合整数规划方程的约束矩阵中的每一行均会与混合整数规划方程的变量相乘,若混合整数规划方程的约束矩阵中的某一行(的所有元素)为零,说明该行与混合整数规划方程的变量之间不存在计算关系,若混合整数规划方程的约束矩阵中的某一行(的任意一个元素)不为零,说明该行与混合整数规划方程的变量之间存在计算关系。例如,设线性规划方程的约束矩阵A前三行均为0,那么,这三行则与线性规划方程的变量x之间不存在计算关系。Specifically, 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 be Contains at least one of the following: (1) The dimension of the variable of the mixed integer programming equation, that is, the number of elements contained in the variable of the mixed integer programming equation, for example, the number of elements contained in the variable x of the linear programming equation. (2) The sparsity of the constraint matrix of the mixed integer programming equation, that is, the number of elements with a value of zero in the constraint matrix of the mixed integer programming equation, for example, the number of elements with a value of 0 in the constraint matrix A of the linear programming equation quantity. (3) The block information of the constraint matrix of the mixed integer programming equation. The block information of the mixed integer programming equation is used to indicate the submatrix whose elements are zero contained in the constraint matrix of the mixed integer programming equation. For example, assuming a linear programming equation The first three rows of the constraint matrix A are all 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 rows in the constraint matrix of the mixed integer programming equation have a calculation relationship with the variables of the mixed integer programming equation. Since each row in the constraint matrix of the mixed integer programming equation will be multiplied by the variables of the mixed integer programming equation, if the mixed integer programming equation is mixed If (all the elements of) a certain row in the constraint matrix of the integer programming equation are zero, it means that there is no calculation relationship between the row and the variables of the mixed integer programming equation. If any of the rows (of any elements) in the constraint matrix of the mixed integer programming equation An element) is not zero, indicating that there is a computational relationship between the row and the variables of the mixed integer programming equation. For example, assuming that 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.

得到与混合整数规划方程的结构相关的信息后,可基于这些信息从算子资源池中确定目标算子。需要说明的是,算子资源池包含可用于实现预处理的多个算子,具体如表1所示:After obtaining information related to the structure of the mixed integer programming equation, the target operator can be determined from the operator resource pool based on this information. It should be noted that the operator resource pool contains multiple operators that can be used to implement preprocessing, as shown in Table 1:

表1

Table 1

基于表1可知,算子资源池包含但不限于表1所示的多个可供选择的算子,故可根据与混合整数规划方程的结构相关的信息,从算子资源池中选择用于对混合整数规划方程实现预处理的至少一个算子,后续可将选择出来的这部分算子称为目标算子。Based on Table 1, it can be seen that the operator resource pool includes but is not limited to multiple optional operators shown in Table 1. Therefore, the operator resource pool can be selected from the operator resource pool based on the information related to the structure of the mixed integer programming equation. At least one operator is used to preprocess the mixed integer programming equation. This selected operator can be later called the target operator.

具体地,可通过以下方式来获取目标算子:Specifically, the target operator can be obtained in the following ways:

(1)在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程。需要说明的是,方程资源池包含不同结构的多个预置方程(也可以理解为是提前设置的不同结构的方程模板),而与混合整数规划方程的结构相关的信息用于指示混合整数规划方程的结构类别,因此,与在方程资源池中遍历,寻找与与混合整数规划方程的结构相关的信息相匹配的预置方程,那么,该预置方程与混合整数规划方程即为结构相似或相同的两个方程。(1) In the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation. It should be noted that the equation resource pool contains multiple preset equations with different structures (can also be understood as equation templates with different structures set in advance), and the information related to the structure of the mixed integer programming equation is used to indicate the mixed integer programming The structural category of the equation, therefore, is to traverse the equation resource pool to find a preset equation that matches the information related to the structure of the mixed integer programming equation. Then, the preset equation and the mixed integer programming equation have a similar structure or The same two equations.

(2)在算子资源池中,将针对预置方程的预处理所使用的算子确定为目标算子。需要说明的是,确定与混合整数规划方程结构相似或相同的预置方程后,由于预置方程是提前设置的,故可以确定在针对预置方程的预处理中使用了算子资源池中的哪些算子,并将这部分算子确定为用于实现混合整数规划方程的预处理的算子,即目标算子。值得注意的是,通常目标算子的数量有多个,在针对预置方程的预处理中,每个目标算子可被循环使用多次,故可确定每个目标算子在针对预置方程的预处理中的迭代次数。然后,可按迭代次数将这多个目标算子划分为多个算子集合,每个算子集合包含这多个目标算子中的至少一个目标算子。在这多个算子集合中,第1个算子集合中的目标算子的迭代次数为1次,第2个算子集合中的目标算子的迭代次数为2次,…,第k个算子集合中的目标算子的迭代次数为k次,k为大于或等于1的整数。(2) In the operator resource pool, determine the operator used for preprocessing of the preset equation as the target operator. It should be noted that after determining the preset equation with a similar or identical structure to the mixed integer programming equation, since the preset equation is set in advance, it can be determined that the preprocessing of the preset equation has used the operator resource pool Which operators are determined and these operators are determined as operators used to implement preprocessing of mixed integer programming equations, that is, target operators. It is worth noting that there are usually multiple target operators. In the preprocessing for the preset equation, each target operator can be recycled multiple times, so it can be determined that each target operator is used for the preset equation. The number of iterations in preprocessing. Then, the multiple target operators can be divided into multiple operator sets according to the number of iterations, and each operator set contains at least one target operator among the multiple target operators. Among these multiple operator sets, the number of iterations of the target operator in the first operator set is 1, the number of iterations of the target operator in the second operator set is 2,..., the kth The number of iterations of the target operator in the operator set is k times, and k is an integer greater than or equal to 1.

应理解,本实施例仅以与混合整数规划方程的结构相关的信息与混合整数规划方程的变量和混合整数规划方程的约束矩阵中的至少一项相关联进行示意性说明,在实际应用中,与混合整数规划方程的结构相关的信息还可与混合整数规划方程的其它项相关联,例如,与变量中元素数量对应的矩阵,与约束数量对应的矩阵等等。It should be understood that this embodiment is only schematically illustrated by associating information related to the structure of the mixed integer programming equation with at least one of the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. In practical applications, 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, etc.

进一步地,基于上述例子,与混合整数规划方程的结构相关的信息还可包括以下至少一项:与变量中元素数量对应的矩阵的稀疏度、与约束数量对应的矩阵的稀疏度等等。Further, based on the above example, the information related to the structure of the mixed integer programming equation may also include at least one of the following: the sparsity of the matrix corresponding to the number of elements in the variable, the sparsity of the matrix corresponding to the number of constraints, and so on.

还应理解,预置方程的结构与混合整数规划方程的结构相似或相同,通常指的是预置方程的约束矩阵与混合整数规划方程的约束矩阵相似或相同。It should also be understood that the structure of the preset equation is similar or the same as the structure of the mixed integer programming equation, which usually means that the constraint matrix of the preset equation is similar or the same as the constraint matrix of the mixed integer programming equation.

进一步地,预置方程的结构与混合整数规划方程的结构相似或相同还可包括:这两个方程的与变量中元素数量对应的矩阵相似或相同,和/或,这两个方程的与约束数量对应的矩阵相似或相同等等。 Furthermore, the structure of the preset equation and the structure of the mixed integer programming equation may also include: the matrices corresponding to the number of elements in the variables of the two equations are similar or the same, and/or the AND constraints of the two equations The matrices corresponding to the quantities are similar or the same, etc.

403、将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵。403. Merge the rows that are in a multiple relationship in the constraint matrix, or set the columns that are in a multiple relationship in the constraint matrix to the same column to obtain a constraint matrix after redundancy is removed.

确定目标算子后,可基于目标算子实现针对混合整数规划方程的预处理,以得到预处理后的混合整数规划方程。为了实现更加优质的预处理,可提前对混合整数规划方程进行去冗余操作,该操作包括:After the target operator is determined, preprocessing of the mixed integer programming equation can be implemented based on the target operator to obtain the preprocessed mixed integer programming equation. In order to achieve better preprocessing, the mixed integer programming equation can be deredundant in advance, which includes:

(1)在混合整数规划方程的约束矩阵中,可通过一定的方式确定成倍数关系的行,并将这些行进行合并,得到合并行后的约束矩阵。依旧如上述例子,设a1和a2分别为约束矩阵A的第一行和第二行,那么,可对a1和a2分别进行以下计算:
(1) In the constraint matrix of the mixed integer programming equation, the rows with multiple relationships can be determined in a certain way, and these rows can be merged to obtain the constraint matrix after the merged rows. Still as in the above example, assuming a 1 and a 2 are the first and second rows of the constraint matrix A respectively, then the following calculations can be performed for a 1 and a 2 respectively:

上式中,a11为a1的第1个元素,a12为a1的第2个元素,…,a1m为a1的第m个元素,同理,a21、a22和a2m,此处不再赘述。λ和λ`均为预置的参数矩阵,这两个矩阵中的各个元素均为预置值。In the above formula, a 11 is the first element of a 1 , a 12 is the second element of a 1 , ..., a 1m is the m-th element of a 1 , similarly, a 21 , a 22 and a 2m , which will not be described again here. λ and λ` are both preset parameter matrices, and each element in these two matrices is a preset value.

基于公式(2),可为约束矩阵A的每一行设置一个ratio,其中,第x行的ratio(即ratiox)=sum`[x]/sum[x],x=1,…,h。若ratiox=ratioy,说明ax和ay可能成倍数关系,即ax=qay,也就是说ax和ay是潜在的平行行。那么,可计算出约束矩阵A中所有行的ratio,并将所有行的ratio按大小进行排序(与此同时,约束矩阵A中所有行也按ratio的大小进行排序),相同的ratio所对应的行即为潜在的平行行。那么,可对潜在的平行行做进一步的判断,从而确定这些潜在的平行行是否为真正的平行行(即这些潜在的平行行是否真的成倍数关系。在确定真正的平行行后,可删除元素较大的行,保留元素最小的行(当然,也可以删除元素较小的行,保留元素最大的行等等),从而将约束矩阵A的平行行合并,得到合并行后的约束矩阵A。如公式(4)所示的例子,在将矩阵A的所有行的ratio进行排序后,其中,ratio1=sum`[1]/sum[1],ratio2=sum`[2]/sum[2],…,ratioh=sum`[h]/sum[h]。设ratio1=ratio2,说明a1和a2可能成倍数关系,即a1可能等于qa2,也就是说a1和a2是潜在的平行行。那么,可进一步判断a1和a2是否真的为倍数关系,若二者成倍数关系,说明a1和a2是真正的平行行,并保留较小的行,若二者不成倍数关系,则不对其进行操作。Based on formula (2), a ratio can be set for each row of the constraint matrix A, where the ratio of the x-th row (i.e. ratioox) = sum`[x]/sum[x], x=1,...,h. If ratiox = ratioy, it means that a x and a y may be in a multiple relationship, that is, a x = qa y , which means that a x and a y are potential parallel lines. Then, the ratios of all rows in the constraint matrix A can be calculated, and the ratios of all rows are sorted by size (at the same time, all rows in the constraint matrix A are also sorted by the size of the ratio). The same ratio corresponds to Rows are potential parallel rows. Then, further judgment can be made on the potential parallel rows to determine whether these potential parallel rows are real parallel rows (that is, whether these potential parallel rows are really multiples). After determining the real parallel rows, you can delete For rows with larger elements, retain the rows with the smallest elements (of course, you can also delete rows with smaller elements, retain the rows with the largest elements, etc.), thereby merging the parallel rows of the constraint matrix A to obtain the constraint matrix A after the merged rows. .As shown in the example of formula (4), after sorting the ratios of all rows of matrix A, ratio1=sum`[1]/sum[1], ratio2=sum`[2]/sum[2 ],..., ratioh=sum`[h]/sum[h]. Assume ratio1=ratio2, indicating that a 1 and a 2 may be in a multiple relationship, that is, a 1 may be equal to qa 2 , that is to say, a 1 and a 2 are Potential parallel rows. Then, we can further determine whether a 1 and a 2 are really in a multiple relationship. If they are in a multiple relationship, it means that a 1 and a 2 are truly parallel rows, and the smaller row can be retained. If the two are in a multiple relationship, If the two are not in a multiple relationship, no operation will be performed on them.

(2)在合并行后的约束矩阵中,可通过相同的方式确定成倍数关系的列,并将这些列设置成相同的列,得到去冗余后的约束矩阵(也可以称为变换后的约束矩阵)。依旧如上述例子,设A1和A2分别为合并行后的约束矩阵A的第一列和第二列,同样地,可为合并行后的约束矩阵A的每一列设置一个ratio,以基于所有行的ratio来确定真正的平行列(获取真正的平行列的过程,可参考前述获取真正的平行行的过程,此处不再赘述),在确定真正的平行列后,可这些平行列都设置成其中的某一列,得到去冗余后的约束矩阵A。例如,设A1和A2是真正的平行列,有A1=qA2,让变量x中第一行的元素从x1变换为qx1,可使得合并行后的约束矩阵 A中第一列从A1变换为A2,如公式(3)所示:
min c1x1+c2x2+…=c1/q*(qx1)+c1x2+…
s.t.x1A1+x2A2+…=(qx1+x2)A2+…    (3)
(2) In the constraint matrix after merging rows, the columns with multiple relationships can be determined in the same way, and these columns are set to the same columns to obtain the constraint matrix after redundancy removal (which can also be called the transformed constraint matrix). Still as in the above example, let A 1 and A 2 be respectively the first and second columns of the constraint matrix A after merging rows. Similarly, a ratio can be set for each column of the constraint matrix A after merging rows, based on ratio of all rows to determine the real parallel columns (for the process of obtaining real parallel columns, please refer to the aforementioned process of obtaining real parallel rows, which will not be repeated here). After determining the real parallel columns, these parallel columns can be Set to one of the columns to obtain the constraint matrix A after redundancy removal. For example, assuming that A 1 and A 2 are truly parallel columns, A 1 = qA 2 , and transforming the elements of the first row in the variable x from x 1 to qx 1 can make the constraint matrix after merging the rows The first column in A is transformed from A 1 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 +…
stx 1 A 1 +x 2 A 2 +…=(qx 1 +x 2 )A 2 +… (3)

基于上式可知,当约束矩阵A和变量x均发生如公式(3)中的变换后,与变量中元素数量对应的矩阵c中第1行的元素从c1变换为c1/q。相应地,还需改变x1的取值范围:
Based on the above formula, it can be seen that when both the constraint matrix A and the variable x are transformed as in formula (3), the element in the first row of the matrix c corresponding to the number of elements in the variable is transformed from c 1 to c 1 /q. Correspondingly, the value range of x 1 needs to be changed:

上式中,clo1为x1的最大值,cup1为x1的最小值。In the above formula, clo 1 is the maximum value of x 1 , and cup 1 is the minimum value of x 1 .

404、基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程。404. Update the mixed integer programming equation based on the redundantly removed constraint matrix to obtain an updated mixed integer programming equation.

得到去冗余后的约束矩阵后,可将去冗余后的约束矩阵后对原始的混合整数规划方程进行更新,得到更新后的混合整数规划方程。基于前述的公式(4)可知,在原始的混合整数规划方程中,将原始的约束矩阵替换为去冗余后的约束矩阵将后,原始的变量也需相应替换为变换后的变量,原始的与变量中元素数量对应的矩阵也需相应替换为变换后的与变量中元素数量对应的矩阵,从而得到更新后的混合整数规划方程。After obtaining the constraint matrix after removing redundancy, the original mixed integer programming equation can be updated with the constraint matrix after removing redundancy to obtain the updated mixed integer programming equation. Based on the aforementioned formula (4), it can be seen that in the original mixed integer programming equation, after replacing the original constraint matrix with the constraint matrix after removing redundancy, the original variables also need to be replaced with the transformed variables accordingly. The original The matrix corresponding to the number of elements in the variable also needs to be replaced with the transformed matrix corresponding to the number of elements in the variable, so as to obtain the updated mixed integer programming equation.

应理解,步骤403和步骤404为可选的步骤。在实际应用中,在确定目标算子后,也可不对混合整数规划方程进行去冗余操作和更新操作(即不执行步骤403和步骤404),那么,步骤405的处理对象则为原始的混合整数规划方程。It should be understood that steps 403 and 404 are optional steps. In practical applications, after the target operator is determined, the mixed integer programming equation does not need to be deredundant and updated (that is, steps 403 and 404 are not performed). Then, the processing object in step 405 is the original mixed Integer programming equations.

405、基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。405. Preprocess the updated mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation.

得到更新后的混合整数规划方程后,可利用目标算子实现针对更新后的混合整数规划方程的预处理,得到预处理后的混合整数规划方程。After the updated mixed integer programming equation is obtained, the objective operator can be used to implement preprocessing for the updated mixed integer programming equation, and the preprocessed mixed integer programming equation is obtained.

具体地,可通过以下迭代策略对更新后的混合整数规划方程进行预处理:Specifically, the updated mixed integer programming equation can be preprocessed through the following iteration strategy:

由于已获取k个算子集合,本实施例中,对每个算子集合所执行的操作是相似的,故下文以第k个算子集合为例进行示意性介绍。设第k个算子集合包含n个目标算子(n为大于或等于1的整数),那么,这n个目标算子的迭代次数为k次,那么,可对更新后的混合整数规划方程执行如图5所示的步骤(图5为本申请实施例提供的预处理的一个流程示意图):Since k operator sets have been obtained, in this embodiment, the operations performed on each operator set are similar. Therefore, the kth operator set is used as an example for a schematic introduction below. Assume that the kth operator set contains n target operators (n is an integer greater than or equal to 1). Then, the number of iterations of these n target operators is k times. Then, the updated mixed integer programming equation can be Execute the steps shown in Figure 5 (Figure 5 is a schematic flowchart of preprocessing provided by the embodiment of this application):

(1)在n个目标算子的第j次迭代中,在对更新后的混合整数规划方程执行第i个算子之前,可先检测第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和是否小于第一阈值(第一阈值通常基于迭代次数k确定,一般随着迭代次数k的 增大而增大,即二者呈正相关关系)。其中,i=1,…,n,j=1,…,k。(1) In the j-th iteration of n target operators, before executing the i-th operator on the updated mixed integer programming equation, the index of the i-th target operator in the first iteration can be detected first. Whether the sum of indicators of the i-th target operator in the j-1th iteration is less than the first threshold (the first threshold is usually determined based on the number of iterations k, generally with the number of iterations k increases, that is, there is a positive correlation between the two). Among them, i=1,...,n, j=1,...,k.

(2)若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和小于第一阈值,说明此后还需继续执行第i个目标算子,则进一步检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值(第二阈值通常基于迭代次数k确定,一般随着迭代次数k的增大而增大,即二者呈正相关关系)。(2) If the sum of the index of the i-th target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is less than the first threshold, it means that the i-th target operator needs to continue to be executed thereafter. target operator, then further detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold (the second threshold is usually determined based on the number of iterations k, and generally increases as the number of iterations k increases. increases, that is, there is a positive correlation between the two).

(3)若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,说明此后不再需要继续执行第i个目标算子,则在第j次迭代至第k次迭代中,跳过第i个目标算子。(3) If the sum of the index of the i-th target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is greater than or equal to the first threshold, it means that there is no need to continue thereafter. If the i-th target operator is executed, the i-th target operator will be skipped in the j-th iteration to the k-th iteration.

(4)若第i个目标算子在第j-1次迭代中的指标小于第二阈值,说明当前可执行第i个算子,则对更新后的混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标。值得注意的是,第i个目标算子在第j次迭代中的指标可通过以下方式生成:首先,确定第i个目标算子在第1次迭代至第j次迭代中,所删除的行在更新后的混合整数规划方程中的占比。然后,基于该占比进行计算,从而得到第i个目标算子在第j次迭代中的指标。(4) If the index of the i-th target operator in the j-1th iteration is less than the second threshold, it means that the i-th operator can currently be executed, and the i-th target operator is executed on the updated mixed integer programming equation. operator, and generate the index of the i-th target operator in the j-th iteration. It is worth noting that the index of the i-th target operator in the j-th iteration can be generated in the following way: first, determine the rows deleted by the i-th target operator in the 1st iteration to the j-th iteration. in the updated mixed integer programming equation. Then, calculation is performed based on this proportion to obtain the index of the i-th target operator in the j-th iteration.

(5)若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,说明当前不可执行第i个算子,则跳转至第i+1个目标算子,并对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代。(5) If the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, it means that the i-th operator cannot be executed currently, and then jump to the i+1-th target operator. And perform the above steps for the i+1th target operator until the jth iteration of the n target operators is completed.

(6)继续执行n个目标算子的第j+1次迭代(即重复执行步骤(1)至步骤(5)),直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。(6) Continue to execute the j+1th iteration of n target operators (that is, repeat steps (1) to step (5)) until the kth iteration of n target operators is completed, and obtain the preprocessed Mixed integer programming equations.

应理解,在第k个算子集合,n个目标算子已按一定的顺序进行排序(该顺序即这n个目标算子在针对预置方程的预处理中的执行顺序),故在针对更新后的混合整数规划方程中,每次迭代中均可按照该顺序来执行这n个算子。It should be understood that in the kth operator set, the n target operators have been sorted in a certain order (the order is the execution order of the n target operators in the preprocessing of the preset equation), so in the In the updated mixed integer programming equation, these n operators can be executed in this order in each iteration.

应理解,对于除第k个算子集合之外的其余算子集合,也可执行如同对第k个算子集合所执行的操作,此处不再赘述,从而得到预处理后的混合整数规划方程。It should be understood that for other operator sets except the kth operator set, the same operations as those performed for the kth operator set can also be performed, which will not be described in detail here, thereby obtaining the preprocessed mixed integer programming. equation.

406、对预处理后的混合整数规划方程进行求解,得到的解作为任务的处理结果。406. Solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.

得到预处理后的混合整数规划方程,可对预处理后的混合整数规划方程进行求解,得到相应的解,该解可作为前述任务的处理结果。After obtaining the preprocessed mixed integer programming equation, the preprocessed mixed integer programming equation can be solved to obtain the corresponding solution, which can be used as the processing result of the aforementioned task.

为了进一步理解上述过程,下文结合多个应用例对本申请实施例提供的计算机任务处理方法作进一步的介绍。在第一个应用例中,设待处理的任务为供应链领域中,某个工厂的排产计划,图6展示了该排产计划在整个供应链关节中的作用(图6为本申请实施例提供的计算机任务处理方法的一个应用例示意图),即如图6中的production plan模块所示。从数学模型的角度来讲,该问题是一个典型的大规模、多目标、约束稀疏、多变量的分配问题。该问题的输入是客户的订单需求与现有的加工资源(原材料、产能等),输出是根据订单需求安排的加工生产计划(加工量、运输量、交付量等),期望的输出结果是能最小化加工成本、加工时间以及最大化订单满足率(即按时按量交付客户的需求)等,并且需要满足所有的加工约束。In order to further understand the above process, the computer task processing method provided by the embodiment of the present application is further introduced below in conjunction with multiple application examples. In the first application example, assuming that the task to be processed is the production scheduling plan of a certain factory in the supply chain field, Figure 6 shows the role of this production planning in the entire supply chain (Figure 6 shows the implementation of this application An application example diagram of the computer task processing method provided in the example), as shown in the production plan module in Figure 6. From the perspective of mathematical models, this problem is a typical large-scale, multi-objective, sparsely constrained, and multi-variable allocation problem. The input of this problem is the customer's order demand and existing processing resources (raw materials, production capacity, etc.). The output is the processing production plan (processing volume, transportation volume, delivery volume, etc.) arranged according to the order demand. The expected output result is the ability to Minimize processing cost, processing time and maximize order fulfillment rate (that is, deliver customer needs on time and quantity), etc., and all processing constraints need to be met.

在获取排产计划的问题中,排产计划需要满足不同的约束,包括物料约束、运输约束、库存约束、生产能力上限约束等。例如:客户需求是在三天内制造2000台PC,1000台主机, 800台笔记本。图7为本申请实施例提供的生产过程中的物料组装关系(bill of material,BOM)的一个示意图,如图7所示,以PC的生成过程为例,说明BOM是如何影响生产过程的:假设每个PC需要配置一台主机,而每个笔记本则可单独配置。现有两家工厂A和B,工厂A能加工PC、主机而工厂B能加工主机、笔记本,并且二者的每天加工能力是有限的,即A工厂每天只能加工最多1000台PC或主机,B工厂每天只能加工最多1000台主机或笔记本。那么,一个合法的、较优的生产计划是:第一天,工厂A安排生产1000台主机,工厂B安排生产1000台主机,工厂B生产完后将这1000台主机送往工厂A;第二天,工厂A利用已经生产的1000台主机来完成1000台PC的组装生产,工厂B则继续安排生产1000台主机;第三天,工厂A利用工厂B在第一天送来的1000台主机完成1000台PC的装配,工厂B安排生产800台笔记本。按照上述安排,两个工厂将在第三天完成客户的所有订单需求,并且符合材料、生产力、时间以及交通等各种约束。上述例子还没有考虑到多种相互冲突的目标(成本、订单交付满足率等),在真实的工业场景远远比示例问题复杂。In the problem of obtaining the production schedule, the production schedule needs to satisfy different constraints, including material constraints, transportation constraints, inventory constraints, production capacity upper limit constraints, etc. For example: customer demand is to manufacture 2,000 PCs and 1,000 hosts within three days. 800 laptops. Figure 7 is a schematic diagram of the bill of material (BOM) in the production process provided by the embodiment of the present application. As shown in Figure 7, the PC generation process is taken as an example to illustrate how the BOM affects the production process: It is assumed that each PC needs to be configured with a host, and each laptop can be configured individually. There are two factories A and B. Factory A can process PCs and mainframes, while factory B can process mainframes and laptops. The daily processing capacity of both is limited, that is, factory A can only process up to 1,000 PCs or mainframes per day. Factory B can only process up to 1,000 hosts or laptops per day. Then, a legal and better production plan is: on the first day, factory A arranges to produce 1,000 hosts, and factory B arranges to produce 1,000 hosts. After factory B completes production, the 1,000 hosts are sent to factory A; on the second day, factory A arranges to produce 1,000 hosts. On the third day, Factory A uses the 1,000 hosts it has already produced to complete the assembly and production of 1,000 PCs, while Factory B continues to arrange the production of 1,000 hosts; on the third day, Factory A uses the 1,000 hosts sent by Factory B on the first day to complete the assembly and production. For the assembly of 1,000 PCs, Factory B arranges to produce 800 laptops. According to the above arrangement, the two factories will complete all customer order requirements on the third day and comply with various constraints such as materials, productivity, time, and transportation. The above example does not take into account multiple conflicting objectives (cost, order delivery fulfillment rate, etc.), and real industrial scenarios are far more complex than the example problem.

那么,可通过以下步骤来获取工厂的待求解的生产计划:Then, the factory’s production plan to be solved can be obtained through the following steps:

步骤1:构建方程。依照业务要求,设定混合整数规划方程,该方程可包含变量以及约束矩阵之间的数学关系,该变量为工厂的待求解的生产计划,该约束矩阵为待求解的生产计划所需满足的加工约束,加工约束可包含以下至少一项:材料约束、生产力约束、时间约束或交通约束等等,其中,材料约束可包括生产时所能使用的材料上限和材料配比等等,生产力约束可包括生产时所需生产工人的人数上限和工作效率上限等等,时间约束可包括产品的交付日期等等,交通约束可包括生产时所需交通成本的上限和生产时所需交通工具的数量上限等等。可见,对该方程进行求解,相当于获取该工厂的生产计划。Step 1: Construct the equation. According to business requirements, set up a mixed integer programming equation. This equation can include mathematical relationships between variables and constraint matrices. The variables are the factory's production plan to be solved, and the constraint matrix is the processing required for the production plan to be solved. Constraints, processing constraints can include at least one of the following: material constraints, productivity constraints, time constraints or traffic constraints, etc., where material constraints can include the upper limit of materials that can be used in production, material ratios, etc. Productivity constraints can include The upper limit of the number of production workers required during production, the upper limit of work efficiency, etc. The time constraints can include the delivery date of the product, etc. The transportation constraints can include the upper limit of the transportation cost required during production and the upper limit of the number of transportation vehicles required during production. wait. It can be seen that solving this equation is equivalent to obtaining the production plan of the factory.

步骤2:将构建好的混合整数规划方程读入求解器,调用求解器指定接口,执行混合整数规划方程的预处理。该预处理过程可分成以下几个步骤完成:Step 2: Read the constructed mixed integer programming equation into the solver, call the specified interface of the solver, and perform preprocessing of the mixed integer programming equation. This preprocessing process can be divided into the following steps:

(1)问题结构识别:对混合整数规划方程进行结构识别,从而获取与混合整数规划方程的结构相关的信息。(1) Problem structure identification: Perform structure identification on the mixed integer programming equation to obtain information related to the structure of the mixed integer programming equation.

(2)删除冗余:对混合整数规划方程的约束矩阵,确定平行行和平行列,从而对平行行和平行列实现相应的去冗余处理。在去冗余处理的过程中,可按照BOM的上下层依赖关系,遍历混合整数规划方程,可将带来更好的化简效果。主要原因是上层变量的求解将严格依赖下层变量,在空间上,先处理下层变量会更方便上层变量的化简。(2) Delete redundancy: For the constraint matrix of the mixed integer programming equation, determine the parallel rows and rows, so as to achieve corresponding redundancy processing for parallel rows and rows. In the process of removing redundancy, the mixed integer programming equation can be traversed according to the upper and lower dependencies of the BOM, which will bring better simplification effects. The main reason is that the solution of the upper-level variables will strictly depend on the lower-level variables. In terms of space, it will be more convenient to simplify the upper-level variables by processing the lower-level variables first.

(3)算子选择:根据结构识别所得到的结构信息匹配目标算子,打开每个目标算子的执行参数(例如,迭代次数、迭代顺序、自适应指标等等),按照一定的策略对混合整数规划方程执行这些目标算子,以实现方程的预处理。该策略所需实现的目标为:若该指标表明,该算子执行一定次数后已经不能化简变量和约束矩阵,则执行早停。(3) Operator selection: Match the target operator according to the structural information obtained from the structure recognition, open the execution parameters of each target operator (for example, the number of iterations, iteration order, adaptive indicators, etc.), and select the target operator according to a certain strategy. Mixed integer programming equations implement these objective operators to achieve preprocessing of the equations. The goal to be achieved by this strategy is: if the indicator shows that the operator cannot simplify the variables and constraint matrices after a certain number of executions, the execution will stop early.

(4)持续化简:可重新执行以上过程,即步骤(1)至步骤(3),即执行多次预处理,直至方程满足预置的收敛性判断条件,得到预处理后的混合整数规划方程。(4) Continuous simplification: The above process can be re-executed, that is, steps (1) to (3), that is, preprocessing is performed multiple times until the equation meets the preset convergence judgment conditions, and the preprocessed mixed integer programming is obtained. equation.

需要说明的是,步骤2中的子步骤(2)为可选的步骤,在实际应用中,可执行也可不执行,可根据实际需求进行选择,此处不做限制。It should be noted that sub-step (2) in step 2 is an optional step. In actual applications, it may or may not be executed. The selection can be made according to actual needs and is not limited here.

步骤3:方法选择。在算法库中对不同方法做选择,包括原始单纯形法、对偶单纯形法、内点法等。 Step 3: Method selection. Choose from different methods in the algorithm library, including primitive simplex method, dual simplex method, interior point method, etc.

步骤4:基于步骤3所选择的方法,对预处理后的混合整数规划方程完成求解。Step 4: Based on the method selected in step 3, complete the solution of the preprocessed mixed integer programming equation.

此外,在供应链领域的多工厂排产问题中,还可将本申请实施例提供的求解器以及相关技术的求解器进行比较,比较结果如图8所示(图8为本申请实施例提供的比较结果的一个示意图),将应用相关技术的计算结果和应用本申请实施例的计算结果可知,相比于相关技术一而言,本发明可以端到端降低求解时间18%以上,相比相关技术二和相关技术三而言,本发明可降低求解时间60%以上。In addition, in the multi-factory scheduling problem in the supply chain field, the solver provided by the embodiment of the present application and the solver of the related technology can also be compared. The comparison result is shown in Figure 8 (Figure 8 is provided by the embodiment of the present application A schematic diagram of the comparison results). By comparing the calculation results using the related technology and the calculation results using the embodiments of the present application, it can be seen that compared with the related technology 1, the present invention can reduce the solution time by more than 18% end-to-end. Regarding related technology 2 and related technology 3, the present invention can reduce the solving time by more than 60%.

第二个应用例中,设待处理的任务为对某个公开数据集的求解,可使用相关技术提供的求解器和本申请实施例提供的求解器,分别对描述该任务的混合整数规划方程进行求解,并进行比较,比较结果如表2所示:In the second application example, assuming that the task to be processed is the solution of a certain public data set, the solver provided by the relevant technology and the solver provided by the embodiment of the present application can be used to respectively solve the mixed integer programming equation describing the task. Solve and compare. The comparison results are shown in Table 2:

表2
Table 2

基于表2可知,相较于相关技术一,本申请实施例的求解时间可从1394s降低到100s以内,超越了相关技术二和相关技术三的求解时间,可见,本申请实施例的求解器中的预处理模块,具备卓越的性能。Based on Table 2, it can be seen that compared with related technology 1, the solving time of the embodiment of the present application can be reduced from 1394s to less than 100s, surpassing the solving time of related technology 2 and related technology 3. It can be seen that in the solver of the embodiment of the present application Preprocessing module with excellent performance.

第三个应用例中,设待处理的任务为物流领域中的车辆路径优化问题。车辆路线问题最早是在1959年首次提出,该问题是指定一定数量的客户,各自有不同数量的货物需求,配送中心向客户提供货物,由一个车队负责分送货物,组织适当的行车路线,目标是使得客户的需求得到满足,并能在一定的约束下,达到诸如路程最短、成本最小、耗费时间最少等目的。In the third application example, the task to be processed is the vehicle route optimization problem in the logistics field. The vehicle routing problem was first proposed in 1959. The problem is to designate a certain number of customers, each with different quantities of goods requirements. The distribution center provides goods to the customers, and a fleet is responsible for distributing the goods and organizing appropriate driving routes. The goal is to satisfy customer needs and achieve goals such as the shortest distance, the lowest cost, and the least time consuming under certain constraints.

该问题需要在有限个可行解集合中找出最优解,这类问题需要在离散的、有限的数学结构上,求满足给定约束条件的目标函数最优值(最大值或最小值)的问题,也称离散优化问题,该类问题都与顺序有关。This problem requires finding the optimal solution among a limited set of feasible solutions. This type of problem requires finding the optimal value (maximum or minimum value) of the objective function that satisfies the given constraints on a discrete and finite mathematical structure. Problems, also called discrete optimization problems, are all related to order.

与多工厂的排产问题不同的是,该问题需要更多地考虑不同种类的车辆的装载容量,故在构建数学模型时(即用于描述该问题的混合整数规划方程),需要在变量之间有时间先后顺序的考量。需要说明的是,描述该问题的混合整数规划方程中,变量为待求解的车辆采用计划,该变量中不同的元素表示不同种类的车辆(由于车辆路径往往难以用数值表示,故这里某一种的车辆指按某种路径进行行驶的车辆)的数量,约束矩阵则包含该待求解的车辆采用计划所需满足的容量约束、产品约束、时间约束以及路况约束中的一种或多种,其中,容量约束包含车辆运输时的容量上限等等,产品约束包含车辆运输时所能转载的产品类别等等,时间约束包含不同种类的车辆到达目的地的时间先后顺序等等,路况约束包含不同种类的车辆所能行驶的路况等等。Different from the multi-factory production scheduling problem, this problem requires more consideration of the loading capacity of different types of vehicles. Therefore, when building a mathematical model (that is, a mixed integer programming equation used to describe the problem), it is necessary to consider the loading capacity of different types of vehicles. There is a time sequence consideration. It should be noted that in the mixed integer programming equation describing this problem, the variable is the vehicle adoption plan to be solved, and different elements in this variable represent different types of vehicles (since vehicle paths are often difficult to express numerically, so here a certain refers to the number of vehicles traveling along a certain route), and the constraint matrix contains one or more of the capacity constraints, product constraints, time constraints and road condition constraints that the vehicle adoption plan to be solved needs to satisfy, where , the capacity constraint includes the upper capacity limit of the vehicle during transportation, etc., the product constraint includes the product categories that the vehicle can transport during transportation, etc., the time constraint includes the time sequence of different types of vehicles arriving at the destination, etc., and the road condition constraint includes different types of vehicles. The road conditions that the vehicle can travel on, etc.

因此,在该类问题中,往往在变量的时间维度有明显的数学结构,故可以依托本申请实施例提供的预处理方法来化简方程,从而加速方程的求解。Therefore, in this type of problem, there is often an obvious mathematical structure in the time dimension of the variable. Therefore, the preprocessing method provided by the embodiment of the present application can be relied on to simplify the equation, thereby accelerating the solution of the equation.

第四个应用例中,设待处理的任务为云技术领域中的中心选址问题。在实际应用中,企 业制定选址决策时需考虑对手的竞争。一般来讲,用户需要考虑一个离散的网络,两个服务提供者(领导者和跟随者)相继地开放一定数量的设施,以竞争市场份额。每个用户向最近的设施寻求服务。In the fourth application example, the task to be processed is the center location problem in the field of cloud technology. In practical applications, enterprises Companies need to consider rival competition when making location decisions. Generally speaking, users need to consider a discrete network where two service providers (leader and follower) open a certain number of facilities one after another to compete for market share. Each user seeks services from the nearest facility.

与前面的例子不同,本应用例需要求解一个双层的线性规划方程,其中上层问题表示领导者的决策,其目标是最大覆盖,而下层问题是跟随者相应的NP难问题。假设跟随者采用贪婪策略,可将跟随者的响应集成到领导者问题的约束条件中。Different from the previous example, this application case requires solving a two-level linear programming equation, where the upper-level problem represents the leader's decision-making, and its goal is maximum coverage, while the lower-level problem is the corresponding NP-hard problem for the follower. Assuming that the follower adopts a greedy strategy, the follower's response can be integrated into the constraints of the leader's problem.

考虑到两层的区别,在使用本申请实施例提供的预处理方法时,执行流程需要从底层执行到上层,并且实现前述的迭代策略(实现某些算子的早停等等),从而更进一步的降低预处理的耗时。Considering the difference between the two layers, when using the preprocessing method provided by the embodiment of this application, the execution process needs to be executed from the bottom layer to the upper layer, and the aforementioned iteration strategy (implementing early stopping of certain operators, etc.) needs to be implemented, so as to more Further reduce the time-consuming preprocessing.

需要说明的是,基于中心选址问题所构建的混合整数规划方程,其变量为待求解的地址选取计划,该变量中不同的元素表示不同对象(例如,企业、工厂等等)的地址(例如,经纬度等等),约束矩阵则包含该待求解的地址选取计划所需满足的分布约束、交通环境约束以及规则约束中的一种或多种,其中,分布约束包含不同对象的当前分布情况、不同对象的未来分布预测、对象的业务量增长率以及对象之间互动的区域分布等等,交通环境约束包含对象之间互动时的运输条件、配送条件以及用地条件等等,规则约束包含对象之间互动所需遵守的法规等等。It should be noted that the variable of the mixed integer programming equation constructed based on the central location problem is the address selection plan to be solved. Different elements in the variable represent the addresses of different objects (for example, enterprises, factories, etc.) (for example, , longitude, latitude, etc.), the constraint matrix contains one or more of the distribution constraints, traffic environment constraints and rule constraints that the address selection plan to be solved needs to satisfy, where the distribution constraints include the current distribution of different objects, Future distribution predictions of different objects, business volume growth rates of objects, regional distribution of interactions between objects, etc. Traffic environment constraints include transportation conditions, distribution conditions, land use conditions, etc. when objects interact with each other. Rule constraints include the relationship between objects. regulations that need to be followed for interactions, etc.

第五个应用例中,设待处理的任务为电力领域中的电网调度问题。电网调度问题主要包括两个阶段:In the fifth application example, it is assumed that the task to be processed is a power grid dispatching problem in the electric power field. The power grid dispatching problem mainly includes two stages:

在第一阶段中,通过线性化处理和混合整数编码技术将非凸电力系统的经济调度问题转化为混合整数规划方程,然后运用优化软件包求解混合整数规划方程,得到一个满意的可行解;In the first stage, the economic dispatch problem of the non-convex power system is converted into a mixed integer programming equation through linearization processing and mixed integer coding technology, and then an optimization software package is used to solve the mixed integer programming equation to obtain a satisfactory feasible solution;

在第二阶段中,根据第一阶段求得的可行解,对机组的出力区间进行压缩处理,重新求解混合整数规划方程,得到最终的电力系统经济调度方案。因此,电网调度是多阶段数学模型。In the second stage, based on the feasible solution obtained in the first stage, the output range of the unit is compressed, and the mixed integer programming equation is resolved to obtain the final economic dispatch plan of the power system. Therefore, power grid dispatching is a multi-stage mathematical model.

在本应用例中,多阶段模型需要更多的考虑不同时间周期的边界约束,因此在使用本申请实施例提供的预处理方法的过程中,需要考虑到对时间周期的切分。In this application example, the multi-stage model needs to consider more boundary constraints of different time periods. Therefore, in the process of using the preprocessing method provided by the embodiment of this application, it is necessary to consider the segmentation of time periods.

需要说明的是,基于电网调度问题所构建的混合整数规划方程,其变量为待求解的用电量调度计划,该变量中不同的元素表示不同地区的用电量,约束矩阵则包含该待求解的用电量调度计划所需满足的数量约束以及价格约束中的一种或多种,其中,数量约束包含各个地区的用电量上限等等,价格约束包含各个地区用电时的总价格上限等等。It should be noted that the variable of the mixed integer programming equation constructed based on the power grid dispatch problem is the power consumption dispatch plan to be solved. Different elements in this variable represent the power consumption in different regions, and the constraint matrix contains the power consumption to be solved. One or more of the quantity constraints and price constraints that the electricity consumption dispatch plan needs to satisfy. Among them, the quantity constraints include the upper limit of electricity consumption in each region, etc., and the price constraints include the upper limit of the total price of electricity in each region. etc.

本申请实施例中,在获取用于描述待处理的任务的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到的解可作为任务的处理结果。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于描述特定类的任务),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混 合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。In the embodiment of the present application, after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation. This information is related to the following At least one item is relevant: the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific class of tasks), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the mixed integer programming equation. The preprocessing of integrated integer programming equations can effectively reduce the time consumed in the equation preprocessing process and improve the performance of the equation solving process.

更进一步地,本申请实施例提供了方程资源池,在确定该混合整数规划方程属于哪一类预置混合整数规划方程后,即方程资源池中的某一个预置方程(也可以称为方程资源池中的某一个方程模板),可将针对该预置方程的预处理所使用的算子,算子迭代次数以及算子执行顺序作为针对该混合整数规划方程的预处理所使用的算子,算子迭代次数以及算子执行顺序,以减少人为干预对预处理的影响,从而优化方程的预处理效果。Furthermore, the embodiment of the present application provides an equation resource pool. After determining which type of preset mixed integer programming equation the mixed integer programming equation belongs to, that is, a certain preset equation in the equation resource pool (which can also be called an equation An equation template in the resource pool), the operator used for preprocessing of the preset equation, the number of operator iterations and the order of operator execution can be used as the operator used for preprocessing of the mixed integer programming equation , the number of operator iterations and the order of operator execution to reduce the impact of human intervention on preprocessing, thereby optimizing the preprocessing effect of the equation.

更进一步地,本申请实施例还提供了迭代策略,即在迭代过程中,当一个算子所发挥的作用变小时,可认为该算子在之后的迭代中继续执行的收益有限,并及时停止执行该算子。并且,对于预处理的循环,也设计相应的停止机制。如此一来,不仅可有效地简化混合整数规划方程,还能减少不必要的预处理流程,从而降低预处理的时间开销。Furthermore, the embodiments of this application also provide an iterative strategy, that is, during the iterative process, when the role of an operator becomes smaller, it can be considered that the benefit of continuing to execute the operator in subsequent iterations is limited, and it will be stopped in time. Execute this operator. Moreover, a corresponding stopping mechanism is also designed for the preprocessing cycle. In this way, not only the mixed integer programming equation can be effectively simplified, but also unnecessary preprocessing processes can be reduced, thereby reducing the time overhead of preprocessing.

以上是对本申请实施例提供的计算机任务处理方法所进行的详细说明,以下将对本申请实施例提供的计算机任务处理装置进行介绍。图9为本申请实施例提供的计算机任务处理装置的一个结构示意图,该装置包括:The above is a detailed description of the computer task processing method provided by the embodiment of the present application. The computer task processing device provided by the embodiment of the present application will be introduced below. Figure 9 is a schematic structural diagram of a computer task processing device provided by an embodiment of the present application. The device includes:

获取模块901,用于获取混合整数规划方程,混合整数规划方程用于描述待处理的任务;The acquisition module 901 is used to obtain the mixed integer programming equation, which is used to describe the task to be processed;

确定模块902,用于基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;The determination module 902 is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, where the target operator is a part of the operators in the operator resource pool;

预处理模块903,用于基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;The preprocessing module 903 is used to preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation;

求解模块904,用于对预处理后的混合整数规划方程进行求解,得到的解作为任务的处理结果。The solving module 904 is used to solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task.

本申请实施例中,在获取用于描述待处理的任务的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到的解可作为任务的处理结果。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于描述特定类的任务),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并提高方程求解流程的性能。In the embodiment of the present application, after obtaining the mixed integer programming equation used to describe the task to be processed, the target operator can be determined in the operator resource pool based on information related to the structure of the mixed integer programming equation. This information is related to the following At least one item is relevant: the variables of the mixed integer programming equation and the constraint matrix of the mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved, and the obtained solution can be used as the processing result of the task. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to describe a specific type of task), so as to select a specific target operator for the mixed integer programming equation, thereby realizing the preprocessing of the mixed integer programming equation, which can effectively reduce the cost of the equation preprocessing process time consumed and improves the performance of the equation solving process.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项:变量的维度、约束矩阵的稀疏度、约束矩阵的分块信息、约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, and the existence of a calculation relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.

在一种可能的实现方式中,确定模块902,用于:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所使用的算子确定为目标算子。In a possible implementation, the determination module 902 is configured to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine for The operator used in the preprocessing of the preset equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个, 且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,预处理模块903,用于:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, And the number of iterations of n target operators is k times, and n and k are both integers greater than or equal to 1. The preprocessing module 903 is used to: in the j-th iteration of n target operators, if the i-th If the sum of the index of the target operator in the 1st iteration to the index of the i-th target operator in the j-1th iteration is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, Skip the i-th target operator, i=1,...,n,j=1,...,k; or, if the index of the i-th target operator in the first iteration to the i-th target operator is If the sum of indicators in the j-1th iteration is less than the first threshold, then detect whether the indicator of the i-th target operator in the j-1th iteration is less than the second threshold; or, if the i-th target operator is in If the index in the j-1th iteration is less than the second threshold, execute the i-th target operator on the mixed integer programming equation and generate the index of the i-th target operator in the j-th iteration; or, if the i-th target operator is If the index of the target operator in the j-1th iteration is greater than or equal to the second threshold, then perform the above steps for the i+1th target operator until the jth iteration of n target operators is completed; execute n The j+1th iteration of n target operators is completed until the kth iteration of n target operators is completed, and the preprocessed mixed integer programming equation is obtained.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators.

在一种可能的实现方式中,该装置还包括:去冗余模块,用于将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;更新模块,用于基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;预处理模块903,用于基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In a possible implementation, the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy is removed; the update module is used to update the mixed integer programming equation based on the redundant constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module 903 is used to update the mixed integer programming equation based on the target operator pair The updated mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.

图10为本申请实施路提供的生产计划获取装置的一个结构示意图,如图10所示,该装置包括:Figure 10 is a schematic structural diagram of a production plan acquisition device provided by the implementation method of this application. As shown in Figure 10, the device includes:

获取模块1001,用于获取混合整数规划方程,混合整数规划方程用于描述供应链领域中待求解的生产计划;The acquisition module 1001 is used to obtain the mixed integer programming equation, which is used to describe the production plan to be solved in the supply chain field;

确定模块1002,用于基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,目标算子为算子资源池中的部分算子;The determination module 1002 is used to determine the target operator in the operator resource pool based on the information related to the structure of the mixed integer programming equation, where the target operator is a part of the operators in the operator resource pool;

预处理模块1003,用于基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;The preprocessing module 1003 is used to preprocess the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation;

求解模块1004,用于对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。The solving module 1004 is used to solve the preprocessed mixed integer programming equation to obtain the solved production plan.

本申请实施例中,在获取用于描述待求解的生产计划的混合整数规划方程后,可基于与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,该信息与以下至少一项相关:混合整数规划方程的变量和混合整数规划方程的约束矩阵。然后,可基于目标算子对混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。最后,可对预处理后的混合整数规划方程进行求解,得到已求解的生产计划。前述过程中,可对混合整数规划方程的变量和约束矩阵进行识别,从而与混合整数规划方程的结构相关的信息,基于该信息,可确定混合整数规划方程的结构,即该混合整数规划方程属于哪一类混合整数规划方程(用于求解供应链领域中工厂和企业的生产计划),从而为该混合整数规划方程挑选特定的目标算子,从而实现该混合整数规划方程的预处理,可有效降低方程预处理过程所消耗的时间,并 提高方程求解流程的性能。In the embodiment of the present application, after obtaining the mixed integer programming equation used to describe the production plan to be solved, the target operator can be determined in the operator resource pool based on the information related to the structure of the mixed integer programming equation. This information is related to At least one of the following is relevant: the variables of a mixed integer programming equation and the constraint matrix of a mixed integer programming equation. Then, the mixed integer programming equation can be preprocessed based on the target operator to obtain the preprocessed mixed integer programming equation. Finally, the preprocessed mixed integer programming equation can be solved to obtain the solved production plan. In the foregoing process, the variables and constraint matrices of the mixed integer programming equation can be identified, thereby providing information related to the structure of the mixed integer programming equation. Based on this information, the structure of the mixed integer programming equation can be determined, that is, the mixed integer programming equation belongs to Which type of mixed integer programming equation (used to solve the production plan of factories and enterprises in the field of supply chain), so as to select a specific target operator for this mixed integer programming equation, so as to achieve the preprocessing of this mixed integer programming equation, can be effective Reduce the time consumed by equation preprocessing and Improve the performance of the equation solving process.

在一种可能的实现方式中,混合整数规划方程的变量为待求解的生产计划,混合整数规划方程的约束矩阵包含以下至少一项:待求解的生产计划需满足的材料约束、生产力约束、时间约束或交通约束。In a possible implementation, 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 includes at least one of the following: material constraints, productivity constraints, and time that the production plan to be solved needs to satisfy. restraints or traffic constraints.

在一种可能的实现方式中,与混合整数规划方程的结构相关的信息包括以下至少一项:变量的维度、约束矩阵的稀疏度、约束矩阵的分块信息或约束矩阵中与变量存在计算关系的行,其中,分块信息用于指示约束矩阵所包含的元素为零的子矩阵。In a possible implementation, the information related to the structure of the mixed integer programming equation includes at least one of the following: the dimensions of the variables, the sparsity of the constraint matrix, the block information of the constraint matrix, or the existence of a computational relationship with the variables in the constraint matrix. rows, where the blocking information is used to indicate that the constraint matrix contains submatrices with zero elements.

在一种可能的实现方式中,确定模块1002,用于:在方程资源池中,确定与与混合整数规划方程的结构相关的信息相匹配的预置方程;在算子资源池中,将针对预置方程的预处理所对应的算子确定为目标算子。In a possible implementation, the determination module 1002 is configured to: in the equation resource pool, determine the preset equation that matches the information related to the structure of the mixed integer programming equation; in the operator resource pool, determine the preset equation for The operator corresponding to the preprocessing of the preset equation is determined as the target operator.

在一种可能的实现方式中,针对混合整数规划方程的预处理中,目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,预处理模块1003,用于:在n个目标算子的第j次迭代中,若第i个目标算子在第1次迭代中的指标至第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过第i个目标算子,i=1,…,n,j=1,…,k;或若和小于第一阈值,则检测第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,若第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对混合整数规划方程执行第i个目标算子,并生成第i个目标算子在第j次迭代中的指标;或,若第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成n个目标算子的第j次迭代;执行n个目标算子的第j+1次迭代,直至完成n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。In a possible implementation, in the preprocessing of mixed integer programming equations, the number of target operators is n, and the number of iterations of the n target operators is k times, and both n and k are greater than or equal to 1. Integer of If the sum of indicators in one iteration is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped, i=1,...,n,j=1,... , k; or if the sum is less than the first threshold, then detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold; or, if the i-th target operator is in the j-1th iteration If the index in the iteration is less than the second threshold, execute the i-th target operator on the mixed integer programming equation and generate the index of the i-th target operator in the j-th iteration; or, if the i-th target operator is in If the index in the j-1th iteration is greater than or equal to the second threshold, then the above steps are performed for the i+1th target operator until the jth iteration of n target operators is completed; The j+1th iteration is performed until the kth iteration of the n target operators is completed, and the preprocessed mixed integer programming equation is obtained.

在一种可能的实现方式中,在针对预置方程的预处理和针对混合整数规划方程的预处理中,n个目标算子的迭代次数相同。In a possible implementation, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same.

在一种可能的实现方式中,第i个目标算子在第j次迭代中的指标,基于第i个目标算子所删除的行在混合整数规划方程中的占比确定。In a possible implementation, the index of the i-th target operator in the j-th iteration is determined based on the proportion of rows deleted by the i-th target operator in the mixed integer programming equation.

在一种可能的实现方式中,第一阈值和第二阈值基于n个目标算子的迭代次数确定。在一种可能的实现方式中,该装置还包括:去冗余模块,用于将约束矩阵中成倍数关系的行合并,或,将约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;更新模块,用于基于去冗余后的约束矩阵对混合整数规划方程进行更新,得到更新后的混合整数规划方程;预处理模块1003,用于基于目标算子对更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。In a possible implementation, the first threshold and the second threshold are determined based on the number of iterations of n target operators. In a possible implementation, the device further includes: a redundancy removal module, used to merge the rows with a multiple relationship in the constraint matrix, or set the columns with a multiple relationship in the constraint matrix to the same column, to obtain The constraint matrix after the redundancy has been removed; the update module is used to update the mixed integer programming equation based on the redundancy removal constraint matrix to obtain the updated mixed integer programming equation; the preprocessing module 1003 is used to update the mixed integer programming equation based on the target operator pair The updated mixed integer programming equation is preprocessed to obtain the preprocessed mixed integer programming equation.

需要说明的是,上述装置各模块/单元之间的信息交互、实现过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参考本申请实施例前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction, implementation process, etc. between the modules/units of the above-mentioned device are based on the same concept as the method embodiments of the present application, and the technical effects they bring are the same as those of the method embodiments of the present application. The specific content can be Refer to the description in the method embodiments shown above in the embodiments of the present application, which will not be described again here.

本申请实施例还涉及一种计算机存储介质,包括计算机可读指令,当所述计算机可读指令被执行时,实现如图4所示实施例的方法步骤。Embodiments of the present application also relate to a computer storage medium, which includes computer-readable instructions. When the computer-readable instructions are executed, the method steps of the embodiment shown in Figure 4 are implemented.

本申请实施例还涉及一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如图4所示实施例的方法步骤。 Embodiments of the present application also relate to a computer program product containing instructions that, when run on a computer, cause the computer to execute the method steps of the embodiment shown in FIG. 4 .

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。 If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .

Claims (18)

一种生产计划获取方法,其特征在于,所述方法包括:A method for obtaining a production plan, characterized in that the method includes: 获取混合整数规划方程,所述混合整数规划方程用于描述待求解的生产计划;Obtain a mixed integer programming equation, which is used to describe the production plan to be solved; 基于与所述混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,所述目标算子为所述算子资源池中的部分算子;Based on information related to the structure of the mixed integer programming equation, determine a target operator in the operator resource pool, where the target operator is a part of the operators in the operator resource pool; 基于所述目标算子对所述混合整数规划方程进行预处理(presolve),得到预处理后的混合整数规划方程;Preprocess (presolve) the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; 对所述预处理后的混合整数规划方程进行求解,得到已求解的生产计划。The preprocessed mixed integer programming equation is solved to obtain a solved production plan. 根据权利要求1所述的方法,其特征在于,所述混合整数规划方程的变量为所述待求解的生产计划,所述混合整数规划方程的约束矩阵包含以下至少一项:所述待求解的生产计划需满足的材料约束、生产力约束、时间约束或交通约束。The method according to claim 1, characterized in that 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 includes at least one of the following: the to-be-solved Material constraints, productivity constraints, time constraints or transportation constraints that the production plan needs to meet. 根据权利要求2所述的方法,其特征在于,所述信息包括以下至少一项:所述变量的维度、所述约束矩阵的稀疏度、所述约束矩阵的分块信息或所述约束矩阵中与所述变量存在计算关系的行,其中,所述分块信息用于指示所述约束矩阵所包含的元素为零的子矩阵。The method according to claim 2, characterized in that the information includes at least one of the following: the dimension of the variable, the sparsity of the constraint matrix, the block information of the constraint matrix, or the A row that has a calculation relationship with the variable, wherein the blocking information is used to indicate a submatrix whose elements are zero contained in the constraint matrix. 根据权利要求1至3任意一项所述的方法,其特征在于,所述基于所述与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子包括:The method according to any one of claims 1 to 3, characterized in that, based on the information related to the structure of the mixed integer programming equation, determining the target operator in the operator resource pool includes: 在方程资源池中,确定与所述与混合整数规划方程的结构相关的信息相匹配的预置方程;In the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; 在算子资源池中,将针对所述预置方程的预处理所对应的算子确定为目标算子。In the operator resource pool, the operator corresponding to the preprocessing of the preset equation is determined as the target operator. 根据权利要求4所述的方法,其特征在于,针对所述混合整数规划方程的预处理中,所述目标算子的数量为n个,且n个目标算子的迭代次数为k次,n和k均为大于或等于1的整数,所述基于所述目标算子对所述混合整数规划方程进行预处理,得到预处理后的混合整数规划方程包括:The method according to claim 4, characterized in that, in the preprocessing of the mixed integer programming equation, the number of the target operators is n, and the number of iterations of the n target operators is k times, n and k are both integers greater than or equal to 1. The mixed integer programming equation is preprocessed based on the target operator, and the preprocessed mixed integer programming equation obtained includes: 在n个目标算子的第j次迭代中,若所述第i个目标算子在第1次迭代中的指标至所述第i个目标算子在第j-1次迭代中的指标之和大于或等于第一阈值,则在第j次迭代至第k次迭代中,跳过所述第i个目标算子,i=1,…,n,j=1,…,k;或In the j-th iteration of n target operators, if the index of the i-th target operator in the first iteration is between the index of the i-th target operator in the j-1 iteration The sum is greater than or equal to the first threshold, then in the j-th iteration to the k-th iteration, the i-th target operator is skipped, i=1,...,n, j=1,...,k; or 若所述和小于所述第一阈值,则检测所述第i个目标算子在第j-1次迭代中的指标是否小于第二阈值;或,If the sum is less than the first threshold, detect whether the index of the i-th target operator in the j-1th iteration is less than the second threshold; or, 若所述第i个目标算子在第j-1次迭代中的指标小于第二阈值,则对所述混合整数规划方程执行第i个目标算子,并生成所述第i个目标算子在第j次迭代中的指标;或,If the index of the i-th target operator in the j-1th iteration is less than the second threshold, execute the i-th target operator on the mixed integer programming equation and generate the i-th target operator. indicator in the jth iteration; or, 若所述第i个目标算子在第j-1次迭代中的指标大于或等于第二阈值,则对第i+1个目标算子执行上述步骤,直至完成所述n个目标算子的第j次迭代;If the index of the i-th target operator in the j-1th iteration is greater than or equal to the second threshold, then perform the above steps for the i+1-th target operator until the n target operators are completed. jth iteration; 执行所述n个目标算子的第j+1次迭代,直至完成所述n个目标算子的第k次迭代,得到预处理后的混合整数规划方程。The j+1th iteration of the n target operators is executed until the kth iteration of the n target operators is completed, and the preprocessed mixed integer programming equation is obtained. 根据权利要求5所述的方法,其特征在于,在针对所述预置方程的预处理和针对所述混合整数规划方程的预处理中,所述n个目标算子的迭代次数相同。The method according to claim 5, characterized in that, in the preprocessing for the preset equation and the preprocessing for the mixed integer programming equation, the number of iterations of the n target operators is the same. 根据权利要求5或6所述的方法,其特征在于,所述第i个目标算子在第j次迭代中的指标,基于所述第i个目标算子所删除的行在所述混合整数规划方程中的占比确定。The method according to claim 5 or 6, characterized in that the index of the i-th target operator in the j-th iteration is based on the row deleted by the i-th target operator in the mixed integer The proportion in the planning equation is determined. 根据权利要求5至7任意一项所述的方法,其特征在于,所述第一阈值和所述第二阈 值基于所述n个目标算子的迭代次数确定。The method according to any one of claims 5 to 7, characterized in that the first threshold and the second threshold The value is determined based on the number of iterations of the n target operators. 根据权利要求1至8任意一项所述的方法,其特征在于,所述基于所述目标算子对所述混合整数规划方程进行预处理,得到预处理后的混合整数规划方程之前,所述方法还包括:The method according to any one of claims 1 to 8, characterized in that, before preprocessing the mixed integer programming equation based on the target operator to obtain the preprocessed mixed integer programming equation, Methods also include: 将所述约束矩阵中成倍数关系的行合并,或,将所述约束矩阵中成倍数关系的列设置成相同的列,得到去冗余后的约束矩阵;Merge the rows in the constraint matrix that are in a multiple relationship, or set the columns in the constraint matrix that are in a multiple relationship to the same column to obtain a constraint matrix after removing redundancy; 基于所述去冗余后的约束矩阵对所述混合整数规划方程进行更新,得到更新后的混合整数规划方程;Update the mixed integer programming equation based on the redundantly removed constraint matrix to obtain an updated mixed integer programming equation; 所述基于所述目标算子对所述混合整数规划方程进行预处理,得到预处理后的混合整数规划方程包括:Preprocessing the mixed integer programming equation based on the target operator, and obtaining the preprocessed mixed integer programming equation includes: 基于所述目标算子对所述更新后的混合整数规划方程进行预处理,得到预处理后的混合整数规划方程。The updated mixed integer programming equation is preprocessed based on the target operator to obtain a preprocessed mixed integer programming equation. 一种计算机任务处理方法,其特征在于,所述方法包括:A computer task processing method, characterized in that the method includes: 获取混合整数规划方程,所述混合整数规划方程用于描述待处理的任务;Obtain a mixed integer programming equation, which is used to describe the task to be processed; 基于与所述混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,所述目标算子为所述算子资源池中的部分算子;Based on information related to the structure of the mixed integer programming equation, determine a target operator in the operator resource pool, where the target operator is a part of the operators in the operator resource pool; 基于所述目标算子对所述混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;Preprocess the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; 对所述预处理后的混合整数规划方程进行求解,得到的解作为所述任务的处理结果。The preprocessed mixed integer programming equation is solved, and the obtained solution is used as the processing result of the task. 根据权利要求10所述的方法,其特征在于,所述信息包括以下至少一项:所述混合整数规划方程的变量的维度、所述混合整数规划方程的约束矩阵的稀疏度、所述约束矩阵的分块信息或所述约束矩阵中与所述变量存在计算关系的行,其中,所述分块信息用于指示所述约束矩阵所包含的元素为零的子矩阵。The method of claim 10, wherein the information includes at least one of the following: dimensions of variables of the mixed integer programming equation, sparsity of the constraint matrix of the mixed integer programming equation, the constraint matrix The blocking information or the rows in the constraint matrix that have a computational relationship with the variable, wherein the blocking information is used to indicate a submatrix whose elements are zero contained in the constraint matrix. 根据权利要求10或11所述的方法,其特征在于,所述基于所述与混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子包括:The method according to claim 10 or 11, characterized in that, based on the information related to the structure of the mixed integer programming equation, determining the target operator in the operator resource pool includes: 在方程资源池中,确定与所述与混合整数规划方程的结构相关的信息相匹配的预置方程;In the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; 在算子资源池中,将针对所述预置方程的预处理所对应的算子确定为目标算子。In the operator resource pool, the operator corresponding to the preprocessing of the preset equation is determined as the target operator. 一种计算机任务处理装置,其特征在于,所述装置包括:A computer task processing device, characterized in that the device includes: 获取模块,用于获取混合整数规划方程,所述混合整数规划方程用于描述待处理的任务;An acquisition module, used to acquire a mixed integer programming equation, where the mixed integer programming equation is used to describe the task to be processed; 确定模块,用于基于与所述混合整数规划方程的结构相关的信息,在算子资源池中确定目标算子,所述目标算子为所述算子资源池中的部分算子;A determination module, configured to determine a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, where the target operator is a part of the operators in the operator resource pool; 预处理模块,用于基于所述目标算子对所述混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;A preprocessing module, configured to preprocess the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; 求解模块,用于对所述预处理后的混合整数规划方程进行求解,得到的解作为所述任务的处理结果。A solving module is used to solve the preprocessed mixed integer programming equation, and the obtained solution is used as the processing result of the task. 一种计算机任务处理装置,其特征在于,包括:处理器、存储器、总线、输入输出设备,所述处理器与所述存储器、输入输出设备相连,所述总线分别连接所述处理器、存储器以及输入输出设备相连;A computer task processing device, characterized in that it includes: a processor, a memory, a bus, and an input and output device. The processor is connected to the memory and the input and output devices. The bus is connected to the processor, the memory, and the input and output devices respectively. Input and output devices are connected; 所述输入输出设备用于获取混合整数规划方程,所述混合整数规划方程用于描述待处理 的任务;The input and output device is used to obtain a mixed integer programming equation, and the mixed integer programming equation is used to describe the processing to be processed tasks; 所述存储器中存储有算子资源池;An operator resource pool is stored in the memory; 所述处理器用于:The processor is used for: 从所述存储器中获取获取算子资源池,并基于与所述混合整数规划方程的结构相关的信息,在所述算子资源池中确定目标算子,所述目标算子为所述算子资源池中的部分算子;Obtain an operator resource pool from the memory, and determine a target operator in the operator resource pool based on information related to the structure of the mixed integer programming equation, where the target operator is the operator Some operators in the resource pool; 基于所述目标算子对所述混合整数规划方程进行预处理,得到预处理后的混合整数规划方程;Preprocess the mixed integer programming equation based on the target operator to obtain a preprocessed mixed integer programming equation; 对所述预处理后的混合整数规划方程进行求解,得到的解作为所述任务的处理结果。The preprocessed mixed integer programming equation is solved, and the obtained solution is used as the processing result of the task. 根据权利要求14所述的装置,其特征在于,所述信息包括以下至少一项:所述混合整数规划方程的变量的维度、所述混合整数规划方程的约束矩阵的稀疏度、所述约束矩阵的分块信息或所述约束矩阵中与所述变量存在计算关系的行,其中,所述分块信息用于指示所述约束矩阵所包含的元素为零的子矩阵。The device according to claim 14, wherein the information includes at least one of the following: dimensions of variables of the mixed integer programming equation, sparsity of the constraint matrix of the mixed integer programming equation, the constraint matrix The blocking information or the rows in the constraint matrix that have a computational relationship with the variable, wherein the blocking information is used to indicate a submatrix whose elements are zero contained in the constraint matrix. 根据权利要求14或15所述的装置,其特征在于,所述处理器,用于:The device according to claim 14 or 15, characterized in that the processor is used for: 在方程资源池中,确定与所述与混合整数规划方程的结构相关的信息相匹配的预置方程;In the equation resource pool, determine a preset equation that matches the information related to the structure of the mixed integer programming equation; 在算子资源池中,将针对所述预置方程的预处理所对应的算子确定为目标算子。In the operator resource pool, the operator corresponding to the preprocessing of the preset equation is determined as the target operator. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,该程序由计算机执行时,使得所述计算机实施权利要求1至12任一项所述的方法。A computer storage medium, characterized in that the computer storage medium stores a computer program, which when executed by a computer causes the computer to implement the method described in any one of claims 1 to 12. 一种计算机程序产品,其特征在于,所述计算机程序产品存储有指令,所述指令在由计算机执行时,使得所述计算机实施权利要求1至12任一项所述的方法。 A computer program product, characterized in that the computer program product stores instructions, which when executed by a computer, cause the computer to implement the method described in any one of claims 1 to 12.
PCT/CN2023/084027 2022-03-31 2023-03-27 Computer task processing method and related device therefor Ceased WO2023185714A1 (en)

Applications Claiming Priority (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
CN202210333041.7 2022-03-31

Publications (1)

Publication Number Publication Date
WO2023185714A1 true WO2023185714A1 (en) 2023-10-05

Family

ID=88199365

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/084027 Ceased WO2023185714A1 (en) 2022-03-31 2023-03-27 Computer task processing method and related device therefor

Country Status (2)

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

Cited By (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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110131167A1 (en) * 2009-12-01 2011-06-02 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
CN110518591A (en) * 2019-08-22 2019-11-29 中国农业大学 A kind of tidal current computing method of uncertain electric system
CN112818280A (en) * 2019-11-18 2021-05-18 华为技术有限公司 Information processing method and related equipment
EP3968262A1 (en) * 2020-09-09 2022-03-16 Chicago Mercantile Exchange Inc. Linear model partitioner

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110131167A1 (en) * 2009-12-01 2011-06-02 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
CN110518591A (en) * 2019-08-22 2019-11-29 中国农业大学 A kind of tidal current computing method of uncertain electric system
CN112818280A (en) * 2019-11-18 2021-05-18 华为技术有限公司 Information processing method and related equipment
EP3968262A1 (en) * 2020-09-09 2022-03-16 Chicago Mercantile Exchange Inc. Linear model partitioner

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Master's Thesis", 12 May 2016, BEIJING JIAOTONG UNIVERSITY, CN, article ZHANG, YAQIAN: "Preprocessing Method in Mixed Integer Programming", pages: 1 - 67, XP009549136 *

Cited By (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

Also Published As

Publication number Publication date
CN116933908A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
US12020575B2 (en) Autonomous vehicle fleet management system based on application status
US11900478B2 (en) Digitally cross-referencing community transaction data to determine commodity types and automatically assign tax codes to an invoice
JP7005600B2 (en) Complex event processing for microbatch streaming
US10102485B2 (en) Method and system for predicting demand for vehicles
CN113076224B (en) Data backup method, data backup system, electronic device and readable storage medium
US20230033019A1 (en) Data processing method and apparatus, computerreadable medium, and electronic device
US11762701B2 (en) Computer system providing numeric calculations with less resource usage
CN110334091A (en) A kind of data fragmentation distributed approach, system, medium and electronic equipment
CN113032132A (en) Spatio-temporal data visualization task execution method based on cloud edge architecture
US12014216B2 (en) Method for platform-based scheduling of job flow
CN114491269A (en) Recommended methods and devices, equipment and media for mobility services
CN114626752A (en) An automatic vehicle scheduling method, device, computer equipment and storage medium
JP2024544646A (en) Dynamic system workload placement in cloud infrastructure - Patents.com
CN111680799B (en) Method and device for processing model parameters
WO2023185714A1 (en) Computer task processing method and related device therefor
CN114358625A (en) Method and device for distributing object streams, storage medium and electronic equipment
CN113986493A (en) Service use request processing method, related device and computer program product
CN113919734A (en) Order delivery method and device
US11774977B1 (en) Systems, apparatus, and methods for optimization of autonomous vehicle workloads
US11669363B2 (en) Task allocations based on color-coded representations
CN116341838A (en) A computer task processing method and related equipment
CN110489512B (en) Method and apparatus for outputting information
US20220270043A1 (en) Systems and methods for determining duty costs associated with a supply chain network
CN114491270A (en) Recommendation method, device, equipment and medium for travel service
CN113222310A (en) Goods picking productivity scheduling method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23778081

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 23778081

Country of ref document: EP

Kind code of ref document: A1