A commodity out-of-stock scheduling method, device, equipment and medium
By receiving historical sales and real-time inventory data from vending machines, and using a time-series forecasting model to predict the probability of stockouts and generate allocation instructions, the problem of untimely stockout scheduling and unreasonable resource utilization in existing technologies is solved, achieving more efficient product replenishment and resource allocation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 河北盛马电子科技有限公司
- Filing Date
- 2026-03-09
- Publication Date
- 2026-06-09
AI Technical Summary
The existing methods for managing stockouts are not timely, have low efficiency, and make unreasonable use of resources. They are unable to respond promptly to changes in vending machine sales and individual differences, resulting in frequent stockouts or inventory backlogs in some vending machines.
By receiving historical sales time-series data and real-time inventory data uploaded by the edge computing nodes of vending machines, the system uses a time-series prediction model to predict the probability of future stockouts and generates allocation or delivery instructions based on risk thresholds. It prioritizes allocating inventory from nearby vending machines to avoid direct delivery, thus achieving dynamic scheduling.
It improved the timeliness and accuracy of out-of-stock dispatching, optimized resource allocation, reduced costs, and improved replenishment efficiency and resource utilization.
Smart Images

Figure CN122175509A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of logistics scheduling and retail management technology, and more specifically, it relates to a method, device, equipment and medium for scheduling out-of-stock goods. Background Technology
[0002] Against the backdrop of the booming development of the retail industry today, vending machines, as a convenient and efficient sales terminal, have been widely used in various public places due to their flexible layout and 24-hour uninterrupted service, greatly satisfying consumers' shopping needs anytime and anywhere.
[0003] Existing methods for managing stockouts primarily rely on periodic inspections and simple rule-based scheduling strategies. Periodic inspections involve staff conducting on-site checks of each vending machine at fixed intervals, recording inventory levels, and judging whether restocking is necessary based on experience. While this method can identify stockouts to some extent, the fixed inspection cycle prevents timely responses to changes in actual sales performance.
[0004] Simple rule-based scheduling strategies set fixed thresholds based on historical sales data of vending machines. When inventory falls below a certain threshold, a replenishment operation is triggered. However, this method does not fully consider the dynamic changes in sales data and the differences between different vending machines. Vending machines in different geographical locations have significantly different sales models and stockout risks due to variations in surrounding foot traffic, consumption habits, and other factors. Simple rules cannot be flexibly adjusted according to actual scenarios and cannot accurately adapt to the sales characteristics and stockout risks of different vending machines. This may result in some vending machines experiencing frequent stockouts, impacting sales, while others accumulate inventory, tying up capital and space. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for scheduling out-of-stock goods, aiming to solve the technical problems of untimely response, low scheduling efficiency, and unreasonable resource utilization in existing technologies, thereby improving the efficiency, accuracy, and resource utilization of goods scheduling. To achieve the above objectives, the technical solution provided by this application is as follows: Firstly, a method for managing product shortages is provided, including: Receive historical sales time-series data and real-time inventory data uploaded by the edge computing nodes of each vending machine within the target area; For each target vending machine, perform the first target operation; The first target operation includes: Based on historical sales time series data and real-time inventory data, determine the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period; For each product, perform the second objective operation; The second objective operation includes: If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. The preset scheduling conditions are that the inventory meets the demand of the vending machine and its own out-of-stock risk is not higher than the first risk threshold. The set of nearby vending machines is a set of multiple vending machines in the target area whose distance from the target vending machine is less than a preset distance threshold. If candidate vending machines exist, a product allocation instruction is generated; If no candidate vending machine is found, a first product delivery instruction is generated; If the first dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated. Replenishment operations are performed on the target vending machine based on the product allocation instruction, the first product delivery instruction, or the second product delivery instruction.
[0006] Secondly, a product shortage scheduling device is provided, comprising: The data acquisition module is used to receive the corresponding historical sales time series data and real-time inventory data uploaded by the edge computing nodes of each vending machine in the target area; The out-of-stock scheduling module is used to execute the first target operation for each target vending machine; Specifically, when executing the first target operation, the out-of-stock scheduling module is used for: Based on historical sales time series data and real-time inventory data, determine the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period; For each product, perform the second objective operation; Specifically, when executing the second target operation, the out-of-stock scheduling module is used for: If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. The preset scheduling conditions are that the inventory meets the demand of the vending machine and its own out-of-stock risk is not higher than the first risk threshold. The set of nearby vending machines is a set of multiple vending machines in the target area whose distance from the target vending machine is less than a preset distance threshold. If a candidate vending machine exists, a product allocation instruction is generated; if no candidate vending machine exists, a first product delivery instruction is generated; if the first dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated. Replenishment operations are performed on the target vending machine based on the product allocation instruction, the first product delivery instruction, or the second product delivery instruction.
[0007] Thirdly, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement a commodity shortage scheduling method provided by any possible implementation of the first aspect.
[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a commodity shortage scheduling method provided by any possible implementation of the first aspect.
[0009] The beneficial effects of the technical solution provided in this application are as follows: This application provides a product out-of-stock scheduling method, apparatus, equipment, and medium. Compared with related technologies, this application can receive historical sales time-series data and real-time inventory data of each product uploaded by edge computing nodes of each vending machine in a target area. For each target vending machine, it determines the first dynamic out-of-stock probability of each product in a future preset time period based on the acquired data. It can promptly capture changes in the sales situation of each product. Compared with fixed-period inspection based on simple rule scheduling strategies, it can discover potential out-of-stock risks more promptly, thereby making timely scheduling decisions and avoiding out-of-stock problems caused by failure to respond to sales changes in a timely manner.
[0010] The embodiments of this application can determine the first dynamic out-of-stock probability of each product for each target vending machine, which fully considers the differences in sales models and out-of-stock risks caused by different vending machines due to factors such as surrounding traffic and consumption habits, and improves the accuracy of scheduling.
[0011] In this embodiment, for each product, when the first dynamic out-of-stock probability of the product is higher than the first risk threshold but not higher than the second risk threshold, candidate vending machines that meet preset scheduling conditions are selected from the set of nearby vending machines. If a candidate vending machine exists, a product transfer instruction is generated, and replenishment is prioritized from nearby vending machines. This fully utilizes the inventory resources of vending machines in the area, avoids the potential cost increase from direct product delivery, and also enables faster replenishment operations. If no candidate vending machine exists, a first product delivery instruction is generated. When the first dynamic out-of-stock probability of the product is higher than the second risk threshold, a second product delivery instruction is generated. The hierarchical scheduling strategy in this embodiment further optimizes resource allocation, improves product scheduling efficiency, and solves the problem of unreasonable resource utilization that may be caused by fixed-period inspections and simple rule-based scheduling strategies. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0013] Figure 1 A flowchart illustrating a product shortage scheduling method provided in this application embodiment; Figure 2 This is a schematic diagram illustrating the process of replenishing a target vending machine based on a first dynamic out-of-stock probability, provided in an embodiment of this application. Figure 3 A structural block diagram of a commodity shortage scheduling device provided in an embodiment of this application; Figure 4 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0014] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0015] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.” When describing multiple (two or more) items, if the relationship between the multiple items is not explicitly defined, the multiple items can refer to one, several or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A includes A1 or A2 or A3, or it can be implemented as parameter A includes at least two of the three items A1, A2 and A3.
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.
[0017] This application provides a method for scheduling out-of-stock goods, which can be executed by a scheduling server, such as... Figure 1As shown, the method may include: S101: Receives the corresponding historical sales time series data and real-time inventory data uploaded by the edge computing nodes of each target vending machine in the target area.
[0018] In this embodiment, the historical sales time-series data corresponding to each target vending machine includes: the historical sales time-series data corresponding to each product in the target vending machine. The historical sales time-series data corresponding to each product may include product type, sales quantity, and sales time. Real-time inventory data refers to the actual inventory quantity of each product in each vending machine at the current moment.
[0019] In this embodiment, the edge node is connected to the main control system of the target vending machine to obtain the machine's transaction log in real time. This transaction log represents records automatically generated by the vending machine each time a sale is successful, including fields such as product identification code, sales timestamp, and sales quantity. Simultaneously, the edge computing node reads the gravity data of the product before and after it is removed from the gravity sensors at the bottom of each aisle of the vending machine, determining a successful sale based on this gravity data. In this embodiment, the edge node can also read the real-time readings of the pressure sensors in each aisle, reflecting the total weight of the products on the aisle, allowing the determination of the current inventory quantity based on the product's weight.
[0020] In this embodiment, the edge computing node can verify and format the collected sales and inventory data. The edge node compares transaction logs and gravity sensor changes at the same time. If both the sales log and gravity sensor readings indicate a sale has occurred (i.e., a sales record in the log and a step decrease in gravity value), a reliable sales record is generated, including the product ID, sales time, and quantity. This reliable sales record is added to the historical sales time-series sequence corresponding to that product.
[0021] In this embodiment, the edge computing node determines the inventory quantity by dividing the pressure sensor reading by the nominal weight of a single item. If an anomaly is detected (e.g., an abnormal pressure sensor reading but a sudden drop in the gravity sensor value, which may indicate that the item is placed at an angle), the anomaly is recorded and redundant data sources (such as visual inspection results) are used as the basis for inventory determination.
[0022] In this embodiment, data is stored separately by product ID. Each product corresponds to a time-series sequence, which records the timestamp and quantity of each reliable sale in chronological order, thus forming historical sales time-series data. In this embodiment, real-time inventory data is stored in key-value format, where the key is the product ID and the value is the current corrected inventory quantity and the last update timestamp.
[0023] In this embodiment, the edge computing nodes send historical sales time-series data and real-time inventory data to the scheduling server according to a preset upload strategy (e.g., timed upload, inventory change-triggered upload, etc.).
[0024] S102: For each target vending machine, execute the first target operation to achieve the restocking operation of the target vending machine.
[0025] The first target operation includes: Sa-Sb, where Sa-Sb is not shown in the figure. The first target operation specifically includes: Sa: Based on historical sales time series data and real-time inventory data, determine the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period.
[0026] In this embodiment, the future preset time period refers to a future time range that is artificially set for the purpose of assessing the risk of stockouts, such as the next 12 hours, the next day, or the next 3 days. The first dynamic stockout probability refers to a dynamic quantitative indicator that predicts the likelihood of a product selling out within the future preset time period based on historical sales time-series data and real-time inventory data. This first dynamic stockout probability is dynamically updated and can change as historical sales time-series data and real-time inventory data are updated.
[0027] This embodiment aims to quantitatively assess the probability of each product being out of stock in the future (e.g., the next 12 hours) based on the historical sales patterns and real-time inventory data (current inventory status) of the target vending machine (first dynamic out-of-stock probability), providing a core basis for subsequent scheduling decisions.
[0028] In one possible implementation, the historical sales time-series data corresponding to each target vending machine includes: historical sales time-series data corresponding to each product in the target vending machine; and based on the historical sales time-series data and real-time inventory data, determining the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period, including: For each product in the target vending machine, the historical sales time series data of that product is input into the time series prediction model to obtain the predicted sales volume of the product within a preset future time period. Based on product sales and real-time inventory data, determine the first dynamic out-of-stock probability of the product within a preset future time period.
[0029] In this embodiment, the time-series prediction model is used to receive historical sales time-series data of goods and output the predicted sales volume of goods within a specific future time period.
[0030] In this embodiment, all products sold in the target vending machine are traversed. For the product currently being traversed, the historical sales time sequence data (sales quantity sequence) of the product and the inventory quantity of the product at the current moment in the target vending machine are extracted from the storage of the scheduling server.
[0031] The historical sales time-series data is input into a time-series forecasting model. This model analyzes the historical sales data, identifying trends, periodicity, and randomness, and outputs a predicted sales volume for a future, preset time period. This predicted sales volume characterizes the future demand level inferred from historical patterns.
[0032] This embodiment, after obtaining the predicted sales volume of a product, combines the product's real-time inventory data to assess the degree to which the predicted demand for the product can be guaranteed within a preset future time period. For example, the first dynamic stockout probability can be an estimate of the probability that the predicted sales volume exceeds the current available inventory (current inventory quantity minus the reserved quantity). If the predicted sales volume is greater than the real-time inventory data, a stockout risk is determined, and the first dynamic stockout probability can be mapped to a preset range based on the excess proportion (e.g., 0.35 represents a 35% stockout probability). When the predicted sales volume is less than or equal to the current real-time inventory data, a stockout risk is determined to be non-existent, and the first dynamic stockout probability is low or zero.
[0033] In one possible implementation, the time-series prediction model includes a data processing layer, a feature extraction layer, a time-series modeling layer, and a prediction output layer. For each product in the target vending machine, the historical sales time-series data of that product is input into the time-series prediction model to obtain the predicted sales volume of the product within a preset future time period, including: Through the data processing layer, historical sales time-series data are subjected to sequence standardization processing to obtain standardized time-series data; Through the feature extraction layer, time features reflecting commodity sales trends are extracted from standardized time-series data to obtain a time feature vector; Through the time-series modeling layer, the sequence dependency relationship of the time feature vector is modeled to obtain time-series state information; the time-series state information is used to characterize the sales change pattern within a future preset time period. The output layer predicts the sales volume of goods within a preset time period in the future.
[0034] This embodiment inputs historical sales time-series data of the product into the data processing layer. This layer eliminates potential differences in units, extreme values (outliers), and fluctuations in the base value over different time periods from the historical sales time-series data, ensuring that the historical sales time-series data is within a stable and comparable scale range. Specifically, the data processing layer can employ statistical methods (e.g., based on 3D modeling). The principle of threshold filtering is used to detect outliers in the input historical sales time series data and replace them with missing values; the historical sales time series data of different products or different vending machines are normalized to eliminate differences in numerical scale, for example, by using Z-score standardization to normalize the data to a distribution with a mean of 0 and a standard deviation of 1; the normalized historical sales time series data are stabilized by differencing to eliminate trends (e.g., long-term growth) and seasonal fluctuations.
[0035] After the data processing layer processes the historical sales time-series data, standardized time-series data is obtained. This standardized time-series data retains the relative change patterns and time sequence of the historical sales time-series data.
[0036] This embodiment inputs standardized time-series data into a feature extraction layer. This layer automatically identifies and extracts time features that reflect product sales trends from the standardized time-series data. Time features may include: periodic features (e.g., daily periodicity reflecting sales fluctuations at different times of the day), holiday effect indicators (e.g., holidays, weekends, promotional dates, and weekdays), and recent change rates (e.g., the growth rate of sales in the last 3 days relative to the sales of the previous 7 days). The above time features are concatenated according to a preset feature order ([periodic features, date features, trend features]) to form a higher-dimensional time feature vector. For example, extracting 10-dimensional periodic features, 5-dimensional date features, and 3-dimensional trend features, and concatenating them according to the preset feature order, results in an 18-dimensional time feature vector, which is then used as input to the time-series modeling layer.
[0037] In this embodiment, the time feature vector is input into the time series modeling layer. This layer performs in-depth sequence dependency modeling on the time feature vector, analyzes the dynamic correlation and evolution of the time feature vector in the time dimension, and generates time series state information. This time series state information, as an internal high-dimensional state representation, is used to characterize the sales change patterns learned from historical sales time series data that are expected to continue into a preset future time period, such as the continuation, growth, or decline of sales trends.
[0038] The temporal modeling layer in this embodiment includes multiple Long Short-Term Memory (LSTM) units connected sequentially, with each LSTM unit corresponding to a time step. When a temporal feature vector is input to the temporal modeling layer, each feature vector enters the LSTM unit sequentially. Each LSTM unit includes a forget gate, an input gate, an output gate, and a memory unit. In this embodiment, the forget gate determines which no longer important information is discarded from the memory unit at the previous time step; the input gate controls how much new information from the current input needs to be stored in the memory unit; the memory unit updates the information based on historical information and the current input, thus achieving long-term memory of important information in each temporal feature vector; the output gate generates the hidden state at the current time step based on the updated memory unit and the current input, and this hidden state serves as the temporal state information for the current time step, which is then output.
[0039] "Information that is no longer important" refers to historical state information stored in the memory unit that has lost its reference value in the current time step and future predictions. For example, when predicting future sales of a product, a sales peak on a certain day a few months ago due to a special promotion may no longer be relevant for predicting the risk of stockouts in the next few hours. "New information" refers to valid information carried by the time feature vector input at the current time step that has not yet been recorded by the memory unit. For example, sales characteristics of the most recent hour input at the current time step (e.g., a sudden increase in sales, upcoming events, etc.). This new information reflects the latest changes in sales trends.
[0040] This time-series prediction layer requires pre-training before use. During training, historical sales time-series data is used as input, and future actual sales figures are used as supervision labels to construct a training set. The model parameters are optimized using the backpropagation algorithm until the prediction error converges. After training, the model can be used to predict product sales within a preset future time period. The specific training process is similar to existing training methods and will not be elaborated further.
[0041] In this embodiment, the time-series state information is sent to the prediction output layer, which typically consists of one or more fully connected layers. This layer decodes the time-series state information and maps it into specific business prediction values. Based on the future sales patterns encoded in the time-series state information, the business prediction values output predicted sales figures for one or more time points (corresponding to a preset future time period).
[0042] This embodiment uses a time-series prediction model to infer future sales forecasts from raw historical sales time-series data, providing accurate demand forecast input for subsequent calculation of the first dynamic stockout probability.
[0043] Sb: For each item, perform the second target operation.
[0044] The second target operation includes Sb1-Sb5, which are not shown in the figure. Specifically, the second target operation includes: Sb1: If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. The preset scheduling conditions are that the inventory meets the demand of the vending machine and its own out-of-stock risk is not higher than the first risk threshold. The set of nearby vending machines is a set of multiple vending machines in the target area whose distance from the target vending machine is less than a preset distance threshold. Sb2: If a candidate vending machine exists, generate a product transfer instruction; Sb3: If no candidate vending machine exists, generate the first product delivery instruction; Sb4: If the first dynamic out-of-stock probability is higher than the second risk threshold, then generate a second product delivery instruction.
[0045] In this embodiment, see Figure 2 After obtaining the first dynamic out-of-stock probability, it is compared with a preset first risk threshold and a second risk threshold to determine the risk level. The first risk threshold can be 0.3, and the second risk threshold can be 0.6. The risk level can include low risk (first dynamic out-of-stock probability not higher than 0.3), medium risk (first out-of-stock probability higher than 0.3 but not higher than 0.6), and high risk (first dynamic out-of-stock probability higher than 0.6). In this embodiment, the first and second risk thresholds can be determined based on the product's historical sales timeline data and out-of-stock records, and can be dynamically adjusted according to the actual scenario.
[0046] In this embodiment, if the first dynamic out-of-stock probability is not higher than the first risk threshold, it is determined to be low risk and no commodity scheduling instruction is triggered.
[0047] If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, it is classified as medium risk, indicating that the product is out of stock. At this point, based on the geographical information of the target vending machine, all other vending machines in the target area that are less than a preset distance threshold from the target vending machine are selected. A set of neighboring vending machines is formed based on all other selected vending machines, and this set of neighboring vending machines serves as the basis for finding sources of goods to be allocated.
[0048] This embodiment selects all nearby vending machines that meet preset scheduling conditions from each nearby vending machine in the nearby vending machine set as candidate vending machines. The preset scheduling conditions include that the inventory of the out-of-stock item is greater than or equal to the quantity required by the target vending machine, and that the candidate vending machine's own out-of-stock risk is lower than a first risk threshold. In this embodiment, candidate vending machines must meet the following conditions: for the out-of-stock item, the real-time inventory of that item in nearby vending machines should be greater than or equal to the quantity of the item required by the target vending machine, and the first dynamic out-of-stock probability of the corresponding item in the nearby vending machine should not be higher than the first risk threshold.
[0049] If there is at least one candidate vending machine in the set of nearby vending machines, a product transfer instruction is generated. The product transfer instruction includes which product(s) to transfer from which candidate vending machine(s) to the target vending machine and the quantity of the product to be transferred.
[0050] If there are no candidate vending machines in the set of nearby vending machines, it means that there is no safe inventory available for the target vending machine in the set of nearby vending machines, and a first product delivery instruction is generated.
[0051] If the first dynamic out-of-stock probability is higher than the second risk threshold, it is judged as high risk, indicating that the urgency of the out-of-stock item in the target vending machine is extremely high. At this time, a second product delivery instruction is generated.
[0052] In one possible implementation, candidate vending machines that meet preset scheduling conditions are selected from a set of neighboring vending machines, including: Based on the first dynamic out-of-stock probability of the product in the target vending machine, determine whether the product is out of stock; If the item is out of stock, determine the corresponding quantity to be dispatched. For each nearby vending machine, obtain the real-time inventory data and out-of-stock probability of the product for that nearby vending machine; For each nearby vending machine, based on the quantity of the product to be dispatched, the real-time inventory data and out-of-stock probability of that product on that nearby vending machine, and using the dispatch feasibility score calculation formula, a dispatch feasibility score for that product on that nearby vending machine is calculated. The dispatch feasibility score calculation formula is as follows: Where S represents the feasibility score for dispatching the out-of-stock item to the nearby vending machine. I This represents the real-time inventory data of the nearby vending machine corresponding to this product, Q represents the quantity of product to be dispatched to the target vending machine for this product, P represents the first dynamic out-of-stock probability of the nearby vending machine corresponding to this product, and D represents the distance between the target vending machine and the nearby vending machines. This indicates the preset maximum allowed scheduling distance. Let represent the weighting coefficients, and ; Nearby vending machines with a scheduling feasibility score higher than a preset score threshold will be selected as candidate vending machines.
[0053] In this embodiment, for each product, whether it is out of stock can be determined based on its first dynamic out-of-stock probability. For example, if the first dynamic out-of-stock probability of a product is higher than a first risk threshold, then the product is determined to be out of stock. Based on the first dynamic out-of-stock probability of the out-of-stock product, the required quantity of the product to be scheduled is calculated or mapped. The method for determining the quantity of out-of-stock products to be scheduled in this embodiment can be as follows: Based on the projected sales volume and real-time inventory data for a future preset time period, and using the predicted stockout calculation formula, the predicted stockout quantity is calculated. The predicted stockout quantity represents the number of goods expected to be in short supply at the end of the future preset time period without replenishment. In this embodiment, the predicted stockout quantity calculation formula can be: ,in, M This indicates the predicted shortage volume. This indicates the projected sales volume of the product. I This indicates the real-time inventory data of the product corresponding to the nearby vending machine. In this embodiment, if the predicted sales volume of the product exceeds the real-time inventory data, a shortage is determined, and this predicted shortage is... If the predicted sales volume of the product is not greater than the real-time inventory data of the product, then it is determined that there is no shortage of stock, and the shortage of stock is 0.
[0054] Based on the predicted stockout amount and the preset scheduling coefficient, the quantity of goods to be scheduled is calculated using the goods scheduling quantity calculation formula. The goods scheduling quantity calculation formula in this embodiment can be: ,in, This represents the preset scheduling coefficient, which is a constant greater than or equal to 1. It can be obtained based on the first dynamic stockout probability. The higher the first dynamic stockout probability, the larger the corresponding scheduling coefficient, indicating that more sufficient replenishment is needed to cope with higher uncertainty.
[0055] In this embodiment, after obtaining the quantity of out-of-stock items to be dispatched, for each nearby vending machine in the nearby vending machine set, the real-time inventory data of the corresponding out-of-stock items in that nearby vending machine, the first dynamic out-of-stock probability, and the distance between that nearby vending machine and the target vending machine are obtained. Then, a dispatch feasibility score for that nearby vending machine is calculated using a dispatch feasibility score calculation formula. The dispatch feasibility score calculation formula in this embodiment can be: ,in, S This indicates a feasibility score for dispatching the out-of-stock item from a nearby vending machine. I This indicates that the nearby vending machine corresponds to the real-time inventory data of that product. Q This indicates the quantity of the product that the target vending machine needs to allocate for that item.P This indicates the first dynamic out-of-stock probability of the corresponding product in the nearest vending machine. D This indicates the distance between the target vending machine and nearby vending machines. This indicates the preset maximum allowed scheduling distance. These represent weighting coefficients, which can be set based on the analysis of historical scheduling cases and experience. The weighting coefficients in this embodiment It can be dynamically fine-tuned based on the real-time scenario. Weighting coefficients. Indicating the degree of importance attached to inventory adequacy; weighting coefficient Represents the degree of importance attached to risk control; weighting coefficient This indicates the degree of importance placed on distance costs. If this embodiment prioritizes allocation efficiency and cost control, a higher value can be set. Relatively low For example, setting It is 0.3. It is 0.3. It is 0.4.
[0056] In this embodiment, the scheduling feasibility score for each nearby vending machine is compared with a preset scoring threshold (which can be 0.5). All nearby vending machines with scheduling feasibility scores higher than the preset threshold are identified as candidate vending machines. This preset scoring threshold can be set based on historical scheduling success rates and corresponding business strategies, representing the minimum comprehensive feasibility standard for selecting candidate vending machines.
[0057] To further improve the efficiency of product scheduling for target vending machines, this embodiment, after selecting nearby vending machines with scheduling feasibility scores higher than a preset score threshold as candidate vending machines, also includes: The inventory pressure target is obtained based on the required quantity of goods to be dispatched for the product and the real-time inventory data of the corresponding products in the candidate vending machines; Obtain the distance between the target vending machine and each candidate vending machine; If the number of candidate vending machines is greater than one, then perform a multi-objective optimal path selection operation; The multi-objective optimal path selection operation includes: For each candidate vending machine, a target vector for each candidate vending machine is determined based on the inventory pressure target, the distance between the target vending machine and the candidate vending machine, and the first dynamic out-of-stock probability. Determine the Pareto optimal solution set based on the pre-defined dominance relationship; If there is only one candidate vending machine in the Pareto optimal solution set, then that candidate vending machine is selected as the optimal allocation source. If there are multiple candidate vending machines in the Pareto optimal solution set, then based on the target vector, the maximum regret value of each candidate vending machine is calculated using the minimum maximum regret value method, and the candidate vending machine with the smallest maximum regret value is selected as the optimal allocation source.
[0058] In this embodiment, a vending machine is only considered a candidate vending machine if its real-time inventory data is greater than or equal to the quantity of goods to be dispatched.
[0059] In this embodiment, if the number of candidate vending machines is 0, it is determined that no feasible internal allocation source can be found for the target vending machine at the current time and within the preset neighborhood, triggering a higher-level replenishment strategy. For example, a first delivery instruction is generated to replenish the target vending machine from the distribution center in the target area. In this embodiment, if the number of candidate vending machines is 1, that candidate vending machine is determined as the optimal allocation source.
[0060] In this embodiment, the ratio between the required quantity of goods to be dispatched and the real-time inventory data of the corresponding goods in the candidate vending machines is used as the inventory pressure target. This inventory pressure target represents the proportion of the quantity of goods to be dispatched to the current inventory of the candidate vending machines, reflecting the degree to which a single dispatch operation consumes the existing inventory of the candidate vending machines. In this embodiment, if the inventory pressure target approaches 1, it indicates that the dispatch action will take away most or even all of the candidate vending machine's inventory of that goods, and there will be a risk of stockouts in the future; if the inventory pressure target approaches 0, it indicates that the dispatch quantity only accounts for a small portion of the candidate vending machine's inventory, and the impact on the candidate vending machine is small.
[0061] This embodiment can call the integrated map service API to obtain the distance between the target vending machine and each candidate vending machine. For example, the coordinates of the target vending machine and a candidate vending machine can be used as the end point and start point of the path, respectively, to request driving or optimal route planning; the API returns the optimal form of the path along the road network between the two points and its distance value.
[0062] In this embodiment, for each candidate vending machine, a target vector for that candidate vending machine is determined. This target vector can be... ,in, Represents the target vector. Indicates inventory pressure target, This indicates the distance between the target vending machine and the candidate vending machines. P This represents the first dynamic out-of-stock probability.
[0063] In this embodiment, the predefined dominance relationship can be as follows: if candidate vending machine Ca is no worse than candidate vending machine Cb in all targets (inventory pressure target, distance between the target vending machine and the candidate vending machine, and first dynamic out-of-stock probability), and is better than candidate vending machine Cb in at least one target, then candidate vending machine Ca is determined to be better than candidate vending machine Cb. For example, if the distances between candidate vending machine Ca and candidate vending machine Cb and the target vending machine are 2km and 2.5km respectively, and the first out-of-stock probability of candidate vending machine Ca is 0.1, and the first out-of-stock probability of candidate vending machine Cb is 0.2, then candidate vending machine Ca is better than candidate vending machine Cb in both distance and out-of-stock probability. Correspondingly, it can be considered that candidate vending machine Ca dominates candidate vending machine Cb at this time (in this embodiment, candidate vending machine Ca dominating candidate vending machine Cb indicates that candidate vending machine Ca is a better candidate than candidate vending machine Cb).
[0064] In this embodiment, the candidate vending machines that are not dominated by any other candidate vending machines are classified as Pareto optimal solution sets. A Pareto optimal solution set refers to an ideal state of allocation among the candidate vending machines, where, for example, the situation of at least one candidate vending machine cannot be improved without worsening the situation of any other candidate vending machine.
[0065] In this embodiment, the dominance relationships between candidate vending machines are compared using the above method to select the Pareto optimal solution set. If there is only one candidate vending machine in the Pareto optimal solution set, that candidate vending machine can be used as the optimal allocation source to provide the out-of-stock goods to the target vending machine. If there are multiple candidate vending machines in the Pareto optimal solution set, the normalized target regret value of each candidate vending machine on each target is calculated according to the normalized regret value calculation formula. In this embodiment, the normalized regret value calculation formula can be: ,in, This represents the normalized regret value. t Indicates the first t One goal (e.g., t =1 indicates an inventory pressure target. t =2 represents the distance. t =3 indicates the first dynamic out-of-stock probability). Indicates the first k One candidate vending machine, Indicates the first k The candidate vending machine is in the first t The numerical values on each target (e.g., This indicates that the actual distance of the third candidate vending machine to the second target is 1.5km. Indicates the first t Minimum value on each objective Indicates the first t The maximum value on each target. In this embodiment, if ,but It is 0.
[0066] In this embodiment, the largest regret value among the target regret values is taken as the maximum regret value of the candidate vending machine. The smallest value is selected from the maximum regret values corresponding to each candidate vending machine as the final candidate vending machine (optimal allocation source) to provide the out-of-stock goods to the target vending machine.
[0067] This embodiment is applicable to dynamically changing scheduling environments, avoids the subjectivity of manually setting weights, and achieves automatic balancing among multiple objectives.
[0068] To further improve the accuracy of product scheduling, this embodiment, if it identifies a preset activity event within a preset range around the target vending machine within a preset future time period, after obtaining the predicted product sales volume for the preset future time period, further includes: Based on the mapping relationship between the types of preset event activities and historical influence coefficients, the predicted sales volume of goods is adjusted upward to obtain the corrected sales volume of goods. The second dynamic out-of-stock probability of the product is determined based on the revised sales volume and real-time inventory data. If the second dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. If there are candidate vending machines, a product transfer instruction is generated; if there are no candidate vending machines, a first product delivery instruction is generated. If the second dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated.
[0069] This embodiment takes into account the special scenario where there are preset events within a preset range around the target vending machine within a preset time period in the future. By quantifying the potential boosting effect of the preset events on product sales, the predicted product sales are dynamically corrected, and the risk of stockouts is reassessed based on the corrected predicted product sales, thereby generating more forward-looking scheduling instructions to cope with the demand peaks that the events may bring.
[0070] In this embodiment, the preset event refers to a large-scale event that is planned or foreseeable in advance, occurs at a specific time and place, and may significantly increase foot traffic and consumer demand in the surrounding area, such as a sporting event, concert, or festival celebration. The preset range refers to a geographical area (e.g., a radius of 1 km) defined around the target vending machine, used to define which events are considered likely to affect the sales of that target vending machine. The second dynamic stockout probability refers to the updated probability value of a product becoming stockout within a preset time period in the future, obtained by comprehensively considering historical sales time-series data, current real-time inventory data, and the expected impact of surrounding preset events.
[0071] In this embodiment, the historical impact coefficient serves as a quantitative indicator, representing the average increase in sales of the product in surrounding vending machines due to similar past events. This historical impact coefficient can be obtained by analyzing the actual sales volume of the product during similar events in the historical database. In this embodiment, the historical database is determined based on the timestamped historical sales time-series data uploaded by the edge computing nodes of each vending machine and the corresponding inventory data, continuously received and stored by the scheduling server. This database is used to characterize the actual sales time-series patterns, inventory consumption rates, and supply and demand relationships of each product under different spatiotemporal conditions within the historical operating cycle.
[0072] In this embodiment, the mapping relationship refers to the correspondence between the types of preset events and the historical influence coefficients. For example, the historical influence coefficient for a concert is 1.8, and the historical influence coefficient for a sports event is 1.5.
[0073] In this embodiment, after predicting the sales volume of goods, if a preset event is identified within a preset geographical area surrounding the target vending machine within a preset future time period, the previously predicted sales volume is adjusted upwards based on the mapping relationship between the type of the preset event and its historical influence coefficient, combined with information such as the specific event type (e.g., a concert) and its distance from the target vending machine (e.g., 1 km). This results in a revised sales volume. The revised sales volume reflects the predicted future demand for the product after adding the specific event, and is generally higher than the original predicted sales volume.
[0074] This embodiment uses the corrected product sales volume to reassess the stockout risk (calculate the second dynamic stockout probability). The corrected product sales volume is combined with the product's real-time inventory data, employing a method similar to that used to determine the first dynamic stockout probability. For example, based on the probability estimate of the corrected product sales volume and the current available inventory (current inventory quantity minus reserved quantity), the second dynamic stockout probability of the product after adding the impact of a specific event is determined. In this embodiment, the value of the second dynamic stockout probability is typically higher than the first dynamic stockout probability without considering the preset event.
[0075] This embodiment uses a second dynamic out-of-stock probability as a new decision criterion, comparing it with a first risk threshold and a second risk threshold. If the second dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, it is determined that the out-of-stock item is of medium risk under the influence of a preset event. In this case, candidate vending machines that meet preset scheduling conditions are selected from the set of nearby vending machines. If there is a candidate vending machine in the set of nearby vending machines, a product transfer instruction is generated; if there is no candidate vending machine in the set of nearby vending machines, a first product delivery instruction is generated.
[0076] If the second dynamic out-of-stock probability is higher than the second risk threshold, the out-of-stock item is determined to be high-risk under the influence of the preset event. At this time, a second product delivery instruction is generated to replenish the target vending machine.
[0077] This embodiment proactively perceives, quantifies, integrates, and intelligently responds to external environmental disturbances (whether there are preset events), enabling the product scheduling decisions for target vending machines to proactively address foreseeable changes in market demand, significantly improving inventory assurance capabilities and operational resilience in dynamic and complex environments.
[0078] In one possible implementation, for each product, before adjusting the predicted product sales based on the mapping relationship between the type of preset activity event and historical influence coefficients, and obtaining the adjusted product sales, the following steps are also included: Obtain the type of the preset event and the distance between the preset event and the target vending machine; Based on the mapping relationship between the types of preset event activities and historical influence coefficients, the predicted sales volume of goods is adjusted upwards to obtain the adjusted sales volume, including: Based on the type of the preset activity event, query the mapping relationship to determine the historical impact coefficient of the preset activity event on the product; Based on historical impact coefficients and distance, query the historical database for the sales impact coefficient matrix of similar events on vending machines at the same distance. The sales impact coefficient matrix is used to characterize the benchmark impact coefficients of different product categories. Based on the distance between the event and the target vending machine, the baseline influence coefficient, and the product influence coefficient calculation formula, the product influence coefficient is obtained. The product influence coefficient calculation formula is as follows: ,in, k This represents the influence coefficient of the product. Indicates the baseline influence coefficient. Indicates the attenuation factor. d Indicates the distance between the event and the target vending machine; Based on the product's impact coefficient and predicted sales volume, the corrected sales volume is obtained using the product sales volume correction formula: ,in, This indicates the revised sales volume of the product. This indicates the projected sales volume of the product.
[0079] Before revising the predicted sales volume, this embodiment obtains the type of a preset event (the specific category of the identified event) and the distance between the preset event and the target vending machine. In this embodiment, the type of preset event may include sporting events, concerts, and festival celebrations; the distance between the preset event and the target vending machine is used to characterize the influence of the event on the target vending machine.
[0080] This embodiment obtains the historical impact coefficient corresponding to the preset event by using a preset event type and mapping relationship library. The historical impact coefficient represents the average increase in sales of the product in surrounding vending machines due to similar past events.
[0081] This embodiment uses historical influence coefficients and the distance between a preset event and the target vending machine to query a sales influence coefficient matrix in a historical database. This yields a specific benchmark influence coefficient for the current event type, the current product category, and the current distance range. This benchmark influence coefficient quantifies the typical impact of similar events on the sales of similar products at similar distances. The sales influence coefficient matrix in this embodiment can be a structured data table stored in a historical database, with rows and columns associated with different event types, distances, ranges, and product categories, respectively. Each cell value in this sales influence coefficient matrix is the benchmark influence coefficient. .
[0082] The mapping relationship library in this embodiment can be determined by statistical analysis based on the degree of deviation of the sales data of surrounding vending machines from the benchmark level when a large number of similar events occur in the historical database. It is used to characterize the average impact intensity (i.e., historical impact coefficient) of different types of events on commodity sales.
[0083] In this embodiment, the influence coefficient of a product is obtained based on the distance between the activity event and the target vending machine, the baseline influence coefficient, and the product influence coefficient calculation formula. The product influence coefficient calculation formula can be: ,in, k This represents the influence coefficient of the product. This represents the baseline impact coefficient, which can be determined using the product's historical sales time-series data and the actual sales data of surrounding weeks before and after similar events. For example, a baseline impact coefficient of 1.3 indicates that the product's sales are expected to increase by 30% under the influence of this event. This represents the attenuation factor, a preset constant greater than zero (e.g., 0.2). It controls the rate at which the influence of a preset event decreases with increasing distance. A larger attenuation factor indicates that the influence of the preset event decays faster with distance. d Indicates the distance between the event and the target vending machine, for example... d It is 0.5km.
[0084] This embodiment calculates the corrected sales volume based on the product's influence coefficient and predicted sales volume using a product sales volume correction formula. The product sales volume correction formula can be: ,in, This indicates the revised sales volume of the product. This indicates the projected sales volume of the product.
[0085] Sb5: Perform a restocking operation on the target vending machine based on the product transfer instruction, the first product delivery instruction, or the second product delivery instruction.
[0086] In one possible implementation, a restocking operation is performed on the target vending machine according to a merchandise allocation instruction, including: Based on the goods allocation instruction, a first transportation path is generated from the candidate vending machine to the target vending machine, and a replenishment operation is performed on the target vending machine based on the first transportation path; The process of replenishing the target vending machine according to the first product delivery instruction includes: Based on the first product delivery instruction, a second transportation route is generated from the distribution center in the target area to the target vending machine, and a replenishment operation is performed on the target vending machine based on the second transportation route; The process of replenishing the target vending machine according to the second product delivery instruction includes: Based on the second product delivery instruction, a third transportation route is generated from the central warehouse in the target area to the target vending machine, and a replenishment operation is performed on the target vending machine based on the third transportation route; Among them, the central warehouse is at a higher level than the distribution center in terms of warehousing.
[0087] In this embodiment, a restocking operation is performed on the target vending machine according to a preset instruction, wherein the preset instruction can be a product transfer instruction, a first product delivery instruction, or a second product delivery instruction.
[0088] In this embodiment, the goods transfer instruction is an instruction for horizontal inventory transfer between retail terminals at the same level (target vending machine and candidate vending machine). The first goods delivery instruction is an instruction to replenish goods from a regional transit inventory node (distribution center) serving multiple vending machines to the target vending machine. The second goods delivery instruction is an instruction to replenish goods with high priority from a regional core inventory node (central warehouse) with the largest storage capacity and the most complete range of goods to the target vending machine. In this embodiment, the distribution center is located as an intermediate layer node between the central warehouse and the vending machine, and its storage level is lower than that of the central warehouse.
[0089] In this embodiment, if the preset instruction is a product transfer instruction, then based on the geographical locations of the candidate vending machine and the target vending machine, an optimal first transportation path from the candidate vending machine to the target vending machine is generated.
[0090] The method for generating the first path in this embodiment can be: For a candidate vending machine, the location of the candidate vending machine is taken as the starting point and the location of the target vending machine is taken as the ending point. In this embodiment, the locations of each road intersection and the vending machine are taken as nodes, and the road segments between any two locations are taken as edges. Thus, the roads in the target area are regarded as a weighted directed graph G=(V,E), where V represents the set of nodes and E represents the set of edges.
[0091] This embodiment determines the first path based on the following formula: ,in, Let represent all connected paths from the candidate vending machine to the target vending machine, and let 'e' represent each edge. The weight of each edge can be determined using the shortest distance formula, which is as follows: ,in, This represents the shortest distance of the edge. The formula expresses the search for a connected path from the starting point (candidate vending machine) to the ending point (target vending machine) among all possible connected paths. This makes the weights of all road segments e that constitute the path equal. The sum is minimized. The connected path corresponding to the minimum sum is taken as the first path.
[0092] A specific first logistics task order is generated based on the first transportation route. The first logistics task order is sent to the replenishment clerk via a mobile terminal to perform the pickup operation, and then the goods are delivered to the target vending machine according to the first transportation route to perform the replenishment operation, thereby completing the replenishment of the target vending machine. In this embodiment, the first logistics task order may include information such as the pickup point (candidate vending machine), delivery point (target vending machine), product category, product quantity, and route guidance; the first transportation route in this embodiment can be determined based on factors such as real-time traffic conditions, the distance between the candidate vending machine and the target vending machine, and traffic rules.
[0093] If the preset instruction is the first product delivery instruction, then the location of the distribution center and the target vending machine in the target area is determined based on the instruction, and the optimal second transportation route from the distribution center to the target vending machine is generated.
[0094] In this embodiment, the method for determining the second path is similar to that for determining the first path. For the distribution center in the target area, the location of the distribution center is taken as the starting point, and the location of the target vending machine is taken as the ending point. All connected paths from the starting point to the ending point are obtained. From all possible connected paths, a path from the starting point (distribution center) to the ending point (target vending machine) is found such that the sum of the weights of all segments constituting this path is minimized. This connected path is then taken as the second path.
[0095] A specific second logistics task order is generated based on the second transportation route. This second logistics task order is sent to the replenishment clerk via a mobile terminal, enabling the clerk to pick up the goods from the designated distribution center and then deliver them to the target vending machine according to the second transportation route to complete the replenishment operation. In this embodiment, the second logistics task order may include information such as the pickup point (distribution center), delivery point (target vending machine), product category, product quantity, and route guidance. The second transportation route in this embodiment can be determined based on factors such as real-time traffic conditions, the distance between the distribution center and the target vending machine, and traffic rules.
[0096] If the preset instruction is the second product delivery instruction, then the location of the central warehouse and the target vending machine in the target area is determined based on the instruction, and the optimal third transportation route from the central warehouse to the target vending machine is generated.
[0097] In this embodiment, the method for determining the third path is similar to that for determining the first path. For the central warehouse of the target area, the location of the central warehouse is taken as the starting point, and the location of the target vending machine is taken as the ending point. All connected paths from the starting point to the ending point are obtained. From all possible connected paths, a path from the starting point (central warehouse) to the ending point (target vending machine) is found such that the sum of the weights of all segments constituting this path is minimized. This connected path is then taken as the third path.
[0098] A specific third-party logistics task order is generated based on the third transportation route. This task order is then sent to the replenishment clerk via a mobile terminal, enabling the clerk to pick up the goods from the designated central warehouse and deliver them to the target vending machine according to the third transportation route, thus completing the replenishment of the target vending machine. In this embodiment, the third-party logistics task order may include information such as the pickup point (central warehouse), delivery point (target vending machine), product category, product quantity, and route guidance. The third transportation route in this embodiment can be determined based on factors such as real-time traffic conditions, the distance between the central warehouse and the target vending machine, and traffic rules.
[0099] As can be seen from the above, this embodiment receives historical sales time-series data and real-time inventory data from each vending machine, and uses a time-series prediction model to accurately predict the sales volume of goods within a preset time period in the future, thereby determining the first dynamic out-of-stock probability for each product; based on the comparison result between the out-of-stock probability and the set threshold, goods are transferred or delivered from nearby vending machines, distribution centers, or central warehouses to ensure timely replenishment; the accurate demand forecasting and rapid response mechanism provided by this embodiment significantly improves replenishment efficiency and effectively reduces sales losses caused by out-of-stock.
[0100] In this embodiment, when screening candidate vending machines, the real-time inventory, out-of-stock probability, and distance from the target vending machine of nearby vending machines are comprehensively considered. The scheduling feasibility of each nearby vending machine is calculated using a scheduling feasibility scoring formula, and the optimal allocation path is selected. The data-based decision-making method provided in this embodiment avoids blind allocation, reduces unnecessary transportation costs and inventory backlog, and improves resource utilization efficiency.
[0101] The scheduling process in this embodiment relies on historical sales data, real-time inventory data, and the quantity of goods to be scheduled, which reduces the subjectivity and uncertainty of human judgment and improves decision-making efficiency and quality.
[0102] Based on the same principle as the commodity shortage scheduling method provided in the embodiments of this application, the embodiments of this application also provide a commodity shortage scheduling device, such as... Figure 3 As shown, the commodity shortage scheduling device 20 may specifically include: a data acquisition module 21 and a shortage scheduling module 22.
[0103] Among them, the data acquisition module 21 is used to receive the corresponding historical sales time series data and real-time inventory data uploaded by the edge computing nodes of each target vending machine in the target area; The out-of-stock scheduling module 22 is used to execute the first target operation for each target vending machine; The first target operation includes: Based on historical sales time series data and real-time inventory data, determine the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period; For each product, perform the second objective operation; The second objective operation includes: If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. The preset scheduling conditions are that the inventory meets the demand of the vending machine and its own out-of-stock risk is not higher than the first risk threshold. The set of nearby vending machines is a set of multiple vending machines in the target area whose distance from the target vending machine is less than a preset distance threshold. If a candidate vending machine exists, a product allocation instruction is generated; if no candidate vending machine exists, a first product delivery instruction is generated; if the first dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated. Replenishment operations are performed on the target vending machine based on the product allocation instruction, the first product delivery instruction, or the second product delivery instruction.
[0104] In one embodiment of this application, the historical sales time-series data corresponding to each target vending machine includes: historical sales time-series data corresponding to each product in the target vending machine. When determining the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period based on the historical sales time-series data and real-time inventory data, the out-of-stock scheduling module 22 is specifically used for: For each product in the target vending machine, the historical sales time series data of that product is input into the time series prediction model to obtain the predicted sales volume of the product within a preset future time period. Based on product sales and real-time inventory data, determine the first dynamic out-of-stock probability of the product within a preset future time period.
[0105] In one embodiment of this application, the time-series prediction model includes a data processing layer, a feature extraction layer, a time-series modeling layer, and a prediction output layer. When inputting the historical sales time-series data of each product in the target vending machine into the time-series prediction model to obtain the product sales volume within a preset future time period, the stockout scheduling module 22 is specifically used for: Through the data processing layer, historical sales time-series data are subjected to sequence standardization processing to obtain standardized time-series data; Through the feature extraction layer, time features reflecting commodity sales trends are extracted from standardized time-series data to obtain a time feature vector; Through the time-series modeling layer, the sequence dependency relationship of the time feature vector is modeled to obtain time-series state information; the time-series state information is used to characterize the sales change pattern within a future preset time period. The output layer predicts the sales volume of goods within a preset time period in the future.
[0106] In one embodiment of this application, when selecting candidate vending machines that meet preset scheduling conditions from a set of nearby vending machines, the out-of-stock scheduling module 22 is specifically used for: Based on the first dynamic out-of-stock probability of the product in the target vending machine, determine whether the product is out of stock; If the item is out of stock, determine the corresponding quantity to be dispatched. For each nearby vending machine, obtain the real-time inventory data and out-of-stock probability of the product for that nearby vending machine; For each nearby vending machine, based on the quantity of the product to be dispatched, the real-time inventory data and out-of-stock probability of the product for that nearby vending machine, and using the dispatch feasibility score calculation formula, a dispatch feasibility score for that nearby vending machine for that product is calculated. The dispatch feasibility score calculation formula is as follows: ,in, S This indicates a feasibility score for dispatching the out-of-stock item from a nearby vending machine. I This indicates that the nearby vending machine corresponds to the real-time inventory data of that product. Q This indicates the quantity of the product that the target vending machine needs to allocate for that item. P This indicates the first dynamic out-of-stock probability of the corresponding product in the nearest vending machine. D This indicates the distance between the target vending machine and nearby vending machines. This indicates the preset maximum allowed scheduling distance. Let represent the weighting coefficients, and ; Nearby vending machines with a scheduling feasibility score higher than a preset score threshold will be selected as candidate vending machines.
[0107] In one embodiment of this application, when performing a replenishment operation on the target vending machine according to a merchandise allocation instruction, the out-of-stock scheduling module 22 is specifically used for: Based on the goods allocation instruction, a first transportation path is generated from the candidate vending machine to the target vending machine, and a replenishment operation is performed on the target vending machine based on the first transportation path; The process of replenishing the target vending machine according to the first product delivery instruction includes: Based on the first product delivery instruction, a second transportation route is generated from the distribution center in the target area to the target vending machine, and a replenishment operation is performed on the target vending machine based on the second transportation route; The process of replenishing the target vending machine according to the second product delivery instruction includes: Based on the second product delivery instruction, a third transportation route is generated from the central warehouse in the target area to the target vending machine, and a replenishment operation is performed on the target vending machine based on the third transportation route; Among them, the central warehouse is at a higher level than the distribution center in terms of warehousing.
[0108] In one embodiment of this application, after obtaining the predicted sales volume of goods within a preset future time period, the stockout scheduling module 22 is specifically used for: If a preset event is identified within a preset time period in the future, the predicted sales volume of the product is adjusted upward based on the mapping relationship between the type of the preset event and the historical influence coefficient, and the adjusted sales volume of the product is obtained. The second dynamic out-of-stock probability of the product is determined based on the revised sales volume and real-time inventory data. If the second dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. If there are candidate vending machines, a product transfer instruction is generated; if there are no candidate vending machines, a first product delivery instruction is generated. If the second dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated.
[0109] In one embodiment of this application, when adjusting the predicted sales volume of goods based on the mapping relationship between the type of preset activity event and the historical influence coefficient to obtain the adjusted sales volume, the stockout scheduling module 22 is further configured to: Obtain the type of the preset event and the distance between the preset event and the target vending machine; Based on the type of the preset activity event, query the mapping relationship to determine the historical impact coefficient of the preset activity event on the product; Based on historical impact coefficients and distance, query the historical database for the sales impact coefficient matrix of similar events on vending machines at similar distances. The sales impact coefficient matrix is used to characterize the benchmark impact coefficients of different product categories. Based on the distance between the event and the target vending machine, the baseline influence coefficient, and the product influence coefficient calculation formula, the product influence coefficient is obtained. The product influence coefficient calculation formula is as follows: ,in, k Indicates the influence coefficient of the commodity. Indicates the baseline influence coefficient. Indicates the attenuation factor. d Indicates the distance between the event and the target vending machine; Based on the product's impact coefficient and the predicted sales volume, the corrected sales volume is obtained using the product sales volume correction formula: ,in, This indicates the revised sales volume of the product. This indicates the projected sales volume of the product.
[0110] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0111] Figure 4 A schematic diagram of the structure of an electronic device to which this application embodiment applies is shown, such as... Figure 4 As shown, the electronic device can be a scheduling server for implementing the methods provided in any embodiment of this application.
[0112] like Figure 4 As shown, the electronic device 300 may primarily include at least one processor 301. Figure 4 The diagram shows components such as a memory 302, a communication module 303, and an input / output interface 304. Optionally, these components can be connected and communicate with each other via a bus 305. It should be noted that... Figure 4 The structure of the electronic device 300 shown is merely illustrative and does not constitute a limitation on the electronic devices to which the methods provided in the embodiments of this application are applicable.
[0113] The memory 302 can be used to store operating systems and applications, etc. The applications can include computer programs that implement the methods shown in the embodiments of this application when invoked by the processor 301, and can also include programs for implementing other functions or services. The memory 302 can be ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices that can store information and computer programs, or it can be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0114] Processor 301 is connected to memory 302 via bus 305 and implements corresponding functions by calling the application programs stored in memory 302. Processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0115] Electronic device 300 can connect to a network via communication module 303 (which may include, but is not limited to, components such as a network interface) to communicate with other devices (such as user terminals or servers) through the network and achieve data interaction, such as sending data to or receiving data from other devices. Communication module 303 may include wired network interfaces and / or wireless network interfaces, meaning the communication module may include at least one of wired or wireless communication modules.
[0116] The electronic device 300 can connect to necessary input / output devices, such as a keyboard and display device, via the input / output interface 304. The electronic device 300 itself may have a display device, and other display devices can also be connected externally via the interface 304. Optionally, a storage device, such as a hard drive, can also be connected via the interface 304 to store data from the electronic device 300, read data from the storage device, or store data from the storage device in the memory 302. It is understood that the input / output interface 304 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to the input / output interface 304 can be a component of the electronic device 300 or an external device connected to the electronic device 300 when needed.
[0117] The bus 305 used to connect the components may include a path for transmitting information between the components. The bus 305 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Depending on its function, the bus 305 may be divided into an address bus, a data bus, a control bus, etc.
[0118] Optionally, for the solution provided in the embodiments of this application, the memory 302 can be used to store a computer program that executes the solution of this application, and the processor 301 runs the computer program. When the processor 301 runs the computer program, it implements the operation of the method or apparatus provided in the embodiments of this application.
[0119] Based on the same principle as the method provided in the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.
[0120] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.
[0121] It should be noted that the terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0122] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0123] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0124] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A method for scheduling out-of-stock goods, characterized in that, This method is executed by the scheduling server and includes: Receive the corresponding historical sales time series data and real-time inventory data uploaded by the edge computing nodes of each target vending machine in the target area; For each target vending machine, perform the first target operation; The first target operation includes: Based on the historical sales time series data and the real-time inventory data, determine the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period; For each product, perform the second objective operation; The second target operation includes: If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. The preset scheduling conditions are that the inventory meets the demand of the vending machine and its own out-of-stock risk is not higher than the first risk threshold. The set of nearby vending machines is a set of multiple vending machines in the target area whose distance from the target vending machine is less than a preset distance threshold. If the candidate vending machine exists, a product allocation instruction is generated; If no candidate vending machine is found, a first product delivery instruction is generated; If the first dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated; Replenishment operations are performed on the target vending machine according to the product allocation instruction, the first product delivery instruction, or the second product delivery instruction.
2. The commodity shortage scheduling method as described in claim 1, characterized in that, The historical sales time-series data corresponding to each target vending machine includes: the historical sales time-series data corresponding to each product in the target vending machine; and based on the historical sales time-series data and the real-time inventory data, determining the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period, including: For each product in the target vending machine, the historical sales time series data of the product is input into the time series prediction model to obtain the predicted sales volume of the product within a preset future time period. Based on the sales volume of the product and the real-time inventory data, determine the first dynamic out-of-stock probability of the product within the preset future time period.
3. The commodity shortage scheduling method as described in claim 2, characterized in that, The time-series prediction model includes a data processing layer, a feature extraction layer, a time-series modeling layer, and a prediction output layer. For each product in the target vending machine, the historical sales time-series data of that product is input into the time-series prediction model to obtain the product's sales volume within a future preset time period, including: The data processing layer performs sequence standardization on the historical sales time-series data to obtain standardized time-series data. Through the feature extraction layer, time features reflecting commodity sales trends are extracted from the standardized time-series data to obtain a time feature vector; Through the time-series modeling layer, the time feature vector is modeled with sequence dependencies to obtain time-series state information; the time-series state information is used to characterize the sales change pattern within a future preset time period. The predicted output layer outputs the sales volume of goods within a preset future time period.
4. The commodity shortage scheduling method as described in claim 1, characterized in that, The step of selecting candidate vending machines that meet preset scheduling conditions from the set of nearby vending machines includes: Based on the first dynamic out-of-stock probability of the product in the target vending machine, determine whether the product is out of stock; If the item is out of stock, determine the corresponding quantity to be dispatched. For each nearby vending machine, obtain the real-time inventory data and out-of-stock probability of the product for that nearby vending machine; For each nearby vending machine, based on the quantity of the product to be dispatched, the real-time inventory data and out-of-stock probability of the product for that nearby vending machine, and using the dispatch feasibility scoring formula, a dispatch feasibility score for that product is calculated for that nearby vending machine. The dispatch feasibility score calculation formula is as follows: Where S represents the feasibility score of scheduling the out-of-stock item for the nearby vending machine, I represents the real-time inventory data of the nearby vending machine for the item, Q represents the quantity of the item to be scheduled for the target vending machine, P represents the first dynamic out-of-stock probability of the nearby vending machine for the item, and D represents the distance between the target vending machine and the nearby vending machines. This indicates the preset maximum allowed scheduling distance. Let represent the weighting coefficients, and ; Nearby vending machines with a scheduling feasibility score higher than a preset score threshold will be selected as candidate vending machines.
5. A method for scheduling out-of-stock goods as described in claim 1, characterized in that, According to the product allocation instruction, a restocking operation is performed on the target vending machine, including: Based on the product allocation instruction, a first transportation path is generated from the candidate vending machine to the target vending machine, and a replenishment operation is performed on the target vending machine based on the first transportation path; The process of restocking the target vending machine according to the first product delivery instruction includes: Based on the first product delivery instruction, a second transportation route is generated from the distribution center in the target area to the target vending machine, and a replenishment operation is performed on the target vending machine based on the second transportation route; The restocking operation performed on the target vending machine according to the second product delivery instruction includes: Based on the second product delivery instruction, a third transportation route is generated from the central warehouse in the target area to the target vending machine, and a replenishment operation is performed on the target vending machine based on the third transportation route; The central warehouse is at a higher warehousing level than the distribution center.
6. A method for scheduling out-of-stock goods as described in claim 2, characterized in that, If a preset activity event is identified within a preset range around the target vending machine within a preset future time period, after obtaining the predicted sales volume of goods within the preset future time period, the process further includes: Based on the mapping relationship between the types of the preset event and the historical influence coefficient, the predicted sales volume of the goods is adjusted upward to obtain the corrected sales volume of the goods. Based on the revised sales volume and the real-time inventory data, determine the second dynamic out-of-stock probability of the product; If the second dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. If the candidate vending machine exists, a product transfer instruction is generated; if the candidate vending machine does not exist, a first product delivery instruction is generated. If the second dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated.
7. A method for scheduling out-of-stock goods as described in claim 6, characterized in that, Before adjusting the predicted sales volume upwards based on the mapping relationship between the types of the preset activity events and historical influence coefficients to obtain the adjusted sales volume, the method further includes: Obtain the type of the preset activity event and the distance between the preset activity event and the target vending machine; The process of adjusting the predicted sales volume of goods based on the mapping relationship between the types of preset event activities and historical influence coefficients to obtain the adjusted sales volume includes: Based on the type of the preset activity event, query the mapping relationship to determine the historical impact coefficient of the preset activity event on the product; Based on the historical impact coefficient and the distance, query the historical database for the sales impact coefficient matrix of similar events on vending machines at the same distance. The sales impact coefficient matrix is used to characterize the benchmark impact coefficient of different product categories. Based on the distance between the activity event and the target vending machine, the baseline influence coefficient, and using the product influence coefficient calculation formula, the product influence coefficient is obtained. The product influence coefficient calculation formula is as follows: ,in, k Indicates the influence coefficient of the commodity. Indicates the baseline influence coefficient. Indicates the attenuation factor. d Indicates the distance between the event and the target vending machine; Based on the influence coefficient of the product and the predicted product sales volume, the corrected product sales volume is obtained using the product sales volume correction formula, which is as follows: ,in, This indicates the revised sales volume of the product. This indicates the projected sales volume of the product.
8. A commodity shortage dispatching device, characterized in that, include: The data acquisition module is used to receive the corresponding historical sales time series data and real-time inventory data uploaded by the edge computing nodes of each vending machine in the target area; The out-of-stock scheduling module is used to execute the first target operation for each target vending machine; Specifically, when executing the first target operation, the out-of-stock scheduling module is used to: Based on the historical sales time series data and the real-time inventory data, determine the first dynamic out-of-stock probability of each product in the target vending machine within a future preset time period; For each product, perform the second objective operation; Specifically, when executing the second target operation, the out-of-stock scheduling module is used to: If the first dynamic out-of-stock probability is higher than the first risk threshold but not higher than the second risk threshold, then candidate vending machines that meet the preset scheduling conditions are selected from the set of nearby vending machines. The preset scheduling conditions are that the inventory meets the demand of the vending machine and its own out-of-stock risk is not higher than the first risk threshold. The set of nearby vending machines is a set of multiple vending machines in the target area whose distance from the target vending machine is less than a preset distance threshold. If the candidate vending machine exists, a product allocation instruction is generated; if the candidate vending machine does not exist, a first product delivery instruction is generated; if the first dynamic out-of-stock probability is higher than the second risk threshold, a second product delivery instruction is generated. Replenishment operations are performed on the target vending machine according to the product allocation instruction, the first product delivery instruction, or the second product delivery instruction.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes a commodity shortage scheduling method according to any one of claims 1 to 7 when running the computer program.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements a commodity shortage scheduling method according to any one of claims 1 to 7.