Product shortage calculation method and device, electronic equipment and storage medium
By combining the material shortage calculation method of a complete set of integer planning models and the material shortage integer planning models, the problem of inaccurate material shortage data caused by the impact of material layers in the prior art is solved, and more accurate material shortage data calculation and higher production efficiency are achieved.
Patent Information
- Application Number
- CN202411794796.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-15
AI Technical Summary
The existing material shortage calculation methods cannot accurately solve the impact of materials between different layers, resulting in inaccurate evaluation of material shortage data and reducing production efficiency.
The material shortage calculation method combined with a complete set of integer planning models and material shortage integer planning models is used to obtain the production plan data of the target product, calculate the maximum finished product quantity and the remaining quantity of material inventory. If there is material shortage, calculate the quantity of materials to be consumed and material shortage data corresponding to the quantity of finished products to be produced.
Accurate calculations given the original material inventory are achieved, the accuracy and production efficiency of production planning are improved, and the production planning department can arrange production reasonably and avoid production interruptions caused by insufficient materials.
Smart Images

Figure CN119831504A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for calculating material shortage of a product. Background Art
[0002] In the related technology, there is a method of calculating material shortage data, that is, the production planning department will determine whether the target number of finished products can be produced based on the material inventory situation. If there is a material shortage, sufficient materials need to be prepared in advance. However, the current method of calculating material shortages is to calculate the material situation at each layer of the BOM (Bill of Material), which cannot solve the impact of materials between different layers, resulting in inaccurate evaluation of material shortage data, thereby reducing production efficiency.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The embodiments of the present application aim to solve at least one of the technical problems in the related art to a certain extent. To this end, the main purpose of the embodiments of the present application is to propose a method, device, electronic device and storage medium for calculating material shortage of a product, which can accurately calculate the material shortage data, provide data support for processes such as production planning and material management, and thus improve production efficiency.
[0005] To achieve the above purpose, one aspect of an embodiment of the present application provides a method for calculating product shortage, the method comprising the following steps:
[0006] Acquire production plan data of the target product; wherein the production plan data includes at least one of the following: target finished product quantity and original material inventory quantity;
[0007] Calculate the maximum number of finished products of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models;
[0008] Calculate the remaining quantity of material inventory according to the maximum finished product quantity and the original material inventory quantity;
[0009] If the target finished product quantity is greater than the maximum finished product quantity, the number of finished products to be produced is calculated based on the target finished product quantity and the maximum finished product quantity;
[0010] Calculate the quantity of materials to be consumed corresponding to the quantity of finished products to be produced according to the quantity of finished products to be produced by using a material shortage integer programming model;
[0011] If the quantity of the material to be consumed is greater than the remaining quantity of the material inventory, the material shortage data corresponding to the quantity of the finished products to be produced is calculated based on the quantity of the material to be consumed and the remaining quantity of the material inventory.
[0012] In some embodiments, the method further comprises the step of constructing the complete set of integer programming models, wherein constructing the complete set of integer programming models comprises:
[0013] Constructing a first initial function;
[0014] Setting a first relationship constraint on the first initial function to obtain a first objective function; wherein the first relationship constraint includes a first material relationship constraint and a first material inventory constraint;
[0015] According to the first objective function, the complete set of integer programming models is constructed.
[0016] In some embodiments, the expression of the first objective function is:
[0017]
[0018] Among them, N max It is represented by the maximum number of finished products, T is represented by the total number of nodes, and t i Represented as a semi-finished node, Represented as t i The node level, It means that it takes t to produce one finished product. i Node material The theoretical cumulative demand for Expressed as the penalty coefficient, In the complete integer programming model, t i Node material In the The actual consumption of layer nodes, represents the penalty rule in the uniform integer programming model;
[0019] The expression of the first material relationship constraint is:
[0020]
[0021] Among them, o represents the number of link nodes from the finished product node to the raw material node, t i Represents a semi-finished node, t o Represented as a raw material node, Represented as t i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand for In the complete integer programming model, t i Node material In the The actual consumption of layer nodes, It means that it takes t to produce one finished product.o Node Raw Materials Theoretical cumulative demand, N max Expressed as the maximum number of finished products.
[0022] In some embodiments, the calculating the remaining quantity of material inventory according to the maximum finished product quantity and the original material inventory quantity includes:
[0023] Calculate the maximum finished product material consumption quantity corresponding to the maximum finished product quantity according to the maximum finished product quantity;
[0024] The remaining quantity of the material inventory is calculated based on the maximum finished material consumption quantity and the original material inventory quantity.
[0025] In some embodiments, the method further comprises the step of constructing the material shortage integer programming model, wherein constructing the material shortage integer programming model comprises:
[0026] Constructing a second initial function;
[0027] Setting a second relationship constraint on the second initial function to obtain a second objective function; wherein the second relationship constraint includes a second material relationship constraint and a second material inventory constraint;
[0028] According to the second objective function, the material shortage integer programming model is constructed.
[0029] In some embodiments, the expression of the second objective function is:
[0030]
[0031] Where T represents the total number of nodes, t i Represented as a semi-finished node, Represented as t i The node level, It means that it takes t to produce one finished product. i Node material The theoretical cumulative demand for Expressed as the penalty coefficient, In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, Represents the penalty rule in the short-feed integer programming model;
[0032] The expression of the second material relationship constraint is:
[0033]
[0034] Among them, o represents the number of link nodes from the finished product node to the raw material node, t i Represents a semi-finished node, t o Represented as a raw material node, Represented as t i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand for In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, It means that it takes t to produce one finished product. o Node Raw Materials Theoretical cumulative demand, N target Represents the target number of finished products, N max Expressed as the maximum number of finished products.
[0035] In some embodiments, if the quantity of the material to be consumed is greater than the remaining quantity of the material inventory, calculating the material shortage data corresponding to the number of finished products to be produced according to the quantity of the material to be consumed and the remaining quantity of the material inventory includes:
[0036] If the quantity of the material to be consumed is greater than the remaining quantity of the material inventory, the material shortage data calculation formula is used to calculate the quantity of the material to be consumed and the remaining quantity of the material inventory to obtain the material shortage data corresponding to the number of finished products to be produced; wherein the expression of the material shortage data calculation formula is:
[0037]
[0038] Among them, Q m Represents material shortage data. Represented as the set of all nodes t of non-raw materials (semi-finished products) m, In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, Expressed as the remaining quantity of the material inventory.
[0039] To achieve the above purpose, another aspect of the embodiment of the present application provides a device for calculating product shortage, the device comprising the following modules:
[0040] A production plan data acquisition module is used to acquire production plan data of a target product; wherein the production plan data includes at least one of the following: a target finished product quantity and an original material inventory quantity;
[0041] A maximum finished product quantity calculation module, used for calculating the maximum finished product quantity of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models;
[0042] A material inventory remaining quantity calculation module is used to calculate the material inventory remaining quantity according to the maximum finished product quantity and the original material inventory quantity;
[0043] A module for calculating the number of finished products to be produced, for calculating the number of finished products to be produced according to the target number of finished products and the maximum number of finished products if the target number of finished products is greater than the maximum number of finished products;
[0044] A module for calculating the quantity of materials to be consumed, used for calculating the quantity of materials to be consumed corresponding to the quantity of finished products to be produced according to the quantity of finished products to be produced through a material shortage integer programming model;
[0045] The material shortage data calculation module is used to calculate the material shortage data corresponding to the number of finished products to be produced according to the number of materials to be consumed and the remaining number of material inventory if the number of materials to be consumed is greater than the remaining number of material inventory.
[0046] To achieve the above objective, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0047] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0048] The embodiments of the present application include at least the following beneficial effects: the present application provides a method, device, electronic device and storage medium for calculating material shortage of a product, and the scheme obtains production plan data of the target product; wherein the production plan data includes at least one of the following: the target finished product quantity and the original material inventory quantity; the maximum finished product quantity of the target product under the original material inventory quantity is calculated according to the production plan data through a complete set of integer programming models; the remaining material inventory quantity is calculated according to the maximum finished product quantity and the original material inventory quantity; if the target finished product quantity is greater than the maximum finished product quantity, the number of finished products to be produced is calculated according to the target finished product quantity and the maximum finished product quantity; the number of materials to be consumed corresponding to the number of finished products to be produced is calculated according to the number of finished products to be produced through the material shortage integer programming model; if the number of materials to be consumed is greater than the remaining material inventory quantity, the material shortage data corresponding to the number of finished products to be produced is calculated according to the number of materials to be consumed and the remaining material inventory quantity. The embodiment of the present application can accurately calculate the maximum number of finished products that can be produced under a given original material inventory through a complete set of integer programming models, which is beneficial for the production planning department to arrange production reasonably and avoid production interruptions caused by insufficient materials, thereby improving overall production efficiency; and when the target number of finished products is greater than the maximum number of finished products, that is, there is a shortage of materials, the shortage of materials integer programming model can accurately calculate the number of materials to be consumed corresponding to the number of finished products to be produced, and then accurately calculate the material shortage data corresponding to the number of finished products to be produced based on the number of materials to be consumed and the remaining number of material inventory, thereby guiding the planning department to prepare materials in advance and improve production efficiency and the accuracy of production plans. The embodiment of the present application is based on a shortage calculation method based on a combination of a complete set of integer programming models and a shortage of materials integer programming model, which can solve the influence of materials between different layers, so that the shortage of materials data can be accurately calculated, providing data support for processes such as production planning and material management, thereby improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of the steps of the method for calculating the shortage of the product provided in the embodiment of the present application;
[0050] Figure 2 This is a schematic diagram of a finished product structure provided in an embodiment of the present application;
[0051] Figure 3 It is a structural schematic diagram of a material shortage calculation device of a product provided in an embodiment of the present application;
[0052] Figure 4 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0054] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0055] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] As an example, in actual applications, the planning department will determine whether the required number of finished products can be produced based on the material inventory situation. If there is a shortage of materials, materials need to be prepared in advance. In related technologies, finished products are expanded into a tree-shaped material structure based on the BOM. The middle layers will involve semi-finished materials. The judgment process involves the calculation of the finished product matching rate. The maximum number of finished products that can be produced under a given material inventory is the maximum matching rate. The specific shortage situation is further calculated based on the target number of finished products and the maximum matching data. However, the same material may appear at different levels, and the relationship between materials at different levels will affect the calculation of the optimal matching rate, thereby affecting the calculation of the shortage data. The current method of calculating shortages is to loop through each layer of the BOM to calculate the material situation, which cannot solve the impact of materials between different layers, resulting in inaccurate evaluation of shortage data, thereby reducing production efficiency.
[0058] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for calculating material shortage of a product. The scheme obtains production plan data of the target product; wherein the production plan data includes at least one of the following: a target finished product quantity and an original material inventory quantity; calculates the maximum finished product quantity of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models; calculates the remaining material inventory quantity according to the maximum finished product quantity and the original material inventory quantity; if the target finished product quantity is greater than the maximum finished product quantity, calculates the number of finished products to be produced according to the target finished product quantity and the maximum finished product quantity; calculates the number of materials to be consumed corresponding to the number of finished products to be produced according to the number of finished products to be produced through a material shortage integer programming model; if the number of materials to be consumed is greater than the remaining material inventory quantity, calculates material shortage data corresponding to the number of finished products to be produced according to the number of materials to be consumed and the remaining material inventory quantity. The embodiment of the present application can accurately calculate the maximum number of finished products that can be produced under a given original material inventory through a complete set of integer programming models, which is beneficial for the production planning department to arrange production reasonably and avoid production interruptions caused by insufficient materials, thereby improving overall production efficiency; and when the target number of finished products is greater than the maximum number of finished products, that is, there is a shortage of materials, the shortage of materials integer programming model can accurately calculate the number of materials to be consumed corresponding to the number of finished products to be produced, and then accurately calculate the material shortage data corresponding to the number of finished products to be produced based on the number of materials to be consumed and the remaining number of material inventory, thereby guiding the planning department to prepare materials in advance and improve production efficiency and the accuracy of production plans. The embodiment of the present application is based on a shortage calculation method based on a combination of a complete set of integer programming models and a shortage of materials integer programming model, which can solve the influence of materials between different layers, so that the shortage of materials data can be accurately calculated, providing data support for processes such as production planning and material management, thereby improving production efficiency.
[0059] The method for calculating the shortage of a product provided in the embodiment of the present application relates to the field of data processing technology. The method for calculating the shortage of a product provided in the embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms and other basic cloud computing services. The cloud server, the server can also be a node server in the blockchain network; the software can be an application that implements the method for calculating the shortage of a product, etc., but is not limited to the above forms.
[0060] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs (Personal Computers, personal computers), minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0061] See also Figure 1 , Figure 1 This is an optional step flow chart of the method for calculating the shortage of a product provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0062] Step S101, obtaining production plan data of a target product; wherein the production plan data includes at least one of the following: a target finished product quantity and an original material inventory quantity;
[0063] Among them, the target finished product quantity is the number of finished products planned to be produced within a specific time period based on market demand, sales forecasts or other business goals.
[0064] For the original material inventory quantity, it is the total quantity of various materials actually existing in the warehouse before production starts, which is composed of the quantities of multiple types of materials.
[0065] In the embodiment of the present application, the finished product is expanded into a tree-shaped material structure according to the BOM, and the middle layers will involve semi-finished materials. Specifically, the product BOM material structure is: the product BOM material structure is a tree structure, presenting a multi-layer structure from top to bottom, the top first-layer root node is the finished product, the second layer is the semi-finished material node, and a complete second-layer material can make a finished product; however, some second-layer materials may be missing, and some second-layer material nodes can be expanded into multiple third-layer material nodes, and the second-layer materials can be made from these third-layer materials. This layer-by-layer expansion continues until the last node can no longer be expanded, and the last node is called a leaf node. The material corresponding to the leaf node is called a raw material. When calculating the shortage of materials in the embodiment of the present application, the shortage of raw materials is mainly calculated, and the materials in the middle layer are called semi-finished products. Among them, the upper-layer material is expanded into the lower-layer material, which involves consumption, that is, how much lower-layer material is consumed to produce a corresponding upper-layer material.
[0066] In the embodiment of the present application, it is assumed that a product BOM tree structure is expanded into a total of T nodes, each node is marked as t according to the serial number, where t = 1, 2, ..., T; and the leaf node set is Y = {t|t is a leaf node}, and the leaf node corresponds to the raw material; the total number of all material types involved in the product BOM is set to M, and each material is marked as m = 1, 2, ..., M according to the serial number, where the raw material set is O = {m|m is a raw material}. In the specific implementation, the finished product will traverse the corresponding nodes when it is expanded from the first layer to the leaf node layer by layer, and these nodes can form a raw material leaf node link (t 1 ,t 2 ,...,t i-1 ,t i ,...,t o ), the raw material leaf node link is the finished product node t 1 Expand layer by layer to leaf node t o The traversed node links, where the length of the longest link is equal to the number of layers L in the BOM tree structure, t 1 is the finished product node, i.e. node 1, t o is a leaf node, then the raw material leaf node link set composed of the traversal link is C={(t 1 ,t 2 ,...,t i-1,t i ,...,t o )|t 1 =1,t o ∈Y}, where, due to the upper layer (t i-1 Node) material is expanded to the lower layer (t i Node) materials involve consumption, that is, how much of the lower-level material is consumed to produce a corresponding upper-level material. Therefore, to produce a t i-1 Theoretically, node materials need to consume t i The node material data volume is defined as (Theoretical consumption), t i The actual consumption of the node is t i The material corresponding to the node is Node t i The layer is It should be noted that the parameter o in the link node is a lowercase parameter o, which is used to indicate the number of link nodes from the root node to the leaf node, that is, the link length; and the raw material set is represented by an uppercase parameter O.
[0067] In the specific implementation, set "produce a t i-1 Node material Need i Node material The theoretical demand for The theoretical demand is a known quantity; assuming that “production of one finished product requires t i Node material The theoretical cumulative demand is By path The theoretical cumulative demand is obtained by multiplying the quantity of i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand is The theoretical cumulative demand is a known quantity; set the "stock of material m" to S m , the inventory quantity is a known quantity, that is, the original material inventory quantity; set the "target finished product data" to N target , the target finished product data is a known quantity, also known as the target finished product quantity, that is, the target to be achieved. It should be noted that the above known quantities are all provided by the production plan data.
[0068] In addition, set the "maximum number of finished products" to N max , that is, the maximum number of finished products, in the existing material inventory (the original material inventory quantity S m) products that can be produced under this condition, the maximum number of finished products is an unknown quantity, that is, the maximum number of complete sets that needs to be solved in the embodiment of the present application; set "t i Node material In the The actual consumption of layer nodes is The actual consumption is an unknown quantity. It is solved while solving the maximum number of finished products, that is, the actual consumption corresponding to the maximum number of finished products. Set the "raw material m shortage quantity" to Q m , the shortage quantity is an unknown quantity, that is, the shortage data that the embodiment of the present application needs to obtain in the end. It should be noted that the embodiment of the present application will be described according to the parameters defined above.
[0069] See also Figure 2 , Figure 2 This is a schematic diagram of a finished product structure provided in the embodiment of the present application. Figure 2 As shown, node 1 is the finished product at the top layer; nodes 3, 4, and 6 are intermediate nodes, i.e., semi-finished product nodes, and nodes 3, 4, and 6 are at the 2nd, 2nd, and 3rd layers, respectively; nodes 2, 5, 8, and 7 are all leaf nodes, i.e., representing raw materials, and nodes 2, 5, 8, and 7 are at the 2nd, 3rd, 4th, and 3rd layers, respectively. Among them, the raw material leaf node link set C = {(1, 2), (1, 3, 5), (1, 4, 6, 8), (1, 4, 7)}; among them, r 1,2 represents the theoretical demand for node 2 material to produce one node 1 material, r 1,3 It represents the theoretical demand for node 3 material to produce one node 1 material. The same is true for other nodes. The embodiment of the present application will not be described in detail here.
[0070] Step S102, calculating the maximum number of finished products of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models;
[0071] In some embodiments, the step of constructing a complete set of integer programming models may also be included. Constructing a complete set of integer programming models may include: constructing a first initial function; setting a first relationship constraint on the first initial function to obtain a first objective function; wherein the first relationship constraint includes a first material relationship constraint and a first material inventory constraint; and constructing a complete set of integer programming models according to the first objective function.
[0072] The first initial function is the basic function for constructing a complete set of integer programming models, and no material relationship constraints and material inventory constraints are added. The first relationship constraints include the first material relationship constraints and the first material inventory constraints, which are used to constrain the first initial function to obtain the first objective function; a complete set of integer programming models is constructed based on the first objective function, and the complete set of integer programming models is used to solve (t i Node material In the The actual consumption of the layer nodes) and the N currently stored in the library max (Maximum number of finished products).
[0073] Optionally, the expression of the first objective function is:
[0074]
[0075] Among them, N max It is represented by the maximum number of finished products, T is represented by the total number of nodes, and t i Represented as a semi-finished node, Represented as t i The node level, It means that it takes t to produce one finished product. i Node material The theoretical cumulative demand for Expressed as the penalty coefficient, In the complete integer programming model, t i Node material In the The actual consumption of layer nodes, Represents the penalty rule in the uniform integer programming model.
[0076] Specifically, t i Node hierarchy is a known quantity, and it takes t to produce one finished product i Node material Theoretical cumulative demand is a known quantity, the maximum number of finished products N max and t i Node material In the Actual consumption of layer nodes is an unknown quantity. In the first objective function formula Represents the penalty coefficient. The smaller the layer the node is located, the smaller the penalty is, and vice versa. The penalty coefficient is set to prioritize meeting material requirements from the lower layers. If the lower layers are not satisfied, the higher layers will be used. That is, if there is a lack of semi-finished products, the raw materials will be searched layer by layer to meet the demand. Penalty rules Represents each node multiplying the penalty coefficient by ti Node material In the Actual consumption of layer nodes Then t i =2,...,T are accumulated. Since node 1 is the finished product node, the accumulation starts from node 2 to force the material consumption to be satisfied layer by layer. The first objective function is mainly used to solve N max The maximum value, that is, the maximum set of finished product data (maximum number of finished products), can be obtained at the same time as the maximum set of finished product data. i Node material In the Actual consumption of layer nodes The value of .
[0077] Specifically, the first objective function needs to satisfy the following two types of constraints (first material relationship constraint and first material inventory constraint):
[0078] (1) For the first material relationship constraint: t 1 is the finished product node, t o ∈Y is a leaf node. In each raw material leaf node link (t 1 ,t 2 ,...,t i-1 ,t i ,...,t o ) satisfies the material relationship constraints. The amount of material required to make a finished product is fixed. i Node material In the Actual consumption of layer nodes The maximum number of finished products N must be produced max finished products. Then the expression of the first material relationship constraint is:
[0079]
[0080] Among them, o represents the number of link nodes from the finished product node to the raw material node, t i Represents a semi-finished node, t o Represented as a raw material node, Represented as t i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand for In the complete integer programming model, t i Node material In the The actual consumption of layer nodes, It means that it takes t to produce one finished product. o Node Raw Materials Theoretical cumulative demand, N max It is expressed as the maximum number of finished products. The parameter o in the expression of the first material relationship constraint can be understood as the number of link nodes from the root node to the leaf node, that is, the link length.
[0081] Specifically, t i The node produces a semi-finished material Raw materials needed Theoretical cumulative demand is a known quantity; it takes t to produce one finished product o Node Raw Materials Theoretical cumulative demand is a known quantity; the maximum number of finished products N max is the unknown quantity, t i Node material In the Actual consumption of layer nodes is an unknown quantity; accumulate i=2,...,o. Since node 1 is the finished product node, accumulate from node 2.
[0082] (2) For the first material inventory constraint: The following constraint conditions are applied to each material m. The expression of the first material inventory constraint is as follows:
[0083]
[0084] Among them, the inventory of material m is S m ,{t|m t = m} represents the set of all nodes t whose node material is m. (t i Node material In the The actual consumption of the layer nodes) is accumulated, that is, The total amount does not exceed the existing inventory S m .
[0085] In the specific implementation, a "solve complete set of integer programming models" program is developed. For each finished product demand, the known quantities are calculated and the unknown quantities are defined according to the actual BOM structure information. The pulp open source program is used to create the objective function, and the material relationship constraints and material inventory constraints are configured for the objective function. Then, a complete set of integer programming calculation models is established, and the unknown quantities are solved through the pulp program. (t i Node material In the The actual consumption of the layer node) and the current N max (Maximum number of finished products).
[0086] In step S102 of the embodiment of the present application, the maximum number of complete sets (maximum number of finished products) that can be produced can be calculated in a timely and accurate manner according to the material inventory situation through the complete set integer programming model, so as to determine whether the maximum number of complete sets meets the target number of finished products. If the maximum number of complete sets is greater than or equal to the target number of finished products, it means that there is no shortage of materials. If the maximum number of complete sets is less than the target number of finished products, there is a shortage of materials. The subsequent material shortage integer programming model can be solved to obtain specific material shortage data, thereby guiding the planning department to prepare materials in advance and improve production efficiency.
[0087] Step S103, calculating the remaining quantity of material inventory according to the maximum finished product quantity and the original material inventory quantity;
[0088] In some embodiments, step S103 may include: calculating the maximum finished product material consumption quantity corresponding to the maximum finished product quantity according to the maximum finished product quantity; and calculating the remaining material inventory quantity according to the maximum finished product material consumption quantity and the original material inventory quantity.
[0089] For the maximum finished product material consumption quantity corresponding to the maximum finished product quantity (i.e. ), which can be based on the maximum number of finished products N max , produce a t i-1 Node material Need i Node material Theoretical demand It takes t to produce a finished product i Node material Theoretical cumulative demand t i The node produces a semi-finished material Raw materials needed Theoretical cumulative demand and the inventory S of material m m It can be calculated that t i Node material In the Actual consumption of layer nodes The value of is calculated.
[0090] For the remaining quantity of material inventory, it can be based on the maximum finished product material consumption quantity and the original material inventory quantity (S m ) is calculated.
[0091] Specifically, based on the above maximum number of finished products N max , if the target number of finished products N target Greater than the maximum number of finished products N max , then recalculate the material inventory That is, the remaining quantity of material inventory, the remaining quantity of material inventory The calculation formula is:
[0092]
[0093] in, Expressed as the new inventory of material m (the remaining inventory of the material), S m It is expressed as the original inventory of material m (the original material inventory quantity), It is expressed as the accumulated actual consumption of all nodes t whose node material is m (the maximum consumption of finished materials). Represented as t i Node material In the The actual consumption of layer nodes.
[0094] Step S104, if the target finished product quantity is greater than the maximum finished product quantity, the number of finished products to be produced is calculated according to the target finished product quantity and the maximum finished product quantity;
[0095] For the number of finished products to be produced, it can be obtained by subtracting the maximum number of finished products from the target number of finished products. That is, the target number of finished products N target - Maximum number of finished products N max =The number of finished products to be produced (the number of missing finished products).
[0096] Step S105, calculating the quantity of materials to be consumed corresponding to the quantity of finished products to be produced according to the quantity of finished products to be produced through a material shortage integer programming model;
[0097] In some embodiments, the step of constructing a material shortage integer programming model may also be included. Constructing the material shortage integer programming model may include: constructing a second initial function; setting a second relationship constraint on the second initial function to obtain a second objective function; wherein the second relationship constraint includes a second material relationship constraint and a second material inventory constraint; and constructing the material shortage integer programming model according to the second objective function.
[0098] The second initial function is the basic function for constructing the material shortage integer programming model, and no material relationship constraints and material inventory constraints are added. The second relationship constraints include the second material relationship constraints and the second material inventory constraints, which are used to constrain the second initial function to obtain the second objective function; then the material shortage integer programming model is constructed based on the second objective function, and the material shortage integer programming model is used to solve t i Node material In the Actual consumption of layer nodes (That is, the quantity of materials to be consumed corresponding to the quantity of finished products to be produced).
[0099] In the specific implementation, define t in the shortage integer programming model i Node material In the The actual consumption of layer nodes is This is an unknown quantity that needs to be solved. It is easy to understand that the main requirement is to solve the raw material node consumption It is a leaf node, i.e. raw material consumption.
[0100] Optionally, the expression of the second objective function is:
[0101]
[0102] Where T represents the total number of nodes, t i Represented as a semi-finished node, Represented as t i The node level, It means that it takes t to produce one finished product. i Node material The theoretical cumulative demand for Expressed as the penalty coefficient, In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, Represents the penalty rule in the short-feed integer programming model.
[0103] The goal of the shortage integer programming model is to solve The formula value of the second objective function is maximized, and the second objective function needs to satisfy the following two types of constraints (second material relationship constraint and second material inventory constraint):
[0104] (1) For the second material relationship constraint: t 1 is the finished product node, t o ∈Y is a leaf node. In each raw material leaf node link (t 1 ,t 2 ,...,t i-1 ,t i ,...,t o ) satisfies the material relationship constraints. The amount of material required to make a finished product is fixed, and the actual consumption at each node The maximum number of finished products N must be produced max finished products, and the maximum number of finished products N max A complete set of integer programming models has been derived.
[0105] Optionally, the expression of the second material relationship constraint is:
[0106]
[0107] Among them, o represents the number of link nodes from the finished product node to the raw material node, t i Represents a semi-finished node, t o Represented as a raw material node, Represented as t i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand for In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, It means that it takes t to produce one finished product. o Node Raw Materials Theoretical cumulative demand, N target Represents the target number of finished products, N max It is expressed as the maximum number of finished products. The parameter o in the expression of the second material relationship constraint has the same meaning as the parameter o in the expression of the first material relationship constraint, which can be understood as the number of link nodes from the root node to the leaf node, that is, the link length.
[0108] Specifically, t i The node produces a semi-finished material Raw materials needed Theoretical cumulative demand is a known quantity; N target -N max Currently, it is also a known quantity, representing the number of finished products missing (the number of finished products to be produced); it takes t to produce one finished product. o Node Raw Materials Theoretical cumulative demand is a known quantity; in the shortage integer programming model, t i Node material In the Actual consumption of layer nodes is an unknown quantity; accumulation i=2,...,o, since node 1 is the finished product node, accumulation starts from node 2 in order to force material consumption to be satisfied layer by layer.
[0109] (2) For the second material inventory constraint: For each non-raw material That is, semi-finished products, where O is the set of raw materials. The expression of the second material inventory constraint is:
[0110]
[0111] in, It is represented as the set of all nodes t of non-raw materials (semi-finished products) m, and all these nodes are mapped to the material shortage integer programming model t i Node material In the The actual consumption of layer nodes is Add up and get (the number of materials to be consumed corresponding to the number of finished products to be produced), the total amount No more than current new stock (Material inventory remaining quantity).
[0112] Specifically, the new inventory of material m is a known quantity, which has been calculated in step S103. It should be noted that only m is considered as non-raw material (semi-finished product) material here, because it is assumed that the raw materials are sufficient, and the consumption under ideal conditions without inventory shortage is solved.
[0113] In the specific implementation, similar to building a complete set of integer programming models, a "solving the shortage integer programming model" program is developed. For each finished product demand, the known quantity is calculated and the unknown quantity is defined according to the actual BOM structure information. The pulp open source program is used to create the objective function, and the material relationship constraints and material inventory constraints are configured for the objective function. Then, the shortage integer programming model is established, and the pulp program is used to solve t i Node material In the Actual consumption of layer nodes (i.e. the number of materials to be consumed corresponding to the number of finished products to be produced), especially the actual consumption of raw material nodes, and then the remaining quantity of material inventory Compare and get the shortage quantity.
[0114] In step S105 of the embodiment of the present application, t is solved by using the material shortage integer programming model. i Node material In the Actual consumption of layer nodes (i.e. the number of materials to be consumed corresponding to the number of finished products to be produced), the specific material shortage data can be calculated, and then the planning department can be guided to prepare materials in advance and improve production efficiency.
[0115] Step S106: If the quantity of the materials to be consumed is greater than the remaining quantity of the material inventory, the material shortage data corresponding to the quantity of the finished products to be produced is calculated according to the quantity of the materials to be consumed and the remaining quantity of the material inventory.
[0116] In some embodiments, step S106 may include: if the quantity of materials to be consumed is greater than the remaining quantity of the material inventory, a material shortage data calculation formula is used to calculate the quantity of materials to be consumed and the remaining quantity of the material inventory to obtain material shortage data corresponding to the number of finished products to be produced; wherein the expression of the material shortage data calculation formula is:
[0117]
[0118] Among them, Q m Represents material shortage data. Represented as the set of all nodes t of non-raw materials (semi-finished products) m, In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, Expressed as the remaining quantity of the material inventory.
[0119] Specifically, Q m It is expressed as the shortage quantity of raw material m (the shortage data of the material corresponding to the quantity of finished products to be produced); It is represented as the new inventory of material m (the remaining quantity of material inventory); m is the raw material material, that is, m∈O, where {t|m t =m,m∈O} represents the set of all nodes t of raw material m, and all these nodes are mapped to the material shortage integer programming model t i Node material In the The actual consumption of layer nodes is Add up and get (the number of materials to be consumed corresponding to the number of finished products to be produced), that is, the consumption in an ideal situation where there is no inventory shortage. m >0 means the raw material is out of stock, and the quantity of the shortage is equal to Q m If Q m ≤0 means that there is no shortage of the raw material.
[0120] In the finished product complete set shortage calculation method based on mixed integer programming provided in the embodiment of the present application, the objective function in the complete set integer programming model is to solve the maximum number of finished products, and the objective function of the shortage integer programming model is to solve the actual consumption of a certain material at an intermediate node at a certain level of the node. The constraints are all constraints on the material inventory quantity and the relationship constraints on different levels of materials. The variables are all the actual consumption quantity of each material node in the tree material structure, and priority is given to deducting from the low-level material inventory. The composed mathematical model is called linear programming, and the material consumption may be an integer or a non-integer, so the model becomes a mixed integer programming.
[0121] Steps S101 to S106 shown in the embodiment of the present application are obtained by obtaining production plan data of the target product; wherein the production plan data includes at least one of the following: a target finished product quantity and an original material inventory quantity; calculating the maximum finished product quantity of the target product under the original material inventory quantity according to the production plan data through a complete integer programming model; calculating the remaining material inventory quantity according to the maximum finished product quantity and the original material inventory quantity; if the target finished product quantity is greater than the maximum finished product quantity, calculating the number of finished products to be produced according to the target finished product quantity and the maximum finished product quantity; calculating the number of materials to be consumed corresponding to the number of finished products to be produced according to the number of finished products to be produced through a shortage integer programming model; if the number of materials to be consumed is greater than the remaining material inventory quantity, calculating the material shortage data corresponding to the number of finished products to be produced according to the number of materials to be consumed and the remaining material inventory quantity. The embodiment of the present application can accurately calculate the maximum number of finished products that can be produced under a given original material inventory through a complete set of integer programming models, which is beneficial for the production planning department to arrange production reasonably and avoid production interruptions caused by insufficient materials, thereby improving overall production efficiency; and when the target number of finished products is greater than the maximum number of finished products, that is, there is a shortage of materials, the shortage of materials integer programming model can accurately calculate the number of materials to be consumed corresponding to the number of finished products to be produced, and then accurately calculate the material shortage data corresponding to the number of finished products to be produced based on the number of materials to be consumed and the remaining number of material inventory, thereby guiding the planning department to prepare materials in advance and improve production efficiency and the accuracy of production plans. The embodiment of the present application is based on a shortage calculation method based on a combination of a complete set of integer programming models and a shortage of materials integer programming model, which can solve the influence of materials between different layers, so that the shortage of materials data can be accurately calculated, providing data support for processes such as production planning and material management, thereby improving production efficiency.
[0122] In the method for calculating the lack of complete sets of finished products based on mixed integer programming provided in the embodiments of the present application, for finished products with the most complex BOM structure, such as a finished product BOM with a 6-layer BOM and more than 1,000 material nodes, the method for calculating the lack of complete sets of finished products based on mixed integer programming provided in the embodiments of the present application can quickly calculate the maximum number of complete sets and the specific number of missing materials, which is faster and more accurate than other current related technologies.
[0123] See also Figure 3 The embodiment of the present application also provides a product shortage calculation device 300, which can implement the above product shortage calculation method, and the device includes the following modules:
[0124] The production plan data acquisition module 301 is used to acquire the production plan data of the target product; wherein the production plan data includes at least one of the following: the target finished product quantity and the original material inventory quantity;
[0125] A maximum finished product quantity calculation module 302 is used to calculate the maximum finished product quantity of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models;
[0126] A material inventory remaining quantity calculation module 303 is used to calculate the material inventory remaining quantity according to the maximum finished product quantity and the original material inventory quantity;
[0127] The module 304 for calculating the number of finished products to be produced is used to calculate the number of finished products to be produced according to the target number of finished products and the maximum number of finished products if the target number of finished products is greater than the maximum number of finished products;
[0128] The module 305 for calculating the quantity of materials to be consumed is used to calculate the quantity of materials to be consumed corresponding to the quantity of finished products to be produced according to the quantity of finished products to be produced by using a material shortage integer programming model;
[0129] The material shortage data calculation module 306 is used to calculate the material shortage data corresponding to the number of finished products to be produced according to the number of materials to be consumed and the remaining number of materials in stock if the number of materials to be consumed is greater than the remaining number of materials in stock.
[0130] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0131] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned product shortage calculation method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0132] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0133] See also Figure 4 , Figure 4 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0134] The processor 401 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0135] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 402, and the processor 401 calls and executes the shortage calculation method of the product in the embodiment of this application;
[0136] Input / output interface 403, used to implement information input and output;
[0137] Communication interface 404, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0138] Bus 405 , which transmits information between various components of the device (e.g., processor 401 , memory 402 , input / output interface 403 , and communication interface 404 );
[0139] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via the bus 405 .
[0140] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for calculating the shortage of the product is implemented.
[0141] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0142] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0143] The embodiments of the present application provide a method for calculating product shortage, a device for calculating product shortage, an electronic device and a storage medium, which obtain production plan data of a target product; wherein the production plan data includes at least one of the following: a target number of finished products and an original material inventory number; calculating the maximum number of finished products of the target product under the original material inventory number according to the production plan data through a complete set of integer programming models; calculating the remaining number of material inventory according to the maximum number of finished products and the original material inventory number; if the target number of finished products is greater than the maximum number of finished products, calculating the number of finished products to be produced according to the target number of finished products and the maximum number of finished products; calculating the number of materials to be consumed corresponding to the number of finished products to be produced according to the number of finished products to be produced through a material shortage integer programming model; if the number of materials to be consumed is greater than the remaining number of material inventory, calculating the material shortage data corresponding to the number of finished products to be produced according to the number of materials to be consumed and the remaining number of material inventory. The embodiment of the present application can accurately calculate the maximum number of finished products that can be produced under a given original material inventory through a complete set of integer programming models, which is beneficial for the production planning department to arrange production reasonably and avoid production interruptions caused by insufficient materials, thereby improving overall production efficiency; and when the target number of finished products is greater than the maximum number of finished products, that is, there is a shortage of materials, the shortage of materials integer programming model can accurately calculate the number of materials to be consumed corresponding to the number of finished products to be produced, and then accurately calculate the material shortage data corresponding to the number of finished products to be produced based on the number of materials to be consumed and the remaining number of material inventory, thereby guiding the planning department to prepare materials in advance and improve production efficiency and the accuracy of production plans. The embodiment of the present application is based on a shortage calculation method based on a combination of a complete set of integer programming models and a shortage of materials integer programming model, which can solve the influence of materials between different layers, so that the shortage of materials data can be accurately calculated, providing data support for processes such as production planning and material management, thereby improving production efficiency.
[0144] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0145] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0146] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0148] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0149] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. 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.
[0151] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0152] 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.
[0153] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0154] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for calculating product shortage, characterized in that: The method comprises the following steps: Acquire production plan data of the target product; wherein the production plan data includes at least one of the following: target finished product quantity and original material inventory quantity; Calculate the maximum number of finished products of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models; Calculate the remaining quantity of material inventory according to the maximum finished product quantity and the original material inventory quantity; If the target finished product quantity is greater than the maximum finished product quantity, the number of finished products to be produced is calculated based on the target finished product quantity and the maximum finished product quantity; Calculate the quantity of materials to be consumed corresponding to the quantity of finished products to be produced according to the quantity of finished products to be produced by using a material shortage integer programming model; If the quantity of the material to be consumed is greater than the remaining quantity of the material inventory, the material shortage data corresponding to the quantity of the finished products to be produced is calculated based on the quantity of the material to be consumed and the remaining quantity of the material inventory.
2. The method according to claim 1, characterized in that The method further comprises the step of constructing the complete set of integer programming models, wherein the step of constructing the complete set of integer programming models comprises: Constructing a first initial function; Setting a first relationship constraint on the first initial function to obtain a first objective function; wherein the first relationship constraint includes a first material relationship constraint and a first material inventory constraint; According to the first objective function, the complete set of integer programming models is constructed.
3. The method according to claim 2, characterized in that The expression of the first objective function is: Among them, N max It is represented by the maximum number of finished products, T is represented by the total number of nodes, and t i Represented as a semi-finished node, Represented as t i The node level, It means that it takes t to produce one finished product. i Node material The theoretical cumulative demand for Expressed as the penalty coefficient, In the complete integer programming model, t i Node material In the The actual consumption of layer nodes, represents the penalty rule in the uniform integer programming model; The expression of the first material relationship constraint is: Among them, o represents the number of link nodes from the finished product node to the raw material node, t i Represents a semi-finished node, t o Represented as a raw material node, Represented as t i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand for In the complete integer programming model, t i Node material In the The actual consumption of layer nodes, It means that it takes t to produce one finished product. o Node Raw Materials Theoretical cumulative demand, N max Expressed as the maximum number of finished products.
4. The method according to claim 1, characterized in that: The calculating the remaining quantity of material inventory according to the maximum finished product quantity and the original material inventory quantity includes: Calculate the maximum finished product material consumption quantity corresponding to the maximum finished product quantity according to the maximum finished product quantity; The remaining quantity of the material inventory is calculated based on the maximum finished material consumption quantity and the original material inventory quantity.
5. The method according to claim 1, characterized in that The method further comprises the step of constructing the material shortage integer programming model, wherein the constructing the material shortage integer programming model comprises: Constructing a second initial function; Setting a second relationship constraint on the second initial function to obtain a second objective function; wherein the second relationship constraint includes a second material relationship constraint and a second material inventory constraint; According to the second objective function, the material shortage integer programming model is constructed.
6. The method according to claim 5, characterized in that The expression of the second objective function is: Where T represents the total number of nodes, t i Represented as a semi-finished node, Represented as t i The node level, It means that it takes t to produce one finished product. i Node material The theoretical cumulative demand for Expressed as the penalty coefficient, In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, Represents the penalty rule in the short-feed integer programming model; The expression of the second material relationship constraint is: Among them, o represents the number of link nodes from the finished product node to the raw material node, t i Represents a semi-finished node, t o Represented as a raw material node, Represented as t i The node produces a semi-finished material Raw materials needed The theoretical cumulative demand for In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, It means that it takes t to produce one finished product. o Node Raw Materials Theoretical cumulative demand, N target Represents the target number of finished products, N max Expressed as the maximum number of finished products.
7. The method according to claim 1, characterized in that If the quantity of the material to be consumed is greater than the remaining quantity of the material inventory, calculating the material shortage data corresponding to the number of finished products to be produced according to the quantity of the material to be consumed and the remaining quantity of the material inventory, including: If the quantity of the material to be consumed is greater than the remaining quantity of the material inventory, the material shortage data calculation formula is used to calculate the quantity of the material to be consumed and the remaining quantity of the material inventory to obtain the material shortage data corresponding to the number of finished products to be produced; wherein the expression of the material shortage data calculation formula is: Among them, Q m Represents material shortage data. Represented as the set of all nodes t of non-raw materials (semi-finished products) m, In the shortage integer programming model, t i Node material In the The actual consumption of layer nodes, Represented as the remaining quantity of the material inventory.
8. A device for calculating the shortage of products, characterized in that: The device comprises the following modules: A production plan data acquisition module is used to acquire production plan data of a target product; wherein the production plan data includes at least one of the following: a target finished product quantity and an original material inventory quantity; A maximum finished product quantity calculation module, used for calculating the maximum finished product quantity of the target product under the original material inventory quantity according to the production plan data through a complete set of integer programming models; A material inventory remaining quantity calculation module is used to calculate the material inventory remaining quantity according to the maximum finished product quantity and the original material inventory quantity; A module for calculating the number of finished products to be produced, for calculating the number of finished products to be produced according to the target number of finished products and the maximum number of finished products if the target number of finished products is greater than the maximum number of finished products; A module for calculating the quantity of materials to be consumed, used for calculating the quantity of materials to be consumed corresponding to the quantity of finished products to be produced according to the quantity of finished products to be produced through a material shortage integer programming model; The material shortage data calculation module is used to calculate the material shortage data corresponding to the number of finished products to be produced according to the number of materials to be consumed and the remaining number of material inventory if the number of materials to be consumed is greater than the remaining number of material inventory.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.