Product inventory distribution method, device and equipment based on greedy algorithm
By adopting a greedy algorithm-based method in inventory allocation, combining heuristic sorting and multiple constraints, the problem that existing greedy algorithms are difficult to achieve global optimality and high computational complexity in integer planning is solved, and efficient and accurate inventory allocation is achieved.
Patent Information
- Application Number
- CN202510117161.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-04-18
AI Technical Summary
Existing greedy algorithms rely on single sorting in inventory allocation, making it difficult to achieve global optimality, and the calculation complexity of integer planning schemes is high and time and resource consumption is high.
The product inventory allocation method based on greedy algorithm is adopted. By obtaining market order information and supplier warehouse information in the database, we judge whether the current market order is a medium-package specification order, and order combination is performed based on heuristic sorting, combining the whole box specification parameters for rounding and calculation, and finally, product allocation is performed based on greedy algorithm, considering inventory constraints, return time constraints and distance weight constraints.
It realizes the avoidance of local optimization in inventory allocation and achieves global optimal solutions, reduces computing complexity and resource consumption, and adapts to the application needs of global supply chains.
Smart Images

Figure CN119850095A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of manufacturing allocation technology, and in particular to a product inventory allocation method, device and equipment based on a greedy algorithm. Background Art
[0002] With the deepening of globalization, manufacturing companies are no longer limited to the local market. Their production bases, supply chain nodes, and customer groups are spread across various countries and regions. This global distribution and operation model has brought unprecedented market opportunities, but also brought many challenges. The transnational layout of the supply chain requires companies to not only operate simultaneously in multiple time zones, but also to accurately control the collaborative efficiency of various links including production, transportation, and storage. In the face of these challenges, intelligent inventory management is particularly important.
[0003] Global inventory allocation refers to the effective allocation of inventory from one or more sources, such as warehouses, factories, etc., to multiple destinations around the world, such as stores, distribution centers, etc. This usually involves complex logistics and supply chain management issues. A reasonable inventory allocation strategy can ensure the smooth operation of all links in the supply chain, reduce capital occupation caused by inventory accumulation, and potential sales losses caused by out-of-stock. For global manufacturing companies, this means the need to implement a more sophisticated inventory management strategy that can respond to global market changes in real time, with an order and inventory management system with powerful data processing capabilities and efficient decision-making mechanisms to optimize global resource allocation, reduce procurement costs, and improve service quality and operational efficiency.
[0004] The existing technology uses the traditional greedy algorithm to optimize inventory allocation, and achieves the global optimum through the local optimum of each step; however, it uses a single sorting method to optimize, and it is difficult to obtain the true global optimal solution. The inventory allocation solution based on integer programming has high computational complexity, consumes a lot of time and resources, and is difficult to adapt to the application needs of the global supply chain. Summary of the invention
[0005] The present application provides a product inventory allocation method, device and equipment based on a greedy algorithm, which is used to solve the technical problems that the existing greedy algorithm relies on a single sorting and is difficult to reach the global optimum, and the integer programming scheme has high computational complexity and consumes a lot of time and resources.
[0006] In view of this, the first aspect of the present application provides a product inventory allocation method based on a greedy algorithm, comprising:
[0007] Obtain market order information and supplier warehouse information in the database;
[0008] Determine whether the current market order is a medium-sized order based on the market order information and the supplier warehouse information, and if so, combine the current market order based on heuristic sorting to obtain a sorted combined demand;
[0009] The supplier warehouse allocation quantity is obtained by rounding off the sorting combination demand quantity and the full box specification parameters;
[0010] Based on the greedy algorithm, product allocation is performed according to the supplier warehouse allocation quantity and the shipping constraint conditions to obtain an inventory allocation result. The shipping constraint conditions include inventory quantity constraint, return time constraint and distance weight constraint.
[0011] Preferably, the acquiring of market order information and supplier warehouse information in the database includes:
[0012] Extract the product demand, delivery specification parameters, market warehouse location and order placement time of each market order in the database to generate market order information;
[0013] The product inventory, shipping specification parameters, supplier warehouse location and return time under each warehouse name are extracted from the database to generate supplier warehouse information.
[0014] Preferably, judging whether the current market order is a medium-sized package order according to the market order information and the supplier warehouse information, and if so, combining the current market order based on heuristic sorting to obtain the sorted combined demand, includes:
[0015] If the current market order is determined to be a medium-sized package order based on the market order information and the supplier warehouse information, the current market orders are sorted in ascending order based on the order placement time to obtain a serial market order;
[0016] The sequence market orders are traversed based on heuristic sorting, and the current market orders are combined into full-box orders according to the product demand to obtain the sorted combined demand.
[0017] Preferably, judging whether the current market order is a medium-sized package order according to the market order information and the supplier warehouse information, and if so, combining the current market order based on heuristic sorting to obtain the sorted combined demand, further includes:
[0018] If it is not a medium-package specification order, determine whether the receiving specification parameters of the current market order match the shipping specification parameters of the warehouse. If so, sort the current market orders in ascending order according to the order placement time to obtain a time-series market order;
[0019] Perform rounding calculation based on the product demand and public specification parameters to obtain a single allocation amount;
[0020] Products are allocated to the time-series market orders according to the single allocation quantity and the single shipment constraint condition to obtain an inventory allocation result.
[0021] Preferably, the greedy algorithm is based on which product allocation is performed according to the supplier warehouse allocation quantity and the shipping constraint conditions to obtain an inventory allocation result, wherein the shipping constraint conditions include inventory quantity constraint, return time constraint and distance weight constraint, and the above also includes:
[0022] Sort all warehouses in descending order according to the inventory of the product to generate inventory constraints;
[0023] Sort the products of each warehouse in ascending order according to the return time to generate a return time constraint;
[0024] Calculate the distance between warehouses according to the market order information and the warehouse location information in the supplier warehouse information to obtain the warehouse spacing;
[0025] A distance weight matrix is constructed based on the warehouse spacing, and a distance weight ascending sequence is determined according to the distance weight matrix to generate a distance weight constraint.
[0026] A second aspect of the present application provides a product inventory allocation device based on a greedy algorithm, comprising:
[0027] A data acquisition unit, used to acquire market order information and supplier warehouse information in the database;
[0028] An order combination unit is used to determine whether the current market order is a medium-sized package order based on the market order information and the supplier warehouse information, and if so, to combine the current market order based on heuristic sorting to obtain a sorted combined demand;
[0029] An allocation calculation unit, used to perform rounding calculation based on the sorting combination demand and the full box specification parameters to obtain the supplier warehouse allocation quantity;
[0030] The inventory allocation unit is used to allocate products based on a greedy algorithm according to the supplier warehouse allocation quantity and shipping constraints to obtain inventory allocation results. The shipping constraints include inventory quantity constraints, return time constraints and distance weight constraints.
[0031] Preferably, the data acquisition unit is specifically used for:
[0032] Extract the product demand, delivery specification parameters, market warehouse location and order placement time of each market order in the database to generate market order information;
[0033] The product inventory, shipping specification parameters, supplier warehouse location and return time under each warehouse name are extracted from the database to generate supplier warehouse information.
[0034] Preferably, the order combination unit is specifically used for:
[0035] If the current market order is determined to be a medium-sized package order based on the market order information and the supplier warehouse information, the current market orders are sorted in ascending order based on the order placement time to obtain a serial market order;
[0036] The sequence market orders are traversed based on heuristic sorting, and the current market orders are combined into full-box orders according to the product demand to obtain the sorted combined demand.
[0037] Preferably, it also includes:
[0038] The whole package matching unit is used to determine whether the receiving specification parameters of the current market order match the shipping specification parameters of the warehouse if it is not a medium package specification order, and if so, sort the current market order in ascending order according to the order placement time to obtain a time-series market order;
[0039] A rounding calculation unit, used for performing rounding calculation according to the product demand and the public specification parameters to obtain a single allocation amount;
[0040] A single allocation unit is used to allocate products to the time-series market order according to the single allocation quantity and the single shipment constraint condition to obtain an inventory allocation result.
[0041] A third aspect of the present application provides a product inventory allocation device based on a greedy algorithm, the device comprising a processor and a memory;
[0042] The memory is used to store program code and transmit the program code to the processor;
[0043] The processor is used to execute the product inventory allocation method based on the greedy algorithm described in the first aspect according to the instructions in the program code.
[0044] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0045] In the present application, a product inventory allocation method based on a greedy algorithm is provided, including: obtaining market order information and supplier warehouse information in a database; judging whether the current market order is a medium-package specification order based on the market order information and the supplier warehouse information, and if so, combining the current market order based on heuristic sorting to obtain the sorted combination demand; performing rounding calculation based on the sorted combination demand and the whole box specification parameters to obtain the supplier warehouse allocation; based on the greedy algorithm, allocating products according to the supplier warehouse allocation and shipping constraints to obtain the inventory allocation result, and the shipping constraints include inventory quantity constraints, return time constraints and distance weight constraints.
[0046] The product inventory allocation method based on the greedy algorithm provided in this application performs specification analysis on market orders. For the medium-sized package specification orders, the market orders can be sorted and combined by heuristic sorting to meet the shipping specifications; the possibility of setting multiple combinations ensures that the subsequent inventory allocation will not fall into the local optimum, and then obtain the real global optimal solution; in addition, the allocation process not only needs to calculate the specific supplier warehouse allocation quantity, but also needs to be allocated in combination with the shipping constraints. The inventory allocation based on multiple constraints is more in line with the actual situation, so the allocation is more efficient and the allocation results are more accurate and reliable; this process has a small amount of calculation, simple operation, and can adapt to the actual inventory allocation scenario requirements. Therefore, this application can solve the technical problems that the existing greedy algorithm relies on a single sorting and is difficult to reach the global optimum, and the integer programming solution has a high computational complexity and consumes a lot of time and resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of a product inventory allocation method based on a greedy algorithm provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of the structure of a product inventory allocation device based on a greedy algorithm provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] For easier understanding, see Figure 1 , the present application provides an embodiment of a product inventory allocation method based on a greedy algorithm, comprising:
[0051] Step 101: Obtain market order information and supplier warehouse information from the database.
[0052] Furthermore, step 101 includes:
[0053] Extract the product demand, delivery specification parameters, market warehouse location and order placement time of each market order in the database to generate market order information;
[0054] The product inventory, shipping specification parameters, supplier warehouse location and return time under each warehouse name are extracted from the database to generate supplier warehouse information.
[0055] This embodiment needs to analyze the information relationship between market demand and supply warehouses to achieve more accurate and reliable product allocation, so it is necessary to obtain market order information and supplier warehouse information. It can be understood that market order information includes but is not limited to product demand, receiving specification parameters, market warehouse location and order placement time; similarly, the same is true for supplier warehouse information.
[0056] In addition, the market warehouse location is the warehouse where the goods are stored after the market receives them, that is, both the demand side and the supply side have inventory warehouses. The receiving specification parameter refers to the packaging method of the received goods of the market order, the general quantity, such as the number of full boxes, one box includes 100 products; this parameter can be configured according to market conditions and product categories, and is only used as an example here, not limited; the shipping specification parameter is the same. It should be noted that both the harvesting specification parameter and the shipping specification parameter refer to the packaging method of the goods. The packaging method is generally divided into two types, medium package or full package. The number of goods in the full package specification is generally an integer multiple of the number of goods in the medium package specification.
[0057] The return time is inversely proportional to the storage time of the product in the warehouse, that is, the longer the product is in stock, the earlier the product will be returned when it needs to be allocated; that is, the goods that have been stored in the warehouse for a longer time will be allocated first to ensure the health and liquidity of the entire inventory level.
[0058] Step 102: determine whether the current market order is a medium-sized package order based on the market order information and the supplier warehouse information. If so, combine the current market order based on heuristic sorting to obtain the sorted combined demand.
[0059] Further, step 102 includes:
[0060] If the current market order is determined to be a medium-sized package order based on the market order information and the supplier warehouse information, the current market orders are sorted in ascending order based on the order placement time to obtain a serial market order;
[0061] Based on the heuristic sorting, the sequential market orders are traversed and the current market orders are combined into full-box orders according to the product demand to obtain the sorted combination demand.
[0062] Furthermore, step 102 further includes:
[0063] If it is not a medium-sized specification order, determine whether the receiving specification parameters of the current market order match the shipping specification parameters of the warehouse. If so, sort the current market orders in ascending order according to the order placement time to obtain the time-series market order;
[0064] According to the product demand and public specification parameters, a single allocation quantity is obtained by rounding off the calculation;
[0065] Products are allocated to the time-series market orders based on a single allocation quantity and a single shipment constraint to obtain inventory allocation results.
[0066] It should be noted that, based on the receiving specification parameters in the market order information and the shipping specification parameters in the supplier's warehouse information, it is possible to analyze whether the demander and the supplier meet the one-to-one supply conditions, that is, the demander's product demand and receiving specification parameters match those of the supplier, the demand is less than the inventory, and the shipping specification is consistent with the receiving specification; then there is no difference between the supply and demand sides, and a one-to-one single sorting method can be used for distribution, which is also the case where the traditional greedy algorithm is applicable.
[0067] For the one-to-one allocation scheme, it should be noted that the allocation process needs to meet some constraints, which can be either demand-side or supply-side. For example, the current market orders are sorted in ascending order according to the order placement time, which is actually the order placement time. The earlier the order is placed, the faster it will be responded to and the goods will be allocated in time. The later the order is placed, the later the response will be. The supplier needs to consider a single shipment constraint. The single shipment constraint of this embodiment includes inventory constraint and return time constraint. The inventory constraint means that the supplier warehouse with a larger inventory is given priority for product allocation, so all warehouses that meet the allocation requirements can be sorted in descending order, and the warehouse with the largest inventory is selected to give priority to product allocation. The return time constraint means that the products with a longer inventory age in the supplier warehouse need to be allocated first; so the return time can be sorted in ascending order, the earlier the time, the earlier the time, and the later the time, the later the time, so as to constrain the product allocation of the supplier. Other allocation constraints can also be set according to actual conditions. The single shipment constraint of this embodiment is only an example and is not limited.
[0068] The calculation process of a single allocation is:
[0069]
[0070] in, For a single distribution amount, is the product demand of the current market order, is the current inventory of the supplier’s products, It is a public specification parameter, which is determined based on the demand side's receiving specification parameter and the supplier's shipping specification parameter corresponding to the current market order. The larger one will be used.
[0071] However, many current market orders do not meet the above allocation conditions. Medium-package specification orders are one of them, that is, they are not full-package or full-box requirements, but generally an integer fraction of the full-package or full-box specifications. At this time, this embodiment combines multiple market orders through heuristic combinatorial sorting to achieve integer specifications, which is convenient for suppliers to allocate products.
[0072] Therefore, if the specification orders in the current market order are judged based on the market order information and the supplier's warehouse information, it is necessary to perform order combination processing on the market order based on heuristic sorting. The specification orders in the package in this embodiment can be divided into two situations according to the warehouse to which the market order belongs. One is that the products are stored in the same warehouse after being received by multiple different markets, and the other is that the products are stored in different warehouses after being received by multiple different markets.
[0073] It should be noted that, regardless of whether the products are stored in the same warehouse, the heuristic sorting method can be used to combine orders. The difference is that the warehouse-related constraints of the subsequent suppliers are different, but the previous order combination operations are the same. Specifically, the current market orders can be sorted in ascending order according to the order placement time, that is, the orders placed earlier are placed in front, and they are combined and allocated to products first; in this way, a sequential market order can be obtained. Then, based on the heuristic sorting method, the sequential market orders are traversed, the earliest market order is selected, and other suitable market orders are selected in turn according to the sequential market orders and combined with them. When the average order placement time of the combination is ensured to be the earliest and the total product demand meets the supplier's warehouse shipping specification parameters, a combined order can be generated to participate in the subsequent product allocation.
[0074] The demand for the generated combined order is the sorted combined demand; for example, if the demand for three market orders is 80, 70, and 60 respectively, then the sorted combined demand is 210. After these market orders are allocated, the order combination operation can be repeated until all current market orders are allocated; and if the allocation of a market in this round is less than the demand, it can continue to participate in the subsequent order combination operation, which will not be described in detail.
[0075] Step 103: perform rounding calculation based on the sorted combined demand quantity and the full box specification parameters to obtain the supplier warehouse allocation quantity.
[0076] The calculation process of the supplier warehouse allocation quantity is:
[0077]
[0078] in, Allocate quantity to supplier warehouses, is the product demand of the current market order, which refers to the sorting combination demand here. is the current inventory of the supplier’s products, Specifications for the entire box.
[0079] It should be noted that there are two situations in the above heuristic combination sorting, one is the same warehouse and the other is cross-warehouse. No matter which one, the above formula can be used to calculate the specific supplier warehouse allocation quantity, that is, the supplier warehouse allocation quantity is calculated based on the sorting combination demand, full box specification parameters and product inventory.
[0080] Step 104: Based on the greedy algorithm, product allocation is performed according to the supplier warehouse allocation quantity and the shipping constraints to obtain an inventory allocation result. The shipping constraints include inventory quantity constraints, return time constraints, and distance weight constraints.
[0081] Furthermore, step 104, before that, also includes:
[0082] Sort all warehouses in descending order according to product inventory to generate inventory constraints;
[0083] Sort the products of each warehouse in ascending order according to the return time and generate the return time constraint;
[0084] Calculate the distance between warehouses based on the market order information and the warehouse location information in the supplier warehouse information to obtain the warehouse spacing;
[0085] A distance weight matrix is constructed based on the warehouse spacing, and the distance weight ascending sequence is determined according to the distance weight matrix to generate a distance weight constraint.
[0086] It should be noted that during the operation of the greedy algorithm, optimization goals, selection strategies, and solution construction based on the selection strategy can be set; the strategy of this embodiment includes specific supplier warehouse allocation and shipment constraints; goals include priority allocation to warehouses with large inventory, priority return of products with long inventory age, and priority allocation of products with smaller distance weights. In addition, if the three constraint indicators are considered at the same time, the priority is that the inventory constraint is greater than the return time constraint, and the return time constraint is greater than the distance weight constraint; that is, the inventory of the warehouse is compared first, and if the inventory is the same, the return time is compared, and if both are the same, the distance weight is compared.
[0087] The shipping constraints are generated based on the market order information and the supplier warehouse information; the inventory constraints and return time constraints are directly sorted by the product inventory and return time of the market order; and the distance weight constraint needs to calculate the actual distance between the two warehouses of the demander and the supplier first, and then build a distance weight matrix based on the distance between the warehouses. Since the distance weight matrix can roughly represent the logistics cost, it is possible to seek warehouses with smaller weights for goods allocation, which can reduce the logistics cost as much as possible.
[0088] Since the medium-sized package specification orders in this embodiment can be divided into two situations according to the warehouse to which the market order belongs, one is that the products are stored in the same warehouse after multiple different markets receive the goods, and the other is that the products are stored in different warehouses after multiple different markets receive the goods. If it is the first case, the shipping constraints that need to be met during the allocation operation include inventory constraints and return time constraints. If it is the second case, the shipping constraints that need to be met during the allocation operation include inventory constraints, return time constraints and distance weight constraints. That is, the constraints for the allocation of combined orders generated according to different situations are not exactly the same; the distance factor is not considered for the same warehouse, and the logistics cost impact caused by the distance needs to be weighed for cross-warehouses; there is no significant difference in the operation of calculating the allocation quantity and configuring the constraints between the two situations. There are mainly slight differences in the types of constraints, so the details will not be repeated.
[0089] It is understandable that product allocation can be performed based on the solved supplier warehouse allocation quantity and the configured shipping constraints to obtain inventory allocation results; and there is no conflict in allocation between different products, so in actual application scenarios, multi-process technology can be used to allocate different products. In addition, this embodiment does not make a single sorting decision based on the traditional greedy algorithm, but improves the greedy algorithm based on the heuristic combination sorting method; and on this basis, it also solves the problem that the traditional greedy algorithm cannot consider multiple constraints, ensures the maximum utilization of inventory allocation, and reduces the cost of logistics distribution; this process can also configure different sorting methods according to different business scenarios, and has certain versatility and adaptability.
[0090] The product inventory allocation method based on the greedy algorithm provided in the embodiment of the present application performs specification analysis on market orders. For the medium-sized package specification orders, the market orders can be sorted and combined by heuristic sorting to meet the shipping specifications; the possibility of setting multiple combinations ensures that the subsequent inventory allocation will not fall into the local optimum, and then obtain the real global optimal solution; in addition, in the allocation process, it is necessary not only to calculate the specific supplier warehouse allocation quantity, but also to allocate in combination with the shipping constraints. The inventory allocation based on multiple constraints is more in line with the actual situation, so the allocation is more efficient and the allocation results are more accurate and reliable; the calculation amount of this process is small, the operation is simple, and it can adapt to the actual inventory allocation scenario requirements. Therefore, the embodiment of the present application can solve the technical problems that the existing greedy algorithm relies on a single sorting and is difficult to reach the global optimum, and the integer programming scheme has a high computational complexity and consumes a lot of time and resources.
[0091] For easier understanding, see Figure 2 The present application provides an embodiment of a product inventory allocation device based on a greedy algorithm, comprising:
[0092] The data acquisition unit 201 is used to acquire market order information and supplier warehouse information in the database;
[0093] The order combination unit 202 is used to determine whether the current market order is a medium-sized package order based on the market order information and the supplier warehouse information. If so, the current market order is combined based on the heuristic sorting to obtain the sorted combined demand;
[0094] The allocation calculation unit 203 is used to perform rounding calculation based on the sorting combination demand quantity and the full box specification parameters to obtain the supplier warehouse allocation quantity;
[0095] The inventory allocation unit 204 is used to allocate products based on the greedy algorithm according to the supplier warehouse allocation quantity and the shipping constraint conditions to obtain the inventory allocation result. The shipping constraint conditions include inventory quantity constraint, return time constraint and distance weight constraint.
[0096] Furthermore, the data acquisition unit 201 is specifically used for:
[0097] Extract the product demand, delivery specification parameters, market warehouse location and order placement time of each market order in the database to generate market order information;
[0098] The product inventory, shipping specification parameters, supplier warehouse location and return time under each warehouse name are extracted from the database to generate supplier warehouse information.
[0099] Furthermore, the order combination unit 202 is specifically used for:
[0100] If the current market order is determined to be a medium-sized package order based on the market order information and the supplier warehouse information, the current market orders are sorted in ascending order based on the order placement time to obtain a serial market order;
[0101] Based on the heuristic sorting, the sequential market orders are traversed and the current market orders are combined into full-box orders according to the product demand to obtain the sorted combination demand.
[0102] Furthermore, it also includes:
[0103] The whole package matching unit 205 is used to determine whether the receiving specification parameters of the current market order match the shipping specification parameters of the warehouse if it is not a medium package specification order. If so, the current market order is sorted in ascending order according to the order placement time to obtain a time-series market order;
[0104] A rounding calculation unit 206, used to perform rounding calculation according to the product demand and the common specification parameters to obtain a single allocation amount;
[0105] The single allocation unit 207 is used to allocate products to the time-series market orders according to the single allocation quantity and the single shipment constraint condition to obtain the inventory allocation result.
[0106] The present application also provides a product inventory allocation device based on a greedy algorithm, the device comprising a processor and a memory;
[0107] The memory is used to store the program code and transmit the program code to the processor;
[0108] The processor is used to execute the product inventory allocation method based on the greedy algorithm in the above method embodiment according to the instructions in the program code.
[0109] 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 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. Another point is that 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.
[0110] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or 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.
[0111] 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.
[0112] 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 is essentially 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. The computer software product is stored in a storage medium, including a number of instructions for executing all or part of the steps of the method described in each embodiment of the present application through a computer device (which can be a personal computer, server, or network device, etc.). The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store program codes.
[0113] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A product inventory allocation method based on a greedy algorithm, characterized in that: include: Obtain market order information and supplier warehouse information in the database; Determine whether the current market order is a medium-sized order based on the market order information and the supplier warehouse information, and if so, combine the current market order based on heuristic sorting to obtain a sorted combined demand; The supplier warehouse allocation quantity is obtained by rounding off the sorting combination demand quantity and the full container specification parameters; Based on the greedy algorithm, product allocation is performed according to the supplier warehouse allocation quantity and the shipping constraint conditions to obtain an inventory allocation result. The shipping constraint conditions include inventory quantity constraint, return time constraint and distance weight constraint.
2. The product inventory allocation method based on the greedy algorithm according to claim 1 is characterized in that: The obtaining of market order information and supplier warehouse information in the database includes: Extract the product demand, delivery specification parameters, market warehouse location and order placement time of each market order in the database to generate market order information; The product inventory, shipping specification parameters, supplier warehouse location and return time under each warehouse name are extracted from the database to generate supplier warehouse information.
3. The product inventory allocation method based on the greedy algorithm according to claim 2 is characterized in that: The determining whether the current market order is a medium-sized package order based on the market order information and the supplier warehouse information, and if so, combining the current market order based on heuristic sorting to obtain a sorted combined demand, includes: If the current market order is determined to be a medium-sized package order based on the market order information and the supplier warehouse information, the current market orders are sorted in ascending order based on the order placement time to obtain a serial market order; The sequence market orders are traversed based on heuristic sorting, and the current market orders are combined into full-box orders according to the product demand to obtain the sorted combined demand.
4. The product inventory allocation method based on the greedy algorithm according to claim 2 is characterized in that: The method further comprises: determining whether the current market order is a medium-sized package order according to the market order information and the supplier warehouse information; if so, combining the current market order based on heuristic sorting to obtain a sorted combined demand; and If it is not a medium-package specification order, determine whether the receiving specification parameters of the current market order match the shipping specification parameters of the warehouse. If so, sort the current market orders in ascending order according to the order placement time to obtain a time-series market order; Perform rounding calculation based on the product demand and public specification parameters to obtain a single allocation amount; Products are allocated to the time-series market orders according to the single allocation quantity and the single shipment constraint condition to obtain an inventory allocation result.
5. The product inventory allocation method based on the greedy algorithm according to claim 2 is characterized in that: The greedy algorithm is based on which products are allocated according to the supplier warehouse allocation quantity and the shipping constraints to obtain an inventory allocation result. The shipping constraints include inventory quantity constraints, return time constraints and distance weight constraints. The previous method also includes: Sort all warehouses in descending order according to the inventory of the product to generate inventory constraints; Sort the products of each warehouse in ascending order according to the return time to generate a return time constraint; Calculate the distance between warehouses according to the market order information and the warehouse location information in the supplier warehouse information to obtain the warehouse spacing; A distance weight matrix is constructed based on the warehouse spacing, and a distance weight ascending sequence is determined according to the distance weight matrix to generate a distance weight constraint.
6. A product inventory allocation device based on a greedy algorithm, characterized in that: include: A data acquisition unit, used to acquire market order information and supplier warehouse information in a database; An order combination unit is used to determine whether the current market order is a medium-sized package order based on the market order information and the supplier warehouse information, and if so, to combine the current market order based on heuristic sorting to obtain a sorted combined demand; An allocation calculation unit, used to perform rounding calculation based on the sorting combination demand and the full box specification parameters to obtain the supplier warehouse allocation quantity; The inventory allocation unit is used to allocate products based on a greedy algorithm according to the supplier warehouse allocation quantity and shipping constraints to obtain inventory allocation results. The shipping constraints include inventory quantity constraints, return time constraints and distance weight constraints.
7. The product inventory allocation device based on the greedy algorithm according to claim 6, characterized in that: The data acquisition unit is specifically used for: Extract the product demand, delivery specification parameters, market warehouse location and order placement time of each market order in the database to generate market order information; The product inventory, shipping specification parameters, supplier warehouse location and return time under each warehouse name are extracted from the database to generate supplier warehouse information.
8. The product inventory allocation device based on the greedy algorithm according to claim 7, characterized in that: The order combination unit is specifically used for: If the current market order is determined to be a medium-sized package order based on the market order information and the supplier warehouse information, the current market orders are sorted in ascending order based on the order placement time to obtain a serial market order; The sequence market orders are traversed based on heuristic sorting, and the current market orders are combined into full-box orders according to the product demand to obtain the sorted combined demand.
9. The product inventory allocation device based on the greedy algorithm according to claim 7, characterized in that: Also includes: The whole package matching unit is used to determine whether the receiving specification parameters of the current market order match the shipping specification parameters of the warehouse if it is not a medium package specification order, and if so, sort the current market order in ascending order according to the order placement time to obtain a time-series market order; A rounding calculation unit, used for performing rounding calculation according to the product demand and the public specification parameters to obtain a single allocation amount; A single allocation unit is used to allocate products to the time-series market order according to the single allocation quantity and the single shipment constraint condition to obtain an inventory allocation result.
10. A product inventory allocation device based on a greedy algorithm, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the product inventory allocation method based on the greedy algorithm according to any one of claims 1-5 according to the instructions in the program code.