Visual processing method and system for sales data

Through adaptive dynamic data aggregation algorithm and fusion prediction model, combined with long and short-term memory networks and convolutional neural networks, the problem of inflexible data aggregation and single prediction model in sales data analysis is solved, and efficient and personalized sales trend prediction is achieved. Adaptable with the user interface, improving analysis accuracy and user experience.

CN119202064AInactive Publication Date: 2024-12-27QINSILK COM
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411534824.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the sales data analysis, the prior art has problems such as inflexible data aggregation, single prediction model, and inadaptive user interface adjustments, which are difficult to meet complex data analysis needs and user personalized requirements.

Method used

Data analysis and prediction are performed by collecting data from POS systems, online stores and CRM systems, preprocessing and storage, and data analysis and prediction are performed using adaptive dynamic data aggregation algorithm and fusion prediction model (combining long and short-term memory networks and convolutional neural networks), and Adaptive layout and dynamic adjustment mechanism are adopted to generate intuitive graph display.

Benefits of technology

It significantly improves the flexibility and prediction accuracy of sales data processing, enhances the user interface friendliness and personalized experience, and enables enterprises to make decisions more accurately and gain competitive advantages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202064A_ABST
    Figure CN119202064A_ABST
Patent Text Reader

Abstract

The invention discloses a visual processing method and system for sales data, and relates to the technical field of computer science, and the method comprises the steps: collecting original sales data from data sources of a POS system, an online store and a CRM system, carrying out the data preprocessing, and storing the data in a sales database; combining a long-short-term memory network and a convolutional neural network, constructing a fusion prediction model, and predicting a future sales trend based on historical sales data; using the aggregated data to train a fusion prediction model, and optimizing the ability of the fusion prediction model to capture data feature types; and carrying out adaptive layout and dynamic adjustment on future sales trend results, and visually displaying the future sales trend results to users in the form of charts. Through adaptive data aggregation, prediction model fusion and adaptive layout, the problems of aggregation stiffness, single prediction and inflexible interface in the prior art are solved, and data processing flexibility, prediction accuracy and user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer science and technology, and in particular to a method and system for visualizing and processing sales data. Background Art

[0002] With the rapid development of information technology, big data analysis technology has become an important basis for corporate decision-making, especially in the retail industry. Through effective analysis of sales data, operational efficiency can be improved, inventory management can be optimized, customer experience can be enhanced, and sales growth can be promoted. Traditional sales data analysis mainly relies on manual reports and simple statistical software. This method is time-consuming and inefficient, and it is difficult to cope with the challenges of massive data. In recent years, with the emergence of cloud computing, big data processing frameworks, and advanced data analysis tools, companies can process and analyze large amounts of sales data more efficiently. In addition, advances in machine learning and deep learning technologies have made automated and intelligent data analysis possible, which not only greatly improves the speed and accuracy of data processing, but also reveals the complex patterns and trends hidden behind the data.

[0003] Although existing technologies have made significant progress in the field of sales data analysis, there are still some shortcomings. First, traditional data aggregation methods are usually static, that is, the aggregation level and granularity are fixed, which limits data flexibility and the possibility of user customization. For example, when analyzing sales trends in different time periods, users may want to view data of different granularities, but existing systems often cannot meet this demand well. Second, most systems rely on only a single model when predicting future sales trends, such as time series analysis or simple regression models, which often cannot capture complex nonlinear relationships and long-term dependencies, resulting in low prediction accuracy. In addition, existing systems often lack flexibility and interactivity when displaying prediction results, and it is difficult to make adaptive adjustments based on the personalized needs of users. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a sales data visualization processing method and system to solve the problems of inflexible data aggregation, single prediction model and non-adaptive user interface adjustment in the prior art.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, the present invention provides a method for visualizing sales data, which includes collecting original sales data from data sources of a POS system, an online store, and a CRM system, performing data preprocessing, and storing the data in a sales database; constructing an adaptive dynamic data aggregation algorithm based on the data in the sales database by using data aggregation and machine learning; automatically identifying patterns in the data through the adaptive dynamic data aggregation algorithm, and dynamically adjusting the aggregation level and granularity of the data according to the user's usage habits and query conditions to generate aggregated data; combining a long short-term memory network and a convolutional neural network to construct a fusion prediction model and predict future sales trends based on historical sales data; using the aggregated data to train the fusion prediction model and optimize the ability of the fusion prediction model to capture data feature types; adaptively layouting and dynamically adjusting future sales trend results, and intuitively presenting them to users in the form of charts.

[0007] As a preferred solution of the sales data visualization processing method of the present invention, wherein: the original sales data is collected from the data sources of the POS system, online store, and CRM system, the data is pre-processed, and the data is stored in the sales database. The specific steps are: Data collected in the POS system, including sales transaction records, inventory information, return records, and employee operation records; Data collected in online stores, including order data, user behavior data, reviews and feedback, and promotional activity data; Data collected in the CRM system, including basic customer information, purchase history, service interaction records, and marketing campaign responses; Perform data cleaning, data conversion, data integration, data reduction and data quality inspection on the data collected from the data sources of POS system, online store and CRM system; Define the table structure of database field names and data types based on the preprocessed data, and set the foreign key constraint relationship between the order ID primary key field and the table for each table structure; Import the set data table into the database and create indexes for the fields that are often used as query conditions.

[0008] As a preferred solution of the sales data visualization processing method of the present invention, wherein: based on the data in the sales database, using data aggregation and machine learning to build an adaptive dynamic data aggregation algorithm, the specific steps are: Introduce dynamic adjustment factor α and dynamic weight function w(t) to adjust the dynamic weight and aggregation degree of data in the sales database; The dynamic weight function w(t) is defined as: ; Among them, σ´t is the standard deviation of sales data at time point t, β is the parameter that controls the steepness of the function, and γ is the parameter that determines the center position of the function curve; The dynamic adjustment factor α is defined as: ; Among them, d i is the importance measure of the i-th data point, N is the number of data points, and δ is the importance measure of the data point d i The sensitivity coefficient of , j and i are the indexes of traversing all data points; Combining the dynamic weight function w(t) and the dynamic adjustment factor α, the expression of the clustering function P(x) is constructed as follows: ; ; Among them, x is the time series data, T is the length of the time series; Introduce deep neural network optimization parameters β, γ, and δ, and use the back-propagation algorithm to minimize the difference between the predicted aggregate value and the actual aggregate value; In the process of continuously iteratively optimizing the values ​​of β, γ, and δ, until the performance index of the predetermined convergence standard is reached, the construction of the adaptive dynamic data aggregation algorithm is completed.

[0009] As a preferred solution of the sales data visualization processing method of the present invention, wherein: the adaptive dynamic data aggregation algorithm is used to automatically identify patterns in the data, and the aggregation level and granularity of the data are dynamically adjusted according to the user's usage habits and query conditions to generate aggregated data. The specific steps are: Record the frequency, time period, and specific content of user queries, and use the K-Means clustering algorithm to group user queries; Based on the above grouping, Apriori association rule learning is used to discover the correlation between user queries; If users frequently query data at a particular level, increase the weight of that level; If users frequently view data of a certain granularity, reduce the calculation of data of other granularities; A user preference function u(p) is introduced to measure the user's preference for different aggregation levels P. The expression is: ; Where M is the total number of user query patterns, f i (p) is the preference of the i-th query pattern for aggregation level p Based on the user preference function, the clustering function P(x) is updated, and the expression is: ; Among them, p´(x) represents the updated aggregation function, which outputs the aggregated data; Fusion user preference function u(p), construct composite loss function L´ to train updated clustering function P´(x t ) process to minimize the difference between the predicted value and the actual value, the expression is: ; Among them, y t is the actual aggregate value at time point t, and λ is the regularization coefficient; Use Adam gradient descent method to update the values ​​of β, γ, and δ; A mean square error performance index is set as the convergence criterion. When the change of the performance index is less than the threshold after several consecutive iterations, the model is considered to have converged.

[0010] As a preferred solution of the sales data visualization processing method of the present invention, the specific steps of combining the long short-term memory network and the convolutional neural network to build a fusion prediction model and predict future sales trends based on historical sales data are as follows: Extract historical sales data from the sales database and organize it into a time series format; The convolution kernel in the CNN layer is applied to the sliding window of the input time series to capture multi-scale local features. The expression is: ; in, represents the output of the jth convolution kernel at time point t, represents the i-th weight of the j-th convolution kernel, σ represents the nonlinear activation function, b is the bias term, k represents the width of the convolution kernel, and s represents the convolution step size; Use LSTM layers to process the output of CNN layers to capture long-term dependencies; The outputs of the CNN and LSTM layers are fused through the fully connected layer to generate the expression for predicting future sales trends: ; Among them, g t represents the sales trend forecast value at time point t, W´ g represents the weight matrix of the fusion layer, b g Represents the bias term of the fusion layer; The mean square error is used as the loss function, and the sales trend forecast value at time point t is integrated. The expression of the mean square error loss function L´´ is defined as: ; Use the Adam optimizer to minimize the loss function L and update the model parameters; The prediction results are displayed to the user in the form of a line graph.

[0011] As a preferred solution of the sales data visualization processing method of the present invention, the following specific steps are used to train the fusion prediction model using the aggregated data to optimize the ability of the fusion prediction model to capture data feature types: Extract training samples from the aggregated dataset; The extracted training samples are divided into training set, validation set and test set; Initialize the CNN-LSTM model and the parameters of the convolution kernel, LSTM unit state, fully connected layer weights and bias terms; For each training cycle, iterate over all batches in the training set; After aggregation, each batch of data is fed into the CNN layer to capture local features, and the CNN output is fed into the LSTM layer to capture long-term dependencies; The outputs of the CNN and LSTM layers are fused through a fully connected layer, the loss function is calculated, and backpropagation using the Adam optimizer is used to update the model parameters; At the end of each training cycle, evaluate the model performance using the validation set, monitor the loss function and performance indicators on the validation set, and apply early stopping strategies to prevent overfitting; Use the grid search method to adjust the model learning rate and batch size hyperparameters, and select the best hyperparameter combination based on the performance of the validation set; The model has converged when the loss on the training set no longer decreases and the performance on the validation set no longer improves.

[0012] As a preferred solution of the sales data visualization processing method of the present invention, the future sales trend results are adaptively laid out and dynamically adjusted, and intuitively displayed to the user in the form of a chart, the specific steps are: Introduce screen size factor S and user preference factor U to define the user interface layout; The screen size factor S is expressed as: ; Among them, W and H represent the screen width and height respectively; Combining the screen size factor S and the user preference factor U, an adaptive layout function A(L) is constructed to calculate the position and size of the layout elements. The expression is: ; Among them, β´ is the parameter that controls the influence of screen size factor S, γ´ is the threshold of screen size factor S, Q is the layout parameter list, and (1−U)+U is the linear interpolation of user preference factor U; Introduce the data volume factor V and the user attention factor F, and define the dynamic adjustment parameter D(F) to adjust the granularity and level of displayed data. The expression is: ; Among them, δ´ is the parameter that controls the influence of the data volume factor V, η is the threshold of the data volume factor V, dv is the small change of the integral variable v, and (1−F)+F is the linear interpolation of the user attention factor F; Combining the adaptive layout function A (L) and the dynamic adjustment function D (F), the final chart display is generated, and the expression is: ; Where N´ is the number of layout elements, h i and F i Represents the layout parameter list and user attention factor of the i-th layout element, A (h i ) and D (F i ) are the adaptive layout function and dynamic adjustment function of the i-th layout element respectively.

[0013] In a second aspect, the present invention provides a sales data visualization processing system, including a data storage module, an adaptive dynamic data aggregation module, an intelligent data aggregation module, a prediction model construction module, a model training and optimization module and a data visualization module; the data storage module is used to collect original sales data from data sources of POS systems, online stores, and CRM systems, perform data preprocessing, and store the data in a sales database; the adaptive dynamic data aggregation module is used to construct an adaptive dynamic data aggregation algorithm based on the data in the sales database by using data aggregation and machine learning; the intelligent data aggregation module is used to automatically identify patterns in the data through an adaptive dynamic data aggregation algorithm, and dynamically adjust the aggregation level and granularity of the data according to the user's usage habits and query conditions to generate aggregated data; the prediction model construction module is used to combine long short-term memory networks and convolutional neural networks to construct a fusion prediction model and predict future sales trends based on historical sales data; the model training and optimization module is used to train the fusion prediction model using the aggregated data to optimize the ability of the fusion prediction model to capture data feature types; the data visualization module is used to adaptively layout and dynamically adjust future sales trend results, and intuitively display them to users in the form of charts.

[0014] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for visualizing sales data as described in the first aspect of the present invention is implemented.

[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method for visualizing sales data as described in the first aspect of the present invention.

[0016] The beneficial effects of the present invention are as follows: the present invention effectively solves the problems existing in the prior art such as rigid aggregation methods, single prediction models, and inflexible user interfaces by adopting innovative technical means such as adaptive dynamic data aggregation algorithms, fusion prediction models, and adaptive layout and dynamic adjustment mechanisms; significantly improves the flexibility of sales data processing and prediction accuracy, while enhancing the friendliness and personalized experience of the user interface, so that enterprises can make more accurate decisions in a rapidly changing market environment and gain a competitive advantage; in addition, by optimizing the data aggregation level and granularity, and utilizing a fusion prediction model of long short-term memory networks and convolutional neural networks, the accuracy and reliability of sales trend predictions are further improved, providing strong support for the strategic planning of enterprises. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0018] Figure 1 This is a flowchart of the method for visualizing sales data in Example 1.

[0019] Figure 2 This is a system diagram of the sales data visualization processing system in Example 1. DETAILED DESCRIPTION

[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides a method for visualizing sales data, comprising the following steps: S1. Collect raw sales data from data sources such as POS system, online store, and CRM system, perform data preprocessing, and store the data in the sales database.

[0024] Furthermore, the data collected in the POS system includes sales transaction records, inventory information, return records, and employee operation records; Data collected in online stores, including order data, user behavior data, reviews and feedback, and promotional activity data; Data collected in the CRM system, including basic customer information, purchase history, service interaction records, and marketing campaign responses; It should be noted that in the POS system, sales transaction records include: timestamp, amount, payment method, product ID, quantity, etc. of each transaction; inventory information includes: inventory level, replenishment threshold, etc. of the product; return records include: time, product, reason for return, etc.; employee operation records include: employee login / logout time, operation type (such as price modification, discount, etc.); In online stores, order data includes: order number, order time, product list, quantity, total amount, delivery address, payment status, etc. User behavior data includes: user browsing history, click-through rate, number of times added to shopping cart, final purchase conversion rate, etc. Evaluation and feedback includes: user evaluation, rating, comments on products and services, etc. Promotion activity data includes: sales data during the activity, number of participants, coupon usage, etc. In the CRM system, basic customer information includes: name, contact information, address, birthday, etc.; purchase history includes: customer's past purchase records, preferences, consumption frequency, etc.; service interaction records include: customer service requests, complaints, feedback, after-sales service, etc.; marketing activity response includes: customer response to marketing activities such as email marketing and social media promotion.

[0025] Preferably, the POS system (Point of Sale), as a core component of the retail industry, can not only efficiently handle the customer's checkout process, but also track inventory levels in real time, manage product information, and generate detailed sales reports, thereby helping merchants make more accurate decisions; at the same time, online stores, as an emerging sales channel, connect buyers and sellers around the world through the Internet platform. It can not only display and sell products around the clock, but also collect user behavior data to optimize user experience and implement personalized marketing strategies, thereby increasing sales and customer satisfaction; and the CRM system (Customer Relationship Management) is committed to building and maintaining long-term relationships between companies and customers. By collecting and analyzing customers' personal information, purchase history, and interaction records, it can help companies better understand customer needs, improve service quality, and enhance customer loyalty through customized communication strategies, ultimately achieving the goal of increasing repurchase rates and increasing market share.

[0026] Furthermore, the data collected from the data sources of the POS system, online store, and CRM system are pre-processed, including data cleaning, data conversion, data integration, data reduction, and data quality check processing; It should be noted that the specific operations for cleaning different data sources are as follows: For POS system data cleaning: Delete duplicate records: Check whether there are duplicate sales transaction records, return records or inventory information. If a transaction is recorded repeatedly, the duplicates need to be deleted. Handling missing values: Sales transaction records: If the transaction amount or product ID is missing, you may need to delete the record, or fill it in through other related fields. Inventory information: If the inventory level or replenishment threshold is missing, you can use the average or median of historical inventory data to fill it in. Employee operation records: If the employee's operation time or type is missing, the record usually needs to be deleted. Correct erroneous data: Identify and correct outliers in transaction records, such as negative transaction amounts, unreasonable inventory quantities, or incorrect return reasons.

[0027] For online store data cleaning: Delete duplicate records: Check whether there are duplicate order data, user behavior data or promotion records, and delete duplicate order numbers or duplicate promotion participation records. Handle missing values: Order data: Missing delivery addresses can be filled with the user's historical order information, and missing payment status can be inferred based on the order time and other related fields. User behavior data: If the user's click-through rate or shopping cart data is missing, you can choose to delete the record, or infer the behavior through the user's browsing history. Promotion data: If the usage of the coupon is missing, it may need to be deleted or inferred based on the participation in the event. Correct incorrect data: Correct outliers in the order data, such as negative order amounts, incorrect order status, or unreasonable user behavior data (for example, a large number of invalid clicks in a short period of time).

[0028] For CRM system data cleaning: Delete duplicate records: Check whether there is duplicate customer information, service interaction records, and delete duplicate customer entries or service records. Handle missing values: Basic customer information: If the customer's contact information or address is missing, it can be filled in with other customer information or historical purchase records, and the record can be deleted if necessary. Purchase history: If the product information in the purchase history is missing, it can be inferred based on the customer's other purchase behaviors. Marketing campaign response: If there is a lack of customer response records to a marketing campaign, it may be necessary to fill in with other similar marketing data. Correct erroneous data: Correct unreasonable customer information (such as obviously wrong birthdays, addresses, etc.), or identify and correct abnormal transactions in customer purchase histories.

[0029] Data conversion is used to ensure that all data types are correct based on different data characteristics, especially when cross-data integration requires consistent conversion.

[0030] Among them, POS system data conversion: Data type conversion: Date field: Ensure that the timestamp, return time, etc. in the transaction record remain in the standard date data type. Numerical field: For example, transaction amount, inventory level, etc. should be kept as floating point or integer type. Data encoding: Product category: Encode categorical variables such as product category and payment method, using one-hot encoding or label encoding. Standardization / normalization: Standardize or normalize numerical fields such as transaction amount and inventory quantity to ensure that they are on a unified scale for subsequent analysis.

[0031] Online store data conversion: Data type conversion: Ensure that order numbers, product IDs, etc. are string or integer types. Time field: Ensure that order time, user behavior time, etc. are in standard time format. Data encoding: Classification variables such as user level and product category need to be encoded and converted, and the click rate, number of views, etc. in user behavior data can also be quantified. Standardization / normalization: Standardize click rate, order amount, user behavior data, etc. to ensure that they are on the same scale for easy analysis.

[0032] CRM system data conversion: Data type conversion: Customer information: such as name and address are string types, and contact information is string or numeric type. Date field: The purchase time in the customer purchase history and the date field in the service interaction record need to be converted to the standard date format. Data encoding: Customer classification: Encode the customer's level, preference and other classification variables, using one-hot encoding or label encoding. Standardization / normalization: Standardize the customer's consumption frequency, marketing campaign response and other numeric fields to ensure that these data are on the same scale.

[0033] Data integration is used to integrate data from different sources into the same data set, and it is necessary to ensure the uniformity of field names and data types.

[0034] Among them, the POS system and online store data integration: Merge sales data: Integrate the sales data of the POS system and the online store to ensure that the field names such as order number and product ID are consistent and the data types remain the same. Resolve conflicts: If the price or inventory data of the same product in the POS system and the online store are different, it may be necessary to manually review or resolve the conflict based on business rules (such as giving priority to the updated data).

[0035] Integration of CRM system and sales data: Integrate customer information: Merge customer information in the CRM system with sales data in the POS system and online store, and ensure that field names and data types such as customer ID and purchase history are consistent. Resolve conflicts: If the customer purchase history in the CRM system and sales data is inconsistent, you may need to manually check or update it based on the latest sales records.

[0036] Data reduction is used to aggregate, select features, and reduce dimensionality of integrated data to reduce the amount of data and retain useful information.

[0037] Among them, POS system data reduction: Data aggregation: Sales transaction records can be aggregated by time period (such as daily, weekly, and monthly) to calculate total sales, total number of transactions, etc. Feature selection: Select features that are useful for prediction, such as product ID, sales amount, inventory level, etc., and exclude irrelevant information such as employee operation records. Dimensionality reduction: Use methods such as principal component analysis (PCA) to reduce high-dimensional inventory data and transaction details data to reduce computational complexity.

[0038] Online store data reduction: Data aggregation: Aggregate order data, click volume, final purchase conversion rate, etc. by time period or user behavior. Feature selection: Select key features in user behavior data, such as browsing history, number of times added to shopping cart, etc., and exclude irrelevant promotional activity data. Dimensionality reduction: Use dimensionality reduction technology to reduce the dimension of user behavior data and retain features that are useful for sales prediction.

[0039] CRM system data reduction: Data aggregation: Summarize the customer's purchase history and service interaction records by customer dimension, and calculate the total number of purchases and consumption amount of each customer. Feature selection: Select features that are useful for customer analysis and sales forecasting, such as customer consumption frequency, purchase preferences, etc., and eliminate irrelevant interaction records. Dimensionality reduction: Use dimensionality reduction technology to reduce the complexity of customer dimension information.

[0040] Data quality checks are used to ensure that processed data remains consistent and logically correct.

[0041] Among them, in the POS system data quality check: consistency check: check whether the sales transaction record and inventory information are consistent. For example, the sales quantity should not exceed the inventory quantity. Logical check: ensure that the time sequence in the transaction record is reasonable, the transaction amount cannot be negative, and the return record should be associated with the original transaction.

[0042] Online store data quality check: Consistency check: Ensure that order data and user behavior data are consistent with actual sales records. For example, the browsing records in user behavior should have a reasonable time interval with the order. Logic check: Check the matching of promotion data and order data to ensure the rationality between the use of coupons and the order amount.

[0043] CRM system data quality check: Consistency check: Check whether the customer's purchase history matches the actual sales data to ensure that each purchase by the customer has a corresponding sales record. Logical check: Check the integrity and consistency of customer information to ensure that the customer's contact information, address and other information are correct.

[0044] Define the table structure of database field names and data types based on the preprocessed data, and set the foreign key constraint relationship between the order ID primary key field and the table for each table structure; Import the set data table into the database and create indexes for the fields that are often used as query conditions to improve query efficiency; It should be noted that the specific steps of data preprocessing and storing data in the sales database are key links in the business intelligence and data analysis process. Data preprocessing ensures the quality and consistency of data. By cleaning, converting and integrating data from different sources, it lays a solid foundation for subsequent analysis. Storing preprocessed data in the sales database is not only convenient for management and query, but also ensures the security and availability of data. The implementation of these steps helps to improve the accuracy and efficiency of analysis, thereby providing strong support for corporate decision-making and enhancing the competitiveness and market responsiveness of enterprises.

[0045] S2. Based on the data in the sales database, use data aggregation and machine learning to build an adaptive dynamic data aggregation algorithm.

[0046] Furthermore, a dynamic adjustment factor α and a dynamic weight function w(t) are introduced to adjust the dynamic weight and aggregation degree of the data in the sales database; Specifically, the data in the sales database mainly includes timestamp, sales amount, product ID, inventory information, sales transaction records, user behavior data, customer basic information, etc.

[0047] The dynamic weight function w(t) is defined as: ; Among them, σ´t is the standard deviation of the sales data at time point t, β is the parameter that controls the steepness of the function. A larger β value will cause the function to change from close to 0 to close to 1 more quickly at σt=γ, that is, the function curve is steeper; a smaller β value will make the function curve smoother and the transition area wider. γ is the parameter that determines the center position of the function curve, that is, when σt=γ, w(t)=0.5; if σt>γ, the function w(t) will tend to 1; if σt<γ, the function w(t) will tend to 0.

[0048] It should be noted that at this stage, the standard deviation σt of the sales data needs to be calculated and input into the function w(t) for weight adjustment. The specific steps are as follows: Extract time series data: Extract historical sales data from the sales database and organize it into time series data in chronological order.

[0049] Calculate the standard deviation σt: For each time point t, calculate the standard deviation σt of the sales data at that time point. This can be calculated using key indicators such as sales amount, order quantity, etc.

[0050] Calculate the weight w(t): Substitute σt into the dynamic weight function w(t) to obtain the weight of the data at each time point.

[0051] Preferably, the "dynamic weight function w(t)" is based on the logistic function and can adjust the weight according to the degree of data fluctuation. When the data fluctuation is large, w(t) is close to 1, otherwise it is close to 0.

[0052] It should be noted that in order to better understand the role of the two parameters β and γ, we can consider their impact on the function graph. Suppose we have the following situations: For high β values: If β is large, then the function will be very steep near σt=γ, which means that for a given change in σt, w(t) will change very rapidly, indicating that for a larger degree of volatility σt, the weight w(t) will quickly increase to close to 1; For high β values: On the contrary, if β is small, then the function will be relatively flat near σt=γ, which means that w(t) will change more slowly, indicating that even if σt changes, w(t) will remain relatively stable; For the impact of γ value: The choice of γ determines the center position of the function curve. If the value of γ is high, then a larger σt is required to make w(t) close to 1; if the value of γ is low, a smaller σt can make w(t) close to 1.

[0053] In summary, the choice of these parameters directly affects the behavior of w(t), which in turn affects the performance of the entire dynamic data aggregation algorithm. In practical applications, these parameters can be optimized by training machine learning models to adapt to specific application scenarios.

[0054] Furthermore, the dynamic adjustment factor α is defined as: ; Among them, d i is the importance measure of the i-th data point, N is the number of data points, and δ is the importance measure of the data point d i The sensitivity coefficient of , j and i are the indices of traversing all data points.

[0055] It should be noted that δ controls the importance measure of the data point d i When δ is large, the importance metric d i The difference will be amplified, which means that those data points with higher importance will be given greater weights; conversely, when δ is small, the difference in importance measures has less impact, and the weight distribution between data points is more even; by adjusting the value of δ, we can balance the contribution of different data points in the aggregation function P, which helps to ensure that the aggregation results can reflect important data features while avoiding over-reliance on certain extreme values ​​or outliers.

[0056] Specifically, for each time point t, the importance measure d of each data point is calculated based on the specific characteristics of the sales data (such as sales amount, sales volume, etc.). i You can use indicators such as historical sales trends, seasonal factors, and sales volume of specific items to determine the i .

[0057] Preferably, the expression of the "dynamic adjustment factor α" is based on a softmax function, which can automatically adjust the value of α according to the importance of each data point.

[0058] Combining the dynamic weight function w(t) and the dynamic adjustment factor α, the expression of the clustering function P(x) is constructed as follows: ; ; Among them, x is the time series data, T is the length of the time series, that is, the number of data points; Specifically, the processed time series data (such as sales, order quantity, etc.) is input into the aggregation function P(x); the time series data is dynamically aggregated through the dynamic weight w(t) and the adjustment factor α to obtain the aggregated sales data.

[0059] It should be noted that the range of the aggregation function P(x) depends on the range of the time series data and the values ​​of w(t) and α. When w(t)≈1 and α is large, P(x) tends to reflect the original value of the data. On the contrary, when w(t)≈0 or α is small, P(x) will more reflect the average trend of the data.

[0060] Furthermore, a deep neural network is introduced to optimize the parameters β, γ, and δ, and the difference between the predicted aggregate value and the actual aggregate value is minimized through the back-propagation algorithm; It should be noted that the specific steps of “introducing the deep neural network optimization parameters β, γ, and δ, and minimizing the difference between the predicted aggregate value and the actual aggregate value through the back propagation algorithm” are as follows: First, we need to extract historical data from the sales database as a training set. This data should include time series data and corresponding aggregate values. The time series data will be used as input into the deep neural network, and the aggregate value will be used as the target output of the network.

[0061] Secondly, we need to define a deep neural network. First, we extract historical time series sales data and actual aggregate values ​​from the sales database as training sets and target outputs. The network structure can include multiple hidden layers, using activation functions such as ReLU (Rectified Linear Unit) or tanh to increase nonlinearity. Assume that our network structure is as follows: input layer: receives time series data, multiple hidden layers: each layer uses an activation function such as ReLU, output layer: outputs the predicted values ​​of the three parameters β, γ, and δ.

[0062] Next, define a loss function to measure the difference between the predicted parameters and the actual parameters. Since our goal is to minimize the difference between the predicted aggregate value and the actual aggregate value, we need to calculate the aggregate value through the predicted parameters and compare this aggregate value with the actual aggregate value. The loss function can be defined as Mean Squared Error (MSE) or other appropriate loss functions, such as Root Mean Squared Error (RMSE).

[0063] The loss function L can be defined as: ; in, is to use the prediction parameters The calculated aggregate value, y t is the actual aggregate value and T is the length of the time series.

[0064] During the training process, we use the back-propagation algorithm to update the weights in the network to minimize the loss function L; forward propagation: input the time series data into the network, and get the predicted values ​​of the parameters β, γ, and δ through each layer of the network; calculate the predicted aggregate value: use the predicted parameters Calculate the aggregate value through the aggregation function P; Calculate the loss: use the loss function L to calculate the difference between the predicted aggregate value and the actual aggregate value; Back propagation: Calculate the gradient of the loss relative to the network weight, and use gradient descent or more advanced optimization algorithms (such as Adam) to update the weights; Iterative optimization: Repeat the above process until the predetermined convergence criteria are reached or specific performance indicators are met.

[0065] Finally, to achieve optimal performance, you may need to adjust the network's hyperparameters, such as learning rate, batch size, number of hidden layers, and number of nodes in each layer, which can be determined through cross-validation. Once the model is trained, we need to evaluate the model's performance using unseen data, which can be done by calculating the loss function on the test set. If the model performs well, we can deploy it to a production environment to adjust the parameters in the adaptive dynamic data aggregation algorithm in real time. After deployment, you also need to continuously monitor the model's performance and regularly update the model based on new data to maintain its effectiveness.

[0066] Furthermore, in the process of continuously iteratively optimizing the values ​​of β, γ, and δ, until the performance index of the predetermined convergence standard is reached, the construction of the adaptive dynamic data aggregation algorithm is completed.

[0067] It should be noted that in machine learning and deep learning, "performance indicators that reach predetermined convergence criteria" usually refer to the criteria used to determine whether the model has learned enough information during training and when to stop training. These criteria are usually defined based on changes in training loss and validation loss. The purpose is to avoid overfitting and ensure the model's ability to generalize to new data.

[0068] It should also be noted that the adaptive dynamic data aggregation algorithm built based on the data in the sales database using data aggregation and machine learning technology can automatically identify patterns in the data and dynamically adjust the aggregation level and granularity according to data fluctuations. By introducing deep neural networks to optimize key parameters and using the back propagation algorithm to minimize the difference between the predicted aggregation value and the actual aggregation value, the algorithm can significantly improve the accuracy and flexibility of data aggregation. This algorithm can not only effectively capture trends and anomalies in the data, but also adaptively adjust data aggregation strategies according to user query conditions and usage habits, thereby providing users with more accurate and timely data insights, and helping companies make more informed business decisions.

[0069] S3. Through the adaptive dynamic data aggregation algorithm, patterns in the data are automatically identified, and the aggregation level and granularity of the data are dynamically adjusted according to the user's usage habits and query conditions to generate aggregated data.

[0070] Furthermore, the frequency of user queries, the time period of the queries, the specific content of the queries (e.g., by time range, product category, etc.), and the K-Means clustering algorithm is used to group user queries to identify similar query patterns; Based on the above grouping, we use Apriori association rule learning to discover the correlation between user queries, which can better understand user usage habits; If users frequently query data at a particular level (e.g., aggregated by month), increase the weight of the level; If users frequently view data of a certain granularity (such as daily sales totals), reduce the calculation of data of other granularities; A user preference function u(p) is introduced to measure the user's preference for different aggregation levels P. The expression is: ; Where M is the total number of user query patterns, f i (p) is the preference of the i-th query pattern for aggregation level p Based on the user preference function, the clustering function P(x) is updated, and the expression is: ; Among them, p´(x) represents the updated aggregation function, outputting the aggregated data, X t Represents the tth data point in the time series data; Furthermore, the user preference function u(p) is integrated to construct a composite loss function L´ and a clustering function P´(x t ) process to minimize the difference between the predicted value and the actual value, the expression is: ; Among them, y t is the actual aggregate value at time point t, and λ is the regularization coefficient, which is used to balance the influence of the actual aggregate value and user preference; Use the Adam gradient descent method to update the values ​​of β, γ, and δ. The goal is to minimize the loss function L to reduce the difference between the predicted aggregate value and the actual aggregate value. A mean square error (MSE) performance indicator is set as the convergence criterion. When the change of the performance indicator is less than the threshold after several consecutive iterations, the model is considered to have converged.

[0071] It should be noted that by adopting an adaptive dynamic data aggregation algorithm, the system can automatically identify and learn patterns in the data, and dynamically adjust the aggregation level and granularity of the data according to the user's usage habits and query conditions. This method can significantly improve the efficiency and relevance of data processing, ensuring that the final generated aggregated data not only meets the user's specific needs, but also reflects the changing trends of the data in real time, thereby effectively supporting the decision-making process and improving the user experience and the accuracy of data analysis.

[0072] S4. Combine long short-term memory networks and convolutional neural networks to build a fusion prediction model and predict future sales trends based on historical sales data.

[0073] Furthermore, historical sales data is extracted from the sales database and organized into a time series format; Preferably, "extracting historical sales data" refers to extracting features that are helpful for prediction, such as seasonal factors, holiday effects, etc.

[0074] The convolution kernel in the CNN layer is applied to the sliding window of the input time series to capture multi-scale local features. The expression is: ; in, represents the output of the jth convolution kernel at time point t, represents the i-th weight of the j-th convolution kernel, σ represents a nonlinear activation function, such as Sigmoid or ReLU, b is a bias term used to adjust the output of the activation function, k represents the width of the convolution kernel, and s represents the convolution step size, that is, the number of steps the convolution kernel moves each time. represents the sum operation from i=0 to k−1, represents the input data value at time point t+i−s; Use the LSTM layer to process the output of the CNN layer to capture local features and long-term dependencies in the sales data; It should be noted that the state of the LSTM unit is composed of the hidden state h t and the cell state c t For each time point t, the calculation of LSTM can be expressed as: ; ; ; ; ; Among them, i t , represents the output of the input gate at time point t, W i , represents the weight matrix of the input gate, , represents the hidden state h at the previous moment t−1 And the CNN layer output at the current moment splicing, b i , represents the bias term of the input gate, f t , represents the output of the forget gate at time point t, W f , represents the weight matrix of the forget gate, b f , represents the bias term of the forget gate, c t , represents the cell state at time point t, ⊙, represents the element-level multiplication operation, c t−1 , represents the unit state at the previous moment, W c, represents the weight matrix of the unit state, b c , represents the deviation term of the unit state, o t , represents the output of the output gate at time point t, W o , represents the weight matrix of the output gate, b o , represents the bias term of the output gate, h t , represents the hidden state at time point t; Furthermore, the outputs of the CNN and LSTM layers are fused through the fully connected layer to generate an expression for predicting future sales trends: ; Among them, g t represents the sales trend forecast value at time point t, W´ g represents the weight matrix of the fusion layer, b g Represents the bias term of the fusion layer; The mean square error (MSE) is used as the loss function, and the sales trend forecast value at time point t is integrated. The expression of the mean square error loss function L´´ is defined as: ; Use the Adam optimizer to minimize the loss function L and update the model parameters; The forecast results are presented to users in the form of a line graph, making it easier for them to intuitively understand future sales trends.

[0075] S5. Use the aggregated data to train the fusion prediction model to optimize the ability of the fusion prediction model to capture data feature types.

[0076] Furthermore, training samples are extracted from the aggregated dataset to ensure that the samples contain enough historical data points; The extracted training samples are divided into training set, validation set and test set, with typical proportions of 70%, 15%, 15% or 80%, 10%, 10%; It should be noted that the training set (TrainingSet): This part of the data is used to actually train the model, that is, to adjust the parameters of the model to minimize the loss function; the validation set (Validation Set): This part of the data is used to evaluate the performance of the model during the training process, so as to help adjust the hyperparameters, such as learning rate, number of hidden layer units, etc. The validation set can also be used to implement the early stopping strategy, that is, stop training when the performance on the validation set no longer improves to avoid overfitting; the test set (Test Set): This part of the data is only used after the model training is completed to evaluate the generalization ability of the model on unseen data. The results of the test set can provide an unbiased estimate of the true performance of the model. It is important to ensure that the three subsets are randomly selected from the original data and keep the consistency of the data distribution, so as to ensure the effectiveness of the model training and the accuracy of the evaluation.

[0077] Initialize the CNN-LSTM model and the parameters of the convolution kernel, LSTM unit state, fully connected layer weights and bias terms; For each training cycle, iterate over all batches in the training set; It should be noted that "for each training cycle, traverse all batches in the training set" means that during the model training process, each training cycle (epoch) will traverse all data batches (batch) in the training set. Here, "training cycle" refers to the process in which the model completes one forward propagation and backward propagation on the entire training set, and "traverse all batches" means dividing the entire training set into multiple small batches of data (batches), using a small batch of data for forward propagation and backward propagation each time during training, and repeating this cycle until all data batches have been used once; More specifically, this means: training cycle (epoch): refers to the number of complete traversals of the model on the training set. For example, if the training set contains 1000 samples and the batch size is set to 100, each training cycle will contain 10 batches; traversal of all batches: refers to the fact that in each training cycle, the model will process all small batches of data in sequence. For example, in the above example, each training cycle will process 10 small batches of data; batch: refers to the number of subsets into which the training set is divided in each training cycle. Each subset is called a batch. The data of each batch will be sent to the model for forward propagation and backpropagation to update the model parameters.

[0078] In summary, "for each training cycle, traverse all batches in the training set" means that in each training cycle, the model will process all small batches of data in the training set in turn until the entire training set is traversed. This is a common practice when training deep learning models. It can effectively utilize computing resources and gradually optimize model parameters through multiple iterations.

[0079] Furthermore, after aggregation, each batch of data is fed into a CNN layer to capture local features, and the CNN output is fed into an LSTM layer to capture long-term dependencies; The outputs of the CNN and LSTM layers are fused through a fully connected layer, the loss function is calculated, and backpropagation using the Adam optimizer is used to update the model parameters; At the end of each training cycle, evaluate the model performance using the validation set, monitor the loss function and performance indicators (such as accuracy or mean squared error) on the validation set, and apply early stopping strategies to prevent overfitting; Preferably, in machine learning and deep learning, early stopping is a technique to prevent model overfitting. Its basic idea is to regularly evaluate the performance of the model on the validation set during the training process, and terminate the training process early if the performance on the validation set stops improving or starts to deteriorate.

[0080] It should be noted that the early stopping strategy works as follows: Define performance indicators: Select a performance indicator to evaluate the performance of the model on the validation set, usually the value of the loss function or some accuracy measure (such as accuracy), Set monitoring frequency: Determine when to check the performance on the validation set during training, usually at the end of each training cycle (epoch), Set tolerance threshold: Define a tolerance threshold or maximum number of waiting cycles, that is, the maximum allowed number of times the performance of the model on the validation set no longer improves, Execute training: At the end of each training cycle, use the validation set to evaluate the performance of the model. If the performance improves, continue training. If the performance does not improve, record the number of cycles in which the performance has not improved. If the performance exceeds the tolerance threshold for a number of consecutive cycles without improvement, stop training, and Save the best model: Usually the best performing model version on the validation set is saved for subsequent use.

[0081] Preferably, in this way, the early stopping strategy can help the model avoid overfitting the training data while achieving optimal performance, thereby improving the model's generalization ability on unseen new data; the early stopping strategy is a method of automatically deciding when to stop training by monitoring the performance on the validation set, which helps save computing resources and improve the generalization ability of the model.

[0082] Use the grid search method to adjust the model learning rate and batch size hyperparameters, and select the best hyperparameter combination based on the performance of the validation set; Preferably, the "grid search method" is a commonly used hyperparameter tuning method, which searches for the optimal hyperparameter combination by exhaustively enumerating the specified candidate values. The basic idea of ​​​​grid search is to define a set of candidate values ​​for each hyperparameter, and then traverse all possible combinations, train the model, and evaluate the performance of the model on the validation set, and finally select the hyperparameter combination with the best performance on the validation set as the optimal hyperparameter.

[0083] The model has converged when the loss on the training set no longer decreases and the performance on the validation set no longer improves.

[0084] It should be noted that the statement “when the loss on the training set no longer decreases and the performance on the validation set no longer improves, the model has converged” means that the model training process has reached a stable point, at which point continuing to train the model will not bring more performance improvements.

[0085] More specifically, the loss on the training set no longer decreases: this means that the loss function value of the model on the training set no longer has an obvious downward trend. Usually, as training progresses, the model will gradually learn the pattern of the data on the training set, resulting in a gradual decrease in the value of the loss function. However, if the change in the loss value is very small or almost unchanged within one or more training cycles, then it can be considered that the learning of the model on the training set has been saturated; The performance on the validation set no longer improves: this means that the performance of the model on the validation set is no longer significantly improved. The validation set is a data set used to evaluate the generalization ability of the model and is usually not involved in the direct training process. If the performance indicators on the validation set (such as accuracy, mean square error, etc.) do not change significantly or even begin to deteriorate within several consecutive training cycles, then this indicates that the model may have begun to overfit the training data and can no longer generalize well to unseen data.

[0086] It should also be noted that using aggregated data to train the fusion prediction model can significantly optimize the ability of the fusion prediction model to capture data feature types. In this way, the model can more effectively learn and understand various patterns in sales data, including short-term fluctuations and long-term trends. The aggregated data not only contains rich historical information, but also takes into account user preferences and query habits, so that the model can more accurately predict future sales trends. This training process not only improves the prediction accuracy of the model, but also enhances the robustness and generalization ability of the model, so that the model can better respond to market changes and changes in customer demand. Therefore, this method has important practical value for improving the sales forecast accuracy and decision support level of enterprises.

[0087] S6. Adaptively layout and dynamically adjust future sales trend results, and intuitively display them to users in the form of charts.

[0088] Furthermore, in order to enable the user interface to be adaptively laid out according to different device screen sizes and user preferences, it is necessary to define layout parameters; Introduce screen size factor S and user preference factor U (a value specified by the user in the settings, ranging from [0, 1]) to define the user interface layout; The screen size factor S is expressed as: ; Among them, W and H represent the screen width and height respectively; Combining the screen size factor S and the user preference factor U, an adaptive layout function A(L) is constructed to calculate the position and size of the layout elements. The expression is: ; Among them, β' is a parameter that controls the influence of the screen size factor S, and its value range is [0, ∞), γ' is the threshold of the screen size factor S, and its value range is [0, ∞), Q is a layout parameter list, is the logistic function used for smooth transition, and (1−U)+U is the linear interpolation of the user preference factor U, ensuring that user preference always affects the layout.

[0089] Introduce the data volume factor V and the user attention factor F, and define the dynamic adjustment parameter D(F) to adjust the granularity and level of displayed data. The expression is: ; Among them, δ´ is a parameter that controls the influence of the data volume factor V, with a value range of [0, ∞), η is the threshold of the data volume factor V, with a value range of [0, ∞), dv is the small change in the integral variable v, indicating the location of the data point, (1−F)+F is the linear interpolation of the user attention factor F, ensuring that user attention always affects the data display; Combining the adaptive layout function A (L) and the dynamic adjustment function D (F), the final chart display is generated, and the expression is: ; Where N´ is the number of layout elements, h i and F i Represents the layout parameter list and user attention factor of the i-th layout element, A (h i ) and D (F i ) are respectively the adaptive layout function and dynamic adjustment function of the i-th layout element; It should be noted that through the above steps, we have achieved the adaptive layout of the user interface and the dynamic adjustment of data display, which are intuitively presented to users in the form of charts. This innovative method can not only adapt to different screen sizes and user preferences, but also adjust the displayed data according to the areas of user concern, thereby providing a more personalized and efficient data display experience.

[0090] The present embodiment also provides a sales data visualization processing system, including a data storage module, an adaptive dynamic data aggregation module, an intelligent data aggregation module, a prediction model construction module, a model training and optimization module and a data visualization module; the data storage module is used to collect original sales data from data sources of POS systems, online stores and CRM systems, perform data preprocessing, and store the data in a sales database; the adaptive dynamic data aggregation module is used to construct an adaptive dynamic data aggregation algorithm based on the data in the sales database by using data aggregation and machine learning; the intelligent data aggregation module is used to automatically identify patterns in the data through an adaptive dynamic data aggregation algorithm, and dynamically adjust the aggregation level and granularity of the data according to the user's usage habits and query conditions to generate aggregated data; the prediction model construction module is used to combine long short-term memory networks and convolutional neural networks to construct a fusion prediction model and predict future sales trends based on historical sales data; the model training and optimization module is used to train the fusion prediction model using the aggregated data to optimize the ability of the fusion prediction model to capture data feature types; the data visualization module is used to adaptively layout and dynamically adjust the future sales trend results, and intuitively display them to the user in the form of charts.

[0091] This embodiment also provides a computer device suitable for the method for visualizing processing sales data, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the method for visualizing processing sales data as proposed in the above embodiment.

[0092] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0093] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for visualizing sales data proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination of them, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0094] In summary, the present invention solves the static and fixed problems of traditional data aggregation methods through an adaptive dynamic data aggregation algorithm, realizes dynamic adjustment of data aggregation level and granularity, and improves the flexibility of data processing and the customization ability of users; secondly, the prediction model constructed by integrating long short-term memory network and convolutional neural network can more effectively capture the complex nonlinear and long-term dependencies in sales data compared with the traditional single prediction model, and significantly improves the accuracy of predicting future sales trends; in addition, the present invention also provides an adaptive layout and dynamic adjustment mechanism, which can automatically adjust the layout of the user interface according to the personalized needs of the user and the screen size of the device, ensuring the friendliness and interactivity of the user interface. These improvements significantly enhance the user experience, improve the practicality of the system, and provide enterprises with a more efficient, accurate and user-friendly sales data analysis solution.

[0095] Example 2, referring to Table 1, is the second example of the present invention. To further verify the advancement of the present invention, experimental simulation data of the visualization processing method of sales data is provided.

[0096] A fictitious retail company was selected as the research object. The company has a mature POS system, online store and CRM system, and has accumulated a large amount of sales data. The name of the experimental object: includes different product categories (such as electronic products, clothing, food and cosmetics). Implementation parameters: including sales forecast accuracy, user interface score, query response time, user satisfaction, etc.

[0097] First, data collection and preprocessing were carried out: sales transaction records, inventory information, return records and employee operation records within the past year were collected from the company's POS system; order data, user behavior data, evaluation and feedback, and promotion activity data within the same time period were collected from the online store; basic customer information, purchase history, service interaction records and marketing activity responses were collected from the CRM system; data cleaning, data conversion, data integration, data reduction and data quality inspection were performed on these data; database field names and data types were defined, and foreign key constraints between the order ID primary key field and the table were set; the processed data was imported into the database, and indexes were created for fields that are often used as query conditions.

[0098] Secondly, an adaptive dynamic data aggregation algorithm is constructed: the dynamic adjustment factor α and the dynamic weight function w(t) are set, and the mathematical expressions of the dynamic weight function w(t) and the dynamic adjustment factor α are defined; the parameters β, γ, and δ are optimized using a deep neural network, and the difference between the predicted aggregation value and the actual aggregation value is minimized through the back propagation algorithm; in the process of continuously iteratively optimizing the values ​​of β, γ, and δ, the performance indicator of the predetermined convergence standard is reached, that is, the mean square error (MSE) is less than 0.01.

[0099] Next, we conduct user query analysis and dynamically adjust the aggregation level and granularity: we record the frequency of user queries, the time period of queries, and the specific content of queries, and use the K-Means clustering algorithm to group user queries; we use Apriori association rule learning to discover the correlation between user queries; we increase the weight of specific levels of frequent user queries, and reduce the calculation of specific granularity data that users rarely view; we introduce the user preference function u(p), and update the aggregation function P(x) accordingly.

[0100] Next, a fusion prediction model was built: historical sales data that were helpful for prediction were extracted and organized into a time series format; a convolutional neural network (CNN) was used to capture multi-scale local features, and a long short-term memory network (LSTM) was used to process the output of the CNN layer and capture long-term dependencies; the outputs of the CNN and LSTM layers were fused through a fully connected layer, and a prediction of future sales trends was generated; the mean square error was used as the loss function, and the Adam optimizer was used to minimize the loss function L and update the model parameters.

[0101] Furthermore, model training and optimization: training samples were extracted from the aggregated dataset and divided into training set, validation set and test set; the CNN-LSTM model and its parameters were initialized, and all batches in the training set were traversed for each training cycle; at the end of each training cycle, the model performance was evaluated using the validation set, and an early stopping strategy was applied to prevent overfitting; the grid search method was used to adjust the learning rate and batch size of the model, and the optimal hyperparameter combination was selected based on the performance of the validation set.

[0102] Finally, a series of layout parameters are defined for chart display, and the screen size factor S and user preference factor U are introduced to define the user interface layout; the screen size factor S and user preference factor U are combined to construct an adaptive layout function A (L) to calculate the position and size of layout elements; the data volume factor V and user attention factor F are introduced, and the dynamic adjustment parameter D (F) is defined to adjust the granularity and level of displayed data; finally, a chart display is generated, which includes adaptive layout and dynamic adjustment functions.

[0103] The details are shown in Table 1 below: Table 1 Experimental record table

[0104] As can be seen from the table, the sales forecast accuracy of the proposed method in the four product categories of electronic products, clothing, food and cosmetics exceeds 90%, which shows that the forecast model has high accuracy and reliability. Compared with the traditional method, which is usually less than 85%, the accuracy of the forecast is significantly improved. The user interface scores are generally high, averaging above 4.6 (out of 5), which shows that through adaptive layout and dynamic adjustment functions, the user interface can better meet the needs of different users, thereby improving the user experience. The query response time is around 0.7 seconds on average, which means that users can quickly obtain the required information. Compared with the common response time of 1 to 2 seconds in traditional systems, the waiting time is significantly shortened and user satisfaction is improved. This is also reflected in user satisfaction, which averages above 4.4 points. The high user satisfaction is not only due to the fast response speed, but also related to the dynamic adjustment of data granularity and level according to user preferences, which makes it easier for users to obtain the information they care about most.

[0105] In summary, through the data comparison and analysis of the embodiments, it can be seen that the present invention has obvious innovation and advantages in improving the accuracy of sales forecasting and optimizing the user interface experience compared with the prior art. These improvements not only enhance the practical value of the system, but also provide users with a more personalized experience.

[0106] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for visualizing sales data, characterized in that: include, Collect raw sales data from POS systems, online stores, and CRM system data sources, perform data preprocessing, and store them in the sales database; Based on the data in the sales database, we use data aggregation and machine learning to build an adaptive dynamic data aggregation algorithm; Through the adaptive dynamic data aggregation algorithm, the data patterns are automatically identified, and the aggregation level and granularity of the data are dynamically adjusted according to the user's usage habits and query conditions to generate aggregated data; Combining long short-term memory networks and convolutional neural networks, we build a fusion prediction model and predict future sales trends based on historical sales data; Use the aggregated data to train the fusion prediction model and optimize the fusion prediction model's ability to capture data feature types; The future sales trend results are adaptively laid out and dynamically adjusted, and intuitively presented to users in the form of charts.

2. The method for visualizing sales data according to claim 1, characterized in that: The raw sales data is collected from the data sources of the POS system, online store, and CRM system, and the data is preprocessed and stored in the sales database. The specific steps are as follows: Data collected in the POS system, including sales transaction records, inventory information, return records, and employee operation records; Data collected in online stores, including order data, user behavior data, reviews and feedback, and promotional activity data; Data collected in the CRM system, including basic customer information, purchase history, service interaction records, and marketing campaign responses; Perform data cleaning, data conversion, data integration, data reduction and data quality inspection on the data collected from the data sources of POS system, online store and CRM system; Define the table structure of database field names and data types based on the preprocessed data, and set the foreign key constraint relationship between the order ID primary key field and the table for each table structure; Import the set data table into the database and create indexes for the fields that are often used as query conditions.

3. The method for visualizing sales data according to claim 2, wherein: Based on the data in the sales database, the adaptive dynamic data aggregation algorithm is constructed by using data aggregation and machine learning. The specific steps are as follows: Introduce dynamic adjustment factor α and dynamic weight function w(t) to adjust the dynamic weight and aggregation degree of data in the sales database; The dynamic weight function w(t) is defined as: ; Among them, σ´t is the standard deviation of sales data at time point t, β is the parameter that controls the steepness of the function, and γ is the parameter that determines the center position of the function curve; The dynamic adjustment factor α is defined as: ; Among them, d i is the importance measure of the i-th data point, N is the number of data points, and δ is the importance measure of the data point d i The sensitivity coefficient of , j and i are the indexes of traversing all data points; Combining the dynamic weight function w(t) and the dynamic adjustment factor α, the expression of the clustering function P(x) is constructed as follows: ; ; Among them, x is the time series data, T is the length of the time series; Introduce deep neural network optimization parameters β, γ, and δ, and use the back-propagation algorithm to minimize the difference between the predicted aggregate value and the actual aggregate value; In the process of continuously iteratively optimizing the values ​​of β, γ, and δ, until the performance index of the predetermined convergence standard is reached, the construction of the adaptive dynamic data aggregation algorithm is completed.

4. The method for visualizing sales data according to claim 3, characterized in that: The adaptive dynamic data aggregation algorithm is used to automatically identify patterns in the data, and dynamically adjust the aggregation level and granularity of the data according to the user's usage habits and query conditions to generate aggregated data. The specific steps are: Record the frequency, time period, and specific content of user queries, and use the K-Means clustering algorithm to group user queries; Based on the above grouping, Apriori association rule learning is used to discover the correlation between user queries; If users frequently query data at a particular level, increase the weight of that level; If users frequently view data of a certain granularity, reduce the calculation of data of other granularities; A user preference function u(p) is introduced to measure the user's preference for different aggregation levels P. The expression is: ; Where M is the total number of user query patterns, f i (p) is the preference of the i-th query pattern for aggregation level p Based on the user preference function, the clustering function P(x) is updated, and the expression is: ; Among them, p´(x) represents the updated aggregation function, which outputs the aggregated data; Fusion user preference function u(p), construct composite loss function L´ to train updated clustering function P´(x t ) process to minimize the difference between the predicted value and the actual value, the expression is: ; Among them, y t is the actual aggregate value at time point t, and λ is the regularization coefficient; Use Adam gradient descent method to update the values ​​of β, γ, and δ; A mean square error performance index is set as the convergence criterion. When the change of the performance index is less than the threshold after several consecutive iterations, the model is considered to have converged.

5. The method for visualizing sales data according to claim 4, characterized in that: The method combines the long short-term memory network and the convolutional neural network to build a fusion prediction model and predict future sales trends based on historical sales data. The specific steps are as follows: Extract historical sales data from the sales database and organize it into a time series format; The convolution kernel in the CNN layer is applied to the sliding window of the input time series to capture multi-scale local features. The expression is: ; in, represents the output of the jth convolution kernel at time point t, represents the i-th weight of the j-th convolution kernel, σ represents the nonlinear activation function, b is the bias term, k represents the width of the convolution kernel, and s represents the convolution step size; Use LSTM layers to process the output of CNN layers to capture long-term dependencies; The outputs of the CNN and LSTM layers are fused through the fully connected layer to generate the expression for predicting future sales trends: ; Among them, g t represents the sales trend forecast value at time point t, W´ g represents the weight matrix of the fusion layer, b g Represents the bias term of the fusion layer; The mean square error is used as the loss function, and the sales trend forecast value at time point t is integrated. The expression of the mean square error loss function L´´ is defined as: ; Use the Adam optimizer to minimize the loss function L and update the model parameters; The prediction results are displayed to the user in the form of a line graph.

6. The method for visualizing sales data according to claim 5, characterized in that: The method of using the aggregated data to train the fusion prediction model and optimize the ability of the fusion prediction model to capture data feature types is as follows: Extract training samples from the aggregated dataset; The extracted training samples are divided into training set, validation set and test set; Initialize the CNN-LSTM model and the parameters of the convolution kernel, LSTM unit state, fully connected layer weights and bias terms; For each training cycle, iterate over all batches in the training set; After aggregation, each batch of data is fed into the CNN layer to capture local features, and the CNN output is fed into the LSTM layer to capture long-term dependencies; The outputs of the CNN and LSTM layers are fused through a fully connected layer, the loss function is calculated, and backpropagation using the Adam optimizer is used to update the model parameters; At the end of each training cycle, evaluate the model performance using the validation set, monitor the loss function and performance indicators on the validation set, and apply early stopping strategies to prevent overfitting; Use the grid search method to adjust the model learning rate and batch size hyperparameters, and select the best hyperparameter combination based on the performance of the validation set; The model has converged when the loss on the training set no longer decreases and the performance on the validation set no longer improves.

7. The method for visualizing sales data according to claim 6, characterized in that: The future sales trend results are adaptively laid out and dynamically adjusted, and intuitively presented to the user in the form of a chart. The specific steps are: Introduce screen size factor S and user preference factor U to define the user interface layout; The screen size factor S is expressed as: ; Among them, W and H represent the screen width and height respectively; Combining the screen size factor S and the user preference factor U, an adaptive layout function A(L) is constructed to calculate the position and size of the layout elements. The expression is: ; Among them, β´ is the parameter that controls the influence of screen size factor S, γ´ is the threshold of screen size factor S, Q is the layout parameter list, and (1−U)+U is the linear interpolation of user preference factor U; Introduce the data volume factor V and the user attention factor F, and define the dynamic adjustment parameter D(F) to adjust the granularity and level of displayed data. The expression is: ; Among them, δ´ is the parameter that controls the influence of the data volume factor V, η is the threshold of the data volume factor V, dv is the small change of the integral variable v, and (1−F)+F is the linear interpolation of the user attention factor F; Combining the adaptive layout function A (L) and the dynamic adjustment function D (F), the final chart display is generated, and the expression is: ; Where N´ is the number of layout elements, h i and F i Represents the layout parameter list and user attention factor of the i-th layout element, A (h i ) and D (F i ) are the adaptive layout function and dynamic adjustment function of the i-th layout element respectively.

8. A sales data visualization processing system, based on the sales data visualization processing method according to any one of claims 1 to 7, characterized in that: Including data storage module, adaptive dynamic data aggregation module, intelligent data aggregation module, prediction model building module, model training and optimization module and data visualization module; The data storage module is used to collect original sales data from the data sources of the POS system, online store, and CRM system, perform data preprocessing, and store the data in the sales database; The adaptive dynamic data aggregation module is used to construct an adaptive dynamic data aggregation algorithm based on the data in the sales database by using data aggregation and machine learning; The intelligent data aggregation module is used to automatically identify patterns in data through an adaptive dynamic data aggregation algorithm, and dynamically adjust the aggregation level and granularity of data according to user usage habits and query conditions to generate aggregated data; The prediction model building module is used to combine the long short-term memory network and the convolutional neural network to build a fusion prediction model and predict future sales trends based on historical sales data; The model training and optimization module is used to train the fusion prediction model using the aggregated data, and optimize the ability of the fusion prediction model to capture data feature types; The data visualization module is used to adaptively layout and dynamically adjust future sales trend results, and intuitively present them to users in the form of charts.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the sales data visualization processing method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the sales data visualization processing method described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Shop operation management system based on big data analysis

    CN120509931A

  • Food and beverage network sales trend prediction model construction system and method based on multi-source data fusion and deep learning

    CN120655340A

  • Label generation method and system based on regularization engine label system

    CN120973786A