Mixed integer linear programming model solving method and related equipment

By copying the mixed integer linear programming model to the GPU processing unit and performing integer relaxation and dual iterative solutions, the problem of low solution rate of the mixed integer linear programming model in the prior art is solved, and an efficient solution process is realized, and the computing power of the GPU is used is used. The solution speed of integer linear programming model is improved.

CN118897935APending Publication Date: 2024-11-05SHENZHEN RES INST OF BIG DATA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410983203.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

In the prior art, the solution rate of the hybrid integer linear programming model is limited by the processing speed of the CPU processing unit, and the heuristic algorithm requires repeated calls to the linear programming solver, resulting in inefficiency.

Method used

Copy the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, perform integer relaxation and dual iterative solutions, use the high data processing performance of the GPU to generate feasible solutions, and update the model based on the distance norm of the integer solution and feasible solutions until The solutions are equal and the solution rate is improved.

Benefits of technology

While ensuring accuracy, the solution rate of the hybrid integer linear programming model is significantly improved, the limitation of direct solution on the GPU is overcome, and the parallel processing capability of the GPU is fully utilized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897935A_ABST
    Figure CN118897935A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a mixed integer linear programming model solving method and related equipment, and the method comprises the steps: copying a mixed integer linear programming model of a CPU processing unit to a GPU processing unit, and carrying out the integer relaxation of the mixed integer linear programming model, and obtaining an iterative linear programming model; and performing dual iteration solution on the target planning model in the GPU processing unit to generate a feasible solution, mapping the feasible solution into an integer solution, when the feasible solution and the integer solution are not equal, obtaining an update model corresponding to the target planning model based on a distance norm between the integer solution and the feasible solution, and performing iteration by taking the update model as the target planning model to obtain the target planning model. Obtaining a target feasible solution until the feasible solution is equal to the integer solution; the GPU processing unit is used for sending the target feasible solution to the CPU processing unit, the CPU processing unit is used for obtaining a solving result of the mixed integer linear programming model based on the target feasible solution, and the solving rate of the mixed integer linear programming model is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a mixed integer linear programming model solving method and related equipment. Background Art

[0002] The mixed integer linear programming model is a mathematical optimization model widely used in multiple industrial fields. However, due to the high difficulty of solving the mixed integer linear programming model, it is difficult to solve it quickly in a short time. Therefore, it is necessary to study how to efficiently solve the mixed integer linear programming model.

[0003] In the related art, a heuristic algorithm is usually used to solve a mixed integer linear programming model. However, when processing a mixed integer linear programming model, the heuristic algorithm needs to repeatedly call the linear programming solver on the CPU processing unit, and since the processing speed of the CPU processing unit is limited, the solution rate of the mixed integer linear programming model by the heuristic algorithm is also limited. Summary of the invention

[0004] The embodiments of the present application provide a mixed integer linear programming model solving method and related devices, which can improve the solution rate of the mixed integer linear programming model.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for solving a mixed integer linear programming model, the method comprising:

[0006] The mixed integer linear programming model of the CPU processing unit is copied to the GPU processing unit, and the mixed integer linear programming model is integer relaxed in the GPU processing unit to obtain an iterative linear programming model;

[0007] In the GPU processing unit, a dual iterative solution is performed on the target programming model to generate a feasible solution, the feasible solution is mapped to an integer solution, and when the feasible solution and the integer solution are not equal, an update model corresponding to the target programming model is obtained based on the distance norm between the integer solution and the feasible solution, and the updated model is used as the target programming model for iteration until the feasible solution and the integer solution are equal to obtain a target feasible solution, wherein the initial value of the target programming model is the iterative linear programming model;

[0008] The GPU processing unit is used to send the target feasible solution to the CPU processing unit, and the CPU processing unit is used to obtain a solution result of the mixed integer linear programming model based on the target feasible solution.

[0009] In some embodiments, copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit includes:

[0010] Copying the pageable memory corresponding to the mixed integer linear programming model in the CPU processing unit to the fixed memory;

[0011] The mixed integer linear programming model is transferred from the fixed memory to the video memory unit of the GPU processing unit through a DMA mechanism.

[0012] In some embodiments, copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit includes:

[0013] Obtaining multiple parameter strategies of the mixed integer linear programming model;

[0014] Selecting a target parameter strategy from the plurality of parameter strategies one by one, and obtaining an initial feasible solution of the current target parameter strategy based on a target feasible solution of a previous target parameter strategy;

[0015] The initial feasible solution, the target parameter strategy and the mixed integer linear programming model are copied from the CPU processing unit to the GPU processing unit for processing.

[0016] In some embodiments, performing integer relaxation on the mixed integer linear programming model in the GPU processing unit to obtain an iterative linear programming model includes:

[0017] Based on the initial feasible solution and the target parameter strategy, the mixed integer linear programming model is updated to obtain an updated mixed integer linear programming model;

[0018] The updated mixed integer linear programming model is integer relaxed to obtain the iterative linear programming model.

[0019] In some embodiments, the iterative linear programming model includes primal variables and dual variables, and performing dual iterative solving on the target programming model to generate a feasible solution includes:

[0020] Obtaining a step factor parameter and an original weight parameter, performing step iteration based on the step factor parameter, the original weight parameter, the original variable and the dual variable to generate a target step size;

[0021] Obtaining a primitive variable update function and a dual variable update function, updating the primitive variable based on the target step size and the primitive variable update function, updating the dual variable based on the target step size and the dual variable update function, updating the target step size using the updated primitive variable and the dual variable to obtain an updated target step size, and iterating the primitive variable and the dual variable using the updated target step size as the target step size until the updated primitive variable meets a first precision condition;

[0022] The updated original variables are used as the feasible solution.

[0023] In some embodiments, the target step size includes a target original step size and a target dual step size, and the step size iteration based on the step size factor parameter, the original weight parameter, the original variable, and the dual variable to generate the target step size includes:

[0024] Based on the step factor parameter, the original weight parameter, the original variable and the dual variable, the step size update is performed, and the step of the step size update comprises:

[0025] generating an original weight norm function based on the second norm of the original variable, the second norm of the dual variable and the original weight parameter;

[0026] Generate a step weight constraint based on the difference between the original weight parameter of the current step iteration and the original weight parameter of the previous step iteration, the original weight norm function, the iterative difference of the original variable, the iterative difference of the dual variable, and the step factor parameter;

[0027] Generate a target step size factor and a target original weight based on the step size weight constraint, generate an original step size based on the ratio of the target step size factor and the target original weight, and generate a dual step size based on the product of the target step size factor and the target original weight;

[0028] Repeat the step of updating the step length multiple times to update the original step length and the dual step length multiple times, and use the updated original step length as the target original step length, and use the updated dual step length as the target dual step length.

[0029] In some embodiments, the iterative linear programming model includes a first constraint parameter, a second constraint parameter, and a third constraint parameter, and obtaining the primal variable update function and the dual variable update function includes:

[0030] Based on the difference between the first constraint parameter and the product of the second constraint parameter and the dual variable, and multiplying by the target original step size, an original reference value is obtained, and based on the mapping relationship between the original variable and the difference between the original reference value, the original variable update function is obtained;

[0031] Based on the difference between the updated original variable and the original variable, obtaining an updated difference of the original variable;

[0032] Based on the difference between the third constraint parameter and the product of the second constraint parameter and the original variable update difference, and multiplied by the target dual step, a dual reference value is obtained, and based on the mapping relationship between the original variable and the accumulated value of the original reference value, the dual variable update function is obtained.

[0033] In some embodiments, the iterative linear programming model includes an initial objective function, the initial objective function includes a first constraint parameter, and obtaining an updated model corresponding to the target programming model based on a distance norm between the integer solution and the feasible solution includes:

[0034] Accumulating all the distance norms to obtain an accumulated norm;

[0035] Based on the convex combination of the cumulative norm and the first constraint parameter, an updated objective function is obtained, and based on the updated objective function, the initial objective function in the target programming model is updated to obtain the updated model.

[0036] In some embodiments, the iterating the updated model as the target programming model until the feasible solution and the integer solution are equal to obtain a target feasible solution includes:

[0037] Iterating the target programming model until the feasible solution is equal to the integer solution;

[0038] Obtaining a deviation vector between the feasible solution and the integer solution, and selecting a preset adjustment number of vector elements from the deviation vector for random adjustment to obtain an adjusted deviation vector;

[0039] Generate an adjustment value interval based on the preset adjustment quantity, generate an adjustment value based on the adjustment value interval, select vector elements matching the adjustment value from the adjustment deviation vector according to the vector element sequence of the adjustment deviation vector for adjustment, and generate an updated integer solution according to the updated adjustment deviation vector;

[0040] The target programming model is iterated using the updated integer solution until the number of iterations reaches a preset number of dual iterations, and the feasible solution is used as the target feasible solution.

[0041] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a mixed integer linear programming model solving device for a processing device, the device comprising:

[0042] A copy relaxation module is used to copy the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, and perform integer relaxation on the mixed integer linear programming model in the GPU processing unit to obtain an iterative linear programming model;

[0043] A data processing module, configured to perform dual iterative solution on the target programming model in the GPU processing unit to generate a feasible solution, map the feasible solution to an integer solution, and when the feasible solution and the integer solution are not equal, obtain an updated model corresponding to the target programming model based on the distance norm between the integer solution and the feasible solution, iterate the updated model as the target programming model until the feasible solution and the integer solution are equal, and obtain a target feasible solution, wherein the initial value of the target programming model is the iterative linear programming model;

[0044] The result output module is used to use the GPU processing unit to send the target feasible solution to the CPU processing unit, and use the CPU processing unit to obtain the solution result of the mixed integer linear programming model based on the target feasible solution.

[0045] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, including a memory, a CPU processing unit and a GPU processing unit, wherein the memory stores a computer program, and when the CPU processing unit and the GPU processing unit execute the computer program, they implement the mixed integer linear programming model solving method described in the first aspect above.

[0046] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, it implements the mixed integer linear programming model solving method described in the first aspect above.

[0047] The mixed integer linear programming model solving method and related equipment proposed in the embodiment of the present application, the method comprises: first, copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, and performing integer relaxation on the mixed integer linear programming model in the GPU processing unit to obtain an iterative linear programming model; then, performing dual iterative solution on the target programming model in the GPU processing unit to generate a feasible solution, mapping the feasible solution to an integer solution, and when the feasible solution and the integer solution are not equal, obtaining an updated model corresponding to the target programming model based on the distance norm between the integer solution and the feasible solution, and iterating the updated model as the target programming model until the feasible solution and the integer solution are equal to obtain a target feasible solution, and the initial value of the target programming model is the iterative linear programming model; finally, using the GPU processing unit to send the target feasible solution to the CPU processing unit, and using the CPU processing unit to obtain a solution result of the mixed integer linear programming model based on the target feasible solution. The embodiment of the present application utilizes a GPU processing unit to perform a dual iterative solution on an iterative linear programming model that is a result of relaxing a mixed integer linear programming model, so as to overcome the situation that the mixed integer linear programming model cannot be directly solved on the GPU processing unit, and then utilizes the high data processing performance of the GPU processing unit to effectively improve the rate of solving the mixed integer linear programming model, and during the iteration process, updates the iterative linear programming model based on the distance norm between the integer solution and the feasible solution, so that the relaxed iterative linear programming model can be close to the mixed integer linear programming model, so as to maintain the accuracy of the solution result of the mixed integer linear programming model obtained by solving the iterative linear programming model, thereby effectively improving the solution rate of the mixed integer linear programming model while ensuring the high accuracy of the solution result of the mixed integer linear programming model.

[0048] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a structural schematic diagram of a processing device provided in one embodiment of the present application.

[0050] Figure 2 This is a flowchart of a mixed integer linear programming model solving method provided by another embodiment of the present application.

[0051] Figure 3 yes Figure 2 Flow chart of step 201 in FIG.

[0052] Figure 4 yes Figure 2 Another flow chart of step 201 in FIG.

[0053] Figure 5 This is a schematic diagram of a guided loop solving process provided by yet another embodiment of the present application.

[0054] Figure 6 This is a flowchart of integer relaxation provided by another embodiment of the present application.

[0055] Figure 7 This is a flowchart of a dual iterative solution provided by another embodiment of the present application.

[0056] Figure 8 This is a flowchart for generating a target step size in a dual iterative solution provided by another embodiment of the present application.

[0057] Fig. 9 yes Figure 7 Flowchart of step 702 in FIG.

[0058] Fig.10 It is a flowchart of updating the target planning model provided by another embodiment of the present application.

[0059] Fig.11 This is a flow chart of a random perturbation integer solution provided by another embodiment of the present application.

[0060] Fig.12 This is a schematic diagram of a heuristic two-layer parallel implementation structure provided by another embodiment of the present application.

[0061] Fig.13 It is a structural diagram of a linear programming parallel solution module provided in yet another embodiment of the present application.

[0062] Fig.14 This is a schematic diagram of a timeline of a CPU processing unit provided in yet another embodiment of the present application.

[0063] Fig.15 It is a structural schematic diagram of a mixed integer linear programming model solving device of a processing device provided in yet another embodiment of the present application.

[0064] Fig.16 It is a schematic diagram of the hardware structure of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0066] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0068] First, some nouns involved in this application are analyzed:

[0069] The mixed integer linear programming model is a mathematical optimization model widely used in multiple industrial fields. However, due to the high difficulty of solving the mixed integer linear programming model, it is difficult to solve it quickly in a short time. Therefore, it is necessary to study how to efficiently solve the mixed integer linear programming model.

[0070] Primal-dual linear programming is a technique in optimization theory that splits a linear programming problem into two related problems - the primal problem and the dual problem. The primal problem is usually presented in the form of minimizing an objective function and constraints, while the dual problem is obtained by maximizing the objective function and the corresponding constraints. This method can not only effectively solve linear programming problems, but also provide useful information about the solution, such as verification of the optimal solution and sensitivity analysis. Duality theorems (including strong duality and weak duality) provide a theoretical basis for the accuracy and application of solutions, making optimization problems more controllable and in-depth.

[0071] The combination of the PCI-Express (PCIe) bus and the direct memory access (DMA) mechanism can significantly improve the performance of computer systems. PCIe provides high-bandwidth, low-latency serial data transmission, supports point-to-point connections, and avoids the bandwidth contention problem of traditional buses. The direct memory access mechanism allows peripherals to read and write memory directly without going through the CPU, which reduces the burden on the CPU and speeds up data transmission. Combining PCIe and DMA, peripherals can exchange data directly with memory through high-speed channels, improving the efficiency and responsiveness of the overall system.

[0072] CUDA grid is a key concept in the NVIDIA CUDA programming model, which is used to manage and organize parallel computing tasks. A CUDA grid consists of multiple thread blocks, which are executed in parallel on the GPU. Each thread block can contain multiple threads, which collaborate through shared memory and synchronization mechanisms. The grid structure enables programs to process large-scale data in parallel and make full use of the computing power of the GPU to achieve efficient computing and data processing. Through this hierarchical structure, the CUDA grid can effectively handle complex computing tasks such as image processing, scientific computing, and machine learning.

[0073] In the related art, a heuristic algorithm is usually used to solve a mixed integer linear programming model. However, when processing a mixed integer linear programming model, the heuristic algorithm needs to repeatedly call the linear programming solver on the CPU processing unit, and since the processing speed of the CPU processing unit is limited, the solution rate of the mixed integer linear programming model by the heuristic algorithm is also limited.

[0074] In order to improve the solution rate of the mixed integer linear programming model, the embodiment of the present application utilizes a GPU processing unit to perform a dual iterative solution on the iterative linear programming model after the mixed integer linear programming model is relaxed, so as to overcome the situation that the mixed integer linear programming model cannot be directly solved on the GPU processing unit, and then utilizes the high data processing performance of the GPU processing unit to effectively improve the solution rate of the mixed integer linear programming model, and in the iterative process, updates the iterative linear programming model based on the distance norm between the integer solution and the feasible solution, so that the relaxed iterative linear programming model can be close to the mixed integer linear programming model, so as to maintain the accuracy of the solution result of the mixed integer linear programming model obtained by solving the iterative linear programming model, thereby effectively improving the solution rate of the mixed integer linear programming model while ensuring the high accuracy of the solution result of the mixed integer linear programming model.

[0075] In order to better describe the mixed integer linear programming model solving method provided by the present application, the following first describes the processing device applied to the mixed integer linear programming model solving method. Figure 1 , is a schematic diagram of the structure of a processing device provided in an embodiment of the present application. Figure 1 As shown, the processing device includes a CPU processing unit and a GPU processing unit, wherein the CPU processing unit is used to obtain a mixed integer linear programming model, and the GPU processing unit is used to process the mixed integer linear programming model together with the CPU processing unit.

[0076] Based on the above processing device, the mixed integer linear programming model solving method and related devices provided in the embodiment of the present application will be further described below. The mixed integer linear programming model solving method provided in the embodiment of the present application can be applied to the processing device.

[0077] The following is a detailed description of the mixed integer linear programming model solution method in the embodiment of the present application. Figure 2 , is an optional flow chart of the mixed integer linear programming model solving method provided in the embodiment of the present application, Figure 2 The method in the embodiment may include but is not limited to steps 201 to 203. Figure 2 The order of step 201 to step 203 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0078] Step 201: copy the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, and perform integer relaxation on the mixed integer linear programming model in the GPU processing unit to obtain an iterative linear programming model.

[0079] The following is a detailed description of step 201.

[0080] In some embodiments, after the processing device responds to the mixed integer linear programming model solution request, the processing device will read the mixed integer linear programming model and save it to the host memory of the CPU processing unit, and then concurrently execute j feasibility pump heuristic solution paths of different parameter strategies, and then select a heuristic in sequence (such as the first heuristic at the beginning) as the main heuristic, and set j=1 to start executing the stream parallel algorithm. It can be understood that the specific objective function, constraints and optimization variables of the mixed integer linear programming model in different application scenarios are different, but they all have the same characteristics and can be solved by the mixed integer linear programming model solution method provided in this application.

[0081] This embodiment provides a general mixed integer linear programming model as shown in the following formula (1).

[0082]

[0083] where c T is the coefficient vector of the objective function, G and A represent the coefficient matrices of the constraints, l and u are the lower and upper bound vectors of the variables, respectively. represents a set of integers, and I is the index set of integer variables. is a set of real numbers, then Among them, {m1,m2,n} are the matrix dimensions associated with the coefficient matrix.

[0084] In some embodiments, the total number of parameter strategies is M. Since the mixed integer linear programming model solving method provided in the present application is executed in a loop iterative manner, when the number of different parameter strategies executed reaches j=M+1, the loop execution is repeated, that is, j=1.

[0085] After the CPU processing unit obtains the mixed integer linear programming model, the processing device copies the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, so as to process the mixed integer linear scale model at the GPU processing unit, thereby utilizing the high processing performance of the GPU processing unit to improve the processing efficiency of the mixed integer linear programming model. The following will further describe how to copy the mixed integer linear programming model of the CPU processing unit to the GPU processing unit.

[0086] Reference Figure 3 , copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, including the following steps 301 to 302.

[0087] Step 301: copy the pageable memory corresponding to the mixed integer linear programming model in the CPU processing unit to the fixed memory.

[0088] Step 302: The mixed integer linear programming model is transferred from the fixed memory to the video memory unit of the GPU processing unit through the DMA mechanism.

[0089] Steps 301 to 302 are described in detail below.

[0090] In some embodiments, the mixed integer linear scale model of the CPU processing unit is copied to the GPU processing unit, mainly by copying the mixed integer linear programming model corresponding to the j-th heuristic to the GPU processing unit through the PCI-Express (Peripheral Component Interconnect Express, PCIE) bus and the direct memory access (Direct Memory Access, DMA) mechanism. Specifically, the cudaHostAlloc function in the CUDA interface is used to allocate fixed memory, the cudaMalloc function is used to allocate the GPU processing unit video memory, and then the cudaMemcpy function is used to copy the mixed integer linear programming model data from the CPU processing unit memory to the GPU processing unit video memory.

[0091] Specifically, the data of the mixed integer linear programming model is first copied from the pageable memory of the CPU processing unit to the fixed memory, and then transferred from the fixed memory of the CPU processing unit to the video memory unit of the GPU processing unit through the DMA mechanism. The constraint matrix is ​​stored in the compressed sparse row (CSR) format on the GPU.

[0092] Through the above steps 301 to 302, the mixed integer linear programming model is completely copied from the CPU processing unit to the GPU processing unit by utilizing the PCI-Express bus and direct memory access mechanism that provide a high-bandwidth data transmission channel, thereby making full use of the parallel processing capability of the GPU and accelerating the solution process of the mixed integer linear programming model.

[0093] In some embodiments, since the solution method of the integer linear programming model provided by the present application is based on iterative loop solution of multiple parameter strategies, and the solution result of the integer linear programming model corresponding to the previous parameter strategy will be used as a guide for the solution of the next parameter strategy, thereby guiding the iterative loop solution process to move towards a higher quality feasible solution. The guidance process will be further described below.

[0094] Reference Figure 4 , copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, also includes the following steps 401 to 403.

[0095] Step 401: Obtain multiple parameter strategies of a mixed integer linear programming model.

[0096] Step 402: Select target parameter strategies one by one from multiple parameter strategies, and obtain an initial feasible solution of the current target parameter strategy based on the target feasible solution of the previous target parameter strategy.

[0097] Step 403: copy the initial feasible solution, the target parameter strategy and the mixed integer linear programming model from the CPU processing unit to the GPU processing unit for processing.

[0098] Steps 401 to 403 are described in detail below.

[0099] In some embodiments, a plurality of parameter strategies of a pre-set mixed integer linear programming model are first obtained, and then a target parameter strategy (i.e., the j-th heuristic above) is selected one by one from the plurality of parameter strategies in each loop iteration, and a target feasible solution x is obtained based on the previous target parameter strategy (i.e., the j-1-th heuristic). * (j-1), get the initial feasible solution x of the current target parameter strategy 0(j) Then, the initial feasible solution of the current target parameter strategy, the target parameter strategy and the mixed integer linear programming model are copied from the CPU processing unit to the GPU processing unit for iterative solution processing of the mixed integer linear programming model.

[0100] Reference Figure 5 , is a schematic diagram of a guided loop solution process provided by an embodiment of the present application. Figure 5 As shown, this application takes eight parameter strategies as an example. After solving the mixed integer linear programming model with the previous target parameter strategy as the main heuristic, the solution result is used as a guide for the solution process of the next mixed integer linear model with the next target transmission strategy as the main heuristic.

[0101] In some embodiments, after the mixed integer linear programming model of the CPU processing unit is copied to the GPU processing unit, since the mixed integer linear programming model cannot be directly solved in the GPU processing unit, it is necessary to perform integer relaxation on the mixed integer linear programming model to obtain an iterative linear programming model that can be used for data solving in the GPU processing unit.

[0102] The integer relaxation operation is achieved by omitting the integer constraints of all integer variables in the mixed integer linear programming model. The iterative linear programming model after integer relaxation of the mixed integer linear programming model based on the above formula (1) can be expressed as the following formula (2).

[0103] min{c T x:Gx≥h,Ax=b,l≤x≤u} (2)

[0104] In some embodiments, as described above, the solution result of the mixed integer linear programming model with the previous target parameter strategy as the main heuristic is used as a guide for the solution process of the next mixed integer linear model with the next target transmission strategy as the main heuristic. Specifically, it can be applied before integer relaxation of the mixed integer linear programming model. The process will be further described below.

[0105] Reference Figure 6 , integer relaxation is performed on the mixed integer linear programming model in the GPU processing unit to obtain an iterative linear programming model, including the following steps 601 to 602.

[0106] Step 601: updating the mixed integer linear programming model based on the initial feasible solution and the target parameter strategy to obtain an updated mixed integer linear programming model.

[0107] Step 602: performing integer relaxation on the updated mixed integer linear programming model to obtain an iterative linear programming model.

[0108] Steps 601 to 602 are described in detail below.

[0109] In some embodiments, after obtaining the solution result x of the previous target parameter strategy-based heuristic mixed integer linear programming model * (j-1) After that, based on the solution x * (j-1) The initial feasible solution x of the current target transmission strategy obtained 0 (j) and the target parameter strategy update the mixed integer linear programming model (1) to obtain an updated mixed integer linear programming model, and then the updated mixed integer linear programming model is integer relaxed in the GPU processing unit to obtain an iterative linear programming model, so that the iterative linear programming model is subsequently solved in the GPU processing unit.

[0110] Through the above steps 401 to 403 and steps 601 to 602, the mixed integer linear programming model corresponding to the current target transmission strategy is updated by using the solution result of the mixed integer linear programming model with the previous target parameter strategy as the main heuristic, so as to use the updated mixed integer linear programming model to perform data solution on the relaxed iterative linear programming model, which can effectively guide the iterative loop solution process to a higher quality feasible solution, thereby improving the solution accuracy of the mixed integer linear programming model.

[0111] Step 202: Perform dual iterative solution on the target programming model in the GPU processing unit to generate a feasible solution, map the feasible solution to an integer solution, and when the feasible solution and the integer solution are not equal, obtain an updated model corresponding to the target programming model based on the distance norm between the integer solution and the feasible solution, and iterate the updated model as the target programming model until the feasible solution and the integer solution are equal to obtain the target feasible solution.

[0112] Step 202 is described in detail below.

[0113] In some embodiments, after the iterative linear programming model is obtained in the GPU processing unit, the iterative linear programming model is used as the initial value of the target programming model, and then the target programming model is solved by dual iteration to generate a feasible solution to the target programming model. This embodiment uses PDLP to solve the target programming model in the GPU processing unit. Since most operations in PDLP are matrix-vector and vector-vector operations, the embodiment uses a one-dimensional thread configuration. For ease of explanation, the initial target programming model (i.e., the iterative linear programming model) is listed as shown in the following formula (3).

[0114]

[0115] Where y is the dual variable, x is the primal variable, q and K are the relevant target parameters of the target programming model, and Λ is the set of finite variables λ in the target programming model. These parameters can be specifically described by the following formula (4).

[0116]

[0117] In formula (3), c is used as the first constraint parameter, K is used as the second constraint parameter, q is used as the third constraint parameter, and q is used as T y+l T λ + -u T λ - As the initial objective function, the initial objective function includes a first constraint parameter.

[0118] The following will further describe in detail how to perform dual iterative solution to the target programming model.

[0119] Reference Figure 7 , performing dual iterative solution on the target programming model to generate a feasible solution, including the following steps 701 to 703.

[0120] Step 701: Obtain a step factor parameter and an original weight parameter, perform step iteration based on the step factor parameter, the original weight parameter, the original variable and the dual variable, and generate a target step size.

[0121] Step 701 is described in detail below.

[0122] In some embodiments, after the GPU processing unit obtains the target planning model, it is necessary to first obtain the step factor parameter η and the original weight parameter ω, so as to facilitate the step iteration using the step factor parameter, the original weight parameter, the original variable and the dual variable to generate the target step. The following will further describe how to perform step iteration based on the step factor parameter, the original weight parameter, the original variable and the dual variable to generate the target step.

[0123] Reference Figure 8 , performing step size iteration based on the step size factor parameter, the original weight parameter, the original variable and the dual variable to generate a target step size, including the following steps 801 to 802.

[0124] Step 801: Update the step size based on the step size factor parameter, the original weight parameter, the original variable and the dual variable. The step size update step includes the following steps 801a to 801c.

[0125] Step 801a: Generate an original weight norm function based on the second norm of the original variable, the second norm of the dual variable and the original weight parameter.

[0126] Step 801b: Generate a step weight constraint based on the difference between the original weight parameters of the current step iteration and the original weight parameters of the previous step iteration, the original weight norm function, the iterative difference of the original variables, the iterative difference of the dual variables, and the step factor parameter.

[0127] Step 801c: Generate a target step size factor and a target original weight based on the step size weight constraint, generate an original step size based on the ratio of the target step size factor and the target original weight, and generate a dual step size based on the product of the target step size factor and the target original weight.

[0128] Step 802: Repeat the step of performing multiple step size updates to update multiple original step sizes and dual step sizes, and use the updated original step size as the target original step size, and use the updated dual step size as the target dual step size.

[0129] Steps 801 to 802 are described in detail below.

[0130] In some embodiments, after obtaining the step factor parameter η, the original weight parameter ω, the original variable x, and the dual variable y, the bi-norm of the original variable is calculated. The bi-norm of the dual variable The original weight norm function generated by the original weight parameter ω is shown in the following formula (5).

[0131]

[0132] The original weight norm function (5) is used to adjust the original weight parameter ω to accelerate the step size update process.

[0133] Next, the original weight parameter ω based on the current step size iteration t t+1 The corresponding original weight norm function and the original weight parameter ω of the previous step iteration t The corresponding two-norm difference of the original weight norm function and the iterative difference of K times the original variable (x t+1 -x t ), twice the number of iterative differences of the dual variables 2(y t+1 -y t ) T And the step factor parameter η, the step weight constraint is generated as shown in the following formula (6).

[0134]

[0135] The step weight constraint (6) is used to restrict the step factor parameter η and the original weight parameter ω generated in each iteration to ensure that the generated target original step size and target dual step size converge during the data processing of the target programming model.

[0136] Then, the target step size factor η is generated based on the step size weight constraint (6): * ∈(0,∞) and the target original weight ω * ∈(0,∞), the original step size τ=η / ω is generated based on the ratio of the target step size factor and the target original weight, and the dual step size δ=ωη is generated based on the product of the target step size factor and the target original weight.

[0137] After that, the above-mentioned step size update steps are repeated multiple times to update the original step size τ and the dual step size δ multiple times until the custom termination condition updates the original-dual error accuracy, that is, ε t+1 =max{βε t ,10 -4}, that is, the error accuracy is reduced exponentially by the coefficient β to balance the speed of solution and the quality of the feasible solution. In this algorithm, β is set to 0.98. Then the updated primal step size is used as the target primal step size, and the updated dual step size is used as the target dual step size.

[0138] Step 702: Obtain the original variable update function and the dual variable update function, update the original variables based on the target step size and the original variable update function, update the dual variables based on the target step size and the dual variable update function, update the target step size using the updated original variables and dual variables to obtain an updated target step size, and iterate the original variables and dual variables using the updated target step size as the target step size until the updated original variables meet the first precision condition.

[0139] Step 702 is described in detail below.

[0140] In some embodiments, after obtaining the target primitive step size and the target dual step size, it is necessary to obtain the primitive variable update function and the dual variable update function, so as to combine the target primitive step size and the target dual step size later, and use the primitive variable update function and the dual variable update function to update the primitive variables and the dual variables in the iterative update. The following will first further describe how to obtain the primitive variable update function and the dual variable update function.

[0141] Reference Fig. 9 , obtain the original variable update function and the dual variable update function, including the following steps 901 to 903.

[0142] Step 901: Based on the difference between the first constraint parameter and the product of the second constraint parameter and the dual variable, and multiplying by the target original step size, an original reference value is obtained, and an original variable update function is obtained based on a mapping relationship between the original variable and the original reference value.

[0143] Step 902: Based on the difference between the updated original variable and the original variable, the updated difference of the original variable is obtained.

[0144] Step 903: Based on the difference between the third constraint parameter and the product of the second constraint parameter and the original variable update difference, multiplied by the target dual step size, a dual reference value is obtained, and based on the mapping relationship between the original variable and the accumulated value of the original reference value, a dual variable update function is obtained.

[0145] Steps 901 to 903 are described in detail below.

[0146] In some embodiments, first, based on the transposition K of the first constraint parameter c and the second constraint parameter T and the dual variable y of the current iteration t The difference of the product of T y t ), and multiply it by the target original step length τ to get the original reference value τ(cK T y t ), and based on the mapping relationship between the original variable and the original reference value, the original variable update function is obtained as shown in the following formula (7).

[0147]

[0148] Next, based on twice the number of updates (i.e. the original variable x after the current iteration update) t+1 The difference between the original variable x at the beginning of the current iteration (2x t+1 -x t ), and get the original variable update difference (2x t+1 -x t Then, based on the difference (qK(2x t+1 -x t ), and multiply it by the target dual step size to obtain the dual reference value σ(qK(2x t+1 -x t ), and based on the mapping relationship between the original variable and the accumulated value of the original reference value, the dual variable update function is obtained as shown in the following formula (8).

[0149]

[0150] Among them, the symbol proj X represents the mapping projected onto the convex set X, X and Y are represented as and t represents the current iteration number of the algorithm, and τ, σ>0 are the primal and dual step sizes, respectively. τ and σ can be further expressed as τ=η / ω and σ=ωη, where ω∈(0,∞) is the primal weight and η∈(0,∞) is the step size. Under this parameter setting, the mixed integer linear programming model solution method proposed in this application converges for all η≤1 / ||K||2. Therefore, a parameter ω can be used to control the number of iterations of the primal solution and the dual solution.

[0151] After obtaining the original variable update function (7) and the dual variable update function (8), the original variable x is updated based on the target step size τ and the original variable update function (7): t+1 , update the dual variable y based on the target step size σ and the dual variable update function (8) t+1 , using the updated original variable x t+1 and the dual variable y t+1 The target step size is updated (including the target original step size τ and the target dual step size σ) to obtain the updated target step size, and the updated target step size is used as the target step size to iterate the original variable and the dual variable until the updated original variable meets the first precision condition. It can be understood that this embodiment does not specifically limit the first precision condition, that is, the first precision condition can be customized as needed, or it can be a result of data adjustment according to the iterative process.

[0152] Step 703: Take the updated original variables as a feasible solution.

[0153] Step 703 is described in detail below.

[0154] In some embodiments, the iterative solution process from step 701 to step 702 is stopped when the original variable reaches the accuracy requirement or the maximum number of iterations is reached, and the original variable is used as the feasible solution x of this dual iteration. * .

[0155] Through the above steps 701 to 703, steps 801 to 802, and steps 901 to 903, the target programming model is solved by utilizing the high solution efficiency of the primal-dual solution method to improve the solution rate of the mixed integer linear programming model; in addition, in the dual iterative solution process, the step size is iteratively generated by utilizing the step size weight constraint and the primal weight norm function, thereby ensuring that the generated target primal step size and target dual step size converge during the data processing of the target programming model, and utilizing the generated target primal step size and target dual step size to iteratively solve and update the dual variables and primal variables to improve the accuracy of the feasible solution obtained by solving the mixed integer linear programming model.

[0156] In some embodiments, after obtaining a feasible solution x of the target programming model,* After that, the feasible solution x * The result is transmitted back to the CPU processing unit and the space of the video memory unit of the GPU processing unit in this dual iteration is released to facilitate the next dual iteration solution.

[0157] Then, in the CPU processing unit, the obtained feasible solution x * Execute the fixed-propagation process to convert it into an integer solution x%. The fixed-propagation process converts the feasible solution x into an integer solution x by rounding. * The integer variables with decimal values ​​are fixed to integers within their feasible domains, and then the propagation process is performed, and this is repeated until all variables of this type are fixed, or a feasible domain becomes an empty domain and infeasibility is detected.

[0158] In some embodiments, the GPU processing unit performs dual iterative solution to obtain a feasible solution x of the target programming model. * After that, we can also avoid the need to convert the feasible solution x * Instead of returning the solution to the CPU, the GPU performs the fix-propagation process directly to convert the feasible solution x * Mapping to integer solutions Then for the feasible solution x * and integer solutions When the feasible solution and the integer solution are not equal, based on the integer solution and feasible solution x * The distance norm between The updated model corresponding to the target programming model is obtained so that the updated model can be used as the target programming model for subsequent iteration until the feasible solution and the integer solution are equal, and a more accurate target feasible solution is obtained. The following will further describe how to obtain the updated model corresponding to the target programming model based on the distance norm between the integer solution and the feasible solution.

[0159] Reference Fig.10 , based on the distance norm between the integer solution and the feasible solution, an updated model corresponding to the target programming model is obtained, including the following steps 1001 to 1002.

[0160] Step 1001: Accumulate all distance norms to obtain an accumulated norm.

[0161] Step 1002: Based on the convex combination of the cumulative norm and the first constraint parameter, an updated objective function is obtained, and based on the updated objective function, an initial objective function in the target programming model is updated to obtain an updated model.

[0162] Steps 1001 to 1002 are described in detail below.

[0163] In some embodiments, first, the integer solution in the current iteration is accumulated. and feasible solution x * The distance norms between all the distances are summed up to get the cumulative norm as shown in the following formula (9).

[0164]

[0165] Then, the initial objective function in the objective programming model (3) is replaced based on the cumulative norm (9) to obtain a new objective programming model as shown in the following formula (10).

[0166]

[0167] Next, based on the convex combination of the cumulative norm (9) and the first constraint parameter c, the updated objective function is obtained as shown in the following formula (11).

[0168]

[0169] where α 0 ∈[0,1], yes With x * The Euclidean norm between .

[0170] Then, the objective function in the new objective programming model (10) is replaced based on the updated objective function (ie, the initial objective function in the objective programming model (3) is replaced) to obtain an updated model.

[0171] Next, the updated model is used as the target planning model for iteration until the feasible solution and the integer solution are equal, and then the loop is exited to obtain a target feasible solution with higher accuracy.

[0172] Through the above steps 1001 to 1002, the initial objective function in the target programming model is replaced by utilizing the cumulative norm generated by the distance norms between multiple feasible solutions and integer solutions, and combining the convex combination between the first constraint parameters to update the target programming model, so that when the updated target programming model is used for solving, the values ​​of the feasible solutions and integer solutions obtained are closer, so as to improve the solution accuracy of the mixed integer linear programming model.

[0173] In some embodiments, since the solution method of the integer linear programming model proposed in the present application is based on loop iteration, there is a possibility of falling into the local optimal loop result, so that the global optimal feasible solution cannot be found, which reduces the quality of the solution. Therefore, in order to improve the solution accuracy of the mixed integer linear programming model, it is necessary to increase the random perturbation factor in the loop iterative solution process to call out the local optimal loop. How to increase the random perturbation factor will be further described below.

[0174] Reference Fig.11 , the updated model is used as the target programming model for iteration until the feasible solution and the integer solution are equal, and the target feasible solution is obtained, including the following steps 1101 to 1104.

[0175] Step 1101: Iterate the target programming model until the feasible solution and the integer solution are equal.

[0176] Step 1102: Obtain a deviation vector between a feasible solution and an integer solution, select a preset adjustment number of vector elements from the deviation vector for random adjustment, and obtain an adjusted deviation vector.

[0177] Step 1103: Generate an adjustment value interval based on a preset adjustment quantity, and generate an adjustment value based on the adjustment value interval. According to the vector element order of the adjustment deviation vector, select vector elements of a quantity matching the adjustment value from the adjustment deviation vector for adjustment, and generate an updated integer solution based on the updated adjustment deviation vector.

[0178] Step 1104: using the updated integer solution, iterate the target programming model until the number of iterations reaches the preset dual iteration number, and take the feasible solution as the target feasible solution.

[0179] Steps 1101 to 1104 are described in detail below.

[0180] In some embodiments, during the iterative loop solving process of the target programming model, when the feasible solution and the integer solution are equal, the feasible solution x of the current iteration is obtained. * ′ and the deviation vector between the integer solution of the previous iteration, and then select a preset adjustment number (i.e., T) of vector elements from the deviation vector for random perturbation adjustment, and use the deviation vector after random perturbation adjustment as the adjusted deviation vector.

[0181] Next, based on the preset adjustment quantity (i.e., T), an adjustment value interval [T / 2, 3T / 2] is generated, and based on the adjustment value interval [T / 2, 3T / 2], an adjustment value TT is generated. According to the order of the vector elements of the adjustment deviation vector, vector elements matching the number of the adjustment value TT are selected from the adjustment deviation vector in the sorted order for adjustment (i.e., random transformation or random flipping), and an updated integer solution is generated according to the updated adjustment deviation vector. Then based on the updated integer solution Then, the target programming model is updated through the related steps of steps 1001 to 1002, and the updated target programming model is used to perform iterative loop solving until the number of iterations reaches the preset number of dual iterations, and the current feasible solution is used as the target feasible solution.

[0182] After obtaining the target feasible solution, the target feasible solution is transferred from the GPU processing unit to the CPU processing unit and recorded as x* (j) and perform an iterative solution process of the mixed integer linear programming model for the next parameter strategy.

[0183] It can be understood that the mixed integer linear programming model provided in the present application can utilize a GPU processing unit to iteratively solve the mixed integer linear programming model of M parameter strategies at the same time.

[0184] In some implementations, during the iterative solution process of the mixed integer linear programming model with multiple parameter strategies, after the preset loop condition is met, the migration topology is used to optimize and update all the searched feasible solutions of the mixed integer linear programming model, guiding all the search results to move towards a higher quality feasible solution (i.e., Figure 5 The migration topology is as follows: Figure 5 The ring structure shown in FIG. 1 is used to optimize and update the feasible solutions searched by each heuristic. The optimization and update refers to the synchronization of the feasible solutions obtained by all heuristics during the search process by the designated master heuristic, and the allocation of the best feasible solution to each heuristic. The preset loop condition refers to the completion of the iteration of the heuristic algorithm of round ζ (each execution of M heuristics is called a round), and the selected best feasible solution is updated after the previous migration.

[0185] Step 203: Using the GPU processing unit to send the target feasible solution to the CPU processing unit, and using the CPU processing unit to obtain a solution result of the mixed integer linear programming model based on the target feasible solution.

[0186] The following is a detailed description of step 203.

[0187] In some embodiments, after the last loop termination condition is met, the GPU processing unit is used to send the final target feasible solution to the CPU processing unit, and the CPU processing unit is used to obtain the solution result of the mixed integer linear programming model based on the target feasible solution.

[0188] Reference Fig.12 , is a schematic diagram of a heuristic two-layer parallel implementation structure provided by an embodiment of the present application. Fig.12 As shown, the structure includes a linear programming parallel solution module and a stream parallel heuristic module, wherein: the linear programming parallel solution module makes a finite precision call to the primal-dual hybrid gradient algorithm, and accelerates the acquisition of the feasible solution of the linear programming by calculating the matrix-vector multiplication through the GPU processing unit; the stream parallel heuristic module is based on the linear programming parallel solution module and the fixed-propagation process, executes multiple heuristic solution paths according to different control parameters and executes them on the GPU processing unit in a certain sequence structure, and at the same time regularly optimizes the feasible solution through the migration transfer strategy, guiding all search results to move towards a higher quality feasible solution.

[0189] Reference Fig.13 , is a schematic diagram of the structure of a linear programming parallel solution module provided in an embodiment of the present application, such as Fig.13 As shown, the linear programming parallel solution module includes: a first-order algorithm unit and a CUDA grid execution unit, wherein: the first-order algorithm unit performs a finite precision call on the primal-dual hybrid gradient algorithm, implements an iterative process by executing a large number of matrix-vector operations, and obtains a feasible solution to the linear programming; the CUDA grid execution unit allocates a thread to each vector-vector multiplication in the matrix-vector operation according to the grid division of the current linear programming model, realizes parallel computing, and accelerates the acquisition of feasible solutions to the linear programming.

[0190] Reference Fig.14 , is a schematic diagram of a timeline of a CPU processing unit provided by an embodiment of the present application. The stream parallel heuristic module includes: a stream parallel feasibility pump unit and a migration transfer unit, wherein the stream parallel feasibility pump unit executes feasibility pump algorithms of multiple different paths on the GPU processing unit through a stream parallel structure to achieve computational overlap on the CPU and GPU. The timeline of the CPU processing unit is shown in FIG. Figure 3 As shown; the migration transfer unit regularly optimizes the existing feasible solutions under different paths according to the feasible solutions searched out by each feasible pump path, and guides all search results to move towards higher quality feasible solutions.

[0191] Compared with the prior art, the present application introduces the solution process of the primal-dual linear programming in the projection step of the target feasibility pump algorithm, so that the target feasibility pump algorithm has higher efficiency when searching for feasible solutions to large-scale mixed integer linear programming problems. At the same time, the parallel implementation of the primal-dual linear programming is used to further accelerate the solution process. By implementing the above-mentioned steps 201 to 202 as a stream parallel structure, the memory read operation is overlapped with the CUDA grid execution, and the frequent data transmission between the CPU processing unit and the GPU processing unit is effectively avoided. In addition, the present application introduces the migration transfer strategy of the knowledge synchronization structure, synchronizes the knowledge obtained by all heuristics in the search process with the main heuristic specified in the stream parallel heuristic, and distributes the best feasible solution in other heuristics, guiding all search results to move towards a higher quality feasible solution. While ensuring the quality of the feasible solution, the convergence of the algorithm is further accelerated. The present application can effectively achieve the rapid convergence of large-scale mixed integer linear programming problems.

[0192] The mixed integer linear programming model solving method and related equipment proposed in the embodiment of the present application, the method comprises: first, copying the pageable memory corresponding to the mixed integer linear programming model in the CPU processing unit to the fixed memory, transferring the mixed integer linear programming model from the fixed memory to the video memory unit of the GPU processing unit through the DMA mechanism, obtaining multiple parameter strategies of the mixed integer linear programming model, selecting the target parameter strategy one by one from the multiple parameter strategies, and obtaining the initial feasible solution of the current target parameter strategy based on the target feasible solution of the previous target parameter strategy, copying the initial feasible solution, the target parameter strategy and the mixed integer linear programming model from the CPU processing unit to the GPU processing unit for processing, and updating the mixed integer linear programming model based on the initial feasible solution and the target parameter strategy to obtain an updated mixed integer linear programming model, performing integer relaxation on the updated mixed integer linear programming model to obtain an iterative linear programming model;Then, the step factor parameter and the original weight parameter are obtained in the GPU processing unit, and the step size is updated based on the step factor parameter, the original weight parameter, the original variable and the dual variable. The step size update step includes generating an original weight norm function based on the second norm of the original variable, the second norm of the dual variable and the original weight parameter, generating a step weight constraint based on the difference between the original weight parameter of the current step size iteration and the original weight parameter of the previous step size iteration, the original weight norm function, the iterative difference of the original variable, the iterative difference of the dual variable and the step factor parameter, generating a target step factor and a target original weight based on the step weight constraint, generating an original step based on the ratio of the target step factor to the target original weight, and generating a step weight constraint based on the target step factor and the target original weight. The product of the initial weights generates a dual step, the step of updating the step size is repeated multiple times to update the original step size and the dual step size multiple times, and the updated original step size is used as the target original step size, and the updated dual step size is used as the target dual step size, based on the difference between the first constraint parameter and the product of the second constraint parameter and the dual variable, and multiplied by the target original step size, the original reference value is obtained, and based on the mapping relationship between the original variable and the original reference value difference, the original variable update function is obtained, based on the difference between the updated original variable and the original variable, the original variable update difference is obtained, based on the difference between the third constraint parameter and the product of the second constraint parameter and the original variable update difference, and multiplied by the target dual step size, the dual reference value is obtained, and based on the original variable and the original reference value The dual variable update function is obtained by the mapping relationship of the accumulated values, the original variables are updated based on the target step size and the original variable update function, the dual variables are updated based on the target step size and the dual variable update function, the target step size is updated using the updated original variables and dual variables to obtain the updated target step size, and the updated target step size is used as the target step size to iterate the original variables and the dual variables until the updated original variables meet the first precision condition, the updated original variables are used as the feasible solution, the feasible solution is mapped to an integer solution, when the feasible solution and the integer solution are not equal, all distance norms are accumulated to obtain the accumulated norm, based on the convex combination of the accumulated norm and the first constraint parameter, the updated objective function is obtained, and the initial objective function in the target programming model is updated based on the updated objective function, and the result is obtained. to the update model, iterate the target programming model until the feasible solution and the integer solution are equal, obtain the deviation vector between the feasible solution and the integer solution, select a preset adjustment number of vector elements from the deviation vector for random adjustment to obtain an adjusted deviation vector, generate an adjustment value interval based on the preset adjustment number, and generate an adjustment value based on the adjustment value interval, select a number of vector elements matching the adjustment value from the adjustment deviation vector according to the vector element sequence of the adjustment deviation vector, and generate an updated integer solution according to the updated adjustment deviation vector, iterate the target programming model using the updated integer solution until the number of iterations reaches the preset dual iteration number, take the feasible solution as the target feasible solution, and the initial value of the target programming model is the iterative linear programming model;Finally, the GPU processing unit is used to send the target feasible solution to the CPU processing unit, and the CPU processing unit is used to obtain the solution result of the mixed integer linear programming model based on the target feasible solution. ;

[0193] The embodiment of the present application utilizes the PCI-Express bus and direct memory access mechanism that provide a high-bandwidth data transmission channel to completely copy the mixed integer linear programming model from the CPU processing unit to the GPU processing unit, thereby fully utilizing the parallel processing capability of the GPU and accelerating the solution process of the mixed integer linear programming model; and, utilizing the solution result of the mixed integer linear programming model with the previous target parameter strategy as the main heuristic, updating the mixed integer linear programming model corresponding to the current target transmission strategy, thereby utilizing the updated mixed integer linear programming model to perform a relaxed iterative linear programming model to perform data solution, which can effectively guide the iterative loop solution process to a higher quality feasible solution, thereby improving the solution accuracy of the mixed integer linear programming model; and, utilizing the GPU processing unit to perform a dual iterative solution on the iterative linear programming model after the mixed integer linear programming model is relaxed, so as to overcome the situation where the mixed integer linear programming model cannot be directly solved on the GPU processing unit. The invention discloses a method for solving a mixed integer linear programming model based on a relaxed iterative linear programming model, and then using the high data processing performance of the GPU processing unit to effectively improve the rate of solving the mixed integer linear programming model. In the iterative process, the iterative linear programming model is updated based on the distance norm between the integer solution and the feasible solution, so that the relaxed iterative linear programming model can be close to the mixed integer linear programming model, so as to maintain the accuracy of the solution result of the mixed integer linear programming model obtained by solving the iterative linear programming model, thereby effectively improving the solution rate of the mixed integer linear programming model while ensuring the high accuracy of the solution result of the mixed integer linear programming model. At the same time, by using the cumulative norm generated by the distance norm between multiple feasible solutions and the integer solution, and combining the convex combination between the first constraint parameters, the initial objective function in the target programming model is replaced to update the target programming model, so that when the updated target programming model is used for solving, the numerical values ​​between the feasible solution and the integer solution are closer, so as to improve the solution accuracy of the mixed integer linear programming model.

[0194] The embodiment of the present application also provides a mixed integer linear programming model solving device for a processing device, which can implement the mixed integer linear programming model solving method described above, referring to Fig.15 , the device 1500 comprises:

[0195] A copy relaxation module 1510 is used to copy the mixed integer linear programming model of the CPU processing unit to the GPU processing unit, and perform integer relaxation on the mixed integer linear programming model in the GPU processing unit to obtain an iterative linear programming model;

[0196] The data processing module 1520 is used to perform dual iterative solution on the target programming model in the GPU processing unit to generate a feasible solution, map the feasible solution to an integer solution, and when the feasible solution and the integer solution are not equal, obtain an update model corresponding to the target programming model based on the distance norm between the integer solution and the feasible solution, and iterate the updated model as the target programming model until the feasible solution and the integer solution are equal to obtain a target feasible solution, and the initial value of the target programming model is an iterative linear programming model;

[0197] The result output module 1530 is used to send the target feasible solution to the CPU processing unit by using the GPU processing unit, and obtain the solution result of the mixed integer linear programming model based on the target feasible solution by using the CPU processing unit.

[0198] In some embodiments, the copy relaxation module 1510 is further configured to:

[0199] Copy the pageable memory corresponding to the mixed integer linear programming model in the CPU processing unit to the fixed memory;

[0200] The mixed integer linear programming model is transferred from the fixed memory to the video memory unit of the GPU processing unit through the DMA mechanism.

[0201] In some embodiments, the copy relaxation module 1510 is further configured to:

[0202] Get multiple parameter strategies for mixed integer linear programming models;

[0203] Selecting a target parameter strategy from multiple parameter strategies one by one, and obtaining an initial feasible solution of the current target parameter strategy based on the target feasible solution of the previous target parameter strategy;

[0204] The initial feasible solution, target parameter strategy, and mixed integer linear programming model are copied from the CPU processing unit to the GPU processing unit for processing.

[0205] In some embodiments, the data processing module 1520 is further configured to:

[0206] The mixed integer linear programming model is updated based on the initial feasible solution and the target parameter strategy to obtain an updated mixed integer linear programming model;

[0207] The updated mixed integer linear programming model is integer relaxed to obtain an iterative linear programming model.

[0208] In some embodiments, the data processing module 1520 is further configured to:

[0209] Obtain the step factor parameter and the original weight parameter, perform step iteration based on the step factor parameter, the original weight parameter, the original variable and the dual variable to generate the target step size;

[0210] Obtaining an original variable update function and a dual variable update function, updating the original variable based on the target step size and the original variable update function, updating the dual variable based on the target step size and the dual variable update function, updating the target step size using the updated original variable and the dual variable to obtain an updated target step size, and iterating the original variable and the dual variable using the updated target step size as the target step size until the updated original variable meets the first precision condition;

[0211] The updated original variables are taken as feasible solutions.

[0212] In some embodiments, the data processing module 1520 is further configured to:

[0213] The step size is updated based on the step size factor parameter, the original weight parameter, the original variable and the dual variable. The steps of the step size update include:

[0214] Generate an original weight norm function based on the second norm of the original variable, the second norm of the dual variable and the original weight parameter;

[0215] Generate a step weight constraint based on the difference between the original weight parameter of the current step iteration and the original weight parameter of the previous step iteration, the original weight norm function, the iterative difference of the original variable, the iterative difference of the dual variable, and the step factor parameter;

[0216] Generate a target step factor and a target original weight based on the step weight constraint, generate an original step based on the ratio of the target step factor and the target original weight, and generate a dual step based on the product of the target step factor and the target original weight;

[0217] Repeat the steps of performing multiple step size updates to update multiple primal step sizes and dual step sizes, and use the updated primal step size as the target primal step size, and use the updated dual step size as the target dual step size.

[0218] In some embodiments, the data processing module 1520 is further configured to:

[0219] Based on the difference between the first constraint parameter and the product of the second constraint parameter and the dual variable, and multiplying by the target original step length, an original reference value is obtained, and based on the mapping relationship between the difference between the original variable and the original reference value, an original variable update function is obtained;

[0220] Based on the difference between the updated original variable and the original variable, the updated difference of the original variable is obtained;

[0221] Based on the difference between the third constraint parameter and the product of the second constraint parameter and the original variable update difference, and multiplying by the target dual step size, a dual reference value is obtained, and based on the mapping relationship between the original variable and the accumulated value of the original reference value, a dual variable update function is obtained.

[0222] In some embodiments, the data processing module 1520 is further configured to:

[0223] Accumulate all distance norms to get the cumulative norm;

[0224] Based on the convex combination of the cumulative norm and the first constraint parameter, an updated objective function is obtained, and based on the updated objective function, an initial objective function in the target programming model is updated to obtain an updated model.

[0225] In some embodiments, the data processing module 1520 is further configured to:

[0226] Iterate the target programming model until the feasible solution and the integer solution are equal;

[0227] Obtaining a deviation vector between a feasible solution and an integer solution, selecting a preset adjustment number of vector elements from the deviation vector for random adjustment, and obtaining an adjusted deviation vector;

[0228] Generate an adjustment value interval based on a preset adjustment quantity, generate an adjustment value based on the adjustment value interval, select vector elements of a number matching the adjustment value from the adjustment deviation vector according to the vector element sequence of the adjustment deviation vector for adjustment, and generate an updated integer solution according to the updated adjustment deviation vector;

[0229] The target programming model is iterated by updating the integer solution until the number of iterations reaches the preset number of dual iterations, and the feasible solution is taken as the target feasible solution.

[0230] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, the specific implementation method of the mixed integer linear programming model solving device of the processing device is basically the same as the specific implementation method of the above mixed integer linear programming model solving method, and will not be repeated here.

[0231] In an embodiment of the present application, a mixed integer linear programming model solving device of a processing device utilizes a PCI-Express bus and a direct memory access mechanism that provide a high-bandwidth data transmission channel to completely copy the mixed integer linear programming model from a CPU processing unit to a GPU processing unit, thereby making full use of the parallel processing capability of the GPU and accelerating the solution process of the mixed integer linear programming model; and, utilizing the solution result of the mixed integer linear programming model with the previous target parameter strategy as the main heuristic, updating the mixed integer linear programming model corresponding to the current target transmission strategy, thereby utilizing the updated mixed integer linear programming model to perform a relaxed iterative linear programming model to perform data solution, which can effectively guide the iterative loop solution process to a higher quality feasible solution, thereby improving the solution accuracy of the mixed integer linear programming model; and utilizing the GPU processing unit to perform a dual iterative solution on the iterative linear programming model after the mixed integer linear programming model is relaxed, so as to overcome the problem that the mixed integer linear programming model cannot be directly processed on the GPU. The invention solves the problem of directly solving the problem on the processing unit, and then uses the high data processing performance of the GPU processing unit to effectively improve the rate of solving the mixed integer linear programming model, and in the iterative process, updates the iterative linear programming model based on the distance norm between the integer solution and the feasible solution, so that the relaxed iterative linear programming model can be close to the mixed integer linear programming model, so as to maintain the accuracy of the solution result of the mixed integer linear programming model obtained by the iterative linear programming model, and then effectively improves the solution rate of the mixed integer linear programming model while ensuring the high accuracy of the solution result of the mixed integer linear programming model; at the same time, by using the cumulative norm generated by the distance norm between multiple feasible solutions and integer solutions, and combining the convex combination between the first constraint parameters, the initial objective function in the target programming model is replaced to update the target programming model, so that when the updated target programming model is used for solving, the numerical values ​​between the feasible solution and the integer solution are closer, so as to improve the solution accuracy of the mixed integer linear programming model.

[0232] The present application also provides an electronic device, including:

[0233] at least one memory;

[0234] at least one processor;

[0235] at least one program;

[0236] The program is stored in the memory, and the processor executes the at least one program to implement the mixed integer linear programming model solving method implemented in the present application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.

[0237] See also Fig.16 , Fig.16 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0238] The CPU processing unit 1601 and the GPU processing unit 1606 are used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0239] The memory 1602 can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device or RAM (Random Access Memory). The memory 1602 can store operating systems and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1602, and the CPU processing unit 1601 and the GPU processing unit 1606 are called to execute the mixed integer linear programming model solving method of the embodiment of the present application;

[0240] Input / output interface 1603, used to implement information input and output;

[0241] The communication interface 1604 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0242] Bus 1605 , which transmits information between various components of the device (e.g., CPU processing unit 1601 , GPU processing unit 1606 , memory 1602 , input / output interface 1603 , and communication interface 1604 );

[0243] The CPU processing unit 1601 , the GPU processing unit 1606 , the memory 1602 , the input / output interface 1603 and the communication interface 1604 are connected to each other in communication within the device via the bus 1605 .

[0244] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned mixed integer linear programming model solving method is implemented.

[0245] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0246] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0247] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0248] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0249] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0250] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present 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 data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0251] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0252] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0253] The units described above 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0254] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0255] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, 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 multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0256] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for solving a mixed integer linear programming model, characterized in that: include: The mixed integer linear programming model of the CPU processing unit is copied to the GPU processing unit, and the mixed integer linear programming model is integer relaxed in the GPU processing unit to obtain an iterative linear programming model; In the GPU processing unit, a dual iterative solution is performed on the target programming model to generate a feasible solution, the feasible solution is mapped to an integer solution, and when the feasible solution and the integer solution are not equal, an update model corresponding to the target programming model is obtained based on the distance norm between the integer solution and the feasible solution, and the updated model is used as the target programming model for iteration until the feasible solution and the integer solution are equal to obtain a target feasible solution, wherein the initial value of the target programming model is the iterative linear programming model; The GPU processing unit is used to send the target feasible solution to the CPU processing unit, and the CPU processing unit is used to obtain a solution result of the mixed integer linear programming model based on the target feasible solution.

2. The mixed integer linear programming model solving method according to claim 1, characterized in that: The step of copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit includes: Copying the pageable memory corresponding to the mixed integer linear programming model in the CPU processing unit to the fixed memory; The mixed integer linear programming model is transferred from the fixed memory to the video memory unit of the GPU processing unit through a DMA mechanism.

3. The mixed integer linear programming model solving method according to claim 1, characterized in that: The step of copying the mixed integer linear programming model of the CPU processing unit to the GPU processing unit further includes: Obtaining multiple parameter strategies of the mixed integer linear programming model; Selecting a target parameter strategy from the plurality of parameter strategies one by one, and obtaining an initial feasible solution of the current target parameter strategy based on a target feasible solution of a previous target parameter strategy; The initial feasible solution, the target parameter strategy and the mixed integer linear programming model are copied from the CPU processing unit to the GPU processing unit for processing.

4. The mixed integer linear programming model solving method according to claim 3, characterized in that: The step of performing integer relaxation on the mixed integer linear programming model on the GPU processing unit to obtain an iterative linear programming model comprises: Based on the initial feasible solution and the target parameter strategy, the mixed integer linear programming model is updated to obtain an updated mixed integer linear programming model; The updated mixed integer linear programming model is integer relaxed to obtain the iterative linear programming model.

5. The mixed integer linear programming model solving method according to claim 1, characterized in that: The iterative linear programming model includes primal variables and dual variables, and the target programming model is solved by dual iteration to generate a feasible solution, including: Obtaining a step factor parameter and an original weight parameter, performing step iteration based on the step factor parameter, the original weight parameter, the original variable and the dual variable to generate a target step size; Obtaining a primitive variable update function and a dual variable update function, updating the primitive variable based on the target step size and the primitive variable update function, updating the dual variable based on the target step size and the dual variable update function, updating the target step size using the updated primitive variable and the dual variable to obtain an updated target step size, and iterating the primitive variable and the dual variable using the updated target step size as the target step size until the updated primitive variable meets a first precision condition; The updated original variables are used as the feasible solution.

6. The mixed integer linear programming model solving method according to claim 5, characterized in that: The target step size includes a target original step size and a target dual step size, and the step size iteration is performed based on the step size factor parameter, the original weight parameter, the original variable and the dual variable to generate the target step size, including: Based on the step factor parameter, the original weight parameter, the original variable and the dual variable, the step size update is performed, and the step of the step size update comprises: generating an original weight norm function based on the second norm of the original variable, the second norm of the dual variable and the original weight parameter; Generate a step weight constraint based on the difference between the original weight parameter of the current step iteration and the original weight parameter of the previous step iteration, the original weight norm function, the iterative difference of the original variable, the iterative difference of the dual variable, and the step factor parameter; Generate a target step size factor and a target original weight based on the step size weight constraint, generate an original step size based on the ratio of the target step size factor and the target original weight, and generate a dual step size based on the product of the target step size factor and the target original weight; Repeat the step of updating the step length multiple times to update the original step length and the dual step length multiple times, and use the updated original step length as the target original step length, and use the updated dual step length as the target dual step length.

7. The method for solving the mixed integer linear programming model according to claim 5, characterized in that: The iterative linear programming model includes a first constraint parameter, a second constraint parameter and a third constraint parameter, and the obtaining of the original variable update function and the dual variable update function includes: Based on the difference between the first constraint parameter and the product of the second constraint parameter and the dual variable, and multiplying by the target original step size, an original reference value is obtained, and based on the mapping relationship between the original variable and the difference between the original reference value, the original variable update function is obtained; Based on the difference between the updated original variable and the original variable, obtaining an updated difference of the original variable; Based on the difference between the third constraint parameter and the product of the second constraint parameter and the original variable update difference, and multiplied by the target dual step, a dual reference value is obtained, and based on the mapping relationship between the original variable and the accumulated value of the original reference value, the dual variable update function is obtained.

8. The method for solving the mixed integer linear programming model according to claim 1, characterized in that: The iterative linear programming model includes an initial objective function, the initial objective function includes a first constraint parameter, and the updating model corresponding to the target programming model is obtained based on the distance norm between the integer solution and the feasible solution, including: Accumulating all the distance norms to obtain an accumulated norm; Based on the convex combination of the cumulative norm and the first constraint parameter, an updated objective function is obtained, and based on the updated objective function, the initial objective function in the target programming model is updated to obtain the updated model.

9. The mixed integer linear programming model solving method according to claim 1, characterized in that: The step of iterating the updated model as the target programming model until the feasible solution and the integer solution are equal to obtain a target feasible solution comprises: Iterating the target programming model until the feasible solution is equal to the integer solution; Obtaining a deviation vector between the feasible solution and the integer solution, and selecting a preset adjustment number of vector elements from the deviation vector for random adjustment to obtain an adjusted deviation vector; Generate an adjustment value interval based on the preset adjustment quantity, generate an adjustment value based on the adjustment value interval, select vector elements matching the adjustment value from the adjustment deviation vector according to the vector element sequence of the adjustment deviation vector for adjustment, and generate an updated integer solution according to the updated adjustment deviation vector; The target programming model is iterated using the updated integer solution until the number of iterations reaches a preset number of dual iterations, and the feasible solution is used as the target feasible solution.

10. An electronic device comprising a memory, a CPU processing unit and a GPU processing unit, wherein the memory stores a computer program, characterized in that: When the CPU processing unit and the GPU processing unit execute the computer program, the mixed integer linear programming model solving method described in any one of claims 1 to 9 is implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the mixed integer linear programming model solving method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Method and device for solving linear programming problem based on operation planning large model, equipment and storage medium

    CN119358688A