Artificial intelligence-based production planning method and device, computer equipment and medium
Patent Information
- Application Number
- CN202210815947.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-07-12
AI Technical Summary
[0004]有鉴于此,本发明实施例提供了一种基于人工智能的生产规划方法、装置、计算机设备及介质,以解决在保证生产规划准确率的情况下,生产规划的效率较低的问题
Smart Images

Figure CN115130894B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a production planning method, apparatus, computer equipment, and medium based on artificial intelligence. Background Technology
[0002] Currently, the sales model for products typically adopts a pre-sale model to avoid unsold or out-of-stock situations during the sales process, and to determine the production plan based on the pre-sale situation. However, the pre-sale model will cause buyers to have to go through a waiting period for the product, during which buyers may be lost, resulting in lower product competitiveness. Therefore, before producing the product, the manufacturer usually has relevant planning personnel to conduct production planning based on historical sales information and the company's historical production information.
[0003] However, due to the strong coupling between sales and production information, planners find it difficult to accurately describe the relationship between sales and production information when processing related information, resulting in low accuracy in production planning. Furthermore, during application, it is necessary to fine-tune the production plans for each product based on the company's inventory capacity. Manual adjustments are difficult to make quickly and effectively, leading to low efficiency in production planning. Therefore, how to improve the efficiency of production planning while ensuring its accuracy has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a production planning method, apparatus, computer equipment, and medium based on artificial intelligence to solve the problem of low efficiency in production planning while ensuring the accuracy of production planning.
[0005] In a first aspect, embodiments of the present invention provide a production planning method based on artificial intelligence, the production planning method comprising:
[0006] Obtain historical sales data of the product to be manufactured during the sampling period, input the historical sales data into the trained sales prediction model, and obtain the predicted sales for the target period.
[0007] Obtain production information of the products to be produced during the target time period, input the predicted sales and the production information into the trained production prediction model, and obtain the predicted production for the target time period.
[0008] Calculate the difference between the predicted output and the predicted sales, determine the difference as the predicted inventory, and check whether the predicted inventory meets the preset conditions. If the predicted inventory does not meet the preset conditions, input the predicted output into a pre-trained variational autoencoder for N sampling to generate N optimized outputs, where N is an integer greater than zero.
[0009] The difference between the N optimized production outputs and the predicted sales volume is calculated to determine the corresponding optimized production output as the corresponding optimized inventory quantity. Based on the optimized inventory quantity that meets the preset conditions among the N optimized inventory quantities, the production quantity of the product to be produced in the target time period is determined. The production quantity is used to guide the producer in production planning.
[0010] Secondly, embodiments of the present invention provide an artificial intelligence-based production planning device, the production planning device comprising:
[0011] The sales forecasting module is used to obtain historical sales data of the products to be produced during the sampling period, input the historical sales data into the trained sales forecasting model, and obtain the predicted sales for the target period.
[0012] The production forecasting module is used to obtain production information of the products to be produced during the target time period, input the predicted sales and the production information into the trained production forecasting model, and obtain the predicted production for the target time period.
[0013] The production optimization module is used to calculate the difference between the predicted production and the predicted sales, determine the difference as the predicted inventory, and detect whether the predicted inventory meets the preset conditions. If the predicted inventory does not meet the preset conditions, the predicted production is input into a pre-trained variational autoencoder for N sampling to generate N optimized productions, where N is an integer greater than zero.
[0014] The planning generation module is used to calculate the difference between the N optimized production volumes and the predicted sales volume, determine the corresponding optimized production volume as the corresponding optimized inventory volume, and determine the production volume of the product to be produced in the target time period based on the optimized inventory volume that meets the preset conditions among the N optimized inventory volumes. The production volume is used to guide the producer in production planning.
[0015] Thirdly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the production planning method as described in the first aspect.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the production planning method as described in the first aspect.
[0017] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:
[0018] Historical sales data of the product to be manufactured during the sampling period are obtained. This historical sales data is input into a trained sales prediction model to obtain the predicted sales volume for the target period. Production information of the product to be manufactured during the target period is also obtained. The predicted sales volume and production information are input into a trained production prediction model to obtain the predicted production volume for the target period. The difference between the predicted production volume and the predicted sales volume is calculated, and this difference is determined as the predicted inventory level. It is then checked whether the predicted inventory level meets preset conditions. If the predicted inventory level does not meet the preset conditions, the predicted production volume is input into a pre-trained variational autoencoder for N sampling iterations to generate N optimized production volumes, where N is a positive integer. These N optimized production volumes are then compared with... The system calculates the difference between predicted sales and the corresponding optimized production output, which is then used as the optimized inventory level. Based on the optimized inventory levels that meet preset conditions from among N optimized inventory levels, the production volume of the products to be produced within the target time period is determined. This production volume guides producers in production planning. By evaluating production output through inventory levels, the system avoids situations where inventory exceeds limits during production, thus preventing additional losses and improving the accuracy of production planning. Simultaneously, a variational autoencoder is used to generate optimized production output and fine-tune the predicted output. This prevents conflicting production forecasts for multiple products from causing difficulties in determining a reasonable production plan due to inventory constraints, thereby improving the efficiency of production planning. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of an application environment for a production planning method based on artificial intelligence provided in Embodiment 1 of the present invention;
[0021] Figure 2 This is a flowchart illustrating a production planning method based on artificial intelligence provided in Embodiment 1 of the present invention;
[0022] Figure 3 This is a flowchart illustrating a production planning method based on artificial intelligence provided in Embodiment 2 of the present invention;
[0023] Figure 4 This is a schematic diagram of the structure of a production planning device based on artificial intelligence provided in Embodiment 3 of the present invention;
[0024] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Detailed Implementation
[0025] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0026] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0027] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0028] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0029] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0031] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0032] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0033] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0034] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0035] The production planning method based on artificial intelligence provided in Embodiment 1 of this invention can be applied to, for example... Figure 1 In this application environment, the client and server communicate with each other. Clients include, but are not limited to, PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0036] See Figure 2 This is a flowchart illustrating a production planning method based on artificial intelligence provided in Embodiment 1 of the present invention. The above-described production planning method can be applied to... Figure 1 In the client-side architecture, the corresponding computer device, upon receiving the production planning instruction for the product to be produced, accesses the server to obtain historical sales data and production information for the product to be produced, in order to predict sales volume and output. The client-side also stores real-time inventory limit information to determine whether the predicted sales volume and predicted output meet the inventory limits. Figure 2 As shown, this production planning method may include the following steps:
[0037] Step S201: Obtain historical sales data of the product to be produced during the sampling period, input the historical sales data into the trained sales prediction model, and obtain the predicted sales for the target period.
[0038] Among them, the products to be manufactured can refer to products that require production planning for production, the sampling period can refer to the preset period of time for acquiring historical sales data of the products to be manufactured, the historical sales data can refer to the data of the products to be manufactured in the past sales, and the historical sales data of a sampling period can include the total number of purchases of the products to be manufactured in the sampling period, the number of times the products to be manufactured were purchased consecutively by the same customer in the sampling period, the number of times the products to be manufactured were purchased by the same customer in the sampling period, the number of times the products to be manufactured were complained about by customers for quality problems in the sampling period, and the customer feedback information collected for the products to be manufactured in the sampling period.
[0039] Sales forecasting models can refer to end-to-end models such as neural network models and logistic regression models.
[0040] The target time period can refer to the planned generation time period, and the predicted sales volume can refer to the predicted sales volume within the target time period.
[0041] Specifically, the sampling time period can include M sampling time points and an initial time point, where M is an integer greater than one. For the m-th sampling time point, the value of m is an integer within the range of [1, M]. The historical sales data corresponding to the m-th sampling time point is the statistical result of the sales data between the (m-1)-th sampling time point and the m-th sampling time point. It should be noted that if m is 1, then the historical sales data corresponding to the 1st sampling time point is the statistical result of the sales data between the initial time point and the 1st sampling time point.
[0042] The sales data corresponding to a sampling time point can be represented in vector form, where each element in the vector corresponds to a type of historical sales data. For example, in this embodiment, the vector size is 1*5, that is, one row and five columns. The elements in the first column correspond to the total number of purchases of the product to be produced at the sampling time point; the elements in the second column correspond to the number of times the product to be produced was purchased consecutively by the same customer at the sampling time point; the elements in the third column correspond to the number of times the product to be produced was purchased by the same customer at the sampling time point; the elements in the fourth column correspond to the number of times the product to be produced was complained about for quality issues by customers at the sampling time point; and the elements in the fifth column correspond to the customer feedback information collected for the product to be produced at the sampling time point.
[0043] In this embodiment, the sales data corresponding to a sampling time period can be represented in matrix form, with a matrix size of M*5, that is, M rows and 5 columns, where the m-th row represents the sales data collected at the m-th sampling time point.
[0044] The matrix of sales data corresponding to a sampling time period is used as the input to the trained sales prediction model to obtain the predicted sales for the target time period, which can be the time period adjacent to the sampling time period.
[0045] In one embodiment, the sales data corresponding to a sampling time period can also be represented in vector form, with a vector size of 1*5M, that is, 1 row and 5M columns, where columns 5m-4 to 5m represent the sales data collected at the m-th sampling time point.
[0046] Optionally, the sales forecasting model includes a first encoder and a first fully connected layer, using historical sales data of the sample product during the sample sampling period as training samples for training the sales forecasting model, using the actual sales of the sample product during the target sample period as labels for training the sales forecasting model, and using mean squared error loss as the loss function for training the sales forecasting model.
[0047] The training process for the sales forecasting model includes:
[0048] The training samples are input into the first encoder for feature extraction to obtain the sample feature tensor;
[0049] The sample feature tensor is input into the first fully connected layer for feature mapping to obtain the sample predicted sales for the target time period.
[0050] Based on the predicted and actual sales from the samples, the mean squared error loss is calculated. Using the mean squared error loss as a basis, the parameters of the sales prediction model are updated in reverse using the gradient descent method until the mean squared error loss converges, thus obtaining the trained sales prediction model.
[0051] The first encoder can be used to extract features from historical sales data, the first fully connected layer can be used to map the features extracted by the first encoder to the output space, the sample product can refer to the product that is currently in production, and the sample sampling time period can refer to the sampling time period set for the sample product.
[0052] Actual sales volume refers to the actual number of sample products sold during the target time period.
[0053] Specifically, when selecting sample products, it is recommended to choose products similar to the type of products to be produced as sample products to avoid the impact of differences in product sales conditions on sales forecasts. Correspondingly, to avoid differences in product sales conditions due to different time periods, it is recommended that the sample sampling period be consistent with the sampling period. It should be noted that the above sample product selection process will result in a smaller generalization ability of the sales forecast model. If resources permit, implementers are advised to select several produced products as sample products in each product type to improve the generalization ability of the sales forecast model.
[0054] This embodiment provides two methods for determining sample products, thereby adapting to different training times and resources, and improving the accuracy of the trained sales forecasting model when forecasting the sales of products to be produced.
[0055] The steps described above—obtaining historical sales data of the product to be produced during the sampling period, inputting the historical sales data into the trained sales forecasting model, and obtaining the predicted sales for the target period—enrich the characteristics of the sales data by using multi-dimensional historical sales data to predict the sales for the target period, thereby improving the accuracy of sales forecasting and ultimately improving the accuracy of production planning.
[0056] Step S202: Obtain production information of the product to be produced in the target time period, input the predicted sales and production information into the trained production prediction model, and obtain the predicted production for the target time period.
[0057] Among them, production information can refer to the production factors of the product to be produced during the production process. Production factors can include the production cycle, resource utilization rate, production efficiency, etc. of the product to be produced.
[0058] Production forecasting models can refer to forecasting models such as neural network models and logistic regression models. Predicted production can refer to the predicted production value of products to be produced within a target time period.
[0059] Specifically, production information can be represented in vector form, where each element represents a type of production factor. For example, if the vector size is 1*3, that is, one row and three columns, then the first column represents the production cycle of the product to be produced, the second column represents the resource utilization rate of the product to be produced, and the third column represents the production efficiency of the product to be produced.
[0060] The production prediction model consists of a second fully connected layer and two feature extraction branches. The first branch is the sales volume feature extraction branch, and the second branch is the production information feature extraction branch. The input of the sales volume feature extraction branch is the predicted sales volume, and the output is a sales volume feature tensor. The input of the production information feature extraction branch is the production information, and the output is a production information feature tensor. The output feature tensors of the two branches are concatenated and then input into the second fully connected layer for feature mapping to obtain the predicted production volume of the product to be produced in the target time period.
[0061] The steps described above—obtaining production information for the product to be produced within a target time period, inputting the predicted sales and production information into a trained production prediction model to obtain the predicted production for the target time period—improve the representational ability of the features by fusing the features corresponding to the predicted sales and production information, thereby improving the accuracy of production prediction and ultimately enhancing the accuracy of production planning.
[0062] Step S203: Calculate the difference between the predicted production and the predicted sales, determine the difference as the predicted inventory, and check whether the predicted inventory meets the preset conditions. If the predicted inventory does not meet the preset conditions, input the predicted production into the pre-trained variational autoencoder for N sampling to generate N optimized production values.
[0063] Where N is a positive integer, the predicted inventory level can refer to the quantity of products that may be stored after production based on the predicted output and sales volume, and the preset conditions can be used to determine whether the predicted inventory level meets the actual inventory limit.
[0064] Variational autoencoders can be used to optimize output generation. A variational autoencoder includes a second encoder and a decoder. Sampling generation refers to sampling the latent variable distribution extracted by the second encoder in the variational autoencoder and then reconstructing the sampling results to achieve the effect of data generation. Optimizing output refers to fine-tuning the predicted output.
[0065] Specifically, during training, the variational autoencoder uses the actual output of the sample products as training samples and the optimization loss as the loss function during training. The optimization loss is specifically as follows:
[0066] L=d(x,x′)+e -d(x,x′)
[0067] Where x represents the training sample, x′ represents the reconstructed sample output by the variational autoencoder after inputting the training sample, and d(x, x′) represents the Euclidean distance between the training sample and the reconstructed sample. The purpose of this optimization loss is to make the reconstructed sample as close as possible to the training sample, while ensuring that the reconstructed sample is different from the training sample, thus achieving the optimization effect. When d(x, x′) is close to 0, the optimization loss focuses more on e -d(x,x′) To reduce loss, the training process will increase d(x, x′), meaning that even if the reconstructed samples differ from the training samples, when d(x, x′) is large, e -d(x,x′) When the value is close to 0, the optimization loss focuses more on d(x, x′). In order to reduce the loss, the training process will reduce d(x, x′), that is, make the reconstructed sample as close as possible to the training sample.
[0068] Optionally, checking whether the predicted inventory level meets preset conditions includes:
[0069] Detect whether the predicted inventory level is less than the preset inventory limit;
[0070] If the predicted inventory level is less than the upper limit of inventory, then check whether the predicted inventory level is greater than the preset lower limit of inventory.
[0071] If the predicted inventory level is greater than the lower limit of inventory, then the predicted inventory level meets the preset conditions; otherwise, the predicted inventory level does not meet the preset conditions.
[0072] The upper and lower limits of inventory are determined by actual inventory information. The upper limit of inventory can refer to the remaining storable amount of actual inventory, and the lower limit of inventory can refer to the minimum storable amount of actual inventory.
[0073] Specifically, the purpose of setting an upper limit on inventory is to prevent inventory from exceeding the limit, while the purpose of setting a lower limit on inventory is to prevent excessively low utilization of inventory space and reduced sales flexibility.
[0074] It should be noted that the predicted inventory levels of multiple products awaiting production can be combined and judged based on preset conditions, thereby enabling a more rational allocation of inventory.
[0075] This embodiment determines the preset conditions for predicting inventory levels based on actual inventory information, thereby avoiding inventory exceeding limits and causing additional losses, while also avoiding excessively low inventory space utilization and improving sales flexibility.
[0076] Optionally, the predicted output is input into a pre-trained variational autoencoder for N sampling iterations to generate N optimized outputs, including:
[0077] Input the predicted sales volume and predicted production volume into the trained distribution prediction model to obtain the predicted sampling distribution;
[0078] Based on the predicted sampling distribution, the pre-trained variational autoencoder performs N samplings, and based on the results of the N samplings, N optimized outputs are obtained.
[0079] Among them, the distribution prediction model can be used to predict the sampling distribution in the variational autoencoder. The predicted sampling distribution can refer to the weight distribution at each sampling position during sampling.
[0080] Specifically, the predicted sampling distribution is consistent with the range of the latent variable distribution obtained by the variational autoencoder. The predicted sampling distribution is multiplied with the latent variable distribution obtained by the variational autoencoder to adjust the probability of each position of the latent variable distribution being sampled. In addition, the sampling process has a bias, thereby avoiding invalid sampling.
[0081] This embodiment adjusts the probability of latent variable distribution being sampled at each position by predicting the sampling distribution, thereby increasing the probability of effective sampling, reducing the situation where the optimized output does not meet the preset conditions, and improving the efficiency of production planning.
[0082] Optionally, the actual sales volume and actual output of the sample products during the target time period are used as the second training samples when training the distribution prediction model, and the cross-entropy loss is used as the loss function when training the distribution prediction model.
[0083] The training process for the distribution prediction model includes:
[0084] Obtain the sampled value corresponding to the optimized inventory level of each corresponding sample product when sampling in the pre-trained variational autoencoder, and convert the sampled value into a sampled vector;
[0085] All sampling vectors are superimposed, and the normalization exponential function is used to normalize each element in the superposition result to obtain the sampling probability distribution. The sampling probability distribution is then determined as the label.
[0086] Input the second training sample into the distribution prediction model to obtain the sample distribution;
[0087] Based on the sample distribution and sampling probability distribution, the cross-entropy loss is calculated. Using the cross-entropy loss as a basis, the parameters of the distribution prediction model are updated in reverse using the gradient descent method until the cross-entropy loss converges, thus obtaining the trained distribution prediction model.
[0088] Here, the sampled value can refer to the sampling result, and the sampling vector can refer to the vector composed of the sampling results of each sampling position. For example, the sampling vector is 1*Q in size, which means there are Q sampling positions, where the qth position is 1 and the others are 0, indicating that the qth position is sampled.
[0089] The sampling probability distribution can include the probability that each sampling location will be sampled.
[0090] Specifically, by superimposing all the sampling vectors point by point, and then normalizing the superposition result using the normalization exponential function (Softmax function), the sampling probability distribution composed of the probability values of each element can be obtained.
[0091] This embodiment constructs a sampling probability distribution by using the sampled values corresponding to the optimized inventory quantity that meet preset conditions. The sampling probability distribution is then used as a label to train the distribution prediction model, which can better adapt to the distribution prediction task and improve the accuracy of distribution prediction.
[0092] The above steps involve calculating the difference between predicted production and predicted sales, determining the difference as the predicted inventory level, and checking whether the predicted inventory level meets preset conditions. If the predicted inventory level does not meet the preset conditions, the predicted production is input into a pre-trained variational autoencoder for N sampling iterations to generate N optimized production levels. By generating optimized production through the variational autoencoder, there is no need to analyze production information and predicted sales again. Instead, production is directly optimized to ensure that the subsequent optimized inventory level meets the preset conditions, which greatly reduces analysis costs and improves the efficiency of production planning.
[0093] Step S204: Calculate the difference between the N optimized production outputs and the predicted sales volume, determine the corresponding optimized production output as the corresponding optimized inventory quantity, and determine the production quantity of the product to be produced in the target time period based on the optimized inventory quantity that meets the preset conditions among the N optimized inventory quantities.
[0094] Among these, optimized inventory levels can refer to inventory levels determined by optimizing production output and forecasting sales, while production volume is used to guide producers in production planning.
[0095] Specifically, the target time period includes several target time points, and the production volume of the target time period includes the production volume corresponding to each target time point. Implementers can analyze and evaluate the production volume of the target time period. If the production volume is determined to be reasonable, it can be used directly as the production plan for the products to be produced, or it can be used as a reference for planners to determine the production plan for the products to be produced. Using the production volume as a reference can also effectively improve the efficiency of production planning.
[0096] Optionally, the target time period includes at least two target time points;
[0097] Based on the optimized inventory levels that meet the preset conditions from among N optimized inventory levels, the production quantity of the products to be produced during the target time period is determined, including:
[0098] For any optimized inventory quantity that meets the preset conditions, calculate the variance of the sub-inventory quantities at all corresponding target time points within the optimized inventory quantity;
[0099] The optimal inventory level with the minimum variance is determined as the target inventory level. Based on the optimal sub-output of all corresponding target time points within the target inventory level, the production volume of the product to be produced in the target time period is determined.
[0100] Among them, sub-inventory quantity can refer to the inventory quantity corresponding to each target time point, target inventory quantity can refer to the most stable optimized inventory quantity, and optimized sub-output can refer to the optimized output corresponding to each target time point.
[0101] Specifically, to avoid excessive fluctuations in inventory levels that make it difficult to allocate inventory levels for each product to be produced, variance is used to measure the stability of each optimized inventory level, and the most stable optimized inventory level is determined as the target inventory level.
[0102] This embodiment uses variance to measure the stability of each optimized inventory level, thereby determining the target inventory level, avoiding excessive fluctuations in inventory levels, simplifying the inventory allocation process, and effectively improving the rationality of production planning.
[0103] The above steps involve calculating the difference between N optimized production outputs and predicted sales, determining the corresponding optimized production output as the corresponding optimized inventory level, and then determining the production volume of the product to be produced in the target time period based on the optimized inventory level that meets the preset conditions among the N optimized inventory levels. Determining the production volume based on the optimized inventory level that meets the preset conditions can effectively overcome the situation of excessive inventory or insufficient inventory supply, improve the utilization efficiency of inventory, and thus improve the accuracy of production planning.
[0104] In this embodiment, production output is evaluated based on inventory levels to avoid inventory exceeding limits during production, which would cause additional losses and improve the accuracy of production planning. At the same time, a variational autoencoder is used to generate optimized output and fine-tune the predicted output to prevent the production forecast results of multiple products from being conflicting due to inventory limits, which would make it difficult to determine a reasonable production plan and thus improve the efficiency of production planning.
[0105] See Figure 3 This is a flowchart illustrating a production planning method based on artificial intelligence provided in Embodiment 2 of the present invention. In this production planning method, the target time period includes K target time points. The predicted sales and production information can be input into a trained production prediction model to directly obtain the predicted production for the target time period. At this time, the predicted production is a vector of size 1*K, and the elements in the vector correspond to the predicted production for the target time point. Alternatively, the predicted sales and production information can be input into a trained production prediction model to obtain the predicted production for the target time period through iteration. In this case, the predicted production is a single value.
[0106] The process of directly obtaining the target time period prediction output in vector form can be found in Example 1, and will not be repeated here.
[0107] When obtaining the numerical form of the target time period prediction output through iterative methods, the predicted sales volume includes the sales volume elements corresponding to the K target time points within the target time period, where K is an integer greater than zero.
[0108] By inputting the predicted sales and production information into the trained production prediction model, the predicted production for the target time period includes:
[0109] Step S301: Based on the time sequence of the K sales elements, determine the first sales element as the input element, and determine the initial value of the total output as zero and the initial value of the number of iterations as 1.
[0110] Step S302: Input the input elements, production information and total output into the trained output prediction model to obtain the output output, and increase the iteration number by 1;
[0111] Step S303: Detect whether the time period corresponding to the output output is the target time period. If the time period corresponding to the output output is not the target time period, determine the next sales element as the input element according to the time sequence, and determine the output output as the total output. Repeat the step of inputting the input element, production information and total output into the trained output prediction model until the time period corresponding to the output output is the target time period or the number of iterations is K, and determine the output output of the corresponding target time period as the predicted output of the target time period.
[0112] Here, the K sales elements corresponding to the target time point are in chronological order and arranged from left to right. The first sales element is the leftmost sales element. The input element can refer to the element currently input into the production prediction model. The total production can refer to the sum of the current predicted production. The number of iterations can refer to the number of production predictions.
[0113] Specifically, sales volume and total output are added to the output prediction model in the form of an embedding vector. The embedding vector is 1*2 in size, that is, one row and two columns. The elements in the first column of the vector represent sales volume, and the elements in the second column of the vector represent total output.
[0114] Production information features are extracted through the third encoder to obtain a production information feature tensor. After obtaining the production information feature tensor, the production information feature tensor is concatenated with the embedding vector to achieve feature fusion. Then, the concatenated feature tensor is input into the third fully connected layer for feature mapping to obtain the output output, which corresponds to the target time point of the input sales element.
[0115] The function checks whether the time period corresponding to the output output is the target time period, that is, whether the target time point corresponding to the output output in the current iteration is the last target time point within the target time period.
[0116] The iteration termination condition is either that the time period corresponding to the output output is the target time period or the number of iterations is K. This condition is a mutual verification condition, meaning that when the time period corresponding to the output output is the target time period, the number of iterations should also be K. If only one of the conditions is met when the iteration terminates, it indicates that there is an anomaly in the detection phase, which facilitates the implementer's operation and maintenance and improves the efficiency of operation and maintenance.
[0117] It should be noted that implementers can customize the iteration termination condition to improve iteration efficiency. For example, implementers can set the iteration termination condition to the time period corresponding to the output output being a preset time period or the number of iterations being K. In this case, the iteration stops when the time period corresponding to the output output is the preset time period. This method requires the preset time period to be within the target time period; otherwise, it will still terminate after the predicted output of the target time period is obtained.
[0118] This embodiment uses an iterative approach to predict production output. In each iteration, the output of the previous iteration is used as reference information, which reasonably decouples the predicted sales volume, predicted production output, and total production output. This improves the feature representation capability and the accuracy of production output prediction.
[0119] Corresponding to the AI-based production planning method in the above embodiments, Figure 4A structural block diagram of an AI-based production planning device provided in Embodiment 3 of the present invention is shown. This production planning device is applied to a client. After receiving a production planning instruction for a product to be produced, the computer device corresponding to the client accesses the server to obtain historical sales data and production information of the product to be produced, in order to predict the sales volume and output of the product. The client stores real-time inventory limit information to determine whether the predicted sales volume and predicted output meet the inventory limits. For ease of explanation, only the parts relevant to the embodiments of the present invention are shown.
[0120] See Figure 4 The production planning unit includes:
[0121] The sales forecast module 41 is used to obtain historical sales data of the products to be produced during the sampling period, input the historical sales data into the trained sales forecast model, and obtain the predicted sales for the target period.
[0122] The production prediction module 42 is used to obtain the production information of the products to be produced in the target time period, input the predicted sales and production information into the trained production prediction model, and obtain the predicted production for the target time period.
[0123] The production optimization module 43 is used to calculate the difference between the predicted production and the predicted sales, determine the difference as the predicted inventory, and check whether the predicted inventory meets the preset conditions. If the predicted inventory does not meet the preset conditions, the predicted production is input into the pre-trained variational autoencoder for N sampling to generate N optimized productions, where N is an integer greater than zero.
[0124] The planning generation module 44 is used to calculate the difference between the N optimized outputs and the predicted sales, determine the corresponding optimized output calculation result as the corresponding optimized inventory, and determine the production quantity of the product to be produced in the target time period based on the optimized inventory quantity that meets the preset conditions among the N optimized inventory quantities. The production quantity is used to guide the producer in production planning.
[0125] Optionally, the sales forecasting model includes a first encoder and a first fully connected layer, using historical sales data of the sample product during the sample sampling period as training samples for training the sales forecasting model, using the actual sales of the sample product during the target sample period as labels for training the sales forecasting model, and using mean squared error loss as the loss function for training the sales forecasting model.
[0126] The aforementioned production planning equipment also includes:
[0127] The sample encoding module is used to input training samples into the first encoder for feature extraction to obtain the sample feature tensor;
[0128] The sample sales prediction module is used to input the sample feature tensor into the first fully connected layer for feature mapping to obtain the sample predicted sales for the target time period.
[0129] The sales model training module is used to calculate the mean squared error loss based on the predicted and actual sales based on the sample. Based on the mean squared error loss, the gradient descent method is used to update the parameters of the sales prediction model in reverse until the mean squared error loss converges, thus obtaining the trained sales prediction model.
[0130] Optionally, the predicted sales include K sales elements corresponding to the target time points within the target time period, where K is a positive integer.
[0131] The above-mentioned production forecasting module 42 includes:
[0132] The initialization unit is used to determine the first sales element as the input element based on the time sequence of the K sales elements, and to determine the initial value of the total output as zero and the initial value of the number of iterations as 1.
[0133] The iterative prediction unit is used to input the input elements, production information and total output into the trained output prediction model, obtain the output output, and increment the iteration number by 1.
[0134] The iteration termination unit is used to detect whether the time period corresponding to the output output is the target time period. If the time period corresponding to the output output is not the target time period, the next sales element is determined as the input element according to the time sequence, and the output output is determined as the total output. The steps of inputting the input element, production information and total output into the trained output prediction model are executed again until the time period corresponding to the output output is the target time period or the number of iterations is K, and the output output of the corresponding target time period is determined as the predicted output of the target time period.
[0135] Optionally, the above-mentioned production optimization module 43 includes:
[0136] The upper limit detection unit is used to detect whether the predicted inventory quantity is less than the preset inventory upper limit;
[0137] The lower limit detection unit is used to detect whether the predicted inventory is greater than the preset lower limit if the predicted inventory is less than the upper limit of inventory.
[0138] The condition determination unit is used to determine that the predicted inventory meets the preset conditions if the predicted inventory is greater than the lower limit of inventory; otherwise, it determines that the predicted inventory does not meet the preset conditions.
[0139] Optionally, the above-mentioned production optimization module 43 includes:
[0140] The distribution prediction unit is used to input the predicted sales and predicted output into the trained distribution prediction model to obtain the predicted sampling distribution.
[0141] The distributed sampling unit is used to perform N samplings by a pre-trained variational autoencoder based on the predicted sampling distribution, and to obtain N optimized outputs based on the N sampling results.
[0142] Optionally, the actual sales volume and actual output of the sample products during the target time period are used as the second training samples when training the distribution prediction model, and the cross-entropy loss is used as the loss function when training the distribution prediction model.
[0143] The aforementioned production optimization module 43 also includes:
[0144] The sampling vector acquisition unit is used to acquire the sampled value corresponding to the optimized inventory quantity of each corresponding sample product when it is sampled in the pre-trained variational autoencoder, and convert the sampled value into a sampling vector.
[0145] The label determination unit is used to superimpose all sampling vectors, normalize each element in the superposition result using a normalized exponential function, obtain the sampling probability distribution, and determine the sampling probability distribution as the label;
[0146] The sample distribution prediction unit is used to input the second training sample into the distribution prediction model to obtain the sample distribution.
[0147] The distribution model training unit is used to calculate the cross-entropy loss based on the sample distribution and sampling probability distribution. Based on the cross-entropy loss, the parameters of the distribution prediction model are updated in reverse using the gradient descent method until the cross-entropy loss converges, thus obtaining the trained distribution prediction model.
[0148] Optionally, the target time period includes at least two target time points;
[0149] The above-mentioned planning generation module 44 includes:
[0150] The variance calculation unit is used to calculate the variance of all sub-inventory quantities at all corresponding target time points within any optimized inventory quantity that meets preset conditions.
[0151] The production determination unit is used to determine the optimal inventory level with the minimum variance as the target inventory level, and to determine the production volume of the product to be produced in the target time period based on the optimal sub-production levels of all corresponding target time points within the target inventory level.
[0152] It should be noted that the information interaction and execution process between the above modules and units are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0153] Figure 5This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, which, when executing the computer program, implements the steps in any of the above-described production planning method embodiments.
[0154] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0155] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0156] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0157] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as 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 present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0158] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.
[0159] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0160] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0161] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0162] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0163] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A production planning method based on artificial intelligence, characterized in that, The method includes: Obtain historical sales data of the product to be manufactured during the sampling period, input the historical sales data into the trained sales prediction model, and obtain the predicted sales for the target period. Obtain the production information of the product to be produced during the target time period, input the predicted sales and the production information into the trained production prediction model, and obtain the predicted production for the target time period. Calculate the difference between the predicted output and the predicted sales, determine the difference as the predicted inventory, and check whether the predicted inventory meets the preset conditions. If the predicted inventory does not meet the preset conditions, input the predicted output into a pre-trained variational autoencoder for N sampling to generate N optimized outputs, where N is an integer greater than zero. The difference between the N optimized production outputs and the predicted sales volume is calculated to determine the corresponding optimized production output as the corresponding optimized inventory quantity. Based on the optimized inventory quantity that meets the preset conditions among the N optimized inventory quantities, the production quantity of the product to be produced in the target time period is determined. The production quantity is used to guide the producer in production planning. The predicted output is input into a pre-trained variational autoencoder for N sampling iterations to generate N optimized outputs, including: The predicted sales volume and the predicted output are input into the trained distribution prediction model to obtain the predicted sampling distribution; Based on the predicted sampling distribution, the pre-trained variational autoencoder performs N samplings, and based on the results of the N samplings, N optimized outputs are obtained. The actual sales volume and actual output of the sample product during the target time period are used as the second training samples for training the distribution prediction model, and the cross-entropy loss is used as the loss function for training the distribution prediction model. The training process of the distribution prediction model includes: Obtain the sampled value corresponding to the optimized inventory level of each corresponding sample product when sampling in the pre-trained variational autoencoder, and convert the sampled value into a sampled vector; All sampling vectors are superimposed, and each element in the superposition result is normalized using a normalized exponential function to obtain the sampling probability distribution. The sampling probability distribution is then determined as the label. The second training sample is input into the distribution prediction model to obtain the sample distribution; Based on the sample distribution and the sampling probability distribution, the cross-entropy loss is calculated. Using the cross-entropy loss as a basis, the parameters of the distribution prediction model are updated in reverse using the gradient descent method until the cross-entropy loss converges, thus obtaining the trained distribution prediction model.
2. The production planning method according to claim 1, characterized in that, The sales prediction model includes a first encoder and a first fully connected layer. The historical sales data of the sample product during the sample sampling period is used as the training sample for training the sales prediction model. The actual sales of the sample product during the target sample period is used as the label for training the sales prediction model. The mean squared error loss is used as the loss function for training the sales prediction model. The training process of the sales forecasting model includes: The training samples are input into the first encoder for feature extraction to obtain the sample feature tensor; The sample feature tensor is input into the first fully connected layer for feature mapping to obtain the sample predicted sales for the target time period. Based on the predicted sales volume and the actual sales volume, the mean squared error loss is calculated. Using the mean squared error loss as a basis, the parameters of the sales prediction model are updated in reverse using the gradient descent method until the mean squared error loss converges, thus obtaining the trained sales prediction model.
3. The production planning method according to claim 1, characterized in that, The predicted sales volume includes K sales elements corresponding to the target time points within the target time period, where K is an integer greater than zero; The step of inputting the predicted sales volume and the production information into the trained production prediction model to obtain the predicted production volume for the target time period includes: Based on the time sequence of the K sales elements, the first sales element is determined as the input element, and the initial value of the total output is zero, and the initial value of the number of iterations is 1. The input elements, the production information, and the total output are input into the trained output prediction model to obtain the output output, and the iteration count is increased by 1. If the time period corresponding to the output output is not the target time period, then according to the time sequence, the next sales element is determined as the input element, and the output output is determined as the total output. The step of inputting the input element, the production information and the total output into the trained output prediction model is executed again until the time period corresponding to the output output is the target time period or the number of iterations is K. The output output corresponding to the target time period is then determined as the predicted output of the target time period.
4. The production planning method according to claim 1, characterized in that, The step of detecting whether the predicted inventory level meets the preset conditions includes: Detect whether the predicted inventory level is less than the preset inventory upper limit; If the predicted inventory is less than the upper limit of inventory, then check whether the predicted inventory is greater than the preset lower limit of inventory. If the predicted inventory level is greater than the lower limit of inventory, then the predicted inventory level is determined to meet the preset conditions; otherwise, the predicted inventory level is determined not to meet the preset conditions.
5. The production planning method according to any one of claims 1 to 4, characterized in that, The target time period includes at least two target time points; The step of determining the production quantity of the product to be produced in the target time period based on the optimized inventory quantity that meets the preset conditions from N optimized inventory quantities includes: For any optimized inventory quantity that meets the preset conditions, calculate the variance of the sub-inventory quantities at all corresponding target time points within the optimized inventory quantity; The optimized inventory level with the smallest variance is determined as the target inventory level, and the production volume of the product to be produced in the target time period is determined based on the optimized sub-production volume of all corresponding target time points within the target inventory level.
6. A production planning device based on artificial intelligence, characterized in that, The production planning device includes: The sales forecasting module is used to obtain historical sales data of the products to be produced during the sampling period, input the historical sales data into the trained sales forecasting model, and obtain the predicted sales for the target period. The production forecasting module is used to obtain production information of the products to be produced during the target time period, input the predicted sales and the production information into the trained production forecasting model, and obtain the predicted production for the target time period. The production optimization module is used to calculate the difference between the predicted production and the predicted sales, determine the difference as the predicted inventory, and detect whether the predicted inventory meets the preset conditions. If the predicted inventory does not meet the preset conditions, the predicted production is input into a pre-trained variational autoencoder for N sampling to generate N optimized productions, where N is an integer greater than zero. The planning generation module is used to calculate the difference between the N optimized outputs and the predicted sales, determine the corresponding optimized output calculation result as the corresponding optimized inventory, and determine the production volume of the product to be produced in the target time period based on the optimized inventory volume that meets the preset conditions among the N optimized inventory volumes. The production volume is used to guide the producer in production planning. The production optimization module includes: The distribution prediction unit is used to input the predicted sales volume and the predicted output into the trained distribution prediction model to obtain the predicted sampling distribution. The distributed sampling unit is used to perform N samplings by the pre-trained variational autoencoder according to the predicted sampling distribution, and to obtain N optimized outputs based on the N sampling results. The actual sales volume and actual output of the sample product during the target time period are used as the second training samples for training the distribution prediction model, and the cross-entropy loss is used as the loss function for training the distribution prediction model. The production optimization module also includes: The sampling vector acquisition unit is used to acquire the sampled value corresponding to the optimized inventory quantity retained for each corresponding sample product when it is sampled in the pre-trained variational autoencoder, and to convert the sampled value into a sampling vector. The label determination unit is used to superimpose all sampling vectors, normalize each element in the superposition result using a normalized exponential function to obtain a sampling probability distribution, and determine the sampling probability distribution as the label; A sample distribution prediction unit is used to input the second training sample into the distribution prediction model to obtain the sample distribution; The distribution model training unit is used to calculate the cross-entropy loss based on the sample distribution and the sampling probability distribution, and to update the parameters of the distribution prediction model in reverse using the gradient descent method based on the cross-entropy loss until the cross-entropy loss converges, thereby obtaining the trained distribution prediction model.
7. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the production planning method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the production planning method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Inventory prediction method and device
CN106897795A
sales volume forecasting method and a training method, a device and an electronic system of a model thereof
CN109509030A