A multi-tea vending machine marketing data analysis method and device
By constructing a multidimensional spatial relationship matrix and a recursive update strategy based on block QR decomposition, the problem of stockout masking effect among multiple tea vending machines was solved, the accuracy of sales forecasting and replenishment levels was improved, operating costs were reduced, and marketing effectiveness was enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU ZHONGKANG DACHENG ENVIRONMENTAL PROTECTION TECH CO LTD
- Filing Date
- 2026-06-11
- Publication Date
- 2026-07-17
AI Technical Summary
There is a spatiotemporal interaction between multiple tea vending machines. The shortage masking effect makes it impossible for data analysis models to effectively capture consumption characteristics, resulting in shortages and inventory backlogs at high-potential outlets. Existing methods cannot effectively predict shortage risks and adjust promotional strategies.
By collecting spatiotemporal, meteorological, and sales data from multiple tea vending machines, a multidimensional spatial relationship matrix is constructed. Segmented rank encoding and smoothed target mean encoding are performed to generate feature mapping nodes. Combined with block QR decomposition and a recursive update strategy for the forgetting coefficient, sales forecasts and replenishment levels are output, and promotional intensity is adjusted accordingly.
It enables collaborative management of multiple vending machine networks, reduces the risk of stockouts, increases marketing and operational revenue, and improves the accuracy of sales forecasting and replenishment levels.
Smart Images

Figure CN122415157A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data analysis, and in particular relates to a method and apparatus for analyzing marketing data from multiple tea vending machines. Background Technology
[0002] In real-world scenarios, multiple tea vending machines interact spatiotemporally, frequently experiencing sudden stockouts or restocking delays. This data truncation or anomaly caused by stockouts masks genuine consumer demand. The analysis model overlooks the stockout masking effect and the mutual influence between different vending machine nodes, failing to extract fundamentally strong spatiotemporally correlated consumer characteristics from the data. This easily leads to frequent stockouts at high-potential locations and inventory buildup at remote locations, resulting in increased operating costs and lost sales. Wide-range learning systems, with their advantages of not requiring backpropagation from deep networks, fast training speed, and support for incremental updates, have become a technological juncture for processing vending machine stream data and multidimensional time-series prediction. The analysis method utilizes wide-range networks to map and enhance the features collected from vending machines, achieving sales prediction. However, existing methods typically employ a static and uniform encoding approach during data preprocessing, which fails to adjust variable encoding strategies to accommodate changes in the out-of-stock masking ratio. Furthermore, they do not explore or evaluate the directed spatiotemporal relationships between vending machines or the isolation degree of nodes. Width learning, when generating mapping nodes, relies on random parameters and fails to incorporate modular differences in multidimensional features such as season, tea type, price, and space. It also fails to incorporate label relevance for redundancy removal, resulting in low network feature extraction efficiency and weak fitting ability to residuals. When faced with a continuous influx of new marketing data, the recursive update mechanism of existing networks lacks a forgetting strategy based on data changes, making it impossible to smoothly transition between old and new features. This leads to lag in prediction results and makes it impossible to achieve coordinated adjustments to promotional intensity based on out-of-stock risk prediction, thus failing to meet the analytical needs of marketing across multiple tea vending machines. Summary of the Invention
[0003] To achieve collaborative management of a multi-vending machine network, this invention provides a method and apparatus for analyzing marketing data from multiple tea vending machines.
[0004] The first aspect of this invention provides a method for analyzing marketing data from multiple tea vending machines, comprising the following steps:
[0005] A sample matrix was obtained by collecting order, inventory, replenishment, payment, location, weather, and promotion data according to vending machine number and fixed time window. Out-of-stock masking markers were generated based on zero inventory or delayed replenishment. Rank encoding was performed on continuous variables according to historical quantiles, and the number of segments decreased as the out-of-stock masking ratio increased in the previous period. Smoothed target mean encoding was used for categorical variables based on training window statistics. A normalized directed relation matrix was constructed based on customer flow correlation, distance, and payment conversion rate differences, and isolation degree was calculated.
[0006] The features are divided into seasonal, tea type, price and spatial relationship blocks. The spatial relationship blocks are spliced with first-order and second-order adjacency aggregation and inverse difference features. Each block generates probe nodes with orthogonal random weights and biases determined by interquartile range and isolation degree. The feature mapping nodes are generated by allocating and deducting redundancy scores based on the correlation between nodes and sales volume and repurchase rate labels.
[0007] Nodes whose scores meet the threshold are selected. The residuals of the remaining nodes relative to the selected nodes are compressed according to the out-of-stock occlusion ratio to generate enhanced nodes. Block QR decomposition is used to obtain multiple output weights. When the new time window arrives, the forgetting coefficient is determined by the ratio of the mean of the diagonal elements of each block of the old R matrix to the mean of the new R matrix. The network is then updated recursively. The sales forecast and replenishment level of each vending machine are output. The promotion intensity is adjusted in conjunction with the predicted out-of-stock risk to generate marketing analysis results.
[0008] A second aspect of the present invention provides a marketing data analysis device for multiple tea vending machines, comprising the following modules:
[0009] The calculation module is used to collect order, inventory, replenishment, payment, location, weather and promotion data by vending machine number and fixed time window to obtain a sample matrix. It generates out-of-stock masking marks based on zero inventory or delayed replenishment. It performs rank encoding on continuous variables according to historical quantiles, and the number of segments decreases as the out-of-stock masking ratio increases in the previous period. It uses smoothed target mean encoding of categorical variables based on training window statistics. It constructs a normalized directed relation matrix based on customer flow correlation, distance and payment conversion rate differences and calculates isolation degree.
[0010] The generation module is used to divide the features into seasonal, tea type, price and spatial relationship blocks. The spatial relationship blocks are spliced with first-order and second-order adjacency aggregation and inverse difference features. Each block generates probe nodes with orthogonal random weights and biases determined by interquartile range and isolation degree. The feature mapping nodes are allocated and generated according to the score after deducting redundancy based on the correlation between the node and the sales and repurchase rate labels.
[0011] The analysis module selects nodes whose scores meet the threshold, and generates enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock occlusion ratio. It uses block QR decomposition to obtain multiple output weights. When the new time window arrives, it determines the forgetting coefficient by the ratio of the mean of the diagonal elements of each block of the old R matrix to the mean of the new R matrix and recursively updates the network. It outputs the sales forecast and replenishment level of each vending machine, and adjusts the promotion intensity in conjunction with the predicted out-of-stock risk to generate marketing analysis results.
[0012] This invention collects and integrates spatiotemporal, meteorological, and sales data from multiple tea vending machines. By combining out-of-stock masking, segmented rank encoding, and smoothed target mean encoding, it mitigates data interference caused by stockouts. A multi-dimensional spatial relationship matrix is constructed, and features are segmented. A correlation and redundancy deduction mechanism is used to filter and generate feature mapping nodes, extracting potential associations among various elements while reducing the complexity and computational burden of the network structure. A residual compression mechanism is used to generate enhanced nodes to compensate for the loss of detailed information. Combined with block-based QR decomposition and a recursive update strategy based on the forgetting coefficient, the network model can adjust output weights when facing new data windows, outputting sales predictions and replenishment levels, and adjusting promotional intensity accordingly. This achieves collaborative management of a multi-vending machine network, reduces stockout risk, and improves overall marketing and operational efficiency. Attached Figure Description
[0013] Figure 1 A flowchart for a marketing data analysis method for multiple tea vending machines;
[0014] Figure 2 This is a schematic diagram of segmented optimization;
[0015] Figure 3 This is a schematic diagram of the isolation degree deviation distribution;
[0016] Figure 4 This is a schematic diagram comparing ablation experiments. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] Reference Figure 1 This invention proposes a method for analyzing marketing data from multiple tea vending machines, including:
[0019] S1 collects order, inventory, replenishment, payment, location, weather, and promotion data according to vending machine number and fixed time window to obtain a sample matrix. It generates out-of-stock masking marks based on zero inventory or delayed replenishment. Continuous variables are rank-coded according to historical quantiles, and the number of segments decreases as the out-of-stock masking ratio increases in the previous period. Categorical variables are encoded using smoothed target mean encoding based on training window statistics. A normalized directed relation matrix is constructed based on customer flow correlation, distance, and payment conversion rate differences, and the isolation degree is calculated.
[0020] A multidimensional tensor matrix is created by aggregating transaction details, sensor logs, meteorological interface data, and marketing system data from the IoT database using unique device identifiers and sliding time windows. A Boolean-type out-of-stock masking matrix is generated for records where the inventory field is zero or the actual replenishment time is longer than the planned time. The mean of the out-of-stock masking marks for the previous time window is calculated. A mathematical rounding function is used to subtract the product of this mean and the penalty coefficient from the base number of segments to determine the number of bins. Based on this number of bins, continuous features such as temperature and monetary value are mapped to discrete integers using quantile-rank encoding based on the empirical cumulative distribution of historical data. The TargetEncoder class from the Category_Encoders library is used to perform mean encoding based on the smoothed prior of the target variable for weather conditions and holiday category features to prevent overfitting. Calculate the Euclidean distance between the vending machines' latitude and longitude, combine it with the Pearson correlation coefficient to calculate the similarity of the passenger flow time series, calculate the difference in payment conversion rate for each machine, take the reciprocal of the three values and sum them to construct the original directed graph adjacency matrix, use the normalize function of the Scikit_Learn library to perform L1 regularization row by row to convert it into a normalized directed relation matrix, use the NetworkX library to construct a directed graph and calculate the centrality score of each node, and take the reciprocal of the centrality score as the isolation feature of each vending machine.
[0021] In some implementations, the rank encoding of continuous variables based on historical quantiles, where the number of segments decreases as the shortage coverage ratio of the previous period increases, includes:
[0022] Calculate the ratio of the number of time windows corresponding to the out-of-stock cover markers of each vending machine to the total number of time windows to obtain the out-of-stock cover ratio of the previous period;
[0023] The number of segments for calculating the rank reduction discreteness of continuous variables is set. The number of segments is the set base default number of segments minus the product of the previous period's shortage coverage ratio and the set maximum limit of the attenuation control coefficient, and then rounded down.
[0024] Using the calculated number of segments, boundary isolation points corresponding to the number of segments are uniformly divided within the global probability cumulative distribution interval of the continuous variables in the sample.
[0025] The values of the original continuous variables in the sample are mapped to the corresponding segmented intervals according to the boundary isolation points, and converted into discrete rank-coded indices to generate reduced-rank discretized features.
[0026] Before rank-coding continuous variables of the vending machine, such as temperature, customer flow density, and historical sales, a fixed time window of a set length is read from the database, preferably historical operating data of the past T=168 hours or 30 days. The number of time windows marked as "out of stock" (1) is counted, representing the out-of-stock status. The ratio of this out-of-stock status to the total number of time windows T is used to calculate the out-of-stock percentage p∈[0,1] for the previous period. For example, if 42 hours out of a total of 168 hours are out of stock, then p=0.25.
[0027] Calculate the number of segments K, and set the base default number of segments for continuous variables. The preferred range is 20 to 50, for example, taking... The maximum limit for the attenuation control coefficient M is preferably in the range of 10 to 15, for example, M=10. According to, for example, formula... The calculated number of down-ranked segments, K, is currently 17. This segment number setting helps suppress data distribution truncation bias caused by stockouts. The relationship between the stockout coverage ratio and the number of segments is shown below. Figure 2 This variation pattern can adapt to the discretization requirements of continuous variables under different shortage conditions and suppress data distribution truncation bias. After calculating the specific number of segments K=17, for a specific continuous variable, such as historical temperature data [-5℃, 40℃], the empirical cumulative distribution function of the variable in the full unmasked sample is statistically analyzed. On the cumulative probability interval [0,1], at equal probability intervals of 1 / K, which is approximately 0.0588, the variable quantiles corresponding to cumulative probabilities of 1 / K, 2 / K, ..., (K-1) / K are extracted, thereby uniformly dividing the data into K-1 internal boundary isolation points. Combined with the maximum and minimum values of the data, a total of K segment intervals are formed. When a specific value of a certain original continuous variable is obtained, such as the actual collected temperature of 23.5℃, the specific interval range defined by the above quantiles is located by using a binary search method. If the value falls into the 8th quantile interval, the original floating-point value is converted into a discrete integer rank encoding number 8. This process is repeated for all continuous variables to obtain a rank-reduced discretized eigenvector, which reduces noise parameters and abnormal data interference under extreme shortage conditions.
[0028] In some implementations, the construction of a normalized directed relation matrix based on passenger flow correlation, distance, and differences in payment conversion rates, and the calculation of isolation degree, include:
[0029] Calculate the Pearson correlation coefficient of customer flow between each pair of vending machines within the synchronous time window, the reciprocal of the dimensionless spatial straight-line distance, and the absolute value of the difference in historical payment conversion rate.
[0030] The initial directed relation matrix is constructed based on the combination of multiple influencing sources. The initial directed relation matrix is the product of the preset weight coefficient of passenger flow and the Pearson correlation coefficient of passenger flow, plus the product of the preset weight coefficient of distance and the inverse of the straight-line distance in space, and then the product of the preset weight coefficient of conversion rate and the absolute value of the difference between historical payment conversion rate.
[0031] The initial directed relation matrix is normalized row by row to generate a standardized node connection relation matrix. The element value of a certain row and column in the standardized node connection relation matrix is the element value of the corresponding row and column in the initial directed relation matrix divided by the sum of the element values of all columns in that row.
[0032] The sum of squares of the diagonal elements of the standardized node connection matrix is used as a benchmark. The ratio of the sum of the off-diagonal elements of the corresponding row of each vending machine to the benchmark is inverted to calculate the isolation parameter of each vending machine node.
[0033] When extracting the spatial association topology between vending machines, network parameters containing N vending machines (e.g., N=50) are extracted. Within the same time window of length, such as 30 days, the Pearson correlation coefficient of daily customer traffic is calculated for vending machine nodes i and j. Obtain the latitude and longitude coordinates of both and calculate the actual straight-line distance. After performing dimensionless processing using the max-min standardization method, the reciprocal is taken to obtain the distance-related parameters. Simultaneously calculate the absolute value of the difference between the historical payment conversion rates of the two during this period. .
[0034] By setting a passenger flow weight coefficient with an optimal range of 0.3-0.5. For example, a distance weighting coefficient of 0.4, preferably within the range of 0.2-0.4. For example, a conversion rate weighting coefficient of 0.3, or preferably within the range of 0.1-0.3. If we take 0.2, then combine it with the formula. Calculate the original influence scores between nodes. For example, calculate the following: , Then it is calculated If i=j, then retain its own correlation mapping characteristics, thereby generating an initial N×N directed relation matrix.
[0035] Perform L1 normalization row by row on the initial matrix to normalize the elements of the node connection matrix. This ensures that the sum of the effects of all node connections in each row is 1. The sum of squares, S, of the main diagonal elements of this normalized matrix is used as the global benchmark for the homogeneity of the entire topology.
[0036] For each specific vending machine node i, sum the connectivity of all off-diagonal elements in that row, i.e., the sum of the connectivity of other neighboring nodes. The isolation degree parameter of this node is calculated using the inverse proportional mapping formula. For example, calculating the vending machine in a remote corner of a university. If the calculated value is large, the machine will be assigned a high isolation feature value due to its lack of synchronization with other nodes, preventing incorrect replenishment decisions caused by network marginalization. The isolation score distribution of the 50 vending machines in this experimental sample is based on... Figure 3 It can identify isolated edge nodes in the network.
[0037] S2 divides the features into seasonal, tea type, price and spatial relationship blocks. The spatial relationship blocks are spliced together with first-order and second-order adjacency aggregation and inverse difference features. Each block generates probe nodes with orthogonal random weights and biases determined by interquartile range and isolation degree. The feature mapping nodes are generated by allocating and deducting redundancy scores based on the correlation between nodes and sales volume and repurchase rate labels.
[0038] The NumPy library's slicing indexing operation is used to segment the full feature column into a first block containing seasonal time encoding, a second block containing tea beverage categories, a third block containing price tiers, and a spatial relationship block containing geographical distribution. For the spatial relationship block, the product of the feature matrix and the normalized directed relation matrix is calculated to obtain the first-order adjacency aggregation feature. Matrix multiplication is then performed again to obtain the second-order aggregation feature. The node's own features are subtracted from the first-order aggregation feature to obtain the inverse difference feature. These features are then horizontally concatenated. A random weight matrix with orthogonal properties is initialized for each data block. The interquartile range of the feature distribution of each block is calculated. The interquartile range is multiplied by the isolation degree and random noise to construct a bias vector. The feature block is multiplied by the orthogonal weights, and the bias is added. An initial probe node matrix is generated using the sigmoid activation function. Using the minimum redundancy maximum correlation (mRMR) algorithm, the mutual information between each probe node and the sales volume and repurchase rate tags is calculated as the correlation term, and the mutual information between probe nodes is calculated as the redundancy term. The comprehensive score is obtained by subtracting the redundancy term from the correlation. The number of mapping nodes for each feature block is allocated proportionally according to the score, and the corresponding number of probe nodes are retained as feature mapping nodes.
[0039] In some implementations, the feature is divided into seasonal, tea type, price, and spatial relation blocks. The spatial relation blocks are then concatenated with first-order and second-order adjacency aggregation and inverse difference features, including:
[0040] The preprocessed sample matrix features are divided into seasonal, tea type, price, and initial spatial relation blocks containing spatial relation parameters;
[0041] A first-order adjacency aggregation feature is generated by performing a single matrix multiplication operation between the standardized node connection relation matrix and the initial spatial relation block.
[0042] The standardized node connection relationship matrix is used to perform matrix multiplication with the first-order adjacency aggregation feature again, and information is transferred twice to generate the second-order adjacency aggregation feature.
[0043] Calculate the difference between the initial spatial relation block of the target vending machine node and the mean vector of the features of the first-order neighbor nodes to obtain the inverse difference features;
[0044] The initial spatial relation block, first-order adjacency aggregation feature, second-order adjacency aggregation feature, and reverse difference feature are concatenated into vectors to complete the construction of the spatial relation block.
[0045] The sample feature matrix, after undergoing down-rank encoding and smoothed target mean encoding, is sliced along its column dimension to create seasonal blocks composed of temperature and precipitation (e.g., N×4 feature dimension), tea blocks composed of historical sales percentages of various tea beverage types (e.g., N×10 dimension), price blocks composed of promotional efforts and unit price (e.g., N×3 dimension), and an initial spatial relationship block matrix composed of location latitude and longitude and basic customer traffic. For example, if the dimension is N×5, N is the total number of vending machines.
[0046] Using the calculated N×N normalized node connection matrix Perform topological graph convolution aggregation. This is done through a single matrix multiplication. The spatial features of neighboring machines are weighted and averaged to the target node using normalized weights to generate a first-order adjacency aggregation feature matrix for detecting spatial competition or cooperative effects. .
[0047] After obtaining the first-order features, execute Or equivalent to two consecutive multiplications By simulating the cross-regional secondary attenuation transmission process of features along the road network structure, second-order adjacency aggregation features capable of sensing fluctuations in a wide-area business district are generated. Simultaneously, element-wise subtraction is performed between the node's own feature vector and the arithmetic mean of the feature vectors of all its connected neighboring nodes. Assuming machine i has a passenger flow of 150, and the average passenger flow of its three neighbors is 200, then the value of this inverse difference feature in that dimension is -50, thus generating the inverse difference feature matrix for all nodes. .
[0048] The above four matrices with the same number of rows , , , A horizontal concatenation operation is performed along the feature column dimension. If each feature column has 5 columns, the concatenation will generate a high-dimensional composite spatial relationship block matrix with N rows and 20 columns, which enhances the network's ability to perceive the chain reaction of surrounding shortages and replenishments under irregular distribution.
[0049] In some implementations, each block generates probe nodes using orthogonal random weights and a bias determined by the interquartile range and isolation degree. Feature mapping nodes are then generated based on the node's score after deducting redundancy, according to its correlation with the sales and repurchase rate tags, including:
[0050] An initial weight matrix is randomly generated and orthogonalized to generate orthogonal random weights that match the dimensions of each block;
[0051] Calculate the mean of the interquartile range of each data block, and multiply the mean by the isolation degree of the corresponding vending machine to form a column vector, which is then broadcast-expanded to generate the bias of the corresponding dimension.
[0052] Each data block is input into a single-layer neural network structure with the above-mentioned orthogonal random weights and biases, and the initial probe node features are generated by processing the data through an activation function.
[0053] Calculate the Pearson correlation coefficient between the characteristics of each initial detection node and the sales volume and repurchase rate labels, and obtain the effective score of each detection node by deducting the redundant weights of mutual collinearity between nodes through partial correlation analysis.
[0054] The initial detection nodes are sorted from highest to lowest score, and a predetermined number of the top-ranked nodes are selected and retained as feature mapping nodes.
[0055] The neural network model is a multi-output width learning neural network. Its structure includes an input layer, hidden layers composed of tiled feature mapping nodes and enhancement nodes, and a multi-objective output layer. The feature block matrix X of the input layer is mapped to generate feature mapping nodes through a single-layer structure with orthogonal random weights and biases. The spatial projection error of the feature mapping nodes is compressed to generate enhancement nodes. All hidden layer nodes are combined into the output layer, and the network connection weight matrix is solved through pseudo-inverse calculation to obtain the output Y. The input to this network model consists of preprocessed seasonal feature matrices, tea category feature matrices, price feature matrices, and a high-dimensional composite spatial relationship block feature matrix containing adjacency aggregation features. The output of this network model is the continuous scalar value of the predicted sales volume of each vending machine in future time periods, and the discrete probability distribution data corresponding to different replenishment levels.
[0056] For the constructed blocks of season, tea type, price, and expanded spatial relationships, several initial random weight matrices are generated using a standard Gaussian distribution. These matrices are then transformed into orthogonal matrices using Schmidt orthogonalization or singular value decomposition, resulting in extracted orthogonal random weights. The column vectors are mutually orthogonal, avoiding the problem of collinearity of neuron weights in random-width learning. The optimal weight matrix dimension is determined based on the block input dimension. The capacity matching of the set node groups is determined. Simultaneously, the interquartile range (IQR) is obtained by calculating the difference between the third quartile and the first quartile for each dimension within the current feature block, and then the arithmetic mean of the IQRs for all dimensions of the block is calculated. For example, 0.35 indicates the degree of dispersion of the current data block.
[0057] The isolation parameters calculated for each vending machine in the previous steps. with the mean Multiplying them yields a bias column vector of size N×1, which is then expanded to a bias matrix matching the node output size using a tensor broadcasting mechanism. This results in a larger activation bias applied to more isolated vending machines, causing the network to focus on the subtle feature fluctuations at less popular locations.
[0058] The kth feature block matrix The input to the activation function is multiplied by orthogonal weights and then biased, generating a set of probe nodes containing the initial representation. The Pearson correlation coefficient between the output vector and the target variable is calculated for each generated node. Since different nodes may represent the same information, leading to network ill-conditioning, a redundancy penalty coefficient is set. This penalty term is subtracted from the average Pearson correlation coefficient between the node and the other calculated nodes, completing the partial correlation redundancy deduction and obtaining the score for each node. All scores are sorted in descending order, with a preset limit of retaining the top L nodes with scores greater than an absolute threshold, such as 0.25, preferably L=20. The selected top nodes are solidified and integrated to form a subset of the feature mapping node matrix, thereby reducing the network node redundancy width while locking in the predictor with the highest sensitivity to tea beverage repurchase and sales volume.
[0059] S3: Select nodes whose scores meet the threshold, and generate enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock occlusion ratio. Use block QR decomposition to obtain multiple output weights. When the new time window arrives, determine the forgetting coefficient by the ratio of the mean of the diagonal elements of each block of the old R matrix to the mean of the new R matrix, and recursively update the network. Output the sales forecast and replenishment level of each vending machine, and adjust the promotion intensity in conjunction with the predicted out-of-stock risk to generate marketing analysis results.
[0060] Feature mapping nodes with a comprehensive score greater than a preset constant threshold are selected using conditional filtering in the NumPy library. The `linalg.lstsq` function from the SciPy library is used to calculate the projection of unselected nodes onto the space of selected nodes and to compute the orthogonal residual matrix. Based on the calculated out-of-stock masking ratio, upper and lower bound parameters of the hyperbolic tangent tanh-type limiting function are set, and compression is applied to the residual matrix to generate an enhanced node matrix. The feature mapping nodes and enhanced nodes are then concatenated and merged. Block-based QR decomposition is performed on the merged state matrix. The resulting Q-orthogonal matrix is multiplied by the sales volume and repurchase rate multi-output label matrices, and the global output layer network weights are calculated by solving the upper triangular R matrix equation. When the data stream for the next fixed time window is input, QR decomposition is performed again on the new data block to obtain a new R matrix. The diagonal elements of the old R matrix from the previous period and the current new R matrix are extracted using the `diag` and `mean` functions of the NumPy library, and their arithmetic mean is calculated. The old mean is divided by the new mean to calculate the forgetting coefficient. This forgetting coefficient is then substituted into the Recursive Least Squares (RLS) algorithm formula to update the output layer weight matrix. The updated weight matrix is used to perform forward propagation calculations on the current time window data, outputting the continuous sales forecast value for each vending machine in the future time step. The K-Means clustering algorithm is used to discretize the forecast values and output the replenishment levels. The percentage difference between the sales forecast value and the current actual inventory is calculated as the predicted stockout risk probability. When the risk probability exceeds the safety line using logical judgment branches, the system interface is called to lower the discount coefficient according to an arithmetic sequence and reduce the number of coupons issued, thereby adjusting the promotion intensity. The forecast values and adjustment instructions are summarized and written into the database to generate marketing analysis results.
[0061] In some implementations, the process of selecting nodes whose scores meet a threshold, and then generating enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock occlusion ratio, includes:
[0062] The remaining reserve nodes that were not selected as feature mapping nodes are projected onto the space of the selected feature mapping nodes using the least squares method, the projection error is calculated, and the initial residual characteristics of each reserve node relative to the feature mapping node are obtained.
[0063] The initial residual features are subjected to a limiting function using a compression function. The limiting threshold is inversely proportional to the stockout coverage ratio of the previous period. The higher the stockout coverage ratio of the previous period, the smaller the limiting threshold for suppressing residual fluctuations, thus obtaining limited compressed residual features.
[0064] The restricted compressed residual features are used as auxiliary supplementary inputs and mapped to the enhanced feature space through an activation function to generate enhanced nodes. The feature mapping nodes and enhanced nodes are then concatenated to form the hidden layer full feature matrix of the width learning system.
[0065] The matrix consisting of the remaining reserve nodes that were eliminated due to failing to meet the score in the preliminary screening stage. Instead of discarding, the potentially hidden edge details are recycled. The selected feature map node matrix is set to... Through the normal equation Alternatively, the projection matrix can be obtained through pseudo-inverse. Perform orthogonal projection onto the subspace containing the selected nodes. Calculate the difference matrix between the original values and the projected reconstructed values of the unselected nodes. This allows for the acquisition of initial residual characteristics, which can represent unconventional data fluctuations caused by sudden weather events or short-term surges in popularity. A compression function based on a hyperbolic tangent function deformation is used for hard constraint processing to prevent high-frequency anomalous noise in the residuals from degrading the overall stability of the network. A limiting compression threshold is set. Where C is the upper limit of the preset basic threshold, preferably ranging from 1.2 to 1.5, for example, 1.5. Here, p is the sensitivity adjustment coefficient, for example, set to 2.0, where p is the out-of-stock coverage ratio calculated above. For instance, if a vending machine experiences frequent stockouts within a cycle, resulting in an out-of-stock coverage ratio p=0.4, the threshold will be tightened. Conversely, when there is no stockout, the threshold remains at 1.5. All absolute values exceeding the threshold... The residual elements will be clipped to the threshold by peak clipping and amplitude limiting, thereby generating restricted compressed residual features.
[0066] The constrained residual matrix is multiplied by randomly generated augmentation weights and biases, and then reconstructed using an activation function such as the sigmoid function to extract features, mapping them to a predetermined number, such as 30-dimensional augmentation nodes. The selected feature-mapped nodes are then directly connected to these generated augmentation nodes and horizontally merged along the feature channel dimension to form a multi-level, wide hidden layer full feature matrix for output prediction, balancing the accuracy of the backbone features with the tolerance of the long-tail information of the residuals.
[0067] In some implementations, the method employs block-based QR decomposition to obtain multiple output weights. Upon arrival of a new time window, the forgetting coefficient is determined by the ratio of the mean of the diagonal elements of each block's old R matrix to the mean of the new R matrix, and the network is recursively updated to output sales predictions and replenishment levels for each vending machine, including:
[0068] The generated hidden layer full feature matrix is divided into multiple sub-matrices according to the source of each block. QR decomposition is performed on each sub-matrix to extract the orthogonal matrix and upper triangular R matrix corresponding to each block.
[0069] Using the obtained orthogonal matrix and upper triangular R matrix, the initial network connection weight matrix for multiple output targets is solved by pseudo-inverse calculation;
[0070] When the data samples of the new time window arrive, the ratio of the mean of the diagonal elements of the old R matrix to the mean of the diagonal elements of the new R matrix obtained by decomposing the new sample data is extracted, and the forgetting coefficient of each block is calculated.
[0071] The hidden layer full feature matrix generated from the new sample data is combined with the original matrix using a weighted concatenation based on the forgetting coefficient.
[0072] The concatenated matrix is updated using the block incremental QR decomposition algorithm. The updated new R matrix and pseudo-inverse are recalculated, and then the connection weights of the globally updated multi-output network are recursively calculated. The sales forecast and replenishment level of each vending machine are output.
[0073] Instead of inverting the complete hidden layer matrix, the algorithm horizontally divides it into m sub-matrix blocks based on the data source of the mapping nodes and the classification of augmentation nodes. For example, seasonal blocks and price blocks correspond to their respective generated sub-hidden layer features. The QR decomposition algorithm is then applied to each sub-matrix block, using the following decomposition formula: The solution yields a Q matrix with orthogonal columns and an upper triangular R matrix containing inter-block condition number information. Based on the decomposition products obtained from each block, the generalized pseudoinverse is calculated block by block, and the ridge regression equation is executed. The formula is then used... Determine the initial multi-output network connection weights from the hidden layer to the prediction end. At this point, it is possible to simultaneously acquire the scalar continuous output of the predicted sales volume for each vending machine, as well as the discrete probability distribution outputs corresponding to low, medium, and high replenishment levels.
[0074] As time progresses, when the vending machine system receives new samples for the next synchronization time window, changes in the external business district or climate can cause data distribution drift. QR decomposition is also performed on the newly added feature data blocks to obtain a newly generated upper triangular matrix. Extract the old matrix stored in the historical data of the corresponding module. The mean of the diagonal elements, divided by the newly generated value. The quotient is obtained by taking the mean of the diagonal elements, and then combined with a preset smoothing coefficient to generate a forgetting coefficient within the range of [0.8, 1.0]. For example, when sudden changes in passenger flow during holidays cause a significant increase in the new matrix modulus, the calculated ratio decreases to 0.85, which will increase the attenuation of the memory weights for old samples. Based on the coefficients... The R matrix of the old data is proportionally multiplied and reduced, then weighted and assembled with the feature extraction matrix of the new data using the block incremental Givens rotation algorithm. This allows for recursive updates to obtain the latest version through a block incremental approach. With the corresponding system-wide pseudo-inverse matrix, the weights of multiple output layers can be updated in near real-time with minimal computing power, enabling the prediction of sales of each tea machine at different times within the next 24 hours, and outputting analysis reports in conjunction with the set replenishment forecast.
[0075] The experiment collected historical operating data from 50 tea vending machines distributed in a city over 90 consecutive days as a sample database, divided into a 70% training set, a 10% validation set, and a 20% test set, including various types of holidays and random out-of-stock events. Four control groups were set up: the first group used a basic multi-output width learning network without any strategy; the second group used a variant 1 with added first- and second-order adjacency aggregation and inverse difference spatial relation blocks; the third group used a variant 2 with added isolation bias and restricted compression residual enhancement nodes; and the fourth group used the model from this application, which fully applied out-of-stock occlusion rank reduction discretization and recursive update of the forgetting coefficient. The evaluation metrics selected were the root mean square error of predicted sales volume, the accuracy of replenishment level classification, and the time consumed per incremental update of the model.
[0076] The first group of basic models had a root mean square error (RMSE) of 12.45 for predicted sales, a replenishment level accuracy of 78.5%, and a single model update time of 2.50 seconds. The second group, variant one, saw its RMSE for predicted sales decrease to 10.32, and its replenishment level accuracy improve to 83.2%, with an update time of 2.56 seconds. The third group, variant two, saw its RMSE for predicted sales decrease to 8.65, and its replenishment level accuracy reach 88.4%, with an update time of 2.62 seconds. The fourth group, the model in this application, achieved optimal performance across all metrics, with a RMSE of 6.12 for predicted sales, a replenishment level accuracy as high as 94.6%, and a single model update time reduced to 0.45 seconds. A comparison of the core indicators of the ablation experiments for each model variant is provided below. Figure 4 , can represent the step-by-step gain effect of each optimization module in the present invention.
[0077] Variant 1 utilizes spatial graph convolution aggregation and inverse differencing mechanisms to enhance the network's perception of chain reactions and local polarization effects among surrounding nodes, thus reducing prediction errors. Variant 2, with its superimposed isolation bias and constrained residual generation mechanism, forces the model to focus on the subtle feature fluctuations of less popular and isolated points and suppresses high-frequency anomalous noise. The complete scheme integrates out-of-stock masking and down-rank encoding to suppress distribution truncation bias, and combines it with a block-based recursive forgetting update algorithm. This allows for near real-time weight updates with minimal computational overhead when the distribution of external business districts shifts. It not only pushes overall prediction accuracy to the highest level but also improves network update efficiency by more than 5 times, demonstrating the high timeliness of this scheme under spatial topology and sudden out-of-stock environments.
[0078] This invention also proposes a marketing data analysis device for multiple tea vending machines, comprising the following modules:
[0079] The calculation module is used to collect order, inventory, replenishment, payment, location, weather and promotion data by vending machine number and fixed time window to obtain a sample matrix. It generates out-of-stock masking marks based on zero inventory or delayed replenishment. It performs rank encoding on continuous variables according to historical quantiles, and the number of segments decreases as the out-of-stock masking ratio increases in the previous period. It uses smoothed target mean encoding of categorical variables based on training window statistics. It constructs a normalized directed relation matrix based on customer flow correlation, distance and payment conversion rate differences and calculates isolation degree.
[0080] The generation module is used to divide the features into seasonal, tea type, price and spatial relationship blocks. The spatial relationship blocks are spliced with first-order and second-order adjacency aggregation and inverse difference features. Each block generates probe nodes with orthogonal random weights and biases determined by interquartile range and isolation degree. The feature mapping nodes are allocated and generated according to the score after deducting redundancy based on the correlation between the node and the sales and repurchase rate labels.
[0081] The analysis module selects nodes whose scores meet the threshold, and generates enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock occlusion ratio. It uses block QR decomposition to obtain multiple output weights. When the new time window arrives, it determines the forgetting coefficient by the ratio of the mean of the diagonal elements of each block of the old R matrix to the mean of the new R matrix and recursively updates the network. It outputs the sales forecast and replenishment level of each vending machine, and adjusts the promotion intensity in conjunction with the predicted out-of-stock risk to generate marketing analysis results.
[0082] In some implementations, the rank encoding of continuous variables based on historical quantiles, where the number of segments decreases as the shortage coverage ratio of the previous period increases, includes:
[0083] Calculate the ratio of the number of time windows corresponding to the out-of-stock cover markers of each vending machine to the total number of time windows to obtain the out-of-stock cover ratio of the previous period;
[0084] The number of segments for calculating the rank reduction discreteness of continuous variables is set. The number of segments is the set base default number of segments minus the product of the previous period's shortage coverage ratio and the set maximum limit of the attenuation control coefficient, and then rounded down.
[0085] Using the calculated number of segments, boundary isolation points corresponding to the number of segments are uniformly divided within the global probability cumulative distribution interval of the continuous variables in the sample.
[0086] The values of the original continuous variables in the sample are mapped to the corresponding segmented intervals according to the boundary isolation points, and converted into discrete rank-coded indices to generate reduced-rank discretized features.
[0087] In some implementations, the construction of a normalized directed relation matrix based on passenger flow correlation, distance, and differences in payment conversion rates, and the calculation of isolation degree, include:
[0088] Calculate the Pearson correlation coefficient of customer flow between each pair of vending machines within the synchronous time window, the reciprocal of the dimensionless spatial straight-line distance, and the absolute value of the difference in historical payment conversion rate.
[0089] The initial directed relation matrix is constructed based on the combination of multiple influencing sources. The initial directed relation matrix is the product of the preset weight coefficient of passenger flow and the Pearson correlation coefficient of passenger flow, plus the product of the preset weight coefficient of distance and the inverse of the straight-line distance in space, and then the product of the preset weight coefficient of conversion rate and the absolute value of the difference between historical payment conversion rate.
[0090] The initial directed relation matrix is normalized row by row to generate a standardized node connection relation matrix. The element value of a certain row and column in the standardized node connection relation matrix is the element value of the corresponding row and column in the initial directed relation matrix divided by the sum of the element values of all columns in that row.
[0091] The sum of squares of the diagonal elements of the standardized node connection matrix is used as a benchmark. The ratio of the sum of the off-diagonal elements of the corresponding row of each vending machine to the benchmark is inverted to calculate the isolation parameter of each vending machine node.
[0092] In some implementations, the feature is divided into seasonal, tea type, price, and spatial relation blocks. The spatial relation blocks are then concatenated with first-order and second-order adjacency aggregation and inverse difference features, including:
[0093] The preprocessed sample matrix features are divided into seasonal, tea type, price, and initial spatial relation blocks containing spatial relation parameters;
[0094] A first-order adjacency aggregation feature is generated by performing a single matrix multiplication operation between the standardized node connection relation matrix and the initial spatial relation block.
[0095] The standardized node connection relationship matrix is used to perform matrix multiplication with the first-order adjacency aggregation feature again, and information is transferred twice to generate the second-order adjacency aggregation feature.
[0096] Calculate the difference between the initial spatial relation block of the target vending machine node and the mean vector of the features of the first-order neighbor nodes to obtain the inverse difference features;
[0097] The initial spatial relation block, first-order adjacency aggregation feature, second-order adjacency aggregation feature, and reverse difference feature are concatenated into vectors to complete the construction of the spatial relation block.
[0098] In some implementations, each block generates probe nodes using orthogonal random weights and a bias determined by the interquartile range and isolation degree. Feature mapping nodes are then generated based on the node's score after deducting redundancy, according to its correlation with the sales and repurchase rate tags, including:
[0099] An initial weight matrix is randomly generated and orthogonalized to generate orthogonal random weights that match the dimensions of each block;
[0100] Calculate the mean of the interquartile range of each data block, and multiply the mean by the isolation degree of the corresponding vending machine to form a column vector, which is then broadcast-expanded to generate the bias of the corresponding dimension.
[0101] Each data block is input into a single-layer neural network structure with the above-mentioned orthogonal random weights and biases, and the initial probe node features are generated by processing the data through an activation function.
[0102] Calculate the Pearson correlation coefficient between the characteristics of each initial detection node and the sales volume and repurchase rate labels, and obtain the effective score of each detection node by deducting the redundant weights of mutual collinearity between nodes through partial correlation analysis.
[0103] The initial detection nodes are sorted from highest to lowest score, and a predetermined number of the top-ranked nodes are selected and retained as feature mapping nodes.
[0104] In some implementations, the process of selecting nodes whose scores meet a threshold, and then generating enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock occlusion ratio, includes:
[0105] The remaining reserve nodes that were not selected as feature mapping nodes are projected onto the space of the selected feature mapping nodes using the least squares method, the projection error is calculated, and the initial residual characteristics of each reserve node relative to the feature mapping node are obtained.
[0106] The initial residual features are subjected to a limiting function using a compression function. The limiting threshold is inversely proportional to the stockout coverage ratio of the previous period. The higher the stockout coverage ratio of the previous period, the smaller the limiting threshold for suppressing residual fluctuations, thus obtaining limited compressed residual features.
[0107] The restricted compressed residual features are used as auxiliary supplementary inputs and mapped to the enhanced feature space through an activation function to generate enhanced nodes. The feature mapping nodes and enhanced nodes are then concatenated to form the hidden layer full feature matrix of the width learning system.
[0108] In some implementations, the method employs block-based QR decomposition to obtain multiple output weights. Upon arrival of a new time window, the forgetting coefficient is determined by the ratio of the mean of the diagonal elements of each block's old R matrix to the mean of the new R matrix, and the network is recursively updated to output sales predictions and replenishment levels for each vending machine, including:
[0109] The generated hidden layer full feature matrix is divided into multiple sub-matrices according to the source of each block. QR decomposition is performed on each sub-matrix to extract the orthogonal matrix and upper triangular R matrix corresponding to each block.
[0110] Using the obtained orthogonal matrix and upper triangular R matrix, the initial network connection weight matrix for multiple output targets is solved by pseudo-inverse calculation;
[0111] When the data samples of the new time window arrive, the ratio of the mean of the diagonal elements of the old R matrix to the mean of the diagonal elements of the new R matrix obtained by decomposing the new sample data is extracted, and the forgetting coefficient of each block is calculated.
[0112] The hidden layer full feature matrix generated from the new sample data is combined with the original matrix using a weighted concatenation based on the forgetting coefficient.
[0113] The concatenated matrix is updated using the block incremental QR decomposition algorithm. The updated new R matrix and pseudo-inverse are recalculated, and then the connection weights of the globally updated multi-output network are recursively calculated. The sales forecast and replenishment level of each vending machine are output.
[0114] In this specification, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise limited, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, "a," "an," "the," "the," and "its" may also include plural forms unless the context clearly indicates otherwise. "Multiple" refers to at least two, such as 2, 3, 5, or 8, etc. "And / or" includes any and all combinations of the associated listed items.
[0115] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0116] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for analyzing marketing data from multiple tea vending machines, characterized in that, include: A sample matrix was obtained by collecting order, inventory, replenishment, payment, location, weather, and promotion data according to vending machine number and fixed time window. Out-of-stock masking markers were generated based on zero inventory or delayed replenishment. Rank encoding was performed on continuous variables according to historical quantiles, and the number of segments decreased as the out-of-stock masking ratio increased in the previous period. Smoothed target mean encoding was used for categorical variables based on training window statistics. A normalized directed relation matrix was constructed based on customer flow correlation, distance, and payment conversion rate differences, and isolation degree was calculated. The features are divided into seasonal, tea type, price and spatial relationship blocks. The spatial relationship blocks are spliced with first-order and second-order adjacency aggregation and inverse difference features. Each block generates probe nodes with orthogonal random weights and biases determined by interquartile range and isolation degree. The feature mapping nodes are generated by allocating and deducting redundancy scores based on the correlation between nodes and sales volume and repurchase rate labels. Nodes whose scores meet the threshold are selected. The residuals of the remaining nodes relative to the selected nodes are compressed according to the out-of-stock occlusion ratio to generate enhanced nodes. Block QR decomposition is used to obtain multiple output weights. When the new time window arrives, the forgetting coefficient is determined by the ratio of the mean of the diagonal elements of each block of the old R matrix to the mean of the new R matrix. The network is then updated recursively. The sales forecast and replenishment level of each vending machine are output. The promotion intensity is adjusted in conjunction with the predicted out-of-stock risk to generate marketing analysis results.
2. The method according to claim 1, characterized in that, The method of rank-coding continuous variables based on historical quantiles, where the number of segments decreases as the shortage coverage ratio of the previous period increases, includes: Calculate the ratio of the number of time windows corresponding to the out-of-stock cover markers of each vending machine to the total number of time windows to obtain the out-of-stock cover ratio of the previous period; The number of segments for calculating the rank reduction discreteness of continuous variables is set. The number of segments is the set base default number of segments minus the product of the previous period's shortage coverage ratio and the set maximum limit of the attenuation control coefficient, and then rounded down. Using the calculated number of segments, boundary isolation points corresponding to the number of segments are uniformly divided within the global probability cumulative distribution interval of the continuous variables in the sample. The values of the original continuous variables in the sample are mapped to the corresponding segmented intervals according to the boundary isolation points, and converted into discrete rank-coded indices to generate reduced-rank discretized features.
3. The method according to claim 1, characterized in that, The process of constructing a normalized directed relation matrix based on passenger flow correlation, distance, and differences in payment conversion rates, and calculating the degree of isolation, includes: Calculate the Pearson correlation coefficient of customer flow between each pair of vending machines within the synchronous time window, the reciprocal of the dimensionless spatial straight-line distance, and the absolute value of the difference in historical payment conversion rate. The initial directed relation matrix is constructed based on the combination of multiple influencing sources. The initial directed relation matrix is the product of the preset weight coefficient of passenger flow and the Pearson correlation coefficient of passenger flow, plus the product of the preset weight coefficient of distance and the inverse of the straight-line distance in space, and then the product of the preset weight coefficient of conversion rate and the absolute value of the difference between historical payment conversion rate. The initial directed relation matrix is normalized row by row to generate a standardized node connection relation matrix. The element value of a certain row and column in the standardized node connection relation matrix is the element value of the corresponding row and column in the initial directed relation matrix divided by the sum of the element values of all columns in that row. The sum of squares of the diagonal elements of the standardized node connection matrix is used as a benchmark. The ratio of the sum of the off-diagonal elements of the corresponding row of each vending machine to the benchmark is inverted to calculate the isolation parameter of each vending machine node.
4. The method according to claim 1, characterized in that, The feature is divided into seasonal, tea type, price, and spatial relationship blocks. The spatial relationship blocks are then spliced together with first-order and second-order adjacency aggregation and inverse difference features, including: The preprocessed sample matrix features are divided into seasonal, tea type, price, and initial spatial relation blocks containing spatial relation parameters; A first-order adjacency aggregation feature is generated by performing a single matrix multiplication operation between the standardized node connection relation matrix and the initial spatial relation block. The standardized node connection relationship matrix is used to perform matrix multiplication with the first-order adjacency aggregation feature again, and information is transferred twice to generate the second-order adjacency aggregation feature. Calculate the difference between the initial spatial relation block of the target vending machine node and the mean vector of the features of the first-order neighbor nodes to obtain the inverse difference features; The initial spatial relation block, first-order adjacency aggregation feature, second-order adjacency aggregation feature, and reverse difference feature are concatenated into vectors to complete the construction of the spatial relation block.
5. The method according to claim 1, characterized in that, Each block generates probe nodes using orthogonal random weights and a bias determined by interquartile range and isolation degree. Feature mapping nodes are then generated based on the node's score after deducting redundancy, according to its correlation with sales volume and repurchase rate tags, including: An initial weight matrix is randomly generated and orthogonalized to generate orthogonal random weights that match the dimensions of each block; Calculate the mean of the interquartile range of each data block, and multiply the mean by the isolation degree of the corresponding vending machine to form a column vector, which is then broadcast-expanded to generate the bias of the corresponding dimension. Each data block is input into a single-layer neural network structure with the above-mentioned orthogonal random weights and biases, and the initial probe node features are generated by processing through the activation function. Calculate the Pearson correlation coefficient between the characteristics of each initial detection node and the sales volume and repurchase rate labels, and obtain the effective score of each detection node by deducting the redundant weights of mutual collinearity between nodes through partial correlation analysis. The initial detection nodes are sorted from highest to lowest score, and a predetermined number of the top-ranked nodes are selected and retained as feature mapping nodes.
6. The method according to claim 1, characterized in that, The process of selecting nodes whose scores meet the threshold, and then generating enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock coverage ratio, includes: The remaining reserve nodes that were not selected as feature mapping nodes are projected onto the space of the selected feature mapping nodes using the least squares method, the projection error is calculated, and the initial residual characteristics of each reserve node relative to the feature mapping node are obtained. The initial residual features are subjected to a limiting function using a compression function. The limiting threshold is inversely proportional to the stockout coverage ratio of the previous period. The higher the stockout coverage ratio of the previous period, the smaller the limiting threshold for suppressing residual fluctuations, thus obtaining limited compressed residual features. The restricted compressed residual features are used as auxiliary supplementary inputs and mapped to the enhanced feature space through an activation function to generate enhanced nodes. The feature mapping nodes and enhanced nodes are then concatenated to form the hidden layer full feature matrix of the width learning system.
7. The method according to claim 1, characterized in that, The method employs block-based QR decomposition to obtain multiple output weights. Upon arrival of a new time window, the forgetting coefficient is determined by the ratio of the mean of the diagonal elements of each block's old R matrix to the mean of the new R matrix, and the network is recursively updated. This outputs sales forecasts and replenishment levels for each vending machine, including: The generated hidden layer full feature matrix is divided into multiple sub-matrices according to the source of each block. QR decomposition is performed on each sub-matrix to extract the orthogonal matrix and upper triangular R matrix corresponding to each block. Using the obtained orthogonal matrix and upper triangular R matrix, the initial network connection weight matrix for multiple output targets is solved by pseudo-inverse calculation; When the data samples of the new time window arrive, the ratio of the mean of the diagonal elements of the old R matrix to the mean of the diagonal elements of the new R matrix obtained by decomposing the new sample data is extracted, and the forgetting coefficient of each block is calculated. The hidden layer full feature matrix generated from the new sample data is combined with the original matrix using a weighted concatenation based on the forgetting coefficient. The concatenated matrix is updated using the block incremental QR decomposition algorithm. The updated new R matrix and pseudo-inverse are recalculated, and then the connection weights of the globally updated multi-output network are recursively calculated. The sales forecast and replenishment level of each vending machine are output.
8. A marketing data analysis device for multiple tea vending machines, characterized in that, Includes the following modules: The calculation module is used to collect order, inventory, replenishment, payment, location, weather and promotion data by vending machine number and fixed time window to obtain a sample matrix. It generates out-of-stock masking marks based on zero inventory or delayed replenishment. It performs rank encoding on continuous variables according to historical quantiles, and the number of segments decreases as the out-of-stock masking ratio increases in the previous period. It uses smoothed target mean encoding of categorical variables based on training window statistics. It constructs a normalized directed relation matrix based on customer flow correlation, distance and payment conversion rate differences and calculates isolation degree. The generation module is used to divide the features into seasonal, tea type, price and spatial relationship blocks. The spatial relationship blocks are spliced with first-order and second-order adjacency aggregation and inverse difference features. Each block generates probe nodes with orthogonal random weights and biases determined by interquartile range and isolation degree. The feature mapping nodes are allocated and generated according to the score after deducting redundancy based on the correlation between the node and the sales and repurchase rate labels. The analysis module selects nodes whose scores meet the threshold, and generates enhanced nodes by compressing the residuals of the remaining nodes relative to the selected nodes according to the out-of-stock occlusion ratio. It uses block QR decomposition to obtain multiple output weights. When the new time window arrives, it determines the forgetting coefficient by the ratio of the mean of the diagonal elements of each block of the old R matrix to the mean of the new R matrix and recursively updates the network. It outputs the sales forecast and replenishment level of each vending machine, and adjusts the promotion intensity in conjunction with the predicted out-of-stock risk to generate marketing analysis results.
9. The apparatus according to claim 8, characterized in that, The method of rank-coding continuous variables based on historical quantiles, where the number of segments decreases as the shortage coverage ratio of the previous period increases, includes: Calculate the ratio of the number of time windows corresponding to the out-of-stock cover markers of each vending machine to the total number of time windows to obtain the out-of-stock cover ratio of the previous period; The number of segments for calculating the rank reduction discreteness of continuous variables is set. The number of segments is the set base default number of segments minus the product of the previous period's shortage coverage ratio and the set maximum limit of the attenuation control coefficient, and then rounded down. Using the calculated number of segments, boundary isolation points corresponding to the number of segments are uniformly divided within the global probability cumulative distribution interval of the continuous variables in the sample. The values of the original continuous variables in the sample are mapped to the corresponding segmented intervals according to the boundary isolation points, and converted into discrete rank-coded indices to generate reduced-rank discretized features.
10. The apparatus according to claim 8, characterized in that, The process of constructing a normalized directed relation matrix based on passenger flow correlation, distance, and differences in payment conversion rates, and calculating the degree of isolation, includes: Calculate the Pearson correlation coefficient of customer flow between each pair of vending machines within the synchronous time window, the reciprocal of the dimensionless spatial straight-line distance, and the absolute value of the difference in historical payment conversion rate. The initial directed relation matrix is constructed based on the combination of multiple influencing sources. The initial directed relation matrix is the product of the preset weight coefficient of passenger flow and the Pearson correlation coefficient of passenger flow, plus the product of the preset weight coefficient of distance and the inverse of the straight-line distance in space, and then the product of the preset weight coefficient of conversion rate and the absolute value of the difference between historical payment conversion rate. The initial directed relation matrix is normalized row by row to generate a standardized node connection relation matrix. The element value of a certain row and column in the standardized node connection relation matrix is the element value of the corresponding row and column in the initial directed relation matrix divided by the sum of the element values of all columns in that row. The sum of squares of the diagonal elements of the standardized node connection matrix is used as a benchmark. The ratio of the sum of the off-diagonal elements of the corresponding row of each vending machine to the benchmark is inverted to calculate the isolation parameter of each vending machine node.