Matching method, device and equipment and readable storage medium
By acquiring and combining the multi-dimensional properties of the homo-sum coil, and using genetic algorithms to optimize the matching process, the problem of matching accuracy and inefficiency in traditional methods is solved, and more accurate and efficient matching is achieved, satisfying the rapid response and The demand for efficient logistics.
Patent Information
- Application Number
- CN202411288862.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-27
AI Technical Summary
The traditional steel coil and contract matching method is difficult to fully and accurately grasp the interaction between multiple factors, resulting in inaccuracy and inefficiency of matching, which increases logistics costs and reduces customer satisfaction.
By obtaining multi-dimensional attribute parameters, grouping and sorting of contracts and steel coils, establishing mapping relationships, and using genetic algorithms to optimize the matching process, establishing mathematical models to achieve optimal matching results.
It significantly improves the matching accuracy and computing speed, reduces the complexity of the algorithm, and makes large-scale and multi-dimensional data processing become real-time and efficient, meeting the steel industry's demand for fast response and efficient logistics, reducing logistics problems and improving customers Satisfaction.
Smart Images

Figure CN119205021A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of logistics supply chain technology, and in particular to a matching method, device, equipment and readable storage medium. Background Art
[0002] Traditional methods of matching steel coils with contracts mainly rely on manual decision-making or simple rules, but these methods have significant limitations in practical applications. Steel coil products have complex and diverse properties, including specifications, weight, material, transportation destination and delivery period, and customer needs are highly diversified and dynamic. Traditional matching methods are difficult to fully and accurately grasp the interaction between these multiple factors, thus affecting the accuracy and effect of matching.
[0003] In addition, when faced with large-volume, multi-dimensional combinations of steel coils and contract data, traditional matching methods are often computationally inefficient and difficult to achieve real-time, accurate optimal matching. This can lead to problems such as overloading, empty runs, and delays during actual transportation, which not only increases logistics costs but also reduces customer satisfaction.
[0004] In summary, how to effectively solve the problem of matching contracts with steel coils is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0005] The purpose of this application is to provide a matching method, device, equipment and readable storage medium, which solves the problem of matching contracts with steel coils by comprehensively analyzing the multi-dimensional attributes of steel coil goods and combining them with the specific requirements of the contract.
[0006] In order to solve the above technical problems, this application provides the following technical solutions:
[0007] A matching method, comprising:
[0008] Obtain the contract parameters of the existing contract and the steel coil parameters of the stock steel coil; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material;
[0009] Grouping the existing contracts according to the specifications and materials in the contract parameters to obtain a plurality of contract groups, and sorting the contracts in the contract groups according to the delivery time;
[0010] According to the specifications and materials in the steel coil parameters, the stock steel coils are grouped to obtain a plurality of steel coil groups;
[0011] Establishing a mapping relationship between the contract group and the steel coil group having the same specification and material;
[0012] According to the grouping order, each contract group and the steel coil group with a mapping relationship are matched with each other in turn, and the upper and lower weight limits are used as constraints to obtain the steel coil contract matching result.
[0013] Preferably, in accordance with the grouping order, each contract group and the steel coil group having a mapping relationship are sequentially matched with the upper and lower weight limits as constraints to obtain a steel coil contract matching result, including:
[0014] According to the grouping order, determine the current contract group;
[0015] Establishing a one-dimensional vector of contract weights of the current contract group;
[0016] Establishing a one-dimensional vector of steel coil weight of a target steel coil group having a mapping relationship with the current contract group;
[0017] Establishing a two-dimensional matrix corresponding to the current contract group and the target steel coil group;
[0018] According to the weight upper and lower limit ratio relationship of the current contract group, an upper limit one-dimensional vector is established;
[0019] Combining the one-dimensional vector of the contract weight, the one-dimensional vector of the steel coil weight, the two-dimensional matrix and the one-dimensional vector of the upper limit, a mathematical model for matching the contract with the steel coil is established;
[0020] Based on the genetic algorithm, an optimal solution is obtained for the objective function in the mathematical model;
[0021] The optimal solution is used to determine the steel coil contract matching result.
[0022] Preferably, a two-dimensional matrix corresponding to the current contract group and the target steel coil group is established, including:
[0023] The two-dimensional matrix is established by taking the number of contracts in the current contract group as rows and the number of steel coils in the steel coil group having a mapping relationship with the current contract group as columns;
[0024] Each row in the two-dimensional matrix M represents a contract, each column represents a steel coil, and M[i][j]=1 indicates that the i-th contract matches the j-th steel coil, otherwise it is 0.
[0025] Preferably, a mathematical model for matching contracts with steel coils is established by combining the one-dimensional vector of contract weight, the one-dimensional vector of steel coil weight, the two-dimensional matrix and the one-dimensional vector of upper limit, including:
[0026] The mathematical model is established by combining the one-dimensional vector of the contract weight, the one-dimensional vector of the steel coil weight, the two-dimensional matrix and the one-dimensional vector of the upper limit; wherein the mathematical model includes:
[0027] Contract matching ratio: R C =MS T / C T
[0028]
[0029] Matching weight ratio:
[0030] Objective function: max R = ΣR C ×R S
[0031] Among them, the one-dimensional vector of contract weight is C, the one-dimensional vector of steel coil weight is S, the two-dimensional matrix is M, and the upper limit one-dimensional vector is L;
[0032] MS T Indicates the total weight of each steel coil in each contract when M matches, R C Represents the completion ratio of each contract under the current M matching situation;
[0033] If R C is greater than the upper limit of each contract, then R C is 0, otherwise unchanged;
[0034] R C XC T Represents the contract matching weight of each contract after filtering. Represents the total weight of the mapped steel coil group, R S Represents the proportion of each contract matching weight to the total weight of the steel coil group after filtering;
[0035] R C ×R S Represents the product of the completed contract ratio of each contract after filtering and the ratio of the total weight of the steel coil group. R represents all R c ×R S of and;
[0036] max R represents the optimal solution to the objective function.
[0037] Preferably, based on a genetic algorithm, obtaining an optimal solution for the objective function in the mathematical model includes:
[0038] Randomly generate N two-dimensional random matrices of the same size as M, calculate the first maximum value of each column in each of the two-dimensional random matrices to be 1, and the rest to be 0, and the initial M matches the population;
[0039] From N two-dimensional random matrices, determine the first N1 two-dimensional random matrices with the largest R value;
[0040] Genetic operations are performed on N1 two-dimensional random matrices until a termination condition is met, thereby obtaining an optimal solution to the objective function.
[0041] Preferably, performing genetic operations on N1 two-dimensional random matrices includes:
[0042] Randomly select two two-dimensional random matrices from N1 two-dimensional random matrices, randomly select several columns from each two-dimensional random matrix for replication, exchange the index columns corresponding to the replicated columns of the two two-dimensional random matrices, and generate two new sub-two-dimensional random matrices;
[0043] A mutation operation is performed on the sub-two-dimensional random matrix with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix.
[0044] Preferably, performing a mutation operation on the sub-two-dimensional random matrix with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix includes:
[0045] For the two-dimensional random matrix, randomly select several columns and determine whether to mutate the current column to 0 or 1 according to the preset mutation probability;
[0046] If so, the position that is currently 1 in the column is changed to 0, and a 0 position is randomly selected in the column and changed to 1 or remains unchanged, to obtain the mutated sub-two-dimensional random matrix.
[0047] A matching device, comprising:
[0048] A parameter acquisition module is used to acquire the contract parameters of the existing contract and the steel coil parameters of the stock steel coil; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material;
[0049] A contract group module, used to group the existing contracts according to the specifications and materials in the contract parameters to obtain a plurality of contract groups, and sort the contracts in the contract groups according to the delivery time;
[0050] A steel coil group module, used for grouping the stock steel coils according to the specifications and materials in the steel coil parameters to obtain a plurality of steel coil groups;
[0051] A mapping establishment module, used to establish a mapping relationship between the contract group and the steel coil group having the same specifications and materials;
[0052] The matching optimization module is used to perform matching optimization processing between the contract and the steel coil according to the grouping order, and to obtain the steel coil contract matching result.
[0053] An electronic device, comprising:
[0054] Memory for storing computer programs;
[0055] A processor is used to implement the steps of the above matching method when executing the computer program.
[0056] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above matching method are implemented.
[0057] Apply the method provided in the embodiment of the present application to obtain contract parameters of existing contracts and steel coil parameters of inventory steel coils; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material; group the existing contracts according to the specifications and materials in the contract parameters to obtain a number of contract groups, and sort the contracts in the contract groups according to the delivery time; group the inventory steel coils according to the specifications and materials in the steel coil parameters to obtain a number of steel coil groups; establish a mapping relationship between the contract group and the steel coil group with the same specifications and materials; according to the grouping order, perform a matching optimization process between the contract and the steel coil for each contract group and the steel coil group with the mapping relationship, with the upper and lower weight limits as constraints, to obtain a steel coil contract matching result.
[0058] When matching contracts and steel coils, first obtain the contract parameters and steel coil parameters, then group the existing contracts based on the specifications and materials in the contract parameters, and sort the contracts in the contract group according to the delivery time, and then group the inventory steel coils according to the specifications and materials in the steel coil parameters to obtain steel coil groups. Since the grouping is based on the specifications and materials, a mapping relationship can be established between the contract group and the steel coil group with the same specifications and materials, so that according to the order of the contracts in the group, each contract group and the steel coil group with a mapping relationship are matched with the upper and lower weight limits as constraints, and the contract and steel coil matching is optimized to obtain the steel coil contract matching result.
[0059] Technical effect: The use of optimization methods such as grouping, sorting, and mapping can significantly improve the computing speed and matching accuracy. Specifically, this application can achieve more accurate and comprehensive optimization, effectively reduce the computational complexity of the algorithm, and make large-scale, multi-dimensional data processing real-time and efficient. This not only meets the steel industry's urgent need for rapid response and efficient logistics, but also reduces costs and improves customer satisfaction by reducing logistics problems.
[0060] Correspondingly, the embodiments of the present application also provide matching devices, equipment and readable storage media corresponding to the above-mentioned matching method, which have the above-mentioned technical effects and are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 This is a flowchart of an implementation of a matching method in an embodiment of the present application;
[0063] Figure 2 This is a specific implementation flow chart of a matching method in an embodiment of the present application;
[0064] Figure 3 This is a schematic diagram of the structure of a matching device in an embodiment of the present application;
[0065] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application;
[0066] Figure 5 This is a schematic diagram of the specific structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0068] Please refer to Figure 1 , Figure 1 This is a flowchart of a matching method in an embodiment of the present application, the method comprising the following steps:
[0069] S101. Obtain contract parameters of existing contracts and steel coil parameters of stock steel coils.
[0070] Among them, the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material.
[0071] Existing contracts refer to contracts that need to be matched with corresponding steel coils, and inventory steel coils refer to steel coils that have been produced but have not yet been assigned corresponding contracts.
[0072] In actual applications, contract parameters also include parameters other than specifications, weight, material, delivery time and upper and lower weight limits, such as delivery address, payment content and other information. In this embodiment, the focus is on specifications, weight, material, delivery time and upper and lower weight limits.
[0073] In actual applications, the steel coil parameters also include parameters other than specifications, weight and material, such as production date and other information. In this embodiment, the specifications, weight and material are focused on.
[0074] That is to say, in actual applications, according to specific needs, more parameter information can be obtained when obtaining contract parameters and steel coil parameters, which will not be repeated here.
[0075] S102. Group the existing contracts according to the specifications and materials in the contract parameters to obtain a plurality of contract groups, and sort the contracts in the contract groups according to the delivery time.
[0076] That is, in this embodiment, contracts are divided into several groups based on specifications and materials, and the contracts in the contract groups are sorted according to the delivery time. For example, if there are contracts 1 to 8 as shown in the following table, and the corresponding specifications and materials are as shown in the table:
[0077] Contract Number Specification Material 1 A1 B1 2 A2 B2 3 A1 B1 4 A1 B2 5 A1 B1 6 A1 B1 7 A1 B1 8 A1 B1
[0078] Contracts 1, 3, 5, 6, 7 and 8 with specification A1 and material B1 are grouped as Contract Group 1;
[0079] Contract 4 with specification A1 and material B2 is classified as contract group 2;
[0080] Contract 2 with specification A2 and material B2 is divided into contract group 3.
[0081] The above table is only for the purpose of explaining how to group based on materials and specifications, and is not intended to limit the actual situation where the contract quantity, specifications and materials are the same.
[0082] After completing the contract group, the contracts in the contract group can be sorted according to the delivery time, so that in the subsequent matching process, the most urgent contracts can be matched first. In this way, after updating the existing contracts and inventory steel coils, further optimization can be carried out to achieve the minimum error in the end.
[0083] In practical applications, contracts can be grouped into two categories:
[0084] The first grouping is done by specification and material;
[0085] The second grouping is to group the contracts in the first grouping according to the delivery time period, and sort the contract groups in the second grouping by time. The matching module can be used to give priority to matching the contract groups with urgent time. The contract groups here are the contract groups after the two groupings, and are also the contract groups that need to be mapped later.
[0086] S103. Group the stock steel coils according to the specifications and materials in the steel coil parameters to obtain a plurality of steel coil groups.
[0087] In a similar way to the contract group, the inventory coils are further grouped to obtain a number of coil groups. That is, the number of coil groups corresponds to the number of combinations of specifications and materials.
[0088] S104. Establish a mapping relationship between the contract group and the steel coil group having the same specification and material.
[0089] When matching contracts with steel coils, specifications and materials must match. Therefore, a mapping relationship can be established between contract groups and steel coil groups based on the same specifications and materials, so that contracts and steel coils can be allocated based on the mapping relationship to meet the requirement that the specifications and materials of contracts and steel coils must match.
[0090] S105. According to the grouping order, for each contract group and the steel coil group with a mapping relationship, with the upper and lower weight limits as constraints, the contract and the steel coil are matched and optimized to obtain the steel coil contract matching result.
[0091] In order to prioritize the allocation of suitable steel coils to contracts with more urgent delivery, in this embodiment, each contract group and the steel coils with a mapping relationship can be matched in turn according to the order of the contracts in the group, with the upper and lower limits of weight as constraints, to obtain the steel coil contract matching results.
[0092] In this way, the more urgent the delivery time, the earlier it will be matched, and the difference between the upper and lower weight limits of the matching overall solution will be minimized.
[0093] In one embodiment of the present application, in accordance with the grouping order, each contract group and the steel coil group with a mapping relationship are sequentially matched with the upper and lower weight limits as constraints to obtain the steel coil contract matching results, including:
[0094] Step 1: Determine the current contract group according to the grouping order;
[0095] Step 2: Establish a one-dimensional vector of contract weight of the current contract group;
[0096] Step 3: Establish a one-dimensional vector of the steel coil weight of the target steel coil group having a mapping relationship with the current contract group;
[0097] Step 4: Establish a two-dimensional matrix corresponding to the current contract group and the target steel coil group;
[0098] Step 5: Establish an upper limit one-dimensional vector according to the upper and lower weight limit ratio of the current contract group;
[0099] Step 6: Combine the one-dimensional vector of contract weight, the one-dimensional vector of steel coil weight, the two-dimensional matrix and the one-dimensional vector of upper limit to establish a mathematical model for matching the contract and the steel coil;
[0100] Step 7: Based on the genetic algorithm, find the optimal solution for the objective function in the mathematical model;
[0101] Step 8. Use the optimal solution to determine the steel coil contract matching results.
[0102] Among them, a two-dimensional matrix corresponding to the current contract group and the target steel coil group is established, including:
[0103] A two-dimensional matrix is established with the number of contracts in the current contract group as rows and the number of steel coils in the steel coil group having a mapping relationship with the current contract group as columns;
[0104] In which, each row in the two-dimensional matrix M represents a contract, each column represents a steel coil, and M[i][j]=1 means that the i-th contract matches the j-th steel coil, otherwise it is 0.
[0105] In one embodiment of the present application, a mathematical model for matching contracts and steel coils is established by combining a one-dimensional vector of contract weight, a one-dimensional vector of steel coil weight, a two-dimensional matrix and an upper limit one-dimensional vector, including:
[0106] A mathematical model is established by combining the one-dimensional vector of contract weight, the one-dimensional vector of steel coil weight, the two-dimensional matrix and the one-dimensional vector of upper limit; wherein the mathematical model includes:
[0107] Contract matching ratio: R C =MS T / C T
[0108]
[0109] Matching weight ratio:
[0110] Objective function: max R = ∑ R C ×R S
[0111] Among them, the one-dimensional vector of contract weight is C, the one-dimensional vector of steel coil weight is S, the two-dimensional matrix is M, and the upper limit one-dimensional vector is L;
[0112] MS T Indicates the total weight of each steel coil in each contract when M matches, RC Represents the completion ratio of each contract under the current M matching situation;
[0113] If R C is greater than the upper limit of each contract, then R C is 0, otherwise unchanged;
[0114] R C ×C T Represents the contract matching weight of each contract after filtering. Represents the total weight of the mapped steel coil group, R S Represents the proportion of each contract matching weight to the total weight of the steel coil group after filtering;
[0115] R c ×R S Represents the product of the completed contract ratio of each contract after filtering and the ratio of the total weight of the steel coil group. R represents all R C ×R S of and;
[0116] max R represents the optimal solution to the objective function.
[0117] Among them, based on the genetic algorithm, the optimal solution of the objective function in the mathematical model is obtained, including:
[0118] Randomly generate N two-dimensional random matrices of the same size as M, calculate the first maximum value of each column in each two-dimensional random matrix to be 1, and the rest to be 0, and the initial M matches the population;
[0119] From N two-dimensional random matrices, determine the first N1 two-dimensional random matrices with the largest R value;
[0120] Genetic operations are performed on N1 two-dimensional random matrices until the termination condition is met and the optimal solution of the objective function is obtained.
[0121] Among them, genetic operations are performed on N1 two-dimensional random matrices, including:
[0122] Randomly select two two-dimensional random matrices from N1 two-dimensional random matrices, randomly select several columns from each two-dimensional random matrix for replication, exchange the index columns corresponding to the replicated columns of the two two-dimensional random matrices, and generate two new sub-two-dimensional random matrices;
[0123] A mutation operation is performed on the sub-two-dimensional random matrix with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix.
[0124] The sub-two-dimensional random matrix is mutated with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix, including:
[0125] For the two-dimensional random matrix, randomly select several columns and determine whether to mutate the current column to 0 or 1 according to the preset mutation probability;
[0126] If so, the position that is currently 1 in the column is changed to 0, and a 0 position is randomly selected in the column and changed to 1 or remains unchanged, to obtain the mutated sub-two-dimensional random matrix.
[0127] For ease of description, the above optimization processes are combined and described in detail below.
[0128] According to the contract group and the mapped steel coil group, establish the contract weight one-dimensional vector C (c1, c2, c3, ..., cn) and the steel coil weight one-dimensional vector S (s1, s2, g3, ..., sn). Establish a two-dimensional matrix M, the rows of the matrix M are the number of contracts, the columns are the number of steel coils, each row represents a contract, and each column represents a steel coil, where M[i][j] = 1 means that the i-th contract matches the j-th steel coil, otherwise it is 0. According to the upper and lower limit ratio of the contract weight, establish an upper limit one-dimensional vector L (l1, l2, l3, ..., ln), each value represents the upper limit ratio of a contract;
[0129] Establishing mathematical model for matching contracts and steel coils:
[0130] R C =MS T / C T (1)
[0131]
[0132] max R=ΣR C ×R S (4)
[0133] MS in formula (1) T Indicates the total weight of each steel coil in each contract when M matches, R C represents the proportion of each contract completed under the current M matching situation. In formula (2), if R C If it is greater than the upper limit of each contract, R C is 0, otherwise it remains unchanged. In formula (3), R C ×C T Represents the contract matching weight after each contract is filtered by formula (2), Represents the total weight of the mapped steel coil group, R S Represents the proportion of each contract matching weight to the total weight of the steel coil group after filtering. C ×R S Represents the product of the completed contract ratio of each contract after filtering and the ratio of the total weight of the steel coil group. R represents all R C ×R Smax R means to find the maximum value of the objective function, which is the optimal solution of the function under the contract weight constraint, that is, the optimal matching result that satisfies the contract.
[0134] Design a genetic algorithm to find the optimal solution for the objective function. The specific steps are as follows:
[0135] Coding: Randomly generate N two-dimensional matrices of the same size as M, and find that the first maximum value of each column of each matrix is 1, and the rest are 0, and the initial M matches the population;
[0136] Fitness selection: select the first N1 matching schemes with the largest R value among the N matching schemes (i.e., the two-dimensional random matrix) to enter the genetic operation;
[0137] Perform genetic operations, specifically select crossover and mutation operations, randomly select two matching schemes from N1 matching schemes, randomly select several columns from each scheme for copying, and exchange the index columns corresponding to the copied columns of the two schemes, thereby generating two new offspring schemes. Perform mutation operations on the offspring schemes with a certain mutation probability. For the offspring that need to be mutated, randomly select several columns, and perform 0 and 1 mutations on each column, that is, change the current position of 1 to 0, and randomly select a 0 position in the column to change it to 1 or remain unchanged, and finally generate two offspring matching schemes;
[0138] Repeat the genetic operation until the number of N1 matching solutions plus the newly generated offspring solutions is greater than N, re-select the fitness and enter the next round of iteration;
[0139] Determine whether the termination condition is met. If the maximum number of iterations is met or multiple iterations produce the same solution, the calculation ends.
[0140] Apply the method provided in the embodiment of the present application to obtain contract parameters of existing contracts and steel coil parameters of inventory steel coils; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material; group the existing contracts according to the specifications and materials in the contract parameters to obtain a number of contract groups, and sort the contracts in the contract groups according to the delivery time; group the inventory steel coils according to the specifications and materials in the steel coil parameters to obtain a number of steel coil groups; establish a mapping relationship between the contract group and the steel coil group with the same specifications and materials; according to the grouping order, perform a matching optimization process between the contract and the steel coil for each contract group and the steel coil group with the mapping relationship, with the upper and lower weight limits as constraints, to obtain a steel coil contract matching result.
[0141] When matching contracts and steel coils, first obtain the contract parameters and steel coil parameters, then group the existing contracts based on the specifications and materials in the contract parameters, and sort the contracts in the contract group according to the delivery time, and then group the inventory steel coils according to the specifications and materials in the steel coil parameters to obtain steel coil groups. Since the grouping is done based on the specifications and materials, a mapping relationship can be established between the contract group and the steel coil group with the same specifications and materials, so that each contract group and the steel coil group with a mapping relationship are matched in turn according to the order of the grouped contracts, with the upper and lower weight limits as constraints, to perform the optimal matching of the contract and the steel coil, and obtain the steel coil contract matching result.
[0142] Technical effect: The use of optimization methods such as grouping, sorting, and mapping can significantly improve the computing speed and matching accuracy. Specifically, this application can achieve more accurate and comprehensive optimization, effectively reduce the computational complexity of the algorithm, and make large-scale, multi-dimensional data processing real-time and efficient. This not only meets the steel industry's urgent need for rapid response and efficient logistics, but also reduces costs and improves customer satisfaction by reducing logistics problems.
[0143] To facilitate those skilled in the art to better understand and implement the matching method provided in the embodiment of the present application, the matching method is described in detail below with reference to a specific application scenario as an example.
[0144] Please refer to Figure 2 The specific implementation of this method includes the following steps:
[0145] Step 1: Obtain the basic parameters of existing contracts and inventory steel coils, including: steel coil specifications, weight, material, contract specifications, weight, material, delivery time, upper and lower weight limits;
[0146] Step 2: Group the contracts by specification, material, and delivery time, and sort them by the time of delivery. The closer the time is, the higher the grouping position will be. Group the steel coils by specification and material, and map the contract groups with the steel coil groups according to the same specification and the same material;
[0147] Step 3: Design a genetic algorithm to match the contracts in each group with the mapped steel coil groups according to the upper and lower limit constraints of the contract weight in the order of grouping, obtain the optimal steel coil contract matching result of the group, and delete the matched steel coils in this steel coil group to facilitate the next group matching;
[0148] Step 4: Repeat step 3 to determine whether the termination condition is met, that is, all contracts are matched to steel coils, or the remaining steel coils do not meet the existing contract termination matching algorithm.
[0149] Furthermore, the specific steps of step 3 are as follows:
[0150] Step 3.1: According to the contract group and the mapped steel coil group, establish the contract weight one-dimensional vector C (c1, c2, c3, ..., cn) and the steel coil weight one-dimensional vector S (s1, s2, g3, ..., sn). Establish a two-dimensional matrix M, where the rows of the matrix M are the number of contracts and the columns are the number of steel coils. Each row represents a contract and each column represents a steel coil, where M[i][j] = 1 means that the i-th contract matches the j-th steel coil, otherwise it is 0. According to the upper and lower limit ratio of the contract weight, establish an upper limit one-dimensional vector L (l1, l2, l3, ..., ln), where each value represents the upper limit ratio of a contract;
[0151] Step 3.2: Establish mathematical model for matching contracts and steel coils:
[0152] R C =MS T / C T (1)
[0153]
[0154] max R=ΣR C ×R S (4)
[0155] MS in formula (1) T Indicates the total weight of each steel coil in each contract when M matches, R C represents the proportion of each contract completed under the current M matching situation. In formula (2), if R C If it is greater than the upper limit of each contract, R C is 0, otherwise it remains unchanged. It has been verified that when only R C The search time of the algorithm with upper limit constraint is short, the search process is stable, and the efficiency is high. C The lower limit constraint is difficult to ensure the stability of the search process, and it is easy to produce oscillation phenomenon, resulting in a long search time. C ×C T Represents the contract matching weight after each contract is filtered by formula (2), Represents the total weight of the mapped steel coil group, R S Represents the proportion of each contract matching weight to the total weight of the steel coil group after filtering. In formula (4), RC×R S Represents the product of the completed contract ratio of each contract after filtering and the ratio of the total weight of the steel coil group. R represents all R C ×R S max R means to find the maximum value of the objective function, which is the optimal solution of the function under the contract weight constraint, that is, the optimal matching result that satisfies the contract.
[0156] Step 3.3: Design a genetic algorithm to find the optimal solution for the objective function in step 3.2.
[0157] Furthermore, the specific steps of step 3.3 are as follows:
[0158] Step 3.3.1: Coding: Randomly generate N two-dimensional matrices of the same size as M, and find that the first maximum value of each column of each matrix is 1, and the rest are 0. The initial M matches the population. The value of N is generally determined by the hardware resource environment and the size of M. If the hardware resources are good, the value of N can be larger to speed up the solution of the objective function. The larger the M, the smaller the value of N can be, reducing resource consumption and satisfying the normal operation of the solution process. In this method, the value of N is set to 100;
[0159] Step 3.3.2: Fitness selection: Select the first N1 matching schemes with the largest R value among the N matching schemes to enter the genetic operation of step 3.3.3. It has been verified that the value of N1 is generally the first 10%-50% of N. In this method, the value of N1 is set to the first 10% of N;
[0160] Step 3.3.3: Perform genetic operations, specifically crossover and mutation operations. Randomly select two matching schemes from N1 matching schemes, randomly select several columns from each scheme for copying, and exchange the index columns corresponding to the copied columns of the two schemes, thereby generating two new offspring schemes. It has been verified that randomly selecting several columns can shorten the search time compared to the traditional random selection of continuous columns. The offspring scheme is mutated with a certain mutation probability. The mutation probability of this method is 0.5. For the offspring that needs to be mutated, randomly select several columns and perform mutations of 0 and 1 on each column, that is, change the current position of 1 to 0, and at the same time randomly select a 0 position in the column to change it to 1 or remain unchanged, and finally generate two offspring matching schemes;
[0161] Step 3.3.4: Repeat the genetic operation in step 3.3.3 until the number of N1 matching solutions plus the newly generated offspring solutions is greater than N, re-select the fitness and enter the next round of iteration;
[0162] Step 3.3.5: Determine whether the termination condition is met. If the maximum number of iterations is met or multiple iterations produce the same solution, the calculation ends.
[0163] Compared with the related steel coil cargo and contract matching technology, the present invention adds an intelligent matching strategy based on genetic algorithm, removes the limitations of traditional matching that relies on manual experience or simple rules, and adjusts the decision-making mechanism in the matching process to make it more flexible, dynamic and have global optimization capabilities. That is, the technical effects of this application include:
[0164] Accurate matching: Grouping, sorting and mapping can fully consider the multi-dimensional attributes of steel coils (such as specifications, weight, material, inventory location, etc.) and the specific requirements of the contract (such as delivery period, weight range, material standards, etc.), conduct global optimization search, and ensure that the matching results meet the needs of all parties to the greatest extent and improve matching accuracy.
[0165] Efficient computing: Genetic algorithms use swarm intelligence and evolutionary principles while adopting two-dimensional coding. They can quickly converge to a better solution on large-scale data sets. Compared with traditional linear search or exhaustive methods, they can significantly shorten the calculation time of the matching process. They are particularly suitable for processing complex, nonlinear, and multi-constrained matching problems, and improve computing efficiency.
[0166] Real-time response: The present invention can quickly respond to new contract requirements or inventory changes in a constantly changing market environment, adjust matching plans in real time, ensure the dynamic adaptability of logistics plans, and enhance the reaction speed and decision-making agility of enterprises in fierce competition.
[0167] Corresponding to the above method embodiment, the embodiment of the present application further provides a matching device, and the matching device described below and the matching method described above can be referred to in correspondence with each other.
[0168] See also Figure 3 As shown, the device includes the following modules:
[0169] The parameter acquisition module 101 is used to acquire the contract parameters of the existing contract and the steel coil parameters of the stock steel coils; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material;
[0170] The contract group module 102 is used to group the existing contracts according to the specifications and materials in the contract parameters to obtain a number of contract groups, and sort the contracts in the contract groups according to the delivery time;
[0171] The steel coil group module 103 is used to group the stock steel coils according to the specifications and materials in the steel coil parameters to obtain a plurality of steel coil groups;
[0172] A mapping establishment module 104 is used to establish a mapping relationship between the contract group and the steel coil group having the same specification and material;
[0173] The matching optimization module 105 is used to perform matching optimization processing between the contract and the steel coil according to the grouping order, and to obtain the steel coil contract matching result.
[0174] The device provided in the embodiment of the present application is used to obtain contract parameters of existing contracts and steel coil parameters of inventory steel coils; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material; the existing contracts are grouped according to the specifications and materials in the contract parameters to obtain a number of contract groups, and the contracts in the contract groups are sorted according to the delivery time; the inventory steel coils are grouped according to the specifications and materials in the steel coil parameters to obtain a number of steel coil groups; a mapping relationship is established between the contract group and the steel coil group with the same specifications and materials; according to the grouping order, each contract group and the steel coil group with the mapping relationship are sequentially subjected to a matching optimization process with the upper and lower weight limits as constraints to obtain a steel coil contract matching result.
[0175] When matching contracts and steel coils, first obtain the contract parameters and steel coil parameters, then group the existing contracts based on the specifications and materials in the contract parameters, and sort the contracts in the contract group according to the delivery time, and then group the inventory steel coils according to the specifications and materials in the steel coil parameters to obtain steel coil groups. Since the grouping is based on the specifications and materials, a mapping relationship can be established between the contract group and the steel coil group with the same specifications and materials, so that according to the order of the contracts in the group, each contract group and the steel coil group with a mapping relationship are matched with the upper and lower weight limits as constraints, and the contract and steel coil matching is optimized to obtain the steel coil contract matching result.
[0176] Technical effect: The use of optimization methods such as grouping, sorting, and mapping can significantly improve the computing speed and matching accuracy. Specifically, this application can achieve more accurate and comprehensive optimization, effectively reduce the computational complexity of the algorithm, and make large-scale, multi-dimensional data processing real-time and efficient. This not only meets the steel industry's urgent need for rapid response and efficient logistics, but also reduces costs and improves customer satisfaction by reducing logistics problems.
[0177] In a specific implementation of the present application, the matching optimization module is specifically used to:
[0178] Determine the current contract group according to the grouping order;
[0179] Establish a one-dimensional vector of contract weights for the current contract group;
[0180] Establishing a one-dimensional vector of steel coil weight of a target steel coil group having a mapping relationship with the current contract group;
[0181] Establish a two-dimensional matrix corresponding to the current contract group and the target steel coil group;
[0182] According to the upper and lower weight limit ratio of the current contract group, establish an upper limit one-dimensional vector;
[0183] Combining the one-dimensional vector of contract weight, the one-dimensional vector of steel coil weight, the two-dimensional matrix and the one-dimensional vector of upper limit, a mathematical model for matching contracts and steel coils is established;
[0184] Based on genetic algorithm, the optimal solution of the objective function in the mathematical model is obtained;
[0185] Use the optimal solution to determine the steel coil contract matching results.
[0186] In a specific implementation of the present application, the matching optimization module is specifically used to:
[0187] A two-dimensional matrix is established with the number of contracts in the current contract group as rows and the number of steel coils in the steel coil group having a mapping relationship with the current contract group as columns;
[0188] In which, each row in the two-dimensional matrix M represents a contract, each column represents a steel coil, and M[i][j]=1 means that the i-th contract matches the j-th steel coil, otherwise it is 0.
[0189] In a specific implementation of the present application, the matching optimization module is specifically used to:
[0190] A mathematical model is established by combining the one-dimensional vector of contract weight, the one-dimensional vector of steel coil weight, the two-dimensional matrix and the one-dimensional vector of upper limit; wherein the mathematical model includes:
[0191] Contract matching ratio: R C =MS T / C T
[0192]
[0193] Matching weight ratio:
[0194] Objective function: max R = ∑ R C ×R S
[0195] Among them, the one-dimensional vector of contract weight is C, the one-dimensional vector of steel coil weight is S, the two-dimensional matrix is M, and the upper limit one-dimensional vector is L;
[0196] MS T Indicates the total weight of each steel coil in each contract when M matches, R C Represents the completion ratio of each contract under the current M matching situation;
[0197] If R C is greater than the upper limit of each contract, then R C is 0, otherwise unchanged;
[0198] R C ×C TRepresents the contract matching weight of each contract after filtering. Represents the total weight of the mapped steel coil group, R S Represents the proportion of each contract matching weight to the total weight of the steel coil group after filtering;
[0199] R C ×R S Represents the product of the completed contract ratio of each contract after filtering and the ratio of the total weight of the steel coil group. R represents all R C ×R S of and;
[0200] max R represents the optimal solution to the objective function.
[0201] In a specific implementation of the present application, the matching optimization module is specifically used to:
[0202] Randomly generate N two-dimensional random matrices of the same size as M, calculate the first maximum value of each column in each two-dimensional random matrix to be 1, and the rest to be 0, and the initial M matches the population;
[0203] From N two-dimensional random matrices, determine the first N1 two-dimensional random matrices with the largest R value;
[0204] Genetic operations are performed on N1 two-dimensional random matrices until the termination condition is met and the optimal solution of the objective function is obtained.
[0205] In a specific implementation of the present application, the matching optimization module is specifically used to:
[0206] Randomly select two two-dimensional random matrices from N1 two-dimensional random matrices, randomly select several columns from each two-dimensional random matrix for replication, exchange the index columns corresponding to the replicated columns of the two two-dimensional random matrices, and generate two new sub-two-dimensional random matrices;
[0207] A mutation operation is performed on the sub-two-dimensional random matrix with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix.
[0208] In a specific implementation of the present application, the matching optimization module is specifically used to:
[0209] For the two-dimensional random matrix, randomly select several columns and determine whether to mutate the current column to 0 or 1 according to the preset mutation probability;
[0210] If so, change the position in the column that is currently 1 to 0, and randomly select a 0 position in the column to be 1 or remain unchanged, to obtain the mutated sub-two-dimensional random matrix, to obtain the mutated sub-two-dimensional random matrix.
[0211] Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device. The electronic device described below and the matching method described above can refer to each other.
[0212] See also Figure 4 As shown, the electronic device includes:
[0213] A memory 332, for storing computer programs;
[0214] The processor 322 is configured to implement the steps of the matching method of the above method embodiment when executing a computer program.
[0215] For details, please refer to Figure 5 , Figure 5 A specific structural diagram of an electronic device provided for this embodiment, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electronic device 301.
[0216] The electronic device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .
[0217] The steps in the matching method described above can be implemented by the structure of an electronic device.
[0218] Corresponding to the above method embodiment, the embodiment of the present application further provides a readable storage medium. The readable storage medium described below and the matching method described above can refer to each other.
[0219] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the matching method of the above method embodiment are implemented.
[0220] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0221] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0222] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0223] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0224] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms include, include or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0225] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A matching method, characterized in that: include: Obtain the contract parameters of the existing contract and the steel coil parameters of the stock steel coil; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material; The existing contracts are grouped according to the specifications and materials in the contract parameters to obtain a plurality of contract groups, and the contracts in the contract groups are sorted according to the delivery time; According to the specifications and materials in the steel coil parameters, the stock steel coils are grouped to obtain a plurality of steel coil groups; Establishing a mapping relationship between the contract group and the steel coil group having the same specification and material; According to the grouping order, each contract group and the steel coil group with a mapping relationship are matched with each other in turn, and the upper and lower weight limits are used as constraints to obtain the steel coil contract matching result.
2. The method according to claim 1, characterized in that According to the grouping order, each contract group and the steel coil group with a mapping relationship are sequentially matched with the upper and lower weight limits as constraints to obtain the steel coil contract matching results, including: According to the grouping order, determine the current contract group; Establishing a one-dimensional vector of contract weights of the current contract group; Establishing a one-dimensional vector of steel coil weight of a target steel coil group having a mapping relationship with the current contract group; Establishing a two-dimensional matrix corresponding to the current contract group and the target steel coil group; According to the weight upper and lower limit ratio relationship of the current contract group, an upper limit one-dimensional vector is established; Combining the one-dimensional vector of the contract weight, the one-dimensional vector of the steel coil weight, the two-dimensional matrix and the one-dimensional vector of the upper limit, a mathematical model for matching the contract with the steel coil is established; Based on the genetic algorithm, an optimal solution is obtained for the objective function in the mathematical model; The optimal solution is used to determine the steel coil contract matching result.
3. The method according to claim 2, characterized in that Establishing a two-dimensional matrix corresponding to the current contract group and the target steel coil group, including: The two-dimensional matrix is established by taking the number of contracts in the current contract group as rows and the number of steel coils in the steel coil group having a mapping relationship with the current contract group as columns; Each row in the two-dimensional matrix M represents a contract, each column represents a steel coil, and M[i][j]=1 indicates that the i-th contract matches the j-th steel coil, otherwise it is 0.
4. The method according to claim 2, characterized in that: Combining the one-dimensional vector of the contract weight, the one-dimensional vector of the steel coil weight, the two-dimensional matrix and the one-dimensional vector of the upper limit, a mathematical model for matching the contract and the steel coil is established, including: The mathematical model is established by combining the one-dimensional vector of the contract weight, the one-dimensional vector of the steel coil weight, the two-dimensional matrix and the one-dimensional vector of the upper limit; wherein the mathematical model includes: R C =MS T / C T Contract matching ratio: Matching weight ratio: Objective function: max R = ∑ R C ×R S Among them, the one-dimensional vector of contract weight is C, the one-dimensional vector of steel coil weight is S, the two-dimensional matrix is M, and the upper limit one-dimensional vector is L; MS T Indicates the total weight of each steel coil in each contract when M matches, R C Represents the completion ratio of each contract under the current M matching situation; If R C is greater than the upper limit of each contract, then R C is 0, otherwise unchanged; R C ×C T Represents the contract matching weight of each contract after filtering. Represents the total weight of the mapped steel coil group, R S Represents the proportion of each contract matching weight to the total weight of the steel coil group after filtering; R C ×R S Represents the product of the completed contract ratio of each contract after filtering and the ratio of the total weight of the steel coil group. R represents all R C ×R S of and; max R represents the optimal solution to the objective function.
5. The method according to claim 4, characterized in that Based on the genetic algorithm, the optimal solution of the objective function in the mathematical model is obtained, including: Randomly generate N two-dimensional random matrices of the same size as M, calculate the first maximum value of each column in each of the two-dimensional random matrices to be 1, and the rest to be 0, and the initial M matches the population; From N two-dimensional random matrices, determine the first N1 two-dimensional random matrices with the largest R value; Genetic operations are performed on N1 two-dimensional random matrices until a termination condition is met, thereby obtaining an optimal solution to the objective function.
6. The method according to claim 5, characterized in that Perform genetic operations on N1 two-dimensional random matrices, including: Randomly select two two-dimensional random matrices from N1 two-dimensional random matrices, randomly select several columns from each two-dimensional random matrix for replication, exchange the index columns corresponding to the replicated columns of the two two-dimensional random matrices, and generate two new sub-two-dimensional random matrices; A mutation operation is performed on the sub-two-dimensional random matrix with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix.
7. The method according to claim 6, characterized in that The sub-two-dimensional random matrix is mutated with a preset mutation probability to obtain a mutated sub-two-dimensional random matrix, including: For the two-dimensional random matrix, randomly select several columns and determine whether to mutate the current column to 0 or 1 according to the preset mutation probability; If so, the position that is currently 1 in the column is changed to 0, and a 0 position is randomly selected in the column and changed to 1 or remains unchanged, to obtain the mutated sub-two-dimensional random matrix.
8. A matching device, characterized in that: include: A parameter acquisition module is used to acquire the contract parameters of the existing contract and the steel coil parameters of the stock steel coil; wherein the contract parameters include specifications, weight, material, delivery time and upper and lower weight limits, and the steel coil parameters include specifications, weight and material; A contract group module, used to group the existing contracts according to the specifications and materials in the contract parameters to obtain a plurality of contract groups, and sort the contracts in the contract groups according to the delivery time; A steel coil group module, used for grouping the stock steel coils according to the specifications and materials in the steel coil parameters to obtain a plurality of steel coil groups; A mapping establishment module, used to establish a mapping relationship between the contract group and the steel coil group having the same specifications and materials; The matching optimization module is used to perform matching optimization processing between the contract and the steel coil according to the grouping order, and to obtain the steel coil contract matching result.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the matching method according to any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the matching method according to any one of claims 1 to 7 are implemented.
