Knowledge Graph-Driven Multidimensional Analysis and Visualization Method of Sales Data and Its System
Through knowledge graph-driven multi-dimensional analysis and visualization methods of sales data, combined with deep learning and high-dimensional data visualization technology, the shortcomings of traditional methods in complex relationships, dynamic changes and long-tail data are solved, and efficient, interpretable and scalable sales data analysis is achieved.
Patent Information
- Application Number
- CN202410994427.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Traditional sales data analysis methods have shortcomings in dealing with complex relationships, dynamic changes, long-tail data, multi-source heterogeneous data integration, interpretability and system scalability, and it is difficult to meet the analysis needs of large-scale high-dimensional data.
Using a knowledge graph-driven method, combining deep learning and high-dimensional data visualization technology, a knowledge graph in the sales field is built, time-based adaptive multi-view collaborative graph embedding, feature fusion and multi-dimensional analysis, and in-depth analysis and visualization of data through improved visualization algorithms and microservice architectures.
It significantly improves the complex relationship processing capabilities, dynamic feature modeling capabilities, long-tail data processing effects, multi-source heterogeneous data integration capabilities, model interpretability and system scalability, improves analysis efficiency and accuracy, and supports enterprise data-driven decision-making.
Smart Images

Figure CN119248989B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-dimensional analysis and visualization methods for sales data, and more specifically, to a knowledge graph-driven multi-dimensional analysis and visualization method for sales data and its system. Background Art
[0002] With the rapid development of e-commerce and the in-depth promotion of digital transformation, sales data analysis has become an important basis for enterprise decision-making. Traditional sales data analysis methods mainly include technologies such as statistical analysis, data mining, and machine learning. These methods perform well in dealing with structured data and simple business scenarios. However, with the increase in business complexity and the expansion of data scale, the existing technologies face severe challenges in the following aspects:
[0003] 1. Insufficient ability to handle complex relationships: Traditional methods mainly focus on the attribute analysis of a single entity and are difficult to effectively handle the complex relationships between entities. For example, a well-known e-commerce platform uses traditional association rule mining algorithms to analyze product relationships, but cannot fully consider multi-dimensional factors such as product categories, brands, and user preferences, resulting in limited value of the mined association rules.
[0004] 2. Insufficient dynamic feature modeling: Most existing methods assume that data features are static and are difficult to capture the dynamic changes of sales data. For example, a large retail enterprise uses traditional time series models for sales forecasting, but cannot effectively handle the influence of dynamic factors such as holidays and promotional activities, resulting in unstable prediction accuracy.
[0005] 3. Improper handling of long-tail data: Existing technologies often focus on processing high-frequency data and do not pay enough attention to the analysis of long-tail data. For example, a luxury goods e-commerce platform uses conventional classification algorithms for product recommendations, but the recommendation effect for low-volume customized products is poor, affecting the sales of long-tail products.
[0006] 4. Difficulty in integrating multi-source heterogeneous data: With the diversification of data sources, how to effectively integrate structured, semi-structured, and unstructured data has become a major challenge. A large cross-border e-commerce platform attempts to use traditional feature engineering methods to integrate data from different sources, but the effect is not good, and it cannot make full use of rich data resources.
[0007] 5. Insufficient interpretability: With the application of deep learning technologies, the interpretability of models has become a prominent issue. A well-known cosmetics company uses a deep neural network for customer churn prediction. Although the accuracy is relatively high, it is difficult to explain the reasons for the prediction results to business personnel, affecting the practical application of the model.
[0008] 6. Inefficient Visual Analysis: Facing large-scale high-dimensional data, traditional visualization techniques perform poorly in terms of response speed and interaction experience. When a large home appliance chain enterprise tried to conduct visual analysis on million-level transaction data, the system response was slow, seriously affecting the analysis efficiency.
[0009] 7. Insufficient System Scalability: With the rapid increase in data volume, the architecture design of the existing system is difficult to meet the analysis requirements of high concurrency and large data volume. A well-known online travel platform often faces the risk of system crashes during peak business periods and cannot support real-time large-scale data analysis.
[0010] Facing these challenges, innovative sales data analysis methods are urgently needed, which can comprehensively utilize advanced technologies such as knowledge graphs, deep learning, and high-dimensional data visualization to achieve comprehensive, in-depth, and efficient analysis of sales data. Summary of the Invention
[0011] To solve the above technical problems, the present invention proposes a multi-dimensional analysis and visualization method and system for sales data driven by a knowledge graph.
[0012] The present invention provides a multi-dimensional analysis and visualization method for sales data driven by a knowledge graph, including the following steps:
[0013] Construct a sales domain knowledge graph including product, customer, and transaction entities;
[0014] Based on the knowledge graph, preprocess the original sales data to obtain preprocessed sales data;
[0015] According to the knowledge graph and the preprocessed sales data, implement time-series adaptive multi-view collaborative graph embedding to obtain graph embedding features;
[0016] Fuse the graph embedding features with traditional sales data features to obtain fused features;
[0017] Based on the fused features, conduct multi-dimensional analysis to obtain analysis results;
[0018] Visualize the analysis results to generate visualization data;
[0019] Based on the visualization data, provide an interactive exploration interface to achieve in-depth analysis and insight of the data.
[0020] Specifically, the time-series adaptive multi-view collaborative graph embedding includes the following steps:
[0021] Execute a time-series attention mechanism to obtain the embedding representation of node v at time t
[0022]
[0023] Among them, represents the embedding representation of node v at time t - 1; N(v) represents the neighbor set of node v; represents the attention weight of node v to neighbor node u at time t; W h , W a are learnable weight matrices; a is a learnable vector parameter; σ1 is the LeakyReLU activation function; || represents the vector concatenation operation;
[0024] Perform multi-view fusion to obtain the fused node representation h v :
[0025]
[0026] Among them, represents the embedding representation of node v under the i1-th view; M represents the number of views, and β i1 represents the weight of the i1-th view; MLP represents a multi-layer perceptron;
[0027] Perform knowledge distillation to calculate the knowledge distillation loss L KD :
[0028]
[0029] Among them, and are the outputs of the teacher model and the student model respectively, τ is the temperature parameter, KL is the KL divergence, and σ2 represents the softmax function;
[0030] Perform the meta-learning anti-long-tail module to update the model parameters θ:
[0031]
[0032] Among them, θ ′ represents the model parameters updated by the inner loop, α and β are the learning rates of the inner loop and the outer loop respectively, L S and L Q are the loss functions of the support set and the query set, f θ represents the model function with parameters θ, represents the gradient with respect to θ.
[0033] Specifically, the feature fusion adopts a dynamic cross-modal adaptive feature fusion algorithm, including the following steps:
[0034] Calculate the importance weights of the graph embedding features and the traditional features:
[0035]
[0036] Among them, φ G and φ T are dynamic weight generation functions, H G is the graph embedding feature matrix, X T is the traditional sales data feature matrix, and sigmoid represents the sigmoid activation function;
[0037] Perform a non-linear transformation on the graph embedding feature and the traditional feature:
[0038] H G ′ = LeakyReLU(W1·H G + b1)
[0039] X T ′ = LeakyReLU(W2·X T + b2)
[0040] Among them, H′ G represents the transformed graph embedding feature, and X′ T represents the transformed traditional feature; W1, W2 represent learnable weight matrices; b1, b2 represent learnable bias vectors;
[0041] Introduce the mutual information maximization term:
[0042] I(H G ′, X T ′) = E[f D (H G ′, X T ′)] - log(E[exp(f D (H G ′, X T ″))])
[0043] Among them, f D is the discriminator network, and X″ T is a random permutation of X′ T ; E represents the expectation;
[0044] Perform feature fusion based on the dynamic weight:
[0045]
[0046] Add a residual connection and perform layer normalization:
[0047] F = LayerNorm(F + [H G || X T )
[0048] LayerNorm represents the layer normalization operation; || represents the vector concatenation operation;
[0049] Optimization objective:
[0050] L = L task + λ1·|L MI |- λ2·I(H G ′, X T ′)
[0051] Among them, L task is the loss function of the downstream task, and L MI is the loss of maximizing mutual information. λ1 and λ2 are balance coefficients.
[0052] Specifically, the multi-dimensional analysis includes sales trend analysis, customer segmentation, product association analysis, customer lifetime value prediction, and abnormal transaction detection.
[0053] Specifically, the sales trend analysis uses the Prophet time series prediction model:
[0054] y(t) = g(t) + s(t) + h(t) + ∈ t
[0055] Among them, g(t) is the trend term, s(t) is the seasonal term, h(t) is the holiday term, and ∈ t is the error term.
[0056] Specifically, the customer segmentation uses an improved DBSCAN algorithm, introducing the Mahalanobis distance to measure similarity:
[0057]
[0058] Among them, ρ i3 represents the local density of sample point i3, x i3 , x j3 represents the sample points in the dataset, and d M (x i3 , x j3 ) represents the Mahalanobis distance between sample points x i3 and x j3 ; σ3 represents the kernel width parameter, which is used to control the range of density estimation; exp represents the exponential function.
[0059] Specifically, the product association analysis uses an improved Apriori algorithm, introducing a time decay factor:
[0060]
[0061] Among them, supp(X) represents the support of item set X, and X represents the item set of goods to be analyzed; t represents the time when the transaction occurs; T represents the current time; δ represents the time decay factor, and its value range is (0, 1); c t(X) represents the number of occurrences of item set X at time t; N represents the total number of transactions.
[0062] Specifically, the customer lifetime value prediction uses an RNN model based on the attention mechanism:
[0063]
[0064] Among them, CLTV represents the predicted customer lifetime value; T represents the predicted time span, and α t represents the attention weight at time step t, and x t represents the customer feature vector at time step t; RNN represents the recurrent neural network function.
[0065] Specifically, the visual presentation uses an improved ForceAtlas2 algorithm for force-directed graph layout:
[0066]
[0067] Among them, F r (u, v) represents the repulsive force between nodes u and v; k r represents the repulsive force coefficient, deg(u) and deg(v) respectively represent the degrees of nodes u and v; d(u, v) represents the distance between nodes u and v;
[0068] And the Barnes-Hutt-SNE algorithm is used for high-dimensional data projection:
[0069]
[0070] Among them, p j4|i4 represents the conditional probability that point i4 in the high-dimensional space selects point j4 as its neighbor; x i4 , x j4 , x k4 represents the data points in the high-dimensional space, and σ i4 represents the local density parameter of point i4; ||·|| represents the Euclidean distance; exp represents the exponential function.
[0071] A knowledge graph-driven multi-dimensional analysis and visualization system for sales data that executes the described method includes:
[0072] A knowledge graph construction module for constructing a sales domain knowledge graph containing entities such as products, customers, and transactions;
[0073] A data preprocessing module for preprocessing the original sales data based on the knowledge graph to obtain preprocessed sales data;
[0074] A graph embedding module, which is used to achieve time-series adaptive multi-view collaborative graph embedding based on the knowledge graph and the preprocessed sales data, and obtain graph embedding features;
[0075] A feature fusion module, which is used to fuse the graph embedding features with traditional sales data features to obtain fused features;
[0076] A multi-dimensional analysis module, which is used to perform multi-dimensional analysis based on the fused features to obtain analysis results;
[0077] A visualization presentation module, which is used to visually present the analysis results and generate visualization data;
[0078] An interactive exploration module, which is used to provide an interactive exploration interface based on the visualization data to achieve in-depth analysis and insight of the data.
[0079] The beneficial effects of the present invention are mainly reflected in the following aspects:
[0080] 1. Improve the ability to handle complex relationships: By introducing knowledge graph technology, the present invention can effectively capture and utilize the complex relationships between entities, significantly improving the effect of association rule mining. The average lift reaches 3.2, which is 77.8% higher than the traditional method.
[0081] 2. Enhance the ability to model dynamic features: By adopting the time-series adaptive multi-view collaborative graph embedding algorithm, the present invention can better capture the dynamic features of sales data. In the sales prediction task, the MAPE is reduced to 8.2%, which is 47.8% higher in accuracy than the traditional method.
[0082] 3. Improve the processing effect of long-tail data: Through the meta-learning anti-long-tail module, the present invention has made significant progress in the analysis of long-tail commodities. The F1 score reaches 0.73, which is 62.2% higher than the traditional method.
[0083] 4. Realize the effective integration of multi-source heterogeneous data: By adopting the dynamic cross-modal adaptive feature fusion algorithm, the present invention can effectively integrate data from different sources and types. In the customer clustering task, the silhouette coefficient reaches 0.68, which is 61.9% higher than the traditional method.
[0084] 5. Improve the interpretability of the model: By combining knowledge graph and visualization technologies, the present invention has greatly improved the interpretability of the analysis results, enabling decision-makers to better understand and apply the analysis results.
[0085] 6. Improve the efficiency of visual analysis: Through the improved visualization algorithm and high-performance rendering technology, the present invention reduces the visualization response time to 0.8 seconds, which is 65.2% more efficient than the traditional method.
[0086] 7. Enhance system scalability: By adopting a microservices architecture and containerized deployment strategy, the scalability of the system of the present invention is significantly improved, and it can stably support 12,000 QPS, which is 4 times that of traditional methods.
[0087] In summary, by innovatively combining knowledge graphs, deep learning, and high-dimensional data visualization technologies, the present invention comprehensively solves various challenges faced by existing sales data analysis methods, provides a powerful, efficient, and scalable sales data analysis tool for enterprises, and strongly supports data-driven business decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 It is a flowchart of the knowledge graph-driven multi-dimensional analysis and visualization method for sales data of the present invention.
[0089] Figure 2 It is a schematic diagram of the framework principle of the knowledge graph-driven multi-dimensional analysis and visualization system for sales data of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0090] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following combines the accompanying drawings and preferred embodiments, and details its specific implementation manner, structure, features, and effects as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form. [[ID=IPTC]]
[0091] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0092] The present invention provides a knowledge graph-driven multi-dimensional analysis and visualization method and system for sales data, aiming to solve the deficiencies of traditional sales data analysis methods in dealing with complex relationships, dynamic changes, and long-tail data. By combining knowledge graphs, deep learning, and high-dimensional data visualization technologies, the present invention realizes a comprehensive, in-depth, and intuitive analysis of sales data.
[0093] The following will detail the specific implementation manner of the present invention in combination with the sales data analysis scenario of a large e-commerce platform.
[0094] Please refer to Figure 1 , the knowledge graph-driven multi-dimensional analysis and visualization method for sales data of the present invention includes the following steps:
[0095] 1. Knowledge graph construction step. In this step, the system constructs a sales domain knowledge graph containing entities such as products, customers, and transactions. Taking an e-commerce platform as an example, this step includes the following sub-steps:
[0096] 1.1 Data collection and collation: Collect raw data from multiple data sources such as the platform's trading system, product management system, user management system, etc. For example, collect all transaction records, product information, user information, etc. in the past three years.
[0097] 1.2 Ontology design: Design the ontology structure in the field of e-commerce. The main entity categories include: Product (goods), Customer (customers), Transaction (transactions), Category (categories), Brand (brands), etc. The relationship types include: purchase (buy), belong_to (belong to), produce (produce), etc.
[0098] 1.3 Entity recognition and relationship extraction: Use named entity recognition (NER) technology to identify entities from texts such as product descriptions and user reviews. For example, identify "iPhone 12 Pro Max" (Product) and "Apple Inc." (Brand) from the sentence ""iPhone 12 Pro Max" is the flagship mobile phone launched by Apple Inc. in 2020". Then use the remote supervision method to extract the relationships between entities, such as "iPhone 12 Pro Max" produces "Apple Inc.".
[0099] 1.4 Knowledge fusion: Use entity alignment technology to solve the problem of entity reference ambiguity in different data sources. For example, point to the same entity for Apple, "Apple", Apple Inc., etc.
[0100] 1.5 Knowledge storage: Use the Neo4j graph database to store the constructed knowledge graph and design an optimized index structure to improve query efficiency.
[0101] 2. Data preprocessing steps, based on the constructed knowledge graph, preprocess the original sales data to obtain the preprocessed sales data. Specifically include:
[0102] 2.1 Data cleaning: Process missing values and outliers. For missing product prices, use the multiple imputation method (Multiple Imputation) to fill them. The specific formula is as follows:
[0103] Y imp = Y obs + ∈, ∈~N(0, σ 2 )
[0104] Where Y imp is the filled value, Y obs is the average price of observed similar products, and ∈ is a random error subject to a normal distribution.
[0105] Identify abnormal transactions using the Local Outlier Factor (LOF) algorithm. The calculation formula for the LOF score is as follows:
[0106]
[0107] Among them, N k (p) is the set of k-nearest neighbors of point p, and lrd k is the local reachability density. Usually, points with an LOF score greater than 2 are regarded as outlier points
[0108] 2.2 Data standardization. Perform Z-score standardization on numerical features (such as commodity prices, sales volumes):
[0109]
[0110] Among them, x is the original value, μ is the mean value, and σ is the standard deviation.
[0111] Perform One-hot encoding on categorical features (such as commodity categories, brands).
[0112] 2.3 Feature engineering. Extract time features, such as the month, season, and whether it is a holiday of the sales. Generate interaction features, such as the product of the customer purchase frequency and the product unit price.
[0113] 2.4 Data bucketing. Use the equal-frequency bucketing method to discretize continuous variables (such as customer age, commodity price) to enhance the robustness of the model.
[0114] 2.5 Data balancing. For unbalanced categorical data (such as high-value customers and low-value customers), adopt the SMOTE (Synthetic Minority Over-sampling Technique) algorithm for oversampling. The core idea of the SMOTE algorithm is to interpolate between minority class samples to generate new synthetic samples.
[0115] 3. Steps of time-series adaptive multi-view collaborative graph embedding. According to the knowledge graph and the preprocessed sales data, implement time-series adaptive multi-view collaborative graph embedding to obtain graph embedding features. This step includes the following sub-steps:
[0116] 3.1 Time-series attention mechanism. For each entity (such as commodity, user) on the e-commerce platform, consider its time-varying features. For example, the sales volume, rating, etc. of a certain mobile phone at different time points. The calculation of the time-series attention mechanism is as follows:
[0117]
[0118] Among them, represents the embedding representation of node v (such as a mobile phone) at time t, N(v) is the set of neighbor nodes of v (such as users who purchased the mobile phone, similar mobile phones, etc.), σ1 is the LeakyReLU activation function, and its negative slope is usually set to 0.2; represents the embedding representation of node v at time t-1; W represents the attention weight of node v to neighbor node u at time t; h ,W a is a learnable weight matrix; a is a learnable vector parameter; || represents a vector concatenation operation.
[0119] 3.2 Multi-view fusion module considers different attribute views of the product, such as basic information view, sales performance view, user evaluation view, etc. The calculation of multi-view fusion is as follows:
[0120]
[0121] in, represents the embedding representation of node v in the i1th view, M is the number of views (such as 3), MLP is a three-layer perceptron, and the activation function is ELU (ExponentialLinearUnit); M represents the number of views, β i1 represents the weight of the i1-th view.
[0122] 3.3 Knowledge Distillation Enhanced Interpretability Module, using a rule-based decision tree as a teacher model to transfer its knowledge into our deep learning model. The knowledge distillation loss is calculated as follows:
[0123]
[0124] in, and are the outputs of the teacher model (decision tree) and the student model (deep learning model), τ is the temperature parameter (usually set to 2), and KL is the KL divergence.
[0125] 3.4 Meta-learning Anti-Long Tail Module: To handle long-tail products or new products, a meta-learning strategy is used. In each mini-batch, the data is divided into a support set (popular products) and a query set (long-tail products). The model parameter update process is as follows:
[0126]
[0127] Among them, α and β are the learning rates of the inner loop and outer loop respectively (usually α=0.01, β=0.001), L S and L Q is the loss function of the support set (high-frequency entities) and the query set (low-frequency entities). θ′ represents the model parameters after the inner loop update, fθ Denote the model function with parameter θ Denote the gradient with respect to θ
[0128] 4. Feature fusion step: fuse the graph embedding features and traditional sales data features to obtain fused features. This step adopts the Dynamic Cross-modal Adaptive Feature Fusion (DCAFF) algorithm, which includes the following sub-steps:
[0129] 4.1 Dynamic feature importance evaluation: for each commodity, calculate the importance weights of its graph embedding features and traditional features:
[0130]
[0131] where φ G and φ T are dynamic weight generation functions, H G is the graph embedding feature matrix, X T is the traditional sales data feature matrix; sigmoid represents the sigmoid activation function;
[0132] 4.2 Adaptive feature transformation: perform non-linear transformation on the graph embedding features and traditional features:
[0133] H G ′ = LeakyReLU(W1·H G + b1)
[0134] X T ′ = LeakyReLU(W2·X T + b2)
[0135] The slope of LeakyReLU is usually set to 0.2. Where H′ G represents the transformed graph embedding features, X′ T represents the transformed traditional features; W1, W2 represent learnable weight matrices; b1, b2 represent learnable bias vectors.
[0136] 4.3 Cross-modal mutual information maximization: introduce a mutual information maximization term to promote the collaborative representation of the two features:
[0137] I(H G ′, X T ′) = E[f D (H G ′, X T ′)] - log(E[exp(f D (H G ′, X T ″))})
[0138] where f Dis the discriminator network, X″ T is X′ T a random permutation of; E represents the expectation;
[0139] 4.4 Dynamic fusion, for each product i2, perform feature fusion based on dynamic weights:
[0140]
[0141] 4.5 Add residual connections and perform layer normalization:
[0142] F = LayerNorm(F + [H G ||X T )
[0143] LayerNorm represents the layer normalization operation; || represents the vector concatenation operation;
[0144] Optimization objective:
[0145] L = L task + λ1·|L MI | - λ2·I(H G ′, X T ′)
[0146] where L task is the loss function of the downstream task, L MI is the mutual information maximization loss, and λ1 and λ2 are balance coefficients, usually set λ1 = 0.1 and λ2 = 0.01.
[0147] 5. Multidimensional analysis steps, perform multidimensional analysis based on the fused features to obtain the analysis results. Specifically include:
[0148] 5.1 Sales trend analysis, use the Prophet time series prediction model, considering the holiday effect and long-term trend:
[0149] y(t) = g(t) + s(t) + h(t) + ∈ t
[0150] where g(t) is the trend term, s(t) is the seasonal term, h(t) is the holiday term, and ∈ t is the error term
[0151] 5.2 Customer clustering, use the improved DBSCAN algorithm for customer clustering, introducing the Mahalanobis distance to measure similarity:
[0152]
[0153] where d M is the Mahalanobis distance, and σ3 is the kernel width parameter (usually set as the median of the nearest neighbor distance in the dataset).
[0154] 5.3 Product association analysis, using the improved Apriori algorithm, introducing a time decay factor:
[0155]
[0156] where δ is the time decay factor (usually set between 0.9 and 0.99), T is the current time, c t (X) is the number of occurrences of item set X at time t, and N is the total number of transactions.
[0157] 5.4 Customer lifetime value prediction, adopting an RNN model based on the attention mechanism:
[0158]
[0159] where α t is the attention weight, and x t is the customer feature vector at time t.
[0160] 5.5 Anomaly transaction detection, using the IsolationForest algorithm. Anomaly score calculation:
[0161]
[0162] where E(h(x)) is the average path length of sample x, and c(n) is the average path length of the tree.
[0163] 6. Visualization presentation steps, visualizing the analysis results to generate visualization data. Specifically including:
[0164] 6.1 Force-directed graph layout, using the improved ForceAtlas2 algorithm, introducing node importance weights:
[0165]
[0166] where deg(u) is the degree of node u, d(u, v) is the distance between nodes u and v, and k r is the repulsive force coefficient (usually set between 0.1 and 1).
[0167] 6.2 t-SNE projection, adopting the Barnes-Hutt-SNE algorithm to improve the processing efficiency of large-scale data:
[0168]
[0169] where x i4 and x j4 are data points in the high-dimensional space, and σ i4 is the bandwidth parameter of the Gaussian kernel.
[0170] 6.3 Multi-level detail display, enabling hierarchical clustering and interactive level-of-detail switching, using an improved BIRCH algorithm.
[0171] 6.4 Dynamic interaction and filtering, achieving high-performance interactive visualization based on WebGL, using a quadtree spatial index to optimize the rendering and interaction of large-scale data.
[0172] 6.5 Adaptive color scheme uses a genetic algorithm to optimize color harmony:
[0173] F = w1·C + w2·H + w3·B
[0174] where C is contrast, H is harmony, B is balance, and w i is the weight (usually w1 = 0.4, w2 = 0.3, w3 = 0.3). The population size of the genetic algorithm is usually set to 100, and the number of iterations is 50.
[0175] 7. Interactive exploration steps, based on the visualized data, provide an interactive exploration interface to achieve in-depth analysis and insight of the data. Specifically, it includes:
[0176] 7.1 Intelligent query recommendation, based on the user's historical behavior and current context, uses a seq2seq model to generate query suggestions:
[0177] q t = Decoder(Encoder(h1,...,h t-1 ),c t )
[0178] where h t is the encoding of the user's historical behavior, and c t is the current context vector. Both the encoder and decoder use LSTM networks, and the hidden layer size is usually set to 256.
[0179] 7.2 Real-time drill-down and summarization, achieving OLAP multi-dimensional data analysis accelerated by GPU, using an improved CUBE algorithm to support incremental updates and approximate calculations. For large-scale data, a hierarchical sampling strategy is adopted, and the sampling rate is usually set to 1% to 10%, dynamically adjusted according to the data scale.
[0180] 7.3 Personalized view recommendation adopts a multi-armed bandit algorithm to dynamically balance exploration and exploitation. The reward update formula is as follows:
[0181] r i (t + 1) = (1 - α)·r i (t) + α·R i (t)
[0182] where r i (t) is the estimated reward of arm i at time t, Ri(t) is the actual reward, and α is the learning rate (usually set to 0.1). The exploration strategy adopts the ∈-greedy method, and the ∈ value is initially set to 0.1 and decays over time.
[0183] 7.4 Collaborative analysis and annotation, implementing a real-time collaborative editing and annotation system based on WebSocket. An improved Operational Transformation algorithm is used to handle concurrent editing conflicts to ensure consistency when multiple users edit simultaneously.
[0184] 7.5 Knowledge graph-assisted interpretation, integrating a knowledge graph reasoning engine to provide context explanations for analysis results. A knowledge graph completion algorithm based on transfer learning is used to dynamically expand the knowledge base. The knowledge graph completion adopts the TransE model, and its scoring function is:
[0185] f r (h,t) = ||h + r - t||
[0186] where h, r, and t are the embedding vectors of the head entity, relation, and tail entity respectively. The embedding dimension is usually set between 100 and 200.
[0187] Please refer to Figure 2 , the knowledge graph-driven multi-dimensional analysis and visualization system for sales data of the present invention includes the following modules:
[0188] Knowledge graph construction module 1, which is responsible for constructing a sales domain knowledge graph containing entities such as products, customers, and transactions. It uses the Neo4j graph database to store the knowledge graph and provides a RESTful API interface for other modules to call.
[0189] Data preprocessing module 2, which preprocesses the original sales data based on the constructed knowledge graph. It uses the pandas library in Python for data processing and the scikit-learn library for feature engineering and standardization.
[0190] Graph embedding module 3, which implements a time-series adaptive multi-view collaborative graph embedding algorithm. It is implemented based on the PyTorch deep learning framework and uses GPU for accelerated computing. The model training adopts the Adam optimizer, the learning rate is set to 0.001, and the batch size is 128.
[0191] Feature fusion module 4, which implements a dynamic cross-modal adaptive feature fusion algorithm. It is also implemented based on PyTorch and uses TensorBoard for model training visualization and tuning.
[0192] The multi-dimensional analysis module 5 conducts multi-dimensional analysis based on the fused features. For sales trend analysis, the Prophet library of Facebook is used; for customer segmentation and anomaly detection, the scikit-learn library is used; and for product association analysis, the mlxtend library is used.
[0193] The visualization presentation module 6 visually presents the analysis results. The force-directed graph layout is implemented using the D3.js library, 3D data visualization is implemented using the three.js library, and conventional statistical charts are implemented using the ECharts library.
[0194] The interactive exploration module 7 provides an interactive exploration interface. The front end is developed using the React framework, and the back end is built using Node.js and Express.js to construct a RESTful API. The real-time collaboration function is implemented using the Socket.io library.
[0195] The system architecture adopts a microservices design, is deployed using Docker containerization, and Kubernetes is used for container orchestration and management to ensure the scalability and high availability of the system.
[0196] The knowledge graph-driven multi-dimensional analysis and visualization method and system for sales data proposed by the present invention, by innovatively combining knowledge graphs, deep learning, and high-dimensional data visualization technologies, solve the deficiencies of traditional sales data analysis methods in dealing with complex relationships, dynamic changes, and long-tail data. Each module of the system closely cooperates to form a complete data analysis closed-loop. From data preprocessing, feature learning to multi-dimensional analysis and visualization presentation, each step is carefully designed and optimized. The actual application effect shows that the system can significantly improve the depth, accuracy, and efficiency of sales data analysis, providing strong support for enterprise decision-making.
[0197] To verify the superiority of the present invention, a series of comparative experiments were conducted. The following is a detailed comparison between Example 1 of the present invention and three comparative examples:
[0198] Example 1: The knowledge graph-driven multi-dimensional analysis and visualization method for sales data of the present invention
[0199] Comparative Example 1: Traditional sales data analysis method (without using knowledge graphs and deep learning technologies)
[0200] Comparative Example 2: Deep learning-based sales data analysis method (without using knowledge graphs)
[0201] Comparative Example 3: Knowledge graph-based sales data analysis method (without using deep learning technologies)
[0202] Test metrics and detection methods:
[0203] 1. Sales prediction accuracy: Evaluated using Mean Absolute Percentage Error (MAPE), with the unit of %.
[0204] Detection method: Conduct sales predictions for the next 30 days on the test set and calculate MAPE.
[0205] 2. Customer clustering quality: Evaluated using Silhouette Coefficient, with the value range [-1, 1].
[0206] Detection method: Cluster customers and calculate the Silhouette Coefficient.
[0207] 3. Analysis accuracy of long-tail products: Evaluated using F1 score, with the value range [0, 1].
[0208] Detection method: Conduct sales volume predictions for long-tail products (sales volume ratio lower than 1%) and calculate the F1 score.
[0209] 4. Effect of association rule mining: Evaluated using Lift, and the larger the value, the better.
[0210] Detection method: Mine the association rules between products and calculate the average Lift.
[0211] 5. Visualization response time: Evaluated using the average response time, with the unit of seconds.
[0212] Detection method: Test 1000 random data visualization requests and calculate the average response time.
[0213] 6. System scalability: Evaluated using Queries Per Second (QPS), with the unit of times / second.
[0214] Detection method: Gradually increase the concurrent users in the load test environment and record the maximum QPS when the system runs stably. The test results are shown in the following table:
[0215] Test Index Example 1 Comparative Example 1 Comparative Example 2 Comparative Example 3 Sales Forecast Accuracy Rate (MAPE) 8.2% 15.7% 10.5% 12.3% Customer Segmentation Quality 0.68 0.42 0.56 0.51 Analysis Accuracy Rate of Long Tail Products 0.73 0.45 0.61 0.58 Association Rule Mining Effect 3.2 1.8 2.5 2.7 Visualization Response Time (seconds) 0.8 2.3 1.5 1.7 System Scalability (QPS) 12000 3000 8000 6000
[0216] According to the test results in the above table, it can be seen that Example 1 is the best example, and the analysis and explanation of the above results are as follows:
[0217] 1. Sales prediction accuracy: The MAPE of the present invention is 8.2%, which is significantly better than other methods. This indicates that the time-series adaptive multi-view collaborative graph embedding algorithm of the present invention can better capture the dynamic characteristics and complex relationships of sales data, thereby improving the prediction accuracy.
[0218] 2. Customer segmentation quality: The silhouette coefficient of the present invention is 0.68, which is significantly higher than other methods. This indicates that by integrating the knowledge graph and deep learning technologies, the present invention can more accurately depict customer characteristics, thereby achieving more precise customer segmentation.
[0219] 3. Accuracy of long-tail product analysis: The F1 score of the present invention is 0.73, far leading other methods. This verifies the effectiveness of the meta-learning anti-long-tail module in the present invention, which can better handle the analysis of long-tail products.
[0220] 4. Effect of association rule mining: The average lift of the present invention is 3.2, significantly higher than other methods. This shows that by combining the knowledge graph and deep learning technologies, the present invention can discover more valuable product association rules, providing better support for cross-selling and personalized recommendations.
[0221] 5. Visualization response time: The average response time of the present invention is 0.8 seconds, much faster than other methods. This benefits from the improved ForceAtlas2 algorithm and Barnes-Hutt-SNE algorithm adopted by the present invention, as well as the high-performance rendering technology based on WebGL.
[0222] 6. System scalability: The present invention can stably support 12000 QPS, far leading other methods. This verifies the effectiveness of the microservice architecture and containerized deployment strategy of the present invention, which can better handle large-scale data analysis scenarios.
[0223] The present invention is significantly superior to the comparative methods in all test metrics, which fully demonstrates the innovation and superiority of the present invention:
[0224] 1. Combination of knowledge graph and deep learning: By integrating these two technologies, the present invention can better handle complex entity relationships and dynamic changes, thus achieving better results in tasks such as sales prediction, customer segmentation, and association rule mining.
[0225] 2. Temporal adaptive multi-view collaborative graph embedding algorithm: This innovative algorithm enables the present invention to better capture the temporal characteristics and multi-dimensional attributes of sales data, thus performing well in tasks such as sales prediction and long-tail product analysis.
[0226] 3. Dynamic cross-modal adaptive feature fusion algorithm: This algorithm effectively integrates heterogeneous data sources, enabling the present invention to achieve better results in tasks such as customer segmentation and association rule mining.
[0227] 4. Improved visualization technology: The advantage of the present invention in visualization response time reflects its innovation in large-scale data visualization, which can provide users with a smoother interaction experience.
[0228] 5. Highly Scalable System Architecture: The microservice design and containerized deployment strategy of the present invention enable it to better handle large-scale data analysis scenarios and demonstrate excellent performance in system scalability.
[0229] These test results not only verify the effectiveness of each innovative point of the present invention but also illustrate the superiority of the present invention as an overall solution in practical applications. It can provide enterprises with more accurate, comprehensive, and efficient sales data analysis services, thus supporting better business decisions.
[0230] It should be noted that the above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A multi-dimensional analysis and visualization method for sales data driven by a knowledge graph, characterized in that It includes the following steps: Construct a sales domain knowledge graph including product, customer, and transaction entities; Based on the knowledge graph, preprocess the original sales data to obtain preprocessed sales data; According to the knowledge graph and the preprocessed sales data, implement temporal adaptive multi-view collaborative graph embedding to obtain graph embedding features; Fuse the graph embedding features with traditional sales data features to obtain fused features; Conduct multi-dimensional analysis based on the fused features to obtain analysis results; Visualize the analysis results to generate visualization data; Based on the visualization data, provide an interactive exploration interface to achieve in-depth analysis and insight of the data; The temporal adaptive multi-view collaborative graph embedding includes the following steps: Execute the temporal attention mechanism to obtain the embedded representation of node v at time t Among them, represents the embedding representation of node v at time t - 1; N(v) represents the set of neighbors of node v; represents the attention weight of node v for neighbor node u at time t; W h , W a are learnable weight matrices; a is a learnable vector parameter; σ1 is the LeakyReLU activation function; || represents the vector concatenation operation; Perform multi-view fusion to obtain the fused node representation h v : Among them, represents the embedding representation of node v under the i1-th view; M represents the number of views, and β i1 represents the weight of the i1-th view; MLP represents a multi-layer perceptron; Perform knowledge distillation and calculate the knowledge distillation loss L KD : where, and are the outputs of the teacher model and the student model respectively, τ is the temperature parameter, KL is the KL divergence, and σ2 represents the softmax function; Execute the meta-learning anti-long-tail module to update the model parameter θ: Among them, θ ′ represents the model parameters after the inner loop update, α and β are the learning rates of the inner loop and the outer loop respectively, L S and L Q are the loss functions of the support set and the query set, f θ represents the model function with parameters θ, represents the gradient with respect to θ.
2. The method according to claim 1, wherein The feature fusion adopts a dynamic cross-modal adaptive feature fusion algorithm, including the following steps: Calculate the importance weights of the graph embedding features and traditional features: Among them, φ G and φ T are dynamic weight generation functions, H G is the graph embedding feature matrix, X T is the traditional sales data feature matrix, and sigmoid represents the sigmoid activation function; Perform non-linear transformation on the graph embedding features and traditional features: H G ′ = LeakyReLU(W1·H G + b1) X T ' = LeakyReLU(W2·X T + b2) Among them, H' G represents the transformed graph embedding feature, and X' T represents the transformed traditional feature; W1 and W2 represent learnable weight matrices; b1 and b2 represent learnable bias vectors; Introduce the mutual information maximization term: I(H G ′,X T ′) = E[f D (H G ′,X T ′)] - log(E[exp(f D (H G ′,X T ″))]) Among them, f D is the discriminator network, and X″ T is a random permutation of X′ T ; E represents the expectation; Perform feature fusion based on dynamic weights: Add residual connections and perform layer normalization: F = LayerNorm(F + [H G ||X T ) LayerNorm represents the layer normalization operation; || represents the vector concatenation operation; Optimization objective: L = L task + λ1·|L MI |- λ2·I(H G ′, X T ′) Among them, L task is the loss function of the downstream task, and L MI is the mutual information maximization loss, and λ1 and λ2 are balance coefficients.
3. The method according to claim 1, characterized in that The multi-dimensional analysis includes sales trend analysis, customer segmentation, product association analysis, customer lifetime value prediction, and abnormal transaction detection.
4. The method according to claim 3, characterized in that, The sales trend analysis adopts the Prophet time series prediction model: y(t) = g(t) + s(t) + h(t) + ∈ t Among them, g(t) is the trend term, s(t) is the seasonal term, h(t) is the holiday term, and ∈ t is the error term.
5. The method according to claim 3, wherein The customer segmentation adopts an improved DBSCAN algorithm, introducing the Mahalanobis distance to measure similarity: Among them, ρ i3 represents the local density of the sample point i3, x i3 , x j3 represents the sample points in the dataset, d M (x i3 , x j3 ) represents the Mahalanobis distance between the sample points x i3 and x j3 ; σ3 represents the kernel width parameter, which is used to control the range of density estimation; exp represents the exponential function.
6. The method according to claim 3, wherein The product association analysis adopts an improved Apriori algorithm, introducing a time decay factor: Among them, supp(X) represents the support degree of item set X, where X represents the item set of goods to be analyzed; t represents the time when the transaction occurs; T represents the current time; δ represents the time decay factor, and its value range is (0, 1); c t (X) represents the number of occurrences of item set X at time t; N represents the total number of transactions.
7. The method according to claim 3, characterized in that, The customer lifetime value prediction adopts an RNN model based on the attention mechanism: Among them, CLTV represents the predicted customer lifetime value; T represents the predicted time span, and α t represents the attention weight at time step t, and x t represents the customer feature vector at time step t; RNN represents the recurrent neural network function.
8. The method according to claim 1, characterized in that The visualization presentation adopts an improved ForceAtlas2 algorithm for force-directed graph layout: Among them, F r (u, v) represents the repulsive force between nodes u and v; k r represents the repulsive force coefficient, deg(u) and deg(v) respectively represent the degrees of nodes u and v; d(u, v) represents the distance between nodes u and v; And adopts the Barnes-Hutt-SNE algorithm for high-dimensional data projection: where p j4|i4 represents the conditional probability that point i4 selects point j4 as a neighbor in the high-dimensional space; x i4 , x j4 , x k4 represent data points in the high-dimensional space, σ i4 represents the local density parameter of point i4; ||·|| represents the Euclidean distance; exp represents the exponential function.
9. A knowledge graph-driven multi-dimensional analysis and visualization system for sales data implementing the method according to any one of claims 1-8, characterized in that It includes: A knowledge graph construction module for constructing a sales domain knowledge graph including product, customer, and transaction entities; A data preprocessing module for preprocessing the original sales data based on the knowledge graph to obtain preprocessed sales data; A graph embedding module for implementing temporal adaptive multi-view collaborative graph embedding according to the knowledge graph and the preprocessed sales data to obtain graph embedding features; A feature fusion module for fusing the graph embedding features with traditional sales data features to obtain fused features; A multi-dimensional analysis module for conducting multi-dimensional analysis based on the fused features to obtain analysis results; A visualization presentation module for visualizing the analysis results to generate visualization data; An interactive exploration module for providing an interactive exploration interface based on the visualization data to achieve in-depth analysis and insight of the data.
Citation Information
Patent Citations
Knowledge graph construction method and device for sales scene
CN115827897A
Specific target visual analysis method and system based on knowledge graph
CN116049381A
Topology awareness-based time sequence knowledge graph extrapolation method of dynamic relation graph and time sequence fusion
CN118036749A