A supply chain commodity price anomaly detection method and system based on cross-section value quantity deviation

By using the PriceVol-CSAD method, the coupling relationship between price and sales volume is analyzed using cross-sectional data, which solves the problem of identifying price and sales volume anomalies in the supply chain. It provides interpretable anomaly types and scores, adapts to supply chain environments with multiple SKUs and multiple regions, reduces detection costs and improves identification efficiency.

CN122434594APending Publication Date: 2026-07-21张振玉
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
张振玉
Filing Date
2026-04-29
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies struggle to identify anomalies in the coupling between product prices and sales volume within the supply chain, cannot explain the causes of these anomalies, and are ineffective in detecting anomalies in the absence of time-series data. They are particularly costly to maintain when there are many SKUs and a wide geographical distribution, and cannot provide a ranking of the severity of anomalies.

Method used

The PriceVol-CSAD method is used to analyze the coupling relationship between price and sales volume through cross-sectional data. Anomaly indicators are calculated using robust z-score and two-layer baseline. Combined with sparsity penalty and hyperparameter tuning, interpretable anomaly type labels and scores are provided.

Benefits of technology

It identifies anomalies where price and volume diverge under single-period data conditions, provides interpretable anomaly types and severity scores, adapts to supply chain scenarios with a large number of SKUs and wide geographical distribution, reduces maintenance costs and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122434594A_ABST
    Figure CN122434594A_ABST
Patent Text Reader

Abstract

The application discloses a supply chain commodity anomaly detection method and system based on cross-section price-volume divergence. By aligning the multi-region price table and the sales table into a unified panel, the robust price z and sales z of the commodity dimension and the classification dimension are calculated for each (commodity, node) observation point, and then the weighted sum of the price-volume coupling divergence index, the single-dimensional extreme index and the sparse penalty is taken as the anomaly score, and the semantic labels such as high price and high sales, low price and low sales, price island and sales island are given according to the price-volume z quadrant. The method does not depend on time series and can work on single-period snapshot data, has robustness for boundary conditions such as single commodity quotation point scarcity and distribution degeneration, the output can be directly understood by business personnel, and can be widely applied to commodity anomaly monitoring in scenes such as chain catering, retail, fresh food distribution and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of e-commerce and supply chain data analysis technology, specifically to a method, system, and computer-readable storage medium for automatically identifying, scoring, and interpreting anomalies in product pricing and sales volume in the supply chain based on multi-regional cross-sectional data and the coupling relationship between price distribution and sales volume distribution. Background Technology

[0002] Existing technology In scenarios such as large chain restaurants, retail, community group buying, and fresh food delivery, the same product (SKU) typically needs to be procured or sold in dozens to hundreds of customer canteens / warehouses / stores across the country. Due to various factors such as region, suppliers, contract periods, and manual data entry, the procurement price and sales price of the same product vary at different points in the transaction. Existing methods for detecting price anomalies mainly include: Method A: Fixed threshold alarm - Manually set a reasonable price range for each SKU, and trigger an alarm if the price is exceeded; Method B: Time-series statistical method – Perform Z-score / IQR / EWMA statistics on each SKU over time, and issue an alert when the current price deviates too much from the historical average; Method C: Machine Learning Anomaly Detection – Using unsupervised models such as Isolation Forest, LOF, and Autoencoder to learn normal distributions on multidimensional features and identify anomalies.

[0003] Inadequacy of existing technology Method A heavily relies on manual maintenance, and the maintenance cost is extremely high when there are thousands of SKUs; the threshold lags behind market fluctuations; and the threshold is "black and white", making it impossible to rank the severity.

[0004] Method B is highly dependent on the length of the time series; newly listed products and low-frequency purchased products have no historical data to compare with. When the price list is just a periodic snapshot (e.g., a centralized procurement quotation every half month), the time series method is basically ineffective. Method C lacks interpretability and cannot answer the question "Why was this product judged as abnormal?", making it difficult to implement in the daily work of procurement and operations personnel. At the same time, it has a high learning cost and poor generalization to small sample scenarios.

[0005] A more critical shortcoming is that existing methods only consider price, ignoring the fact that price anomalies are often accompanied by sales signals (e.g., genuinely low prices should lead to high sales volume; truly best-selling products should be purchased simultaneously in multiple customer canteens). When these two factors combine in a counterintuitive way, it is more likely to be due to data errors, improper pricing, arbitrage, or supply chain vulnerabilities, but existing methods cannot identify such price-volume coupling anomalies.

[0006] The technical problem to be solved by the present invention This paper provides a time-series-independent, interpretable, cross-SKU, and cross-regional comparable product anomaly detection method, capable of: 1. It still works even with only real-world data available in a single period price snapshot; 2. Simultaneously utilize the cross-sectional distribution of both price and sales volume to identify counterintuitive anomalies where price and volume diverge. 3. Automatically provide semantic labels for anomaly types (such as "high price, high sales" or "price island") and anomaly severity scores to facilitate business personnel in prioritizing and handling them; 4. Robust to edge cases such as scarce price points for a single SKU and degraded distribution. Summary of the Invention

[0007] Purpose of the invention This paper proposes a supply chain commodity anomaly detection method based on cross-sectional price-volume coupling (hereinafter referred to as PriceVol-CSAD method). It identifies abnormal observation points from price and sales volume panel data in a single period and multiple regions, and classifies and scores them.

[0008] Technical solution The PriceVol-CSAD method includes the following steps (see Figure 1 for the flowchart): Step S1: Data Alignment and Panel Construction S1.1 Extract the quadruple (SKU, Customer Canteen, Quotation Period, Price) from the price list (wide table, column hierarchy: region → province → customer canteen; cell content in the form of <price>(<start date>-<end date>)); S1.2 Extract the tuple (SKU, Customer Canteen, Sales Quantity, Order Quantity, Sales Amount, Gross Profit) from the sales table (long table); S1.3 Left join with (SKU, Customer Cafeteria) as the joint primary key to obtain a unified panel P, where each row is called an observation point o = (SKU, Customer Cafeteria, Price p, Sales q, Context).

[0009] Step S2: Two-Tier Robust Baseline S2.1 For each SKU, calculate its median price m_p^{(SKU)} and absolute median difference MAD_p^{(SKU)} across all customer canteens; the same applies to sales volume. S2.2 For each category, calculate the median price and MAD of all observations within the category as a fallback baseline; S2.3 When the number of price points n_{SKU} for a certain SKU is greater than or equal to N_min (default 4), the main baseline is taken at the SKU level; otherwise, the main baseline is taken at the category level.

[0010] Step S3: Robust z-score calculation S3.1 Price stability z: z_p = K · (p - m_p) / MAD_p, K = 0.6745; S3.2 Sales volume is transformed by log1p and z_q is calculated in the same way (sales volume has a very heavy long tail and must be compressed first). S3.3 When MAD = 0 (the degradation case where all customers' canteens have the same price for the same SKU), automatically fall back to the standard deviation; when the standard deviation is also 0, z is set to 0; S3.4 The z value is truncated |z| ≤ Z_clip (default 8.0) to prevent numerical explosion.

[0011] Step S4: Price-volume coupling anomaly indicators S4.1 Price-volume divergence indicator violation = max(0, z_p × z_q): When price and sales volume deviate from the baseline in the same direction (both positive or both negative), violating the economic common sense of "price ↑ volume ↓", the product is positive and the larger it is, the more abnormal it is; S4.2 One-dimensional extreme index extreme = max(|z_p|, |z_q|): Captures "island-type" anomalies with one-sided extreme deviations; S4.3 Sparse Penalty: sparsity = max(0, (S_ref − n_{SKU}) / S_ref): When there are very few quotes, the baseline confidence is low, and a penalty is imposed on the score. S4.4 Composite anomaly score: score(o) = α · violation + β · extreme − γ ·sparsity where α, β, and γ are adjustable hyperparameters, with default values ​​of (1.0, 0.6, 0.4).

[0012] Step S5: Semantic exception type labels are given interpretable labels according to the following rules (matched by priority).

[0013] Step S6: Aggregate Sorting and Visualization S6.1 Aggregates for each SKU: number of outliers, highest outlier score, count of each type, price range, and total sales. S6.2 Draw scatter points on the (z_p, z_q) plane, color-encode anomaly types, and radius-encode anomaly scores; S6.3 outputs Top-N anomalies for business personnel to review.

[0014] Beneficial effects compared to existing technologies 1. Not dependent on time series: It can work on snapshot data collected only in a single period, solving the problem of time series methods failing in real-world scenarios such as centralized procurement and bi-weekly pricing.

[0015] 2. Price-volume coupling anomaly detection: For the first time, “price anomaly” and “sales volume deviation” are considered together, which can identify abnormal combinations that violate economic common sense, such as “high price and high volume” and “low price and low volume”, which cannot be identified by existing methods. It covers high-value scenarios such as supply chain fraud, manual data entry errors, and contract management loopholes.

[0016] 3. Strong interpretability: Each anomaly is accompanied by numerical indicators (z_p, z_q, violation, extreme) and semantic labels A / B / C / D, which can be directly understood and sorted by procurement and risk control personnel.

[0017] 4. Strong robustness: The robust z-score (based on median + MAD) is naturally resistant to outliers; the triple mechanism of double-layer baseline + sparsity penalty + z-truncation ensures that it can still work in scenarios with very few samples and degenerate distribution.

[0018] 5. Adjustable hyperparameters: The three parameters α, β, and γ allow operators to flexibly balance between "strictly controlling deviations" and "strictly controlling extremes" to match the needs of different business stages. Attached Figure Description

[0019] Figure 1: Overall flowchart of the PriceVol-CSAD method (S1→S6), see the illustration below; Figure 2: Two-layer robust baseline selection decision tree (within SKU vs. within category); Figure 3: Schematic diagram of semantic labels for the valence-quantity coupling (z_p, z_q) plane and four quadrants (including actual data points); Figure 4: System Architecture Diagram (Data Loading Layer → Algorithm Layer → API Layer → Visualization Layer); Figure 5: Schematic diagram of the interface of the embodiment (abnormal list + scatter plot + product details panel). Detailed Implementation

[0021] Data scale: 87 customer canteens of a national chain catering enterprise, 2202 food SKUs, a total of 17656 observation points. The price list is a snapshot of the centralized procurement quotation every half month, and the sales volume list is the actual orders in the same period.

[0022] Key hyperparameters: α=1.0, β=0.6, γ=0.4, N_min=4, S_ref=6.0, K=0.6745, Z_clip=8.0.

[0023] Algorithm results (excerpt):

[0024] Business value: For example, the purchase price of "fermented black beans" for a customer's canteen in Foshan was 8.5 yuan per piece, while the median price of the same product nationwide was significantly lower than this value. However, the sales volume was higher than the average, suggesting that the purchase contract price was overestimated or that the sales volume statistics were abnormal. Example of “Maotouwanzi”: The price of 210 yuan / piece in the Jinan customer canteen is much higher than that of other customer canteens, but the sales volume is extremely low, which is a typical case of price entry error.

[0025] The system architecture is shown in Figure 4, and consists of four modules: Data loading layer (backend / app / data_loader.py): responsible for Excel parsing, wide table to long table conversion, field standardization, and panel construction; Algorithm layer (backend / app / anomaly.py): Implements all steps from S2 to S5, exposing detect(panel) -> AnomalyResult; API layer (backend / app / main.py, based on FastAPI): Exposes / api / overview, / api / anomalies, / api / scatter, / api / product / {code}; Visualization layer (frontend / , HTML + Chart.js): anomaly list + price-volume scatter plot + product details panel, all interactive operations are completed through REST API.

[0026] def _robust_z(values: np.ndarray) ->np.ndarray: v = np.asarray(values, dtype=float) med = np.nanmedian(v) mad = np.nanmedian(np.abs(v - med)) if mad<1e-6: std = np.nanstd(v) if std<1e-6: return np.zeros_like(v) return (v - med) / std return 0.6745 * (v - med) / mad def detect(panel): df = panel.copy() df["Sales_log"] = np.log1p(df["Number of Products Sold"].clip(lower=0)) df["z_price_sku"] = df.groupby("product code")["price"].transform(_robust_z) df["z_qty_sku"] = df.groupby("product code")["sales_log"].transform(_robust_z) df["z_price_cat"] = df.groupby("Category")["Price"].transform(_robust_z) df["z_qty_cat"] = df.groupby("Category")["Sales_log"].transform(_robust_z) df["product price points"] = df.groupby("product code")["product code"].transform("size") use_sku = df["product price points"]>= 4 df["z_price"] = np.where(use_sku, df["z_price_sku"], df["z_price_cat"]) df["z_qty"] = np.where(use_sku, df["z_qty_sku"], df["z_qty_cat"]) df["z_price"] = df["z_price"].clip(-8, 8) df["z_qty"] = df["z_qty"].clip(-8, 8) df["violation"] = (df["z_price"]* df["z_qty"]).clip(lower=0) df["extreme"] = np.maximum(np.abs(df["z_price"]), np.abs(df["z_qty"])) df["sparsity"] = np.maximum(0, (6 - df["sparsity points"]) / 6) df["abnormal score"] = (1.0*df["violation"] + 0.6*df["extreme"] - 0.4*df["sparsity"]).clip(lower=0) return df.

Claims

1. A method for detecting commodity anomalies based on cross-sectional price-quantity discrepancies, characterized in that, include: (a) Data alignment step: Merge the multi-region price table and sales table into a unified panel using (product identifier, sales / purchase node) as the primary key; (b) Two-layer robust baseline step: Calculate the median and absolute median difference of price and sales for the panel according to the product dimension and category dimension respectively, and select the primary baseline based on the sample size threshold; (c) Robust z calculation step: Calculate the price z and sales z for each observation point based on the selected baseline; (d) Price-volume coupling anomaly detection step: The non-negative part of the product of price z and sales volume z is used as the price-volume divergence indicator. Anomaly score is obtained by combining the single-dimensional extreme indicator and sparse penalty weighting. (e) Output step: Based on the anomaly score, semantic labels are given according to the price-volume z quadrant, and an anomaly list is output.

2. The method according to claim 1, characterized in that, The sales figures are transformed using log1p before calculating z.

3. The method according to claim 1, characterized in that, The robust z of the baseline regresses to a standard deviation-based z when the MAD degenerates to 0, and upper and lower cutoffs are applied to the final z value.

4. The method according to claim 1, characterized in that, The semantic tags include at least four categories: high price and high sales (A), low price and low sales (B), price island (C), and sales island (D).

5. The method according to claim 1, characterized in that, The composite anomaly score is expressed in the form score = α · max(0, z_p · z_q) + β · max(|z_p|, |z_q|) − γ · sparsity, where α, β, and γ are adjustable hyperparameters.

6. A system for implementing the method according to any one of claims 1-5, characterized in that, include: The module includes a data loading module, an anomaly detection module, an API service module, and a visualization module.

7. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the method as described in any one of claims 1-5.