Data intelligent interpretation implementation method and device, equipment and storage medium

By cleaning, aggregating and multi-dimensional analysis of sales data, and generating comprehensive reports, the limitations of the existing technology in automated analysis and data interpretation are solved, and the accuracy of trend detection and the efficiency of data interpretation are improved.

CN119538137APending Publication Date: 2025-02-28四川中仑数科科技有限责任公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411473738.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Existing data analysis tools have limitations in automated analysis and data interpretation, especially when detecting complex analytical tasks such as data trends, anomalies, and classified distributions, requiring expert participation.

Method used

By extracting sales data from the database, cleaning and aggregation preprocessing, combining statistical analysis, time series stationarity inspection, sales trend analysis, outlier detection and classification dimension distribution analysis, a comprehensive report is generated to interpret sales data.

Benefits of technology

It improves the accuracy of trend detection and adapts to data scenarios of different types and complex dimensions, allowing users to quickly identify and understand the trend changes of data, and meets the deep needs of enterprises.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538137A_ABST
    Figure CN119538137A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method for realizing intelligent data interpretation, which comprises the following steps of: extracting sales data from a database, carrying out cleaning and aggregation preprocessing, and carrying out multi-dimensional analysis: carrying out statistical analysis on specific time data, carrying out time sequence stability test, checking an overall sales trend, extracting a longest trend, carrying out abnormal value detection, and carrying out classification dimension distribution analysis. These analyses comprehensively generate a comprehensive report that comprehensively interprets sales data. By comprehensively adopting a machine model and time sequence analysis, the long-term trend and short-term fluctuation in the sales data are intelligently detected and analyzed, and multi-dimensional analysis is performed on an abnormal result in combination with a time window and a category label, so that the accuracy of trend detection and anomaly detection is improved, the method is suitable for data scenes of different types and complex dimensions, and the accuracy of sales data detection is improved. And the user can quickly identify and understand the trend change of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of data processing technology and related technical fields, and specifically, to an implementation method, apparatus, device and storage medium suitable for intelligent interpretation of data. Background Art

[0002] Although existing data analysis tools can provide charts and statistical results, they have certain limitations in automated analysis and data interpretation. In particular, when performing complex analysis tasks such as detecting data trends, anomalies, and classification distributions, the participation of experts is often required.

[0003] The shortcomings of the existing technology are mainly reflected in the following aspects:

[0004] Data cleaning, aggregation and analysis mostly require manual intervention, resulting in low efficiency.

[0005] When the data volume is large and complex, existing anomaly detection methods are difficult to effectively identify anomalies.

[0006] Existing technologies are limited in their accuracy and flexibility when analyzing long-term and short-term trends in data.

[0007] Existing tools lack flexible parameter customization capabilities and are unable to meet the diverse needs of different business scenarios. Summary of the invention

[0008] The embodiments described in this article provide a method, device, equipment and storage medium for implementing intelligent interpretation of data to solve the problems existing in the prior art.

[0009] According to a first aspect of the present disclosure, a method for implementing intelligent interpretation of data is provided, comprising:

[0010] Extract merchant-related sales data from the database;

[0011] Performing preprocessing operations including cleaning and aggregation on the extracted sales data to generate preprocessed data;

[0012] Based on the received time range information, statistically analyze the preprocessed data in a specific time period to obtain a first analysis result;

[0013] Arranging the preprocessed data into a time series in chronological order to form time series data, and performing a stationarity test on the time series data to obtain a second analysis result;

[0014] Based on the preprocessed data, checking the overall sales trend, extracting the longest trend, and obtaining a third analysis result, wherein the longest trend includes the longest rising trend and the longest falling trend;

[0015] Based on the time series data, outlier detection is performed to obtain an abnormal analysis result and use it as a fourth analysis result;

[0016] Performing classification dimension distribution analysis on the preprocessed data by a classification method, and extracting the classifications with the highest and lowest proportions as the fifth analysis result;

[0017] A comprehensive report is generated through visual analysis based on the first analysis result, the second analysis result, the third analysis result, the fourth analysis result and the fifth analysis result, and the comprehensive report is used to interpret the sales data.

[0018] In some embodiments of the present disclosure, the step of performing pre-processing operations including cleaning and aggregating the extracted sales data includes:

[0019] Use the Pandas library to clean the data, including: processing missing values, removing duplicates, and formatting data. The missing values ​​are processed by filling the mean or the median.

[0020] The Pandas library is used for aggregation processing to generate the required statistical information, including total sales and the number of items sold.

[0021] In some embodiments of the present disclosure, the step of performing a stationarity test on the time series data includes:

[0022] Perform ADF test on the time series data to test stationarity;

[0023] Calculate the mean and variance of a time series;

[0024] A KPSS test is performed on the mean and variance of the time series to determine whether the mean and variance of the time series change over time.

[0025] In some embodiments of the present disclosure, the step of checking the overall sales trend based on the pre-processed data includes:

[0026] Obtaining date and sales from the preprocessed data;

[0027] Calculate the difference in days between dates and use it as the independent variable;

[0028] Using a linear regression model, the slope of the sales trend is calculated based on the difference in days between the dates in the sales data and the sales amount, wherein the positive or negative value of the slope indicates an increasing or decreasing trend in sales, and the absolute value of the slope indicates a rate of change;

[0029] The significance of the trend was assessed by calculating the p-value of the slope;

[0030] By analyzing the sign and size of the slope and combining it with the significance test results, it is possible to determine whether the overall sales trend is rising, falling, or stable.

[0031] In some embodiments of the present disclosure, the step of extracting the longest trend based on the preprocessed data includes:

[0032] Obtaining date and sales from the preprocessed data;

[0033] Calculate the percentage change in said sales by said date and mark the trend for each day;

[0034] Group consecutive identical trends, calculate the start and end dates of each trend, and the percentage change in sales during each trend, and obtain the longest upward trend and the longest downward trend;

[0035] Identify and get the longest uptrend and the longest downtrend.

[0036] In some embodiments of the present disclosure, the step of performing outlier detection based on the time series data includes:

[0037] Calculating the first quartile and the third quartile of the processed data;

[0038] Calculate the interquartile range (IQR) based on the first quartile and the third quartile;

[0039] Based on the first quartile, the third quartile and the interquartile range, a lower boundary and an upper boundary are calculated to determine an outlier range;

[0040] Filter out abnormal values ​​that exceed the lower boundary and the upper boundary, and record the time and specific value of the abnormal value.

[0041] In some embodiments of the present disclosure, the step of performing classification dimension distribution analysis on the preprocessed data by a classification method, and extracting the classifications with the highest and lowest proportions as the fifth analysis result includes:

[0042] extracting categorical sales and total sales from the preprocessed data;

[0043] Calculate the percentage of each category's sales to total sales as the share;

[0044] Sort by the size of the proportion;

[0045] Extracting the highest and lowest categories of the proportion as the fifth analysis result;

[0046] It supports users to customize analysis dimensions according to specific needs and classify data according to different standards.

[0047] According to a second aspect of the present disclosure, a device for implementing intelligent interpretation of data is provided, comprising:

[0048] An extraction module, used to extract merchant-related sales data from the database;

[0049] A processing module, used for performing preprocessing operations including cleaning and aggregation on the extracted sales data to generate preprocessed data;

[0050] A statistical module, configured to perform statistical analysis on the preprocessed data in a specific time period based on the received time range information to obtain a first analysis result;

[0051] A testing module, used for arranging the preprocessed data into a time series in chronological order to form time series data, and performing a stationarity test on the time series data to obtain a second analysis result;

[0052] A first analysis module is used to check the overall sales trend based on the preprocessed data, extract the longest trend, and obtain a third analysis result, wherein the longest trend includes the longest rising trend and the longest falling trend;

[0053] A detection module, configured to perform outlier detection based on the time series data, obtain an abnormality analysis result and use it as a fourth analysis result;

[0054] A second analysis module is used to perform classification dimension distribution analysis on the preprocessed data by a classification method, and extract the classifications with the highest and lowest proportions as the fifth analysis result;

[0055] A generation module is used to combine the first analysis result, the second analysis result, the third analysis result, the fourth analysis result and the fifth analysis result to generate a comprehensive report through visual analysis to provide a comprehensive interpretation of the sales data.

[0056] According to a third aspect of the present disclosure, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method in any one of the above embodiments are implemented.

[0057] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.

[0058] The implementation method, device, equipment and storage medium for intelligent interpretation of data provided by the embodiments of the present disclosure extract sales data from the data, and after cleaning and aggregation preprocessing, perform multi-dimensional analysis: statistical analysis of specific time data, time series stationarity test, sales trend analysis to obtain the overall sales trend and the longest trend, outlier detection, and classification dimension distribution analysis, which comprehensively generate a comprehensive report that fully interprets the sales data. By comprehensively adopting machine models and time series analysis, long-term trends and short-term fluctuations in sales data can be intelligently detected and analyzed, which not only improves the accuracy of trend detection, but also adapts to data scenarios of different types and complex dimensions, allowing users to quickly identify and understand the trend changes of data.

[0059] The disclosed embodiments cover a multi-dimensional data analysis method, which is not limited to a single specific dimension, but combines multiple analysis dimensions such as statistical analysis, stationarity detection, trend analysis, outlier detection, and classification dimension distribution. This comprehensive approach can fully understand the characteristics of sales data, so as to better meet the deep-seated needs of enterprises and avoid one-sidedness and deviation. By adopting a variety of advanced statistical and machine learning methods, such as machine learning models (Scikit-learn) and time series analysis techniques (including ADF and KPSS tests), intelligent detection and analysis of sales data are realized, covering the identification of long-term trends and short-term fluctuations. Not only does it significantly improve the accuracy of trend detection, but it can also flexibly respond to data scenarios of various types and complexities, helping users quickly identify and deeply understand the trend changes contained in the data.

[0060] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:

[0062] Figure 1 It is a flowchart of a method for implementing intelligent data interpretation provided by an embodiment of the present disclosure;

[0063] Figure 2 It is a structural diagram of a device for implementing intelligent interpretation of data provided by an embodiment of the present disclosure;

[0064] Figure 3 is a schematic diagram of a sales data table provided by an embodiment of the present disclosure;

[0065] Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present disclosure.

[0066] In the drawings, reference numerals with the same last two digits correspond to the same elements. It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.

[0068] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0069] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists, A and B exist at the same time, and B exists. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0070] Furthermore, in all embodiments of the present disclosure, terms such as “first” and “second” are used only to distinguish one component (or a part of a component) from another component (or another part of a component).

[0071] In the description of the present application, unless otherwise specified, "plurality" means more than two (including two), and similarly, "multiple groups" means more than two groups (including two).

[0072] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0073] Based on the problems existing in the existing technology, Figure 1 is a flow chart of a method for implementing intelligent data interpretation provided by an embodiment of the present disclosure, such as Figure 1 As shown in FIG. 1 , the specific process of implementing the method for intelligent data interpretation includes:

[0074] S110, extracting merchant-related sales data from the database.

[0075] In a specific implementation process, the sales data includes one or more of the following: date, sales amount and category. These data are previously uploaded to the database by the merchant to ensure the accuracy and consistency of the data.

[0076] In addition, to meet different analysis needs, sales data can be classified and filtered according to merchants, time periods and other relevant indicators.

[0077] S120. Perform preprocessing operations including cleaning and aggregation on the extracted sales data to generate preprocessed data.

[0078] In a specific implementation, the Pandas library is first used for data cleaning, including processing missing values, removing duplicates, and formatting data, etc., to ensure data quality and consistency. For processing missing values, mean filling or median filling can be used. Then, the Pandas library is used for aggregation processing to generate the required statistical information, such as classified sales, total sales, and the number of goods sold by category.

[0079] S130. Based on the received time range information, perform statistical analysis on the preprocessed data in a specific time period to obtain a first analysis result.

[0080] In a specific implementation, the received time range information is data within the time range selected by the merchant. Based on the data within the time range selected by the merchant, statistical analysis is performed on the pre-processed data of a specific time period, specifically including: calculating key indicators such as total sales, average sales, and standard deviation of sales, so as to fully understand the overall trend and fluctuation of the data. Finally, a first analysis result is obtained.

[0081] S140, arranging the preprocessed data into a time series in chronological order to form time series data, and performing a stationarity test on the time series data to obtain a second analysis result.

[0082] In a specific implementation, the preprocessed data is organized into a time series format to ensure that the data points are arranged in chronological order.

[0083] After the time series data is prepared, in order to test the stationarity of the time series characteristics of the sales data, the two test methods of ADF (Augmented Dickey-Fuller) test and KPSS (Kwiatkowski-Phillips-Schmidt-Shin) test are used.

[0084] The ADF test is used to test the stability of the data to determine whether the statistical characteristics of the data change over time. First, the adfuller() function is used to perform an ADF test on the time series data to calculate the p-value. If the p-value is less than 0.05, the data can be considered stable; otherwise, it indicates that the data is non-stationary. Compared with traditional technologies, the combination of a specific time window adjustment strategy effectively improves the sensitivity of stationarity detection and can more accurately identify the stationary characteristics of the data.

[0085] The p-value is a key statistical indicator used primarily to assess the significance of an observation. It represents the probability of the observed data or more extreme data occurring in a hypothesis test, assuming that the null hypothesis is true. A small p-value (usually less than 0.05 or 0.01) indicates that the observed result is unlikely to be due to random factors, and therefore the result can be considered statistically significant.

[0086] In the ADF test, the p-value is widely used to determine whether the time series data is stationary. The stationarity of the time series is crucial to the effectiveness of many statistical and forecasting models, because non-stationary data may lead to inaccurate results. Specifically, the null hypothesis of the ADF test is that the time series data has a unit root, that is, the data is not stationary; and the alternative hypothesis is that the series is stationary. According to the obtained p-value, if it is less than the predetermined significance level (such as 0.05), the null hypothesis can be rejected and the time series data is considered to be stationary.

[0087] Stationarity means that the statistical characteristics of the time series, such as the mean and variance, do not change over time, making it possible to use past data to predict the future.

[0088] After performing an ADF test on the time series data to test for stationarity, include:

[0089] Calculate the mean and variance of the time series. The mean and variance of the time series are calculated by statistical analysis of the data. The specific steps are as follows:

[0090] 1. Calculate the mean

[0091] Mean: It is the central trend of the time series, indicating the average level of the data, and can be calculated by the following formula:

[0092]

[0093] Where N is the number of observations in the time series (sample size), y t is the observed value at time t.

[0094] 2. Calculate variance

[0095] Variance: measures the volatility of the data in the sequence, that is, how close the data points are to the mean. The calculation formula is:

[0096]

[0097] Where N is the number of observations in the time series (sample size), y t is the observation at time t, and Mean is the mean of the series.

[0098] 3. Example

[0099] Suppose there is a time series data ([5,10,15,20,25]):

[0100] According to formula (1) and formula (2), we can calculate that the mean of the time series is 15 and the variance is 50.

[0101] The mean and variance are the basis of time series analysis and can help analyze the trend and fluctuation characteristics of data.

[0102] A KPSS test is performed on the mean and variance of the time series to determine whether the mean and variance of the time series change over time.

[0103] The kpss() function is used to perform the KPSS test, which focuses on testing whether the mean and variance of the time series change over time. The disclosed embodiment improves the KPSS method and adds an automatic bandwidth selection mechanism to enhance the robustness of the test results and ensure adaptability to different types of data.

[0104] The application scheme of automatic bandwidth selection in KPSS inspection is as follows:

[0105] In the KPSS test, the bandwidth is used to smooth the autocorrelation function (ACF) of the sequence, thereby effectively estimating the long-term variance. Choosing the right bandwidth is crucial to the accuracy of the test. The specific process is as follows:

[0106] 1. Determine sample size

[0107] The optimal bandwidth is calculated based on the length of the time series (number of samples). The following formula can be used:

[0108]

[0109] Where (T) is the number of samples in the time series.

[0110] The optimal bandwidth can be determined using a function of the form: Silverman's Rule of Thumb or the Newey-West method.

[0111] 2. Calculate the autocorrelation function (ACF)

[0112] Calculate the lagged autocorrelation function (ACF) of the time series. ACF describes the correlation between the current value and its past values. The specific steps include:

[0113] Calculate the autocorrelation coefficient of the series, usually choosing several lag orders to capture the underlying periodic pattern of the data.

[0114] Note that the bandwidth choice directly affects the number of lags included in the autocorrelation function, and it is important to ensure that the choice is reasonable and effective.

[0115] 3. Smoothed Autocorrelation Function (ACF)

[0116] The autocorrelation function is smoothed by the selected bandwidth to eliminate the influence of noise caused by high lag orders on the variance estimate. The smoothing process can use a weighted average method so that relatively close lag orders have a greater influence on the final result.

[0117] 4. Choose the appropriate kernel function

[0118] In the KPSS test, the Bartlett kernel function is usually used to smooth the lag order. Through the kernel function, different weights are given to the lag order;

[0119] This kernel function makes the weight of the lag order farther away from the current time point smaller, which can effectively reduce the impact of noise and improve the accuracy of estimation.

[0120] 5. Perform KPSS test

[0121] After the smoothing process is completed, the obtained smoothed autocorrelation function is used to calculate the KPSS test statistic and finally determine the stationarity of the time series.

[0122] Automatic bandwidth selection is crucial in KPSS testing. By setting a reasonable bandwidth, the accuracy of variance estimation can be improved. This solution forms a complete set of automatic bandwidth selection strategies by determining the sample size, calculating and smoothing the autocorrelation function, and selecting a suitable kernel function. This method can effectively reduce noise interference and promote more scientific time series analysis. The robustness of the test results can be enhanced through automatic bandwidth selection.

[0123] Through this analysis process, we will get the second analysis result, which will clearly point out the stationary characteristics of time series data. By combining a specific time window adjustment strategy, the sensitivity of stationarity detection is improved. By conducting a comprehensive stationarity test on the time series of sales data, long-term trends and short-term fluctuations can be more clearly distinguished.

[0124] S150. Based on the preprocessed data, check the overall sales trend, extract the longest trend, and obtain a third analysis result, wherein the longest trend includes the longest rising trend and the longest falling trend.

[0125] In the data preparation stage, sales data including date and sales amount have been collected in step S110 to ensure the integrity and reliability of the data. These data should cover the time period to be analyzed. In step S120, the sales data has been cleaned to ensure that the sales amount is numerical data, and missing values ​​and outliers have been processed, using appropriate filling methods or deleting outliers, so as to improve the reliability of subsequent analysis.

[0126] The step of checking the overall sales trend based on the pre-processed data comprises:

[0127] Obtaining date and sales from the preprocessed data;

[0128] The difference in days between dates was calculated and used as the independent variable so that the linear regression method could be applied in the subsequent data analysis.

[0129] The linear regression model in sklearn.linear_model is used to calculate the slope of the sales trend according to the difference in days between the dates in the sales data and the sales amount, specifically including: taking the difference in days between the dates as the independent variable and the sales amount as the dependent variable, calculating the slope of the overall sales trend, and the positive or negative value of the slope will indicate an increasing or decreasing trend in sales.

[0130] sklearn.linear_model is a widely used technology that belongs to the scikit-learn library, which is a leading open source machine learning library in Python. scikit-learn provides a series of powerful tools and algorithms that enable developers and researchers to efficiently perform various machine learning and data analysis tasks.

[0131] The slope of the overall sales trend is often used to measure the rate at which sales data is changing over time. The most common way to calculate the slope is through linear regression analysis. In simple linear regression, the slope can be calculated using the following formula:

[0132]

[0133] Among them, β1 is the number of samples, x i is the value of the ith independent variable, y i is the value of the ith dependent variable, is the mean value of the independent variable x, is the mean of the independent variable y, and n is the sample size.

[0134] If the slope is positive, it means that the overall sales trend is upward, that is, sales are increasing.

[0135] If the slope is negative, it means that the overall sales trend is downward, that is, sales are decreasing.

[0136] The absolute value of the slope indicates the rate of change.

[0137] The p-value of the slope is calculated to assess the significance of the trend. If the p-value is less than the set significance level (e.g. 0.05), the trend is considered significant. If the slope is positive and the p-value is less than 0.05, it indicates that sales are showing a significant upward trend.

[0138] Overall trend analysis: By analyzing the sign and size of the slope and combining it with the significance test results, we can determine whether the sales trend is rising, falling, or stable.

[0139] The calculation of the overall sales trend will summarize and reflect the general performance of sales data over the entire time range, thereby revealing the long-term market trend. The longest trend is a significant change over a long period of time, which specifically includes the longest upward trend and the longest downward trend.

[0140] In a specific embodiment, the step of extracting the longest trend based on the preprocessed data includes:

[0141] Calculates the percentage change in sales by date and labels each day's trend (up, down, or flat). This labeling helps identify fluctuations in trends over different time periods.

[0142] Grouping consecutive identical trends and calculating the start and end dates of each trend, as well as the percentage change in sales during each trend, can provide a more comprehensive assessment of sales performance.

[0143] Identify and get the longest upward trend and the longest downward trend. For example, the report content may be "From 2024-01-05 to 2024-01-15, sales increased by 20.00%." ​​Such information helps to understand the key change points of sales performance.

[0144] Longest Trend Analysis: By analyzing the longest extracted upward or downward trends, important changes in sales data can be identified. For example, understanding a long-term upward trend may mean an increase in market demand, while a long-term downward trend may require corrective action.

[0145] By combining stationarity detection with trend analysis, it is possible to determine whether the data is suitable for trend analysis. This step helps users understand the changing trend of sales more accurately, improves the reliability of trend analysis results, and ensures the scientific nature of decision-making. In trend analysis, not only the slope (reflecting the direction and strength of the sales trend) is calculated, but also the statistical significance of the trend is evaluated through significance tests (such as t-tests and p-values). This measure effectively avoids the risk of drawing wrong conclusions based on noise or accidental fluctuations, improves the scientific nature and credibility of sales trend analysis, and provides solid data support for decision-making.

[0146] S160: Perform outlier detection based on the time series data to obtain an abnormality analysis result and use it as a fourth analysis result.

[0147] In a specific implementation, outlier detection is performed based on time series data to identify abnormal fluctuations or abnormal patterns that may exist in the data.

[0148] When performing outlier detection, a variety of statistical and machine learning techniques can be applied, such as standard deviation-based methods, box plot analysis, and model-based detection algorithms. These methods can effectively identify sales data points that are out of the normal range and further analyze the reasons behind them.

[0149] In a specific embodiment, the quantile() method of the Pandas library can be used to calculate the first quartile Q1 and the third quartile Q3 of the processed data, and the formula is:

[0150] Q1=0.25×(n+1) (4);

[0151] Q3 = 0.75 × (n + 1) (5);

[0152] Wherein, n is a positive integer;

[0153] This step can understand the central position of the data distribution and its dispersion, thereby providing basic information for subsequent outlier detection.

[0154] Based on Q1 and Q3, the interquartile range (IQR) is calculated, and the formula is:

[0155] IQR = Q3 - Q1 (6);

[0156] IQR can effectively measure the range of variation in data, especially data concentrated in the middle 50%.

[0157] To define outliers, the lower boundary lower_bound and upper boundary upper_bound are calculated based on Q1, Q3 and IQR. The formula is:

[0158] lower_bound=Q1-1.5×IQR (7);

[0159] upper_bound=Q3+1.5×IQR (8);

[0160] These boundaries can effectively identify possible outliers in the data and provide quantitative criteria for detection.

[0161] Based on the determined outlier range, outliers that exceed the lower and upper boundaries are filtered out, and the time and specific values ​​of these outliers are recorded.

[0162] After this series of processing, we can get the abnormal analysis results, which can intuitively reflect the abnormal points in the time series data.

[0163] Combined with time windows and category labels, the anomaly detection results are analyzed in multiple dimensions. This approach improves the accuracy of anomaly detection. By dividing the data by time period and grouping by category labels, it is possible to more clearly identify which factors cause the anomaly.

[0164] S170, analyzing the preprocessed data by a classification method to obtain classification dimension distribution data, and analyzing the data to obtain a fifth analysis result;

[0165] In a specific implementation, based on the pre-processed data, a classification method is used to systematically analyze the data to generate classification dimension distribution data. Through this process, the relative distribution of each classification dimension in the data can be identified and understood.

[0166] In the data preparation stage, sales data including classification information and sales amount are extracted from the database in step S110. In step S120, the data is processed using the Pandas library to aggregate sales amount by classification so as to clearly understand the sales performance of each classification.

[0167] extracting categorical sales and total sales from the preprocessed data;

[0168] The classified sales and total sales are obtained by aggregating the sales data including the classified information and sales in the pre-processing process of step S120.

[0169] Calculate the percentage of each category's sales to total sales using the formula:

[0170] Proportion = (category sales / total sales)*100(9);

[0171] The relative contribution of each category is quantified through a formula.

[0172] After the calculation is completed, the categories are sorted by their proportions to quickly identify the best and worst performing categories.

[0173] Extract the highest and lowest categories from the calculation results as the fifth analysis results. These categories not only show the strengths and weaknesses of the business, but also provide a basis for optimizing decisions. In addition, generate visual charts (such as bar charts or pie charts) to display these data to make them more intuitive and easy to understand. Charts can effectively convey information and vividly display analysis results.

[0174] It supports users to customize analysis dimensions according to specific needs, that is, dynamically adjust classification dimensions, such as classifying data by time, category, region, product line, customer type and other different standards, and calculating the sales share of each category. The disclosed embodiment can automatically generate an analysis report based on user customized parameters, provide information such as sales share, category contribution ranking, etc., to help enterprises identify key market factors and high-value customer groups.

[0175] S180. Generate a comprehensive report through visual analysis by combining the first analysis result, the second analysis result, the third analysis result, the fourth analysis result and the fifth analysis result, wherein the comprehensive report is used to interpret the sales data.

[0176] In a specific implementation, when generating this comprehensive report, a variety of visualization tools, such as charts, dashboards, and heat maps, can be used. These visual presentation methods will make complex data more intuitive and facilitate readers to quickly understand key trends and patterns. The analysis results of each part will be presented in a relevant visualization form, highlighting the relationship between various data dimensions and the overall performance, so as to provide a comprehensive interpretation of sales data.

[0177] Through visual analysis and automatic generation of comprehensive reports, a complete process from data processing to analysis results output is provided. The report summarizes the results of each analysis module and provides a comprehensive interpretation of sales data. This method allows complex data analysis results to be presented to business decision makers in a simple and intuitive form, making up for the shortcomings of traditional analysis tools in insufficient presentation of results and vague interpretation. In addition, the customizability of the report also allows users to select key information according to specific needs to more effectively support the decision-making process.

[0178] By automatically generating analysis reports based on user-customized parameters, it can provide important information including sales share, category contribution ranking, etc. The dynamic report generation function based on real-time data enhances the timeliness and effectiveness of decision-making.

[0179] The implementation method of intelligent data interpretation provided by the embodiment of the present disclosure extracts sales data from the data, and after cleaning and aggregation preprocessing, performs multi-dimensional analysis: statistical analysis of specific time data, time series stationarity test, sales trend analysis to obtain the overall sales trend and the longest trend, outlier detection, and classification dimension distribution analysis. These analyses are combined to generate a comprehensive report that fully interprets the sales data. By comprehensively adopting machine models and time series analysis, long-term trends and short-term fluctuations in sales data are intelligently detected and analyzed, which not only improves the accuracy of trend detection, but also adapts to data scenarios of different types and complex dimensions, allowing users to quickly identify and understand the trend changes of data.

[0180] Based on the above embodiments, the present disclosure also provides a device for realizing intelligent interpretation of data, such as Figure 2 As shown, the device for realizing intelligent interpretation of data includes:

[0181] Extraction module 210, used to extract merchant-related sales data from the database;

[0182] The processing module 220 is used to perform preprocessing operations including cleaning and aggregation on the extracted sales data to generate preprocessed data;

[0183] A statistical module 230, configured to perform statistical analysis on the pre-processed data in a specific time period based on the received time range information to obtain a first analysis result;

[0184] The testing module 240 is used to sort the preprocessed data into a time series in chronological order to form time series data, and perform a stationarity test on the time series data to obtain a second analysis result;

[0185] A first analysis module 250 is used to check the overall sales trend based on the preprocessed data, extract the longest trend, and obtain a third analysis result, wherein the longest trend includes the longest rising trend and the longest falling trend;

[0186] A detection module 260, configured to perform outlier detection based on the time series data, obtain an abnormality analysis result and use it as a fourth analysis result;

[0187] The second analysis module 270 is used to perform classification dimension distribution analysis on the pre-processed data by a classification method, calculate the percentage of each classification sales in the total sales, sort them by percentage, and extract the classifications with the highest and lowest percentages as the fifth analysis result;

[0188] The generation module 280 is used to combine the first analysis result, the second analysis result, the third analysis result, the fourth analysis result and the fifth analysis result to generate a comprehensive report through visual analysis, and the comprehensive report is used to interpret the sales data.

[0189] In a specific implementation, the processing module 220 is specifically used to:

[0190] Use the Pandas library to clean the data, including: processing missing values, removing duplicates, and formatting data. The missing values ​​are processed by filling the mean or the median.

[0191] The Pandas library is used for aggregation processing to generate the required statistical information, including total sales and the number of items sold.

[0192] In a specific implementation, the test module is specifically used for:

[0193] Perform ADF test on the time series data to test stationarity;

[0194] Calculate the mean and variance of a time series;

[0195] A KPSS test is performed on the mean and variance of the time series to determine whether the mean and variance of the time series change over time.

[0196] In a specific implementation, the first analysis module is specifically used to:

[0197] Obtaining date and sales from the preprocessed data;

[0198] Calculate the difference in days between dates and use it as the independent variable;

[0199] Using a linear regression model, the slope of the sales trend is calculated based on the difference in days between the dates in the sales data and the sales amount, wherein the positive or negative value of the slope indicates an increasing or decreasing trend in sales, and the absolute value of the slope indicates a rate of change;

[0200] The significance of the trend was assessed by calculating the p-value of the slope;

[0201] By analyzing the sign and size of the slope and combining it with the significance test results, it is possible to determine whether the overall sales trend is rising, falling, or stable.

[0202] In a specific implementation, the first analysis module is specifically used to:

[0203] Obtaining date and sales from the preprocessed data;

[0204] Calculate the percentage change in said sales by said date and mark the trend for each day;

[0205] Group consecutive identical trends, calculate the start and end dates of each trend, and the percentage change in sales during each trend, and obtain the longest upward trend and the longest downward trend;

[0206] Identify and get the longest uptrend and the longest downtrend.

[0207] In a specific implementation, the detection module is specifically used to:

[0208] Using the quantile() method of Pandas, the first quartile and third quartile of the processed data are calculated;

[0209] Calculate the interquartile range (IQR) based on the first quartile and the third quartile;

[0210] Based on the first quartile, the third quartile and the interquartile range, a lower boundary and an upper boundary are calculated to determine an outlier range;

[0211] Filter out abnormal values ​​that exceed the lower boundary and the upper boundary, and record the time and specific value of the abnormal value.

[0212] In a specific implementation, the second analysis module is specifically used to:

[0213] extracting categorical sales and total sales from the preprocessed data;

[0214] Calculate the percentage of each category's sales to total sales;

[0215] Sort by percentage;

[0216] Extract the categories with the highest and lowest proportions as the fifth analysis result;

[0217] It supports users to customize analysis dimensions according to specific needs and classify data according to different standards.

[0218] The device for realizing intelligent interpretation of data provided by the embodiment of the present disclosure realizes automatic processing and intelligent interpretation of sales data by combining a variety of advanced data analysis technologies and machine learning models.

[0219] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0220] The following is an example to illustrate the solution of the embodiment of the present disclosure:

[0221] A merchant selected sales data from August 14, 2024 to August 20, 2024, such as Figure 3 shown.

[0222] Will Figure 3 The sales data in the data is cleaned and aggregated, and then anomaly detection is performed. The analysis data is as follows:

[0223] Descriptive Analysis:

[0224] Total 6 days, start date 2024-08-14, end date 2024-08-20

[0225] The maximum value is 250080.76, which occurs on 2024-08-16; the minimum value is 124134.05, which occurs on 2024-08-20; the average value is 195916.15

[0226] Trend Analysis:

[0227] The coefficient of variation for sales is 0.22, which indicates that the data has moderate volatility.

[0228] Overall trend: downward trend;

[0229] The largest upward trend: from 2024-08-15 00:00:00 to 2024-08-16 00:00:00, an increase of 19.07%;

[0230] The biggest downward trend: from 2024-08-1700:00:00 to 2024-08-2000:00:00, a drop of -48.51%.

[0231] Outlier Detection: No outliers were detected.

[0232] Classification dimension ratio:

[0233] There are 46 categories in total, as follows:

[0234] TOP 3 Categories:

[0235] The sales volume of the category "Jiangxiang" accounts for 33.53%

[0236] The sales of the category "Domestic Beer" accounted for 31.53%

[0237] The sales of the category "domestic cigarettes" accounted for 7.81%

[0238] DOWN 3 categories:

[0239] The sales of the category "Noodles" accounted for 1.00%

[0240] The sales of the category "Meat and Vegetables" accounted for 0.05%

[0241] The sales share of the category "Red wine peripherals" is 0.00%.

[0242] Through the disclosed embodiments of the present invention, the long-term trend and short-term fluctuation of sales data can be intelligently detected and analyzed, and the proportion of each category can be automatically calculated. An analysis report based on user-customized parameters can be automatically generated, providing information such as sales proportion, to help enterprises identify key market factors.

[0243] Please refer to the embodiment for details. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0244] The computer device includes a memory 410 and a processor 420 that are connected to each other through a system bus. It should be noted that the figure only shows a computer device with components 410-420, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0245] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.

[0246] The memory 410 includes at least one type of readable storage medium, and the readable storage medium includes a non-volatile memory or a volatile memory, for example, a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the memory 410 may be an internal storage unit of a computer device, for example, a hard disk or a memory of the computer device. In other embodiments, the memory 410 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card or a flash card (FlashCard) equipped on the computer device. Of course, the memory 410 may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory 410 is generally used to store the operating system and various application software installed on the computer device, such as the program code of the above method. In addition, the memory 410 may also be used to temporarily store various data that have been output or are to be output.

[0247] The processor 420 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 410 is used to store program codes or instructions, the program code includes computer operation instructions, and the processor 420 is used to execute the program codes or instructions stored in the memory 410 or process data, such as running the program code of the above method.

[0248] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0249] Another embodiment of the present application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads a computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or a combination of steps in the above method; and generate a device for implementing the functional actions specified in each block or a combination of blocks in the block diagram.

[0250] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above methods stored in the memory.

[0251] For the definitions of memory and processor, please refer to the description of the aforementioned computer device embodiment and will not be repeated here.

[0252] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0253] Each functional unit or module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0254] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0255] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.

[0256] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present application can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for purposes of illustration only and are not intended to limit the scope of the present application.

[0257] Several embodiments of the present disclosure are described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the attached claims.

Claims

1. A method for realizing intelligent interpretation of data, characterized in that: include: Extract merchant-related sales data from the database; Performing preprocessing operations including cleaning and aggregation on the extracted sales data to generate preprocessed data; Based on the received time range information, statistically analyze the preprocessed data in a specific time period to obtain a first analysis result; Arranging the preprocessed data into a time series in chronological order to form time series data, and performing a stationarity test on the time series data to obtain a second analysis result; Based on the preprocessed data, checking the overall sales trend, extracting the longest trend, and obtaining a third analysis result, wherein the longest trend includes the longest rising trend and the longest falling trend; Based on the time series data, outlier detection is performed to obtain an abnormal analysis result and use it as a fourth analysis result; Performing classification dimension distribution analysis on the preprocessed data by a classification method, and extracting the classifications with the highest and lowest proportions as the fifth analysis result; A comprehensive report is generated through visual analysis based on the first analysis result, the second analysis result, the third analysis result, the fourth analysis result and the fifth analysis result, and the comprehensive report is used to interpret the sales data.

2. The method according to claim 1, characterized in that The step of performing pre-processing operations including cleaning and aggregating the extracted sales data comprises: Use the Pandas library to clean the data, including: processing missing values, removing duplicates, and formatting data. The missing values ​​are processed by filling the mean or the median. The Pandas library is used for aggregation processing to generate the required statistical information, including total sales and the number of items sold.

3. The method according to claim 1, characterized in that The step of performing a stationarity test on the time series data comprises: Perform ADF test on the time series data to test stationarity; Calculate the mean and variance of a time series; A KPSS test is performed on the mean and variance of the time series to determine whether the mean and variance of the time series change over time.

4. The method according to claim 1, characterized in that: The step of checking the overall sales trend based on the pre-processed data comprises: Obtaining date and sales from the preprocessed data; Calculate the difference in days between dates and use it as the independent variable; Using a linear regression model, the slope of the sales trend is calculated based on the difference in days between the dates in the sales data and the sales amount, wherein the positive or negative value of the slope indicates an increasing or decreasing trend in sales, and the absolute value of the slope indicates a rate of change; The significance of the trend was assessed by calculating the p-value of the slope; By analyzing the sign and size of the slope and combining it with the significance test results, it is possible to determine whether the overall sales trend is rising, falling, or stable.

5. The method according to claim 1, characterized in that The step of extracting the longest trend based on the preprocessed data comprises: Obtaining date and sales from the preprocessed data; Calculate the percentage change in said sales by said date and mark the trend for each day; Group consecutive identical trends, calculate the start and end dates of each trend, and the percentage change in sales during each trend, and obtain the longest upward trend and the longest downward trend; Identify and get the longest uptrend and the longest downtrend.

6. The method according to claim 1, characterized in that The step of performing outlier detection based on the time series data comprises: Calculating the first quartile and the third quartile of the processed data; Calculate the interquartile range (IQR) based on the first quartile and the third quartile; Based on the first quartile, the third quartile and the interquartile range, a lower boundary and an upper boundary are calculated to determine an outlier range; Filter out abnormal values ​​that exceed the lower boundary and the upper boundary, and record the time and specific value of the abnormal value.

7. The method according to claim 1, characterized in that The step of performing classification dimension distribution analysis on the preprocessed data by a classification method, and extracting the classifications with the highest and lowest proportions as the fifth analysis result includes: extracting categorical sales and total sales from the preprocessed data; Calculate the percentage of each category's sales to total sales as the share; Sort by the size of the proportion; Extracting the highest and lowest categories of the proportion as the fifth analysis result; It supports users to customize analysis dimensions according to specific needs and classify data according to different standards.

8. A device for realizing intelligent interpretation of data, characterized in that: include: An extraction module, used to extract merchant-related sales data from the database; A processing module, used for performing preprocessing operations including cleaning and aggregation on the extracted sales data to generate preprocessed data; A statistical module, configured to perform statistical analysis on the preprocessed data in a specific time period based on the received time range information to obtain a first analysis result; A testing module, used for arranging the preprocessed data into a time series in chronological order to form time series data, and performing a stationarity test on the time series data to obtain a second analysis result; A first analysis module is used to check the overall sales trend based on the preprocessed data, extract the longest trend, and obtain a third analysis result, wherein the longest trend includes the longest rising trend and the longest falling trend; A detection module, configured to perform outlier detection based on the time series data, obtain an abnormality analysis result and use it as a fourth analysis result; A second analysis module is used to perform classification dimension distribution analysis on the preprocessed data by a classification method, and extract the classifications with the highest and lowest proportions as the fifth analysis result; A generation module is used to combine the first analysis result, the second analysis result, the third analysis result, the fourth analysis result and the fifth analysis result to generate a comprehensive report through visual analysis to provide a comprehensive interpretation of the sales data.

9. A computer device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

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