Vending machine commodity purchasing prediction analysis method and device
By using a vending machine merchandise procurement forecasting and analysis method and device, combined with multi-dimensional data integration and a rule-based tree model, the problems of limited vending machine inventory, frequent stockouts, and sudden changes in sales have been solved, enabling precise procurement and efficient operation, and adapting to dynamic adjustments in location and merchandise.
Patent Information
- Application Number
- CN202511246382.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-12-12
AI Technical Summary
Vending machines are prone to stockouts due to limited inventory, struggle to cope with sudden changes in sales, and are unable to adapt to frequent changes in locations and products. This results in inaccurate and inefficient procurement, and traditional forecasting models are not adaptable enough, with insufficient data fragmentation and collaborative analysis.
By analyzing machine inventory, warehouse inventory, and product sales attributes, a rule-based tree model is used to predict sales. Combined with multi-dimensional data integration and automated procurement decisions, the Cubist model is used for ensemble learning to adapt to fluctuations in product sales, calculate recommended procurement quantities, and trigger automated procurement.
It improves forecast accuracy, reduces stockouts and backlogs, increases procurement efficiency, optimizes resource allocation, enhances scenario adaptability, and has a wide range of applications and strong practicality.
Smart Images

Figure CN121120127A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vending machine technology, specifically relating to a method and apparatus for predicting and analyzing the procurement of goods for vending machines. Background Technology
[0002] Vending machines, as an important carrier of convenient retail, are widely used in various scenarios such as shopping malls, office buildings, apartments, and campuses due to their advantages such as flexible deployment and 24-hour service. However, their operational characteristics of "small inventory and high-frequency replenishment," as well as the dynamic adjustment of distribution points and product types, pose many challenges to commodity procurement forecasting. Traditional procurement models are no longer suitable for actual needs, mainly in the following aspects:
[0003] First, the issues of sales ceiling and stockouts are prominent. Vending machines have limited storage space and cannot maintain large inventory reserves like traditional supermarkets. When goods sell out and are not replenished in time, a "stockout window" occurs, leading to lost sales. At the same time, machine malfunctions, untimely replenishment, and empty warehouses can also cause stockouts, further restricting actual sales potential. Therefore, accurately analyzing the sales ceiling of vending machines (i.e., the maximum sellable quantity under the matching of inventory and replenishment cycles) is a key prerequisite for procurement forecasting. However, existing technologies often neglect the dynamic relationship between inventory and sales, resulting in a disconnect between forecast results and actual sellable capacity.
[0004] Second, traditional forecasting models lack adaptability. Existing sales forecasts largely rely on models such as random forests and linear regression. These models tend to predict averages and are slow to respond to sudden fluctuations in sales (such as surges in customer traffic during holidays, seasonal product booms, and the launch of new products). Vending machine sales are highly dependent on real-time customer flow; factors such as the surrounding population demographics, weather changes, and promotional activities can all cause sudden increases or decreases in sales. Traditional models struggle to capture these non-linear dynamic characteristics, leading to insufficient forecast accuracy and consequently, problems such as over-purchasing (inventory backlog) or under-purchasing (frequent stockouts).
[0005] Third, the level of automation in procurement decisions is low. Current vending machine procurement largely relies on human experience, manually estimating purchase quantities based on historical sales data. This model has two major limitations: first, it struggles to integrate multi-dimensional data such as machine status, warehouse inventory, and product attributes, leading to biased decision-making; second, with large-scale deployments (e.g., hundreds or thousands of machines) and frequent adjustments to locations / products, manual calculations are inefficient and prone to errors due to subjective judgment. As the vending machine industry scales up, traditional procurement models can no longer meet the demands for "precise replenishment, cost reduction, and efficiency improvement."
[0006] Fourth, data fragmentation and insufficient collaboration. Vending machine operational data is scattered across multiple stages, including terminal sales (machine sales, inventory), warehouse operations (inventory turnover, goods in transit), and merchandise management (category, price, lifecycle). Existing technologies lack systematic integration and correlation analysis of this data. For example, machine stockout data is not linked to warehouse inventory alerts, and the "new / clearance" attribute of goods is not included in sales trend analysis, resulting in a lack of a holistic perspective in procurement forecasting and difficulty in adapting to dynamic adjustments in location and merchandise. Summary of the Invention
[0007] To address this issue, the present invention provides a method and apparatus for predicting and analyzing the procurement of goods for vending machines, thereby solving the problems of inaccurate procurement and low efficiency caused by vending machines' limited inventory, difficulty in responding to sudden changes in sales, inability to adapt to frequent changes in locations and goods.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a method for predictive analysis of vending machine merchandise procurement, comprising the following steps:
[0009] Machine inventory analysis: Collect daily data from both machine and product dimensions to generate analysis results that reflect the sales capacity of machine terminals and the in-machine characteristics of products;
[0010] Warehouse inventory analysis: Generate warehouse health indicators based on daily inventory data of city warehouses, and analyze the inventory sales and circulation of goods at the city level;
[0011] Product sales attribute analysis: Records daily sales attribute data of products, and reflects the product's sales strategy and market performance through the daily sales attribute data;
[0012] Sales forecast analysis: Based on the results of machine inventory analysis, warehouse inventory analysis and product sales attribute analysis, a rule-based tree model is used to predict product sales and obtain sales forecast results. The rule-based tree model classifies the data by autonomously discovering rules and then establishes regression models to adapt to fluctuations in product sales.
[0013] Purchase Trigger Analysis: Combining the sales forecast results with the daily inventory data, determine whether to trigger a purchase based on preset conditions, and calculate the recommended purchase quantity to automate the purchase forecast.
[0014] As a preferred method for predictive analysis of vending machine merchandise procurement, the machine inventory analysis includes:
[0015] The machine-level data includes information reflecting machine operating status, replenishment cycle, location, sales capacity, inventory, and stockout status.
[0016] The machine-related product data includes information reflecting the product's inventory, sales status, reasons for stockouts, and replenishment volume.
[0017] The sales performance of in-stock products is evaluated by integrating multi-dimensional data, and sales deviations caused by stockouts are corrected by using stockout-related data.
[0018] As a preferred method for predictive analysis of vending machine merchandise procurement, the warehouse inventory analysis generates daily warehouse health indicators by collecting data on warehouse inventory, aisle inventory, in-transit inventory, inventory pre-sale days, inventory tags, and distribution locations, and analyzes the overall sales and circulation dynamics of merchandise inventory at the city level.
[0019] As a preferred method for predictive analysis of vending machine merchandise procurement, the sales forecast analysis, based on sample data from the 60 days prior to the forecast date, calculates multi-period averages through moving smoothing; the data is preprocessed to eliminate skewed distribution, and the processing methods include:
[0020] Taking the square root of a proportional variable: Let the proportional variable be x, then the result is...
[0021] Perform a square root operation on the differential variable while preserving its sign: Let the differential variable be y, then the result after processing is... Where sign(·) is the sign function;
[0022] Logarithmic transformation of sales and other variables: Let the original variable be z, then the processed variable is z′=ln(z+1), where ln is the natural logarithm function.
[0023] As a preferred method for predictive analysis of vending machine merchandise purchases, the sales forecast analysis employs the Cubist model as the rule-based tree model, optimizing the prediction results through ensemble learning, including:
[0024] Multi-model parallel ensemble: Suppose that training generates k independent models, and the prediction result of the i-th model is... The final prediction result is
[0025] Multi-model serial ensemble: Let the initial model prediction result be... The error correction model predicts the result as e j The final prediction result is Where m is the number of modified models.
[0026] As a preferred method for predictive analysis of vending machine merchandise procurement, the recommended formula for calculating the procurement quantity in the procurement trigger analysis is as follows:
[0027] Q = S + B + RW
[0028] B = (E × P) × U
[0029] P = H / T
[0030] U = A × C
[0031] R = (L × M) - N
[0032] In the formula, Q is the suggested purchase quantity; S is the predicted sales volume; B is the replenishment quantity of new machines; E is the increase in the quantity of new machines; P is the product distribution ratio; U is the number of replenishment units per new machine; H is the current number of distribution points; T is the number of distribution points in the city; A is the effective daily average change of distribution points; C is the replenishment cycle of new machines; R is the replenishment quantity at the original distribution point; L is the number of distribution channels at the distribution point; M is the replenishment value of a specified single distribution channel; N is the current inventory at the distribution point; and W is the warehouse inventory.
[0033] As a preferred method for predictive analysis of vending machine merchandise procurement, the number of procurement days in the procurement trigger analysis is determined by the following formula:
[0034] D = P d +T d +S d
[0035] In the formula, D represents the number of days for procurement; P d For the number of days to prepare for delivery; T d For transport days; S d Safety stock days;
[0036] The procurement condition is triggered when the number of days of pre-sale inventory in the warehouse is less than D and the number of expected distribution points is greater than the specified threshold.
[0037] The present invention also provides a vending machine merchandise purchase prediction and analysis device, comprising:
[0038] The machine inventory analysis module is used to collect daily data from both machine and product dimensions, and generate analysis results that reflect the sales capacity of machine terminals and the in-machine characteristics of products.
[0039] The warehouse inventory analysis module is used to generate warehouse health indicators based on daily inventory data of city warehouses, and to analyze the inventory sales and circulation of goods at the city level.
[0040] The product sales attribute analysis module is used to record daily sales attribute data of products, and the daily sales attribute data reflects the product's sales strategy and market performance.
[0041] The sales forecasting and analysis module is used to predict product sales based on the results of machine inventory analysis, warehouse inventory analysis, and product sales attribute analysis, using a rule-based tree model to obtain sales forecast results. The rule-based tree model classifies the data by autonomously discovering rules and then establishes regression models to adapt to fluctuations in product sales.
[0042] The procurement trigger analysis module is used to combine the sales forecast results with the daily inventory data, determine whether to trigger procurement based on preset conditions, and calculate the recommended procurement quantity to automate procurement forecasting.
[0043] As a preferred embodiment of the vending machine merchandise procurement forecasting and analysis device, the machine inventory analysis module includes:
[0044] The machine-level data includes information reflecting machine operating status, replenishment cycle, location, sales capacity, inventory, and stockout status.
[0045] The machine-related product data includes information reflecting the product's inventory, sales status, reasons for stockouts, and replenishment volume.
[0046] The sales performance of in-stock products is evaluated by integrating multi-dimensional data, and sales deviations caused by stockouts are corrected by using stockout-related data.
[0047] As a preferred solution for vending machine merchandise procurement forecasting and analysis devices, the warehouse inventory analysis module generates daily warehouse health indicators by collecting data related to warehouse inventory, aisle inventory, in-transit inventory, inventory pre-sale days, inventory tags, and distribution locations, and analyzes the overall sales and circulation dynamics of merchandise inventory at the city level.
[0048] As a preferred embodiment of the vending machine merchandise procurement forecasting and analysis device, the sales forecasting and analysis module calculates multi-period averages based on sample data from the 60 days prior to the forecast date using moving average smoothing; the data is preprocessed to eliminate skewed distribution, and the processing methods include:
[0049] Taking the square root of a proportional variable: Let the proportional variable be x, then the result is...
[0050] Perform a square root operation on the differential variable while preserving its sign: Let the differential variable be y, then the result after processing is... Where sign(·) is the sign function;
[0051] Logarithmic transformation of sales and other variables: Let the original variable be z, then the processed variable is z′=ln(z+1), where ln is the natural logarithm function.
[0052] As a preferred embodiment of the vending machine merchandise procurement prediction and analysis device, the sales prediction and analysis module employs the Cubist model as the rule-based tree model, and optimizes the prediction results through ensemble learning, including:
[0053] Multi-model parallel ensemble: Suppose that training generates k independent models, and the prediction result of the i-th model is... The final prediction result is
[0054] Multi-model serial ensemble: Let the initial model prediction result be... The error correction model predicts the result as e j The final prediction result is Where m is the number of modified models.
[0055] As a preferred embodiment of the vending machine merchandise procurement forecasting and analysis device, the procurement triggering analysis module suggests the following formula for calculating the procurement quantity:
[0056] Q = S + B + RW
[0057] B = (E × P) × U
[0058] P = H / T
[0059] U = A × C
[0060] R = (L × M) - N
[0061] In the formula, Q is the suggested purchase quantity; S is the predicted sales volume; B is the replenishment quantity of new machines; E is the increase in the quantity of new machines; P is the product distribution ratio; U is the number of replenishment units per new machine; H is the current number of distribution points; T is the number of distribution points in the city; A is the effective daily average change of distribution points; C is the replenishment cycle of new machines; R is the replenishment quantity at the original distribution point; L is the number of distribution channels at the distribution point; M is the replenishment value of a specified single distribution channel; N is the current inventory at the distribution point; and W is the warehouse inventory.
[0062] As a preferred embodiment of the vending machine merchandise procurement forecasting and analysis device, the procurement triggering analysis module determines the procurement days using the following formula:
[0063] D = P d +T d +S d
[0064] In the formula, D represents the number of days for procurement; P d For the number of days to prepare for delivery; T d For transport days; S d Safety stock days;
[0065] The procurement condition is triggered when the number of days of pre-sale inventory in the warehouse is less than D and the number of expected distribution points is greater than the specified threshold.
[0066] The beneficial effects of this invention are as follows:
[0067] First, improve prediction accuracy: By integrating multi-dimensional data and applying rule-based tree models, sales fluctuations can be accurately captured, solving the problem of traditional models lagging in response to sudden changes, and significantly improving prediction accuracy.
[0068] Second, reduce stockouts and overstocking: By combining inventory data with dynamic sales forecasts, we can accurately calculate purchase quantities, thereby reducing sales losses caused by stockouts and the risk of overstocking caused by over-purchasing.
[0069] Third, improve procurement efficiency: Automated procurement decision-making processes replace manual estimation, significantly reducing labor costs, adapting to large-scale deployment and frequent demand adjustments, and improving operational efficiency.
[0070] Fourth, optimize resource allocation: through end-to-end data correlation analysis, achieve collaborative management from terminal sales to warehouse inventory, improve commodity circulation efficiency, and reduce overall operating costs.
[0071] Fifth, enhanced scenario adaptability: Designed for the special operating scenarios of vending machines, it can flexibly respond to dynamic factors such as location changes and product iterations, and has a wide range of applications and strong practicality. Attached Figure Description
[0072] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0073] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0074] Figure 1 This is a schematic diagram of the vending machine merchandise procurement forecasting and analysis method provided in an embodiment of the present invention;
[0075] Figure 2 This is a schematic diagram of the technical route for the vending machine merchandise procurement forecasting and analysis method provided in an embodiment of the present invention;
[0076] Figure 3 This is a schematic diagram of the vending machine merchandise procurement prediction and analysis device architecture provided in an embodiment of the present invention. Detailed Implementation
[0077] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0078] Example 1
[0079] See Figure 1 and Figure 2 This invention provides a method for predictive analysis of vending machine merchandise procurement, comprising the following steps:
[0080] S1. Machine Inventory Analysis: Daily data is collected from both the machine and product dimensions to generate analytical results reflecting the machine's terminal sales capacity and product availability. As the terminal carrier for product sales, the machine's own status and the condition of the products sold directly affect sales results. Collecting data from the machine dimension reveals differences in the operational capabilities of different machines; for example, machine sales capacity varies depending on customer traffic in different locations. Collecting data from the product dimension allows for real-time monitoring of product inventory, sales, and stockouts within the machine. By integrating these daily data from both the machine and product dimensions, a comprehensive assessment of the machine's terminal sales potential and the actual sales characteristics of the products can be achieved, providing foundational data support for subsequent forecasting of terminal sales scenarios.
[0081] S2. Warehouse Inventory Analysis: Based on daily inventory data from city warehouses, warehouse health indicators are generated to analyze the inventory, sales, and turnover of goods at the city level. City warehouses are the intermediary link between product procurement and terminal vending machines; their inventory data reflects the supply and turnover status of goods throughout the city. By collecting data on warehouse inventory, distribution channel inventory, and in-transit inventory, the generated warehouse health indicators (such as inventory pre-sale days) can intuitively show whether inventory is sufficient and whether turnover is smooth. Analyzing this data at the city level connects terminal sales data with the procurement process, providing an inventory-level basis for determining whether and how much procurement is needed.
[0082] S3. Product Sales Attribute Analysis: This section records daily sales attribute data for products, reflecting their sales strategies and market performance. Different products require different sales strategies (e.g., new product promotion, clearance sales) and exhibit varying market performance (e.g., sales volume, price sensitivity), directly impacting sales volume. Recording daily sales attribute data such as retail labels, categories, and prices provides a basis for differentiating product characteristics, enabling more targeted sales forecasts, differentiated predictions, and improved forecast accuracy.
[0083] S4. Sales Forecast Analysis: Based on the results of machine inventory analysis, warehouse inventory analysis, and product sales attribute analysis, a rule-based tree model is used to predict product sales, yielding the sales forecast result. The rule-based tree model autonomously discovers rules to classify the data and then establishes regression models to adapt to fluctuations in product sales. The multi-dimensional data collected in steps S1, S2, and S3 covers information such as terminal sales, inventory turnover, and product characteristics, which together form the input basis for sales forecasting. The rule-based tree model can autonomously discover potential rules from the data, classify the data into different subsets, and then establish a regression model for each subset. This method can well adapt to various fluctuations in the product sales process (such as seasonal fluctuations, sudden changes in customer flow, etc.), thereby improving the accuracy of sales forecasting and capturing dynamic changes in sales better than traditional models.
[0084] S5. Procurement Trigger Analysis: Combining the sales forecast results with the daily inventory data, the system determines whether to trigger procurement based on preset conditions and calculates the recommended procurement quantity to automate procurement forecasting. Sales forecast results reflect future demand for goods, while daily inventory data reflects current supply capacity. Combining these two factors and using preset conditions (such as inventory pre-sale days being less than procurement days and the expected number of distribution points meeting targets) to determine whether procurement is necessary ensures timely replenishment when inventory is insufficient. Simultaneously, the recommended procurement quantity is calculated according to a specific formula, comprehensively considering factors such as predicted sales, replenishment needs for new products and existing distribution points, and existing inventory. This automates procurement decisions, reduces manual intervention, and improves procurement efficiency and accuracy.
[0085] In this embodiment, the machine inventory analysis in step S1:
[0086] The machine-level data includes information reflecting the machine's operating status, replenishment cycle, location, sales capacity, inventory, and stockout status. Machine operating status (e.g., online, under maintenance) determines whether the machine can be sold normally; the replenishment cycle affects the frequency of inventory replenishment, thus impacting sales opportunities; the location determines the scale of customer traffic and the characteristics of the consumer group; sales capacity grading can quickly distinguish the machine's sales potential; and inventory and stockout status directly reflect the availability of goods. This data describes the machine's basic situation and operational status from different perspectives, providing a comprehensive basis for assessing the machine's sales capacity.
[0087] The machine-based product dimension data includes information reflecting product inventory, sales performance, reasons for stockouts, and replenishment volume. Inventory directly reflects the current available quantity of a product; sales performance (e.g., average daily sales) reflects the product's popularity; reasons for stockouts (e.g., high demand, out-of-stock) help analyze the root causes of sales losses; and replenishment volume reflects the past replenishment efforts for that product. This data focuses on the specific performance of products within the machine and is a key basis for analyzing product sales characteristics.
[0088] By integrating multi-dimensional data, we can evaluate the sales performance of in-stock products and correct for sales discrepancies caused by stockouts using stockout-related data. Single-dimensional data is insufficient to fully reflect the sales situation of in-stock products. Integrating data from both the machine and product dimensions allows for a comprehensive assessment of sales performance from both machine capabilities and product characteristics. Stockouts can lead to actual sales falling short of potential sales. By analyzing stockout-related data (such as stockout days and reasons), we can estimate the sales lost due to stockouts, thereby correcting the sales data and making the evaluation results closer to the true sales potential. This provides a more accurate foundation for subsequent forecasting.
[0089] The fields recorded in the machine dimension are shown in Table 1:
[0090] Table 1 Fields of Machine Dimension Records
[0091]
[0092]
[0093] The fields for the machine product dimension record are shown in Table 2:
[0094] Table 2 Fields of Machine Product Dimension Records
[0095]
[0096] In this embodiment, the warehouse inventory analysis in step S2 involves collecting data on warehouse inventory, channel inventory, in-transit inventory, inventory pre-sale days, inventory tags, and distribution locations to generate daily warehouse health indicators, thereby analyzing the overall sales and circulation dynamics of commodity inventory at the city level.
[0097] Specifically, warehouse inventory represents the total amount of goods currently available for allocation; aisle inventory reflects the total stock of goods in terminal machines; in-transit inventory indicates the quantity of goods to be replenished; inventory pre-sale days predict the sales duration that existing inventory can support; inventory labels (such as expiration date and sales grade) determine the quality and sales priority of inventory; and distribution point data reflects the sales coverage of goods. The daily warehouse health indicators generated by integrating these data can clearly demonstrate the sales speed, turnover efficiency, and supply stability of goods inventory at the city-wide level, providing a macro-level inventory reference for procurement decisions.
[0098] This includes using daily warehouse inventory data to generate daily warehouse health indicators, analyzing the sales and turnover of goods inventory from the perspective of city warehouses. See Table 3 for the recorded fields:
[0099] Table 3 Fields of City Warehouse Dimension Records
[0100]
[0101]
[0102] In this embodiment, in step S3, the product sales attributes represent the sales strategy for the product in the business. If a product is tagged as "clearance," it means that the business will not order large quantities of this product anymore, and the number of distribution points will decrease rapidly. If a product is tagged as "new product," it means that this product has just started selling in this city, the number of distribution points will increase significantly, and warehouse inventory will be distributed to the machines first. Therefore, it is necessary to record daily product attribute data. The recorded fields are shown in Table 4:
[0103] Table 4: Fields of product attribute data records for the daily dimension
[0104] Field Name Field definition Retail Label In terms of business operations, sales strategies for products include new products, regular products, and clearance items. Product Categories Product categories, such as packaged beverages, sparkling beverages, etc. commodity prices Retail price of goods City daily sales Average daily sales of a city over a certain period of time
[0105] In this embodiment, in the sales forecast analysis described in step S4, based on sample data from the 60 days prior to the forecast date, a multi-period average is calculated using moving smoothing; the data is preprocessed to eliminate skewed distribution, and the processing methods include:
[0106] Taking the square root of a proportional variable: Let the proportional variable be x, then the result is...
[0107] Perform a square root operation on the differential variable while preserving its sign: Let the differential variable be y, then the result after processing is... Where sign() is the sign function;
[0108] Logarithmic transformation of sales and other variables: Let the original variable be z, then the processed variable is z′=ln(z+1), where ln is the natural logarithm function.
[0109] Specifically, the data is based on sample data from the 60 days prior to the forecast date because this period's data better reflects recent sales trends. Moving smoothing is used to calculate averages over multiple time periods, such as 7 days and 14 days, to eliminate the impact of short-term random fluctuations and highlight the data's trend. Data often exhibits a skewed distribution (e.g., sales data is often right-skewed), which can affect the model's predictive performance. Taking the square root of proportional variables, retaining the sign of the square root of differential variables, and taking the logarithm of variables like sales volume transforms skewed data into data closer to a normal distribution, making it easier for the model to learn data patterns and improving prediction accuracy.
[0110] In this embodiment, the sales forecast analysis in step S4 uses the Cubist model as the rule-based tree model, and optimizes the forecast results through ensemble learning, including:
[0111] Multi-model parallel ensemble: Suppose that training generates k independent models, and the prediction result of the i-th model is... The final prediction result is Multi-model parallel ensemble involves training multiple independent Cubist models, each of which may produce different predictions due to random factors (such as differences in data sampling). Averaging these results reduces the prediction bias of a single model, improves the stability and accuracy of predictions by utilizing multiple models, and reduces the impact of extreme predictions.
[0112] Multi-model serial ensemble: Let the initial model prediction result be... The error correction model predicts the result as e j The final prediction result is:
[0113]
[0114] Where m represents the number of correction models. In multi-model serial ensemble, after the initial model generates the basic prediction results, subsequent error correction models specifically learn the prediction errors of the initial model. By accumulating these error correction values into the final prediction results, the bias of the initial model can be gradually corrected, making the final prediction results closer to the true values. This is especially suitable for handling nonlinear error patterns in complex data.
[0115] The Cubist model effectively addresses the issue of predicted values being biased towards the mean. It classifies the training data by autonomously discovering rules, then builds separate linear regression models using data conforming to different rules. This allows the Cubist model to adapt to fluctuations in sales due to seasonality or product sales cycles. The Cubist model also offers ensemble learning, allowing the training of multiple independent models followed by averaging the predictions, or sequential training of multiple models, with subsequent models adjusting the errors of earlier ones. Furthermore, the Cubist model avoids making predictions beyond the training set's range, preventing unreasonable values from exceeding the sample's range. For example, if all target predicted values in the training set are greater than 0, the predicted value will also be greater than 0. Based on these advantages, this invention primarily relies on the Cubist model for prediction, but considers alternative models when it cannot perform the calculations.
[0116] In this embodiment, the formula for calculating the purchase quantity in the purchase trigger analysis described in step S5 is as follows:
[0117] Q = S + B + RW
[0118] B = (E × P) × U
[0119] P = H / T
[0120] U = A × C
[0121] R = (L × M) - N
[0122] In the formula, Q is the suggested purchase quantity; S is the predicted sales volume; B is the replenishment quantity of new machines; E is the increase in the quantity of new machines; P is the product distribution ratio; U is the number of replenishment units per new machine; H is the current number of distribution points; T is the number of distribution points in the city; A is the effective daily average change of distribution points; C is the replenishment cycle of new machines; R is the replenishment quantity at the original distribution point; L is the number of distribution channels at the distribution point; M is the replenishment value of a specified single distribution channel; N is the current inventory at the distribution point; and W is the warehouse inventory.
[0123] The recommended purchase quantity Q should meet future sales and replenishment needs, while deducting existing inventory. Here, S (forecasted sales volume) represents the basic future demand; B (replenishment quantity for new machines) is the quantity of goods needed for new machines; R (replenishment quantity at existing locations) is the replenishment demand for existing machines; and W (warehouse inventory) is the currently available inventory. The formula Q = S + B + RW comprehensively balances demand and inventory, ensuring that the purchase quantity meets demand without causing overstocking.
[0124] The replenishment quantity B for new machines depends on the increase in the number of new machines E, the product distribution ratio P, and the number of replenishment items per new machine U. E reflects the scale of the new machines; P reflects the distribution range of products in the new machines; and U is the replenishment quantity required for a single new machine. B = (E × P) × U can accurately calculate the total replenishment quantity for the new machines, ensuring that there are enough products available for the new machines to sell.
[0125] The product distribution ratio P is the ratio of the current number of distribution points H to the number of distribution points T in the city, reflecting the coverage ratio of the product among all machines in the city. This ratio can reasonably determine the scale of distribution in new machines, ensuring that the distribution volume of new machines is consistent with the existing distribution strategy.
[0126] The number of items U required for replenishment per new machine is determined by the average daily sales volume A at the location and the replenishment cycle C for the new machine. A is the machine's average daily sales capacity, and C is the number of days between two replenishments. Multiplying these two values gives the quantity of goods required for a single new machine within one replenishment cycle, ensuring that the new machine will not be out of stock during the replenishment cycle.
[0127] The replenishment quantity R at the original location is the quantity of replenishment for the existing machines. The quantity L of the storage lanes at the location and the replenishment value M of the designated single storage lane are multiplied to obtain the required inventory when the existing machines are fully stocked; subtracting the current inventory N at the location gives the quantity that needs to be replenished to bring the existing machine inventory to a reasonable level.
[0128] In this embodiment, the number of procurement days in the procurement trigger analysis described in step S5 is determined by the following formula:
[0129] D = P d +T d +S d
[0130] In the formula, D represents the number of days for procurement; P d For the number of days to prepare for delivery; T d For transport days; S d Safety stock days;
[0131] The procurement condition is triggered when the number of days of pre-sale inventory in the warehouse is less than D and the number of expected distribution points is greater than the specified threshold.
[0132] Specifically, if the warehouse inventory pre-sale days are less than the purchase days (D), it means that the existing inventory may not be able to support the next purchase, posing a risk of stockouts. If the expected number of distribution points is greater than a specified threshold, it indicates that the product's sales coverage has reached a certain scale, with sufficient sales demand. Purchases are only triggered when both conditions are met simultaneously. This avoids unnecessary purchases (such as when demand is low due to insufficient distribution points) and ensures timely replenishment when inventory is insufficient and demand is sufficient, achieving precise procurement.
[0133] The application scenarios of this invention are as follows:
[0134] Scenario 1: Differentiated Procurement of Vending Machine Clusters in Multiple Locations
[0135] When multiple vending machines are deployed in various locations such as office buildings, campuses, residential areas, and shopping malls, inventory analysis can be used to obtain data on replenishment cycles, stockout rates, and location-specific labels for each machine. For example, office building machines have high sales on weekdays, while campus machines experience large sales fluctuations on weekends. Combined with product sales attribute analysis (e.g., office buildings prefer coffee and light meals, while campuses prefer snacks and beverages), targeted predictions of product demand for different locations can be made. For instance, for office building vending machines, purchase trigger analysis can be used to calculate the purchase quantity to meet demand during that period, avoiding sales losses due to stockouts. For campus vending machines, the prediction cycle can be adjusted based on factors such as holidays and school closures to ensure that inventory covers students' needs during school hours without causing overstocking during holidays.
[0136] Scenario 2: Dynamic Procurement Adjustments Under Fluctuations in Commodity Sales
[0137] When product sales fluctuate due to seasonal changes (such as summer sales of cold drinks), sudden promotions (such as new product discounts), or weather changes (such as increased sales of hot drinks on rainy days), the model uses sample data from the 60 days prior to the forecast date and calculates averages over multiple time periods (7 days, 14 days, 30 days, etc.) through moving smoothing. This filters out short-term noise and extracts trend features. For example, before summer arrives, the model analyzes the growth trend of cold drink sales over the past 30 days and combines this with the rule classification of the Cubist model to generate accurate sales forecasts. The procurement trigger analysis then automatically calculates the additional quantity of cold drinks needed based on these results, ensuring sufficient inventory in vending machines during high-temperature periods, while monitoring inventory pre-sale days prevents over-purchasing.
[0138] Scenario 3: Procurement Adaptation During Vending Machine Location Expansion and Contraction
[0139] When adding new vending machine locations (such as installing machines in newly built apartments) or reducing inefficient locations, the purchase quantity can be dynamically adjusted using formulas in the purchase trigger analysis. For example, when adding 10 apartment vending machines, the replenishment quantity B for the new machines is calculated as "New machine increase quantity E × Product distribution ratio P × Number of items replenished per new machine U". If the number of locations T in the city where the apartment is located is 100, the current number of distribution locations H is 60 (i.e., P = 60%), the effective daily average number of items A per location is 20, and the replenishment cycle C for the new machines is 3 days (i.e., U = 20 × 3 = 60 items), then B = 10 × 60% × 60 = 360 items, ensuring sufficient initial inventory for the new machines. At the same time, the replenishment quantity R for the original locations is calculated as "Number of product lanes at the location L × Replenishment value per designated product lane M - Current inventory at the location N", ensuring that the replenishment needs of existing machines are coordinated and adapted to the expansion of new machines.
[0140] Scenario 4: Out-of-Stock Data-Driven Procurement Optimization
[0141] When vending machines experience stockouts due to reasons such as warehouse shortages or restocking delays, data from the machine inventory analysis, including the cause of the stockout and the number of days of stockout, are used to correct sales deviations (e.g., if a snack cannot be sold for three consecutive days due to a warehouse shortage, the model will estimate the lost sales for those three days based on historical sales figures and incorporate them into the forecast). In the procurement process, these corrected sales figures increase the predicted sales volume S, which in turn increases the procurement quantity using the formula Q = S + B + RW. For example, if the original predicted sales volume was 500 units, it increases to 650 units after the stockout correction, ensuring that the procurement quantity can compensate for the stockout loss and meet future demand.
[0142] Example 2
[0143] See Figure 3 Embodiment 2 of the present invention also provides a vending machine merchandise procurement prediction and analysis device, comprising:
[0144] The machine inventory analysis module 100 is used to collect daily data from the machine dimension and the machine product dimension, and generate analysis results that reflect the machine terminal sales capacity and product in-machine characteristics.
[0145] The warehouse inventory analysis module 200 is used to generate warehouse health indicators based on the daily inventory data of city warehouses and to analyze the inventory sales and circulation of goods at the city level.
[0146] The product sales attribute analysis module 300 is used to record daily sales attribute data of products, and to reflect the product's sales strategy and market performance through the daily sales attribute data;
[0147] The sales forecast analysis module 400 is used to predict the sales volume of goods based on the results of machine inventory analysis, warehouse inventory analysis and product sales attribute analysis, using a rule-based tree model to obtain the sales forecast results. The rule-based tree model classifies the data by autonomously discovering rules and then establishes regression models to adapt to fluctuations in product sales.
[0148] The procurement trigger analysis module 500 is used to combine the sales forecast results with the daily inventory data, determine whether to trigger procurement based on preset conditions, and calculate the recommended procurement quantity to automate procurement forecasting.
[0149] In this embodiment, the machine inventory analysis module 100 includes:
[0150] The machine-level data includes information reflecting machine operating status, replenishment cycle, location, sales capacity, inventory, and stockout status.
[0151] The machine-related product data includes information reflecting the product's inventory, sales status, reasons for stockouts, and replenishment volume.
[0152] The sales performance of in-stock products is evaluated by integrating multi-dimensional data, and sales deviations caused by stockouts are corrected by using stockout-related data.
[0153] In this embodiment, the warehouse inventory analysis module 200 collects data related to warehouse inventory, channel inventory, in-transit inventory, inventory pre-sale days, inventory tags, and distribution locations to generate daily warehouse health indicators, and analyzes the overall sales and circulation dynamics of commodity inventory at the city level.
[0154] In this embodiment, the sales forecasting and analysis module 400 calculates multi-period averages based on sample data from the 60 days prior to the forecast date using moving average smoothing; the data is preprocessed to eliminate skewed distribution, and the processing methods include:
[0155] Taking the square root of a proportional variable: Let the proportional variable be x, then the result is...
[0156] Perform a square root operation on the differential variable while preserving its sign: Let the differential variable be y, then the result after processing is... Where sign(·) is the sign function;
[0157] Logarithmic transformation of sales and other variables: Let the original variable be z, then the processed variable is z′=ln(z+1), where ln is the natural logarithm function.
[0158] In this embodiment, the sales forecasting and analysis module 400 uses the Cubist model as the regularized tree model, and optimizes the forecasting results through ensemble learning, including:
[0159] Multi-model parallel ensemble: Suppose that training generates k independent models, and the prediction result of the i-th model is... The final prediction result is
[0160] Multi-model serial ensemble: Let the initial model prediction result be... The error correction model predicts the result as e j The final prediction result is Where m is the number of modified models.
[0161] In this embodiment, the formula for calculating the recommended purchase quantity in the procurement trigger analysis module 500 is as follows:
[0162] Q = S + B + RW
[0163] B = (E × P) × U
[0164] P = H / T
[0165] U = A × C
[0166] R = (L × M) - N
[0167] In the formula, Q is the suggested purchase quantity; S is the predicted sales volume; B is the replenishment quantity of new machines; E is the increase in the quantity of new machines; P is the product distribution ratio; U is the number of replenishment units per new machine; H is the current number of distribution points; T is the number of distribution points in the city; A is the effective daily average change of distribution points; C is the replenishment cycle of new machines; R is the replenishment quantity at the original distribution point; L is the number of distribution channels at the distribution point; M is the replenishment value of a specified single distribution channel; N is the current inventory at the distribution point; and W is the warehouse inventory.
[0168] In this embodiment, the number of procurement days in the procurement trigger analysis module 500 is determined by the following formula:
[0169] D = P d +T d +S d
[0170] In the formula, D represents the number of days for procurement; P d For the number of days to prepare for delivery; T d For transport days; S d Safety stock days;
[0171] The procurement condition is triggered when the number of days of pre-sale inventory in the warehouse is less than D and the number of expected distribution points is greater than the specified threshold.
[0172] It should be noted that the information interaction and execution process between the modules of the above-mentioned device are based on the same concept as the method embodiment in Embodiment 1 of this application, and the resulting technical effects are the same as those in the method embodiment of this application. For details, please refer to the description in the method embodiment shown above in this application, and it will not be repeated here.
[0173] Example 3
[0174] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium storing program code for a vending machine merchandise purchase prediction and analysis method. The program code includes instructions for executing the vending machine merchandise purchase prediction and analysis method of Embodiment 1 or any possible implementation thereof.
[0175] Computer-readable storage media can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives, SSDs).
[0176] Example 4
[0177] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
[0178] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor can execute the vending machine merchandise purchase prediction and analysis method of Embodiment 1 or any possible implementation thereof by calling the program instructions.
[0179] Specifically, a processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. This memory can be integrated into the processor or located outside the processor and exist independently.
[0180] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0181] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0182] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.
Claims
1. A method for predictive analysis of vending machine merchandise procurement, characterized in that, Includes the following steps: Machine inventory analysis: Collect daily data from both machine and product dimensions to generate analysis results that reflect the sales capacity of machine terminals and the in-machine characteristics of products; Warehouse inventory analysis: Generate warehouse health indicators based on daily inventory data of city warehouses, and analyze the inventory sales and circulation of goods at the city level; Product sales attribute analysis: Records daily sales attribute data of products, and reflects the product's sales strategy and market performance through the daily sales attribute data; Sales forecast analysis: Based on the results of machine inventory analysis, warehouse inventory analysis and product sales attribute analysis, a rule-based tree model is used to predict product sales and obtain sales forecast results. The rule-based tree model classifies the data by autonomously discovering rules and then establishes regression models to adapt to fluctuations in product sales. Purchase Trigger Analysis: Combining the sales forecast results with the daily inventory data, determine whether to trigger a purchase based on preset conditions, and calculate the recommended purchase quantity to automate the purchase forecast.
2. The vending machine merchandise procurement forecasting and analysis method according to claim 1, characterized in that, In the machine inventory analysis: The machine-level data includes information reflecting machine operating status, replenishment cycle, location, sales capacity, inventory, and stockout status. The machine-related product data includes information reflecting the product's inventory, sales status, reasons for stockouts, and replenishment volume. The sales performance of in-stock products is evaluated by integrating multi-dimensional data, and sales deviations caused by stockouts are corrected by using stockout-related data.
3. The vending machine merchandise procurement forecasting and analysis method according to claim 1, characterized in that, In the warehouse inventory analysis, daily warehouse health indicators are generated by collecting data on warehouse inventory, channel inventory, in-transit inventory, inventory pre-sale days, inventory tags, and distribution locations, and the overall sales and circulation dynamics of commodity inventory are analyzed from the city level.
4. The vending machine merchandise procurement forecasting and analysis method according to claim 1, characterized in that, In the sales forecast analysis, based on sample data from the 60 days prior to the forecast date, a multi-period average is calculated using moving smoothing; the data is preprocessed to eliminate skewed distribution, and the processing methods include: Taking the square root of a proportional variable: Let the proportional variable be x, then the result after processing is... Perform a square root operation on the differential variable while preserving its sign: Let the differential variable be y, then the result after processing is... Where sign(·) is the sign function; Logarithmic transformation of sales and other variables: Let the original variable be z, then the processed variable is z′=ln(z+1), where ln is the natural logarithm function.
5. The vending machine merchandise procurement forecasting and analysis method according to claim 1, characterized in that, In the sales forecasting analysis, the rule-based tree model used is the Cubist model, and the forecasting results are optimized through ensemble learning, including: Multi-model parallel ensemble: Suppose that training generates k independent models, and the prediction result of the i-th model is... The final prediction result is Multi-model serial ensemble: Let the initial model prediction result be... The error correction model predicts the result as e j The final prediction result is Where m is the number of modified models.
6. The vending machine merchandise procurement forecasting and analysis method according to claim 1, characterized in that, In the aforementioned procurement trigger analysis, the recommended formula for calculating the procurement quantity is: Q = S + B + RW B = (E × P) × U P = H / T U = A × C R = (L × M) - N In the formula, Q is the suggested purchase quantity; S is the predicted sales volume; B is the replenishment quantity for new machines; E is the increase in the quantity of new machines; P is the product distribution ratio; U is the number of replenishment units per new machine; H is the current number of distribution points; T is the number of distribution points in the city; A is the effective daily average change in distribution points; C is the replenishment cycle for new machines; R is the replenishment quantity at the original distribution point; L is the number of distribution lanes at the distribution point; M is the replenishment value for a specified single distribution lane; N is the current inventory at the distribution point; and W is the warehouse inventory.
7. The vending machine merchandise procurement forecasting and analysis method according to claim 1, characterized in that, In the procurement trigger analysis, the procurement days are determined by the following formula: D=P d +T d +S d In the formula, D represents the number of days for procurement; P d For the number of days to prepare for delivery; T d For transport days; S d Safety stock days; The procurement condition is triggered when the number of days of pre-sale inventory in the warehouse is less than D and the number of expected distribution points is greater than the specified threshold.
8. A vending machine merchandise procurement forecasting and analysis device, characterized in that, include: The machine inventory analysis module is used to collect daily data from both machine and product dimensions, and generate analysis results that reflect the sales capacity of machine terminals and the in-machine characteristics of products. The warehouse inventory analysis module is used to generate warehouse health indicators based on daily inventory data of city warehouses, and to analyze the inventory sales and circulation of goods at the city level. The product sales attribute analysis module is used to record daily sales attribute data of products, and the daily sales attribute data reflects the product's sales strategy and market performance. The sales forecasting and analysis module is used to predict product sales based on the results of machine inventory analysis, warehouse inventory analysis, and product sales attribute analysis, using a rule-based tree model to obtain sales forecast results. The rule-based tree model classifies the data by autonomously discovering rules and then establishes regression models to adapt to fluctuations in product sales. The procurement trigger analysis module is used to combine the sales forecast results with the daily inventory data, determine whether to trigger procurement based on preset conditions, and calculate the recommended procurement quantity to automate procurement forecasting.
9. The vending machine merchandise procurement prediction and analysis device according to claim 8, characterized in that, In the machine inventory analysis module: The machine-level data includes information reflecting machine operating status, replenishment cycle, location, sales capacity, inventory, and stockout status. The machine-related product data includes information reflecting the product's inventory, sales status, reasons for stockouts, and replenishment volume. The sales performance of in-stock products is evaluated by integrating multi-dimensional data, and sales deviations caused by stockouts are corrected by using stockout-related data. The warehouse inventory analysis module collects data on warehouse inventory, channel inventory, in-transit inventory, inventory pre-sale days, inventory tags, and distribution locations to generate daily warehouse health indicators, and analyzes the overall sales and circulation dynamics of commodity inventory at the city level. In the sales forecasting and analysis module, based on sample data from the 60 days prior to the forecast date, the average value across multiple time periods is calculated using moving smoothing; the data is preprocessed to eliminate skewed distribution, and the processing methods include: Taking the square root of a proportional variable: Let the proportional variable be x, then the result after processing is... Perform a square root operation on the differential variable while preserving its sign: Let the differential variable be y, then the result after processing is... Where sign(·) is the sign function; Logarithmic transformation of sales and other variables: Let the original variable be z, then the processed variable is z′=ln(z+1), where ln is the natural logarithm function; The sales forecasting and analysis module uses the Cubist model as its regularized tree model, and optimizes the forecasting results through ensemble learning, including: Multi-model parallel ensemble: Suppose that training generates k independent models, and the prediction result of the i-th model is... The final prediction result is Multi-model serial ensemble: Let the initial model prediction result be... The error correction model predicts the result as e j The final prediction result is Where m is the number of modified models.
10. The vending machine merchandise procurement prediction and analysis device according to claim 8, characterized in that, In the procurement trigger analysis module, the suggested formula for calculating the procurement quantity is: Q = S + B + RW B = (E × P) × U P = H / T U = A × C R = (L × M) - N In the formula, Q is the suggested purchase quantity; S is the predicted sales volume; B is the replenishment quantity for new machines; E is the increase in the quantity of new machines; P is the product distribution ratio; U is the number of replenishment units per new machine; H is the current number of distribution points; T is the number of distribution points in the city; A is the effective daily average change in distribution points; C is the replenishment cycle for new machines; R is the replenishment quantity at the original distribution point; L is the number of distribution lanes at the distribution point; M is the replenishment value at a specified single distribution lane; N is the current inventory at the distribution point; and W is the warehouse inventory. In the procurement trigger analysis module, the procurement days are determined by the following formula: D=P d +T d +S d In the formula, D represents the number of days for procurement; P d For the number of days to prepare for delivery; T d For transport days; S d Safety stock days; The procurement condition is triggered when the number of days of pre-sale inventory in the warehouse is less than D and the number of expected distribution points is greater than the specified threshold.