Business processing method, device, equipment and storage medium
Through feature decomposition and correlation random data filling technology, the sales prediction accuracy of long-tail SKU is improved, the problem of low prediction accuracy in the existing technology is solved, and the warehousing cost is reduced.
Patent Information
- Application Number
- CN201911244837.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-06
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2039-12-06
AI Technical Summary
When predicting the sales of long-tail SKUs, the prediction accuracy is low, resulting in higher warehousing costs.
By receiving service requests, target long-tail data is determined, feature decomposition is performed based on the pre-obtained diagonal matrix and correlation matrix, and a standardized feature vector is obtained to fill the zero value in the long-tail data, thereby predicting the sales volume of each item.
It improves the sales forecast accuracy of long-tail SKUs, increases the amount of information of long-tail data, and reduces warehousing costs.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a business processing method, device, equipment and storage medium. Background Art
[0002] Long-tail data refers to the sales data of product SKUs (Stock Keeping Units) with relatively small daily sales. However, due to the large number of categories, the total sales and revenue are quite considerable over time. Usually, long-tail SKUs occupy a large share in certain categories. For example, in the household daily necessities category, more than 60% of SKUs have daily sales near "zero" all year round.
[0003] At present, it is usually necessary to predict the sales volume of each product and prepare warehousing according to the prediction results. Since the daily sales data of long-tail SKUs is basically zero and contains less information, the prediction accuracy is low when making predictions, and the prediction results are not accurate enough, which easily leads to high warehousing costs. Summary of the invention
[0004] The present application provides a business processing method, device, equipment and storage medium to solve the defects of the prior art such as low accuracy of product sales forecasting resulting in high cost.
[0005] The first aspect of the present application provides a method for processing a service, including:
[0006] receiving a service request, wherein the service request includes service data;
[0007] Determine target long-tail data according to the business data;
[0008] Determine a correlation matrix corresponding to the target long-tail data according to the target long-tail data and a pre-obtained diagonal matrix;
[0009] Decomposing the correlation matrix based on eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix;
[0010] Determine the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector;
[0011] Determining the sales volume of each item included in the target long-tail data based on the relevant random data;
[0012] The business request is responded to based on the sales volume of each item.
[0013] Optionally, determining the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector includes:
[0014] Determining a KL expansion cutoff term threshold based on the diagonal matrix and the standardized eigenvector;
[0015] Determine a target random variable based on the KL expansion cutoff term threshold;
[0016] Based on the target random variable, the correlation random data is determined.
[0017] Optionally, the receiving a service request includes:
[0018] Receive a business request sent by the main server, where the business data includes historical sales data of products that need to be processed by the slave server.
[0019] Optionally, determining target long-tail data according to the business data includes:
[0020] Determine historical sales data of items whose sales volume is less than a preset condition based on the business data;
[0021] The historical sales data of items whose sales volume is less than a preset condition is used as the target long-tail data.
[0022] Optionally, determining the sales volume of each item included in the target long-tail data based on the correlation random data includes:
[0023] Based on the relevant random data, a pre-trained prediction model is used to determine the sales volume of each item included in the target long-tail data.
[0024] Optionally, before determining the sales volume of each item included in the target long-tail data by using a pre-trained prediction model based on the relevant random data, the method further includes:
[0025] Get training data;
[0026] The pre-trained prediction model is obtained by training based on the training data.
[0027] Optionally, responding to the business request based on the sales volume of each item includes:
[0028] Send the sales volume of each item to the main server.
[0029] A second aspect of the present application provides a service processing device, including:
[0030] A receiving module, used for receiving a service request, wherein the service request includes service data;
[0031] An acquisition module, used to determine target long-tail data according to the business data;
[0032] A determination module, used to determine a correlation matrix corresponding to the target long-tail data according to the target long-tail data and a pre-acquired diagonal matrix;
[0033] A processing module, configured to decompose the correlation matrix based on eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix; determine the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector; and determine the sales volume of each item included in the target long-tail data based on the correlation random data;
[0034] The sending module is used to respond to the business request based on the sales volume of each item.
[0035] Optionally, the processing module is specifically used to:
[0036] Determining a KL expansion cutoff term threshold based on the diagonal matrix and the standardized eigenvector;
[0037] Determine a target random variable based on the KL expansion cutoff term threshold;
[0038] Based on the target random variable, the correlation random data is determined.
[0039] Optionally, the receiving module is specifically used to:
[0040] Receive a business request sent by the main server, where the business data includes historical sales data of products that need to be processed by the slave server.
[0041] Optionally, the acquisition module is specifically used to:
[0042] Determine historical sales data of items whose sales volume is less than a preset condition based on the business data;
[0043] The historical sales data of items whose sales volume is less than a preset condition is used as the target long-tail data.
[0044] Optionally, the confirmation processing module is specifically used to:
[0045] Based on the relevant random data, a pre-trained prediction model is used to determine the sales volume of each item included in the target long-tail data.
[0046] Optionally, the processing module is further used to:
[0047] Get training data;
[0048] The pre-trained prediction model is obtained by training based on the training data.
[0049] Optionally, the sending module is specifically used to:
[0050] Send the sales volume of each item to the main server.
[0051] A third aspect of the present application provides an electronic device, comprising: at least one processor and a memory;
[0052] The memory stores computer-executable instructions;
[0053] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.
[0054] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.
[0055] The business processing method, device, equipment and storage medium provided by this application are through. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0057] Figure 1 This is a schematic diagram of the architecture of the processing system on which the embodiments of the present application are based;
[0058] Figure 2 A flowchart of a method for processing a service provided in an embodiment of the present application;
[0059] Figure 3 A flowchart of a method for processing a service provided by another embodiment of the present application;
[0060] Figure 4 A simple schematic diagram of a training process provided in an embodiment of the present application;
[0061] Figure 5 A flowchart of another method for processing a service provided by another embodiment of the present application is provided;
[0062] Figure 6 A schematic diagram of the structure of a service processing device provided in an embodiment of the present application;
[0063] Figure 7A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0064] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0066] First, the terms involved in this application are explained:
[0067] Eigendecomposition: Eigendecomposition, also known as spectral decomposition, is a method of decomposing a matrix into the product of matrices represented by its eigenvalues and eigenvectors. Eigendecomposition can only be applied to diagonalizable matrices.
[0068] Karhunen–Loève (KL) expansion: It is a theory of random processes, which describes random processes as linear combinations of infinite orthogonal functions. In this application, KL expansion is implemented based on eigendecomposition, that is, the formula for decomposing the correlation matrix based on eigendecomposition is as follows:
[0069]
[0070] Among them, ∑ XX represents the correlation matrix, λ i represents the non-zero eigenvalues of the correlation matrix, v i Represents λ i The corresponding normalized eigenvector, Indicates v i The transpose of , n represents the number of non-zero eigenvalues of the correlation matrix, that is, the correlation matrix is expanded into n items based on eigendecomposition, which is called the KL expansion item.
[0071] Covariance Matrix: This refers to the matrix of correlation combinations of sales of different SKUs in daily, weekly or monthly dimensions.
[0072] Nataf Transformation: A distribution transformation method based on CDF that converts the original data into the required distribution space.
[0073] Random Variable: A parameter that has a random variation property, as opposed to a constant.
[0074] Independent and Identical Distribution: Two or more distributions with the same shape without any correlation.
[0075] The business processing method provided in the embodiment of the present application is applicable to, but not limited to, the application scenario of determining future sales volume for product stocking. Figure 1As shown, it is a schematic diagram of the architecture of the processing system based on the embodiment of the present application. The processing system may include a server and a terminal, wherein the server may be a server cluster, and the server cluster performs business processing based on a distributed manner. The server cluster may include a master server and a slave server. Relevant personnel may send a product sales request to the server cluster through the terminal, requesting the future sales of the product (or item) to be prepared, and the product sales request may include a product identification, such as a product SKU. The master server in the server cluster may receive the product sales request sent by the terminal, and obtain the original business data corresponding to the product identification according to the product sales request, and the original business data may be the historical sales data of each product in a preset time period before the current. After the master server obtains the original business data, it divides the original business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and divides it into multiple business data, and sends a business request to each slave server. For each slave server, the business request sent by the master server to it includes the business data that the slave server is responsible for. The slave server receives the business request sent by the master server, and can determine the target long-tail data according to the business data, for example, according to the daily sales of each product in the business data and the preset threshold, determine the sales of products with smaller sales, and use the sales of these products as the target long-tail data. According to the target long-tail data and the pre-obtained diagonal matrix, determine the correlation matrix corresponding to the target long-tail data, decompose the correlation matrix based on the eigendecomposition, obtain the standardized eigenvector corresponding to the correlation matrix, determine the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector, determine the sales of each item included in the target long-tail data based on the correlation random data, and respond to the business request of the master server based on the sales of each item. After receiving the responses from each slave server, the master server integrates them to obtain the sales of all items requested by the terminal, and feeds them back to the terminal so that the relevant personnel can prepare the goods according to the sales of the items. Among them, if the original business data includes the business data of items with higher sales, the master server can predict its future sales according to the existing prediction method, or it can be distributed to each slave server for prediction. It can be set according to actual needs, and this application does not limit it.
[0076] Optionally, if the daily sales of these products are very sparse, the sales of these products can be aggregated to a weekly or monthly dimension, and the sales of these products can be predicted based on the above method. In this case, the predicted sales of these products are also in a weekly or monthly dimension, and can be expanded and restored to daily sales based on the proportion of the historical daily sales of these products in a week or a month.
[0077] Optionally, the master server can also determine the part with smaller sales volume based on the original business data, split it and send business requests to each slave server. Then the business data included in the business request is the business data of the product with smaller sales volume, and the slave server determines the target long-tail data based on the business data.
[0078] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0079] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0080] Embodiment 1
[0081] This embodiment provides a business processing method for product sales forecasting business processing when preparing products. The execution subject of this embodiment is a business processing device, which can be set in a server or in a slave server of a server cluster.
[0082] like Figure 2 FIG. 1 is a flow chart of a method for processing a service provided in this embodiment, the method comprising:
[0083] Step 101: Receive a service request, where the service request includes service data.
[0084] The service processing device may receive a service request sent by a terminal or other server, wherein the service request includes service data that the service processing device needs to process.
[0085] Exemplarily, the business processing device is set in a slave server in a server cluster, and can receive business requests sent by a master server. Specifically, relevant personnel can send product sales requests to the server cluster through a terminal, requesting the future sales of products to be prepared, and the product sales request may include a product identifier, such as a product SKU. The master server in the server cluster can receive the product sales request sent by the terminal, and obtain the original business data corresponding to the product identifier according to the product sales request. The original business data can be the historical sales data of each product in a preset time period before the current time. After the master server obtains the original business data, it divides the original business data into multiple business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and sends a business request to each slave server. For each slave server, the business request sent by the master server to it includes the business data that the slave server is responsible for.
[0086] Step 102: determine target long-tail data according to the business data.
[0087] Specifically, after receiving a business request, business data can be obtained from the business request, and target long-tail data can be determined based on the business data. The target long-tail data can include the historical daily sales of each item, specifically the historical daily sales of each item in a preset time period before the current time.
[0088] Exemplarily, when a slave server receives a business request sent by a main server, the target long-tail data can be determined based on the business data. For example, the sales volume of products with lower sales volume can be determined based on the daily sales volume of each product in the business data and a preset threshold, and the sales volume of these products can be used as the target long-tail data.
[0089] Optionally, the master server can also determine the part with smaller sales volume based on the original business data, split it and send business requests to each slave server. The business data included in the business request is the business data of the product with smaller sales volume. The slave server determines the target long-tail data based on the business data, taking the weekly or monthly dimension as the daily sales volume of the product.
[0090] Optionally, if the daily sales of these products are very sparse, the daily sales of these products can also be aggregated to the weekly dimension or monthly dimension as the target long-tail data. In this case, the predicted sales of these products are also in the weekly dimension or monthly dimension. Based on the proportion of the historical daily sales of these products in a week or a month, they can be expanded and restored to daily sales.
[0091] For example, taking a product as an example, the daily sales volume of the product in the first and second weeks of October is [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]. The daily sales volume for 14 days is highly random and discrete, so we can aggregate it to weeks and obtain the weekly sales volume of the product in the first and second weeks of October as [1,1]. [1,1] is used as the target long-tail data for the product.
[0092] It should be noted that in a prediction, the data used for each item, whether it is daily sales, weekly sales or monthly sales, must be consistent. That is, if daily sales are used, then each item should use daily sales; if weekly sales are used, then all items should use weekly sales. It is not possible for some products to use daily sales and some products to use weekly sales.
[0093] Step 103, determining a correlation matrix corresponding to the target long-tail data according to the target long-tail data and the pre-obtained diagonal matrix.
[0094] Specifically, after the target long-tail data is determined, the correlation matrix corresponding to the target long-tail data may be determined according to the target long-tail data and a pre-obtained diagonal matrix.
[0095] The pre-obtained diagonal matrix can be obtained by pre-setting an initial diagonal matrix and training based on the historical sales data of the items included in the target long-tail data. For example, the first historical sales data corresponding to the item can be obtained as the training long-tail data, and the second historical sales data can be used as the result (or labeled data) of the future sales predicted based on the first historical sales data. The first correlation random data is obtained according to the above steps based on the initial diagonal matrix and the first historical sales data. The first sales of the items included in the training long-tail data are determined based on the first correlation random data. The first sales are compared with the second historical sales data. An error threshold can be set. When the error is large, the initial diagonal matrix is adjusted according to the preset adjustment rules to obtain the first diagonal matrix. The above process is repeated, and the diagonal matrix is continuously adjusted until the prediction result meets the requirements. Then, the final diagonal matrix, that is, the pre-obtained diagonal matrix mentioned above, can be obtained. The diagonal matrix is a matrix composed of non-zero eigenvalues of the correlation matrix.
[0096] Step 104, decomposing the correlation matrix based on eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix.
[0097] Specifically, after obtaining the correlation matrix, the correlation matrix can be decomposed based on eigendecomposition to obtain the standardized eigenvector corresponding to the correlation matrix. Specifically, the KL expansion of the correlation matrix is implemented based on eigendecomposition to expand the correlation matrix into n items, where n represents the number of non-zero eigenvalues of the correlation matrix.
[0098] Exemplarily, the formula for decomposing the correlation matrix based on eigendecomposition is as follows:
[0099]
[0100] Among them, ∑ XX represents the correlation matrix, λ i represents the non-zero eigenvalues of the correlation matrix, v i Represents λ i The corresponding normalized eigenvector, Indicates v i The transpose of , n represents the number of non-zero eigenvalues of the correlation matrix, that is, the correlation matrix is expanded into n items based on eigendecomposition, which can be called KL expansion items.
[0101] Step 105, based on the diagonal matrix and the standardized eigenvectors, determine the correlation random data corresponding to the target long-tail data.
[0102] Specifically, after the standardized eigenvector of the correlation matrix is determined, the correlation random data corresponding to the target long-tail data can be obtained based on the diagonal matrix and the standardized eigenvector.
[0103] The correlation random data corresponding to the target long-tail data refers to the random data obtained after performing correlation random filling processing on the target long-tail data, and filling the "zero value data" in the target long-tail data to increase the information content of the target long-tail data.
[0104] Step 106, based on the correlated random data, determine the sales volume of each item included in the target long-tail data.
[0105] Specifically, after obtaining the correlation random data corresponding to the target long-tail data, the sales volume of each item included in the target long-tail data can be determined based on the correlation random data. Specifically, the correlation random data replaces the target long-tail data as input data for predicting the sales volume of each item included in the target long-tail data, and is input into the trained sales prediction model to obtain the sales volume of each item included in the target long-tail data.
[0106] Optionally, if the daily sales of each product are aggregated to a weekly or monthly dimension when making a forecast, after obtaining the forecast results, if the predicted daily sales of these products are desired, they can be expanded and restored to daily sales based on the proportion of the historical daily sales of these products within a week or a month.
[0107] For example, the daily sales of a product in the first and second weeks of October are [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], and the weekly sales in the weekly dimension are [1, 1]. Taking [1, 1] as the target long-tail data of the product, the prediction result is [2, 3]. The historical daily sales of the product can be obtained. For example, the historical daily sales of the product in 8 weeks in August and September are summed up. The daily sales on Mondays and Tuesdays in these 8 weeks are summed up, and so on. The comprehensive value of the daily sales on each day of the week is obtained, for example, [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday] = [2, 4, 3, 6, 3, 1, 5]. Based on the proportion of the comprehensive value of daily sales on each day (taking Monday as an example, its proportion is 2 / (2+4+3+6+3+1+5) = 2 / 24), [2, 3] is expanded into 14-dimensional daily sales:
[0108] [2*2 / 24,2*4 / 24,2*3 / 24,…,3*1 / 24,3*5 / 24]
[0109] It should be noted that this is only an exemplary description, and the specific method of restoring from the weekly dimension or the monthly dimension to the daily dimension can be set according to actual needs, and this embodiment does not limit it.
[0110] Step 107, responding to the business request based on the sales volume of each item.
[0111] Specifically, after determining the sales volume of the items, the business request of the main server can be responded to based on the sales volume of each item, so that after receiving the responses from each slave server, the main server integrates them to obtain the sales volume of all products requested by the terminal, and feeds back to the terminal so that relevant personnel can prepare stocks according to the sales volume of the products.
[0112] Among them, if the original business data includes business data of products with higher sales, the main server can predict its future sales based on existing prediction methods, or it can be distributed to each slave server for prediction. The specific settings can be based on actual needs and are not limited in this application.
[0113] The business processing method provided in this embodiment determines the target long-tail data according to the business data included in the business request after receiving the business request, and determines the correlation matrix corresponding to the target long-tail data according to the target long-tail data and the pre-obtained diagonal matrix, and then decomposes the correlation matrix based on characteristic decomposition to obtain the standardized eigenvector corresponding to the correlation matrix, and determines the correlation random number corresponding to the target long-tail data based on the pre-obtained diagonal matrix and the standardized eigenvector, and determines the sales volume of each item included in the target long-tail data based on the correlation random data. Since the zero-value data in the long-tail data is filled with non-zero values and used to predict the future sales volume of the item, the amount of information contained in the long-tail data is increased, and the accuracy of the prediction of the future sales volume of the product is improved, thereby reducing the storage cost.
[0114] Embodiment 2
[0115] This embodiment further supplements the method provided in the first embodiment.
[0116] like Figure 3 The figure is a flow chart of a method for processing a service provided in this embodiment.
[0117] As an implementable manner, based on the above embodiment, optionally, the correlation random data corresponding to the target long-tail data is determined based on the diagonal matrix and the standardized eigenvector, specifically including:
[0118] Step 1051, determining a KL expansion truncation term threshold based on the diagonal matrix and the standardized eigenvector.
[0119] Step 1052: determine the target random variable based on the KL expansion cutoff term threshold.
[0120] Step 1053, determine the correlation random data based on the target random variable.
[0121] Specifically, after determining the standardized eigenvector corresponding to the correlation matrix, the KL expansion truncation term threshold of the correlation matrix can be determined based on the pre-obtained diagonal matrix and the standardized eigenvector, the target random variable can be determined based on the KL expansion truncation term threshold, the correlation random data can be determined based on the target random variable, the sales volume of each item included in the target long-tail data can be determined based on the obtained correlation random data, and the business request can be responded to based on the sales volume of each item.
[0122] For example, based on the target long-tail data, the correlation matrix ∑ between different SKUs is obtained. XX At the same time, the daily sales of different SKUs can be considered to be independent and identically distributed. Considering that zero-day sales represent no sales, it can also be understood as sales less than 1. The following will generate random numbers between 0 and 1 through feature decomposition to fill the "zero-value data" in the target long-tail data, which can also be understood as "potential sales".
[0123] First, for the n×1 vector e consisting of the target long-tail data k (which can be called a long-tail data sample vector, which includes n sample values) and a preset diagonal matrix (i.e., a pre-obtained diagonal matrix) Λ = diag[λ 1 ,λ2,…,λ n ], the following equation holds:
[0124] ∑ XX e k =Λe k Formula 1
[0125] Among them, λ i is the correlation matrix∑ XX According to the vector e k and the preset diagonal matrix Λ=diag[λ 1 ,λ2,…,λ n ] can determine the correlation matrix ∑ XX .
[0126] The Karhunen–Loève (KL) expansion can be defined as a decomposition of the correlation matrix:
[0127]
[0128] Among them, v i is the standardized λ i The corresponding normalized feature vector.
[0129] After determining the correlation matrix ∑ XX After that, the standardized feature vector v can be determined according to Formula 2 i .
[0130] A random variable can be expressed as:
[0131]
[0132] where μ X represents the mean of the random variable X. In the embodiments of the present application, μ X = 0; X~N(0,1) follows a standard normal distribution, and X i represents the output term of the normal distribution, that is, a scalar value randomly taken from the normal distribution. If the long-tail data sample follows a standard normal distribution, X i can also be the above long-tail data sample value.
[0133] However, since long-tail data samples usually do not follow a normal distribution, in order to perform correlation random filling on the target long-tail data, here X i is a scalar value randomly taken from the normal distribution, 0 < X i < 1.
[0134] Usually in actual operations, in order to reduce the computational amount, it is not necessary to obtain all n KL expansion terms. Only M terms (M < n) need to be obtained to obtain a truncated approximation value.
[0135]
[0136] M can be called the KL expansion truncation term threshold. The M terms need to ensure that the truncation error is less than a preset value, such as 0.05. The truncation error is defined as:
[0137]
[0138] where Var represents the variance.
[0139] After determining the standardized eigenvector v i then the KL expansion truncation term threshold M can be determined according to Formula Five and the truncation error being less than the preset threshold (0.05). After determining M, the target random variable can be determined according to M and Formula Four
[0140] Since X follows a standard normal distribution, to obtain a number between 0 and 1, it is also necessary to transform the number to between 0 and 1 according to the Nataf transformation. For example, a transformation from the normal distribution to a uniform distribution between 0 and 1 can be performed, and then the cumulative probability (Cumulative Density Function, CDF) can be calculated:
[0141]
[0142] in, That is the vector e k Corresponding correlation random data.
[0143] based on And formula six to determine the correlation of random data
[0144] For example, the vector e k for:
[0145]
[0146] The final e k The corresponding correlation random data is:
[0147]
[0148] After determining the correlation random number, the sales volume of each item included in the target long-tail data is determined based on the correlation random data. Specifically, based on the correlation random data, a pre-trained prediction model is used to determine the sales volume of each item included in the target long-tail data, and based on the sales volume of each item, the business request is responded to.
[0149] The pre-trained prediction model may be a pre-trained XGBoost model, an LR model, or the like.
[0150] The prediction model can be obtained by training with training data. The training data can include training random data and training annotated data. The training random data can be training correlation random data obtained by using the first historical sales data corresponding to the item through the above steps. The training annotated data can be the second historical sales data, that is, the actual sales data compared with the prediction result based on the training correlation random data according to preset rules. The specific training process is similar to the prior art and will not be repeated here.
[0151] Optionally, during the training process, the prediction results obtained based on the training correlation random data (i.e., the long-tail data after correlation random filling processing) can also be compared with the prediction results obtained based on the original long-tail data prediction, and the diagonal matrix is adjusted according to the comparison results until the final diagonal matrix (i.e., the pre-obtained diagonal matrix) is obtained so that the prediction results are better than the prediction results obtained based on the original long-tail data. Figure 4 As shown, it is a simple schematic diagram of the training process provided by this embodiment. Taking the aggregation to the weekly dimension or the monthly dimension as an example, the details are as follows:
[0152] 1. Training data input
[0153] The training data includes historical sales data of a batch of products, which may specifically include first historical sales data (such as sales data of 10 products in May) and second historical sales data (sales data of the above 10 products in June).
[0154] 2. Target SKUs with low sales volume
[0155] That is, products with low sales volume are identified based on historical sales data, and their corresponding sales volume data are aggregated into weekly or monthly dimensions as training long-tail data.
[0156] 3. Calculate the correlation matrix of SKU in weekly or monthly dimensions
[0157] That is, determine the correlation matrix of the training long-tail data (for the sake of distinction, it can be called the training correlation matrix).
[0158] 4. Calculate the eigenvalues and normalized eigenvectors of the correlation matrix.
[0159] That is, the training correlation matrix is decomposed based on the eigendecomposition to obtain the standardized eigenvalues and standardized eigenvectors.
[0160] 5. Generate random numbers with correlation
[0161] That is, generate training-related random numbers.
[0162] 6. Use existing models to make predictions.
[0163] During the training process, the training results can be verified through test data, and the training parameters can be continuously adjusted according to the verification results, and the training parameters can be adjusted while training, so that the final test results meet the requirements.
[0164] 7. Compare with the original model
[0165] By processing the training and test data, it is also necessary to compare with the original prediction model. If the training results are not as good as the original model, the relevant random numbers can be regenerated until the prediction results of the generated data are improved relative to the prediction accuracy of the original model, and then the prediction results can be output.
[0166] Because a series of random data is generated through the correlation between SKUs, more information is added to the "zero-value data" of the long-tail data, thereby effectively improving the prediction accuracy and robustness.
[0167] As another practicable manner, based on the above embodiment, optionally, step 101 specifically includes:
[0168] Step 1011, receiving a business request sent by the main server, the business data includes the historical sales data of the product that needs to be processed by the slave server.
[0169] Specifically, the business request may be sent by the master server. According to the distributed service architecture, the master server receives product sales requests sent by the terminal or other servers, and requests the future sales of the products to be prepared. The product sales request may include a product identifier, such as a product SKU. The master server in the server cluster can receive the product sales request sent by the terminal, and obtain the original business data corresponding to the product identifier according to the product sales request. The original business data may be the historical sales data of each product in a preset time period before the current time. After the master server obtains the original business data, it divides the original business data into multiple business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and sends a business request to each slave server. The business data includes the historical sales data of the products that the slave server needs to process.
[0170] As another practicable manner, based on the above embodiment, optionally, step 102 specifically includes:
[0171] Step 1021, based on the business data, determine the historical sales data of the items whose sales volume is less than a preset condition.
[0172] Step 1022, taking the historical sales data of items whose sales volume is less than a preset condition as target long-tail data.
[0173] Specifically, the business data may not be limited to the historical sales data of products with low sales volume, but may also include the historical sales data of products with high sales volume. After receiving the business request, the historical sales data of items whose sales volume is less than the preset condition may be located according to the business data, and the historical sales data of products whose sales volume is greater than the preset condition may be directly predicted according to the existing prediction model to obtain the sales volume of these products. The historical sales data of items whose sales volume is less than the preset condition is used as the target long-tail data, and needs to be randomly filled with correlation to improve the accuracy and effectiveness of its prediction results.
[0174] As another practicable manner, based on the above embodiment, optionally, determining the sales volume of each item included in the target long-tail data based on the correlation random data may specifically include:
[0175] Step 1061, based on the correlated random data, using a pre-trained prediction model, determine the sales volume of each item included in the target long-tail data.
[0176] Specifically, the training correlation random data can be obtained based on the earlier historical sales data of the item, and the established model can be trained to obtain a trained prediction model. For example, if the sales volume of an item in November needs to be predicted, and the target long-tail data required is the historical sales data of the item in October, then the historical sales data of the item in September can be used as the training feature data (i.e., the original long-tail data used to obtain the training correlation random data), and the historical sales data of the item in October can be used as the training annotation data. The specific settings can be based on actual needs, and this embodiment will not be repeated.
[0177] Optionally, before determining the sales volume of each item included in the target long-tail data by using a pre-trained prediction model based on the relevant random data, the method further includes:
[0178] Step 2011, obtaining training data.
[0179] Step 2012: Perform training based on the training data to obtain a pre-trained prediction model.
[0180] The specific training process has been described in detail above and will not be repeated here.
[0181] As another practicable manner, based on the above embodiment, optionally, step 105 may specifically include:
[0182] Step 1071, send the sales volume of each item to the main server.
[0183] Specifically, after determining the sales volume of an item, the slave server can respond to the business request of the main server and send the sales volume of the item to the main server, so that the main server can integrate the results of each slave server to respond to the request of the terminal or other servers, so that relevant personnel can obtain the sales volume of the products they need and prepare the goods.
[0184] As another practicable manner, based on the above embodiment, optionally, as Figure 5 As shown, it is a flow chart of another method for processing a service provided by this implementation. This implementation takes the scenario of a server cluster providing a product sales forecast as an example. The method for processing this service specifically includes:
[0185] Step 2021: The main server receives a product sales request sent by the terminal, where the product sales request includes a product identifier.
[0186] Step 2022: The main server obtains original business data corresponding to the product identifier according to the product sales request.
[0187] The original business data may be the historical sales data of each product in a preset time period before the current time.
[0188] In step 2023, the master server divides the original business data into multiple business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and sends a business request to each slave server.
[0189] Step 2024: The slave server receives a service request sent by the master server, where the service request includes service data.
[0190] Specifically, each service request received from the server includes service data that the slave server needs to process.
[0191] Step 2025, determine the target long-tail data from the server based on the business data.
[0192] Step 2026, the slave server determines the correlation matrix corresponding to the target long-tail data based on the target long-tail data and the pre-acquired diagonal matrix.
[0193] Step 2027, the slave server decomposes the correlation matrix based on eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix.
[0194] Step 2028, the slave server determines the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector.
[0195] Step 2029, the server determines the sales volume of each item included in the target long-tail data based on the relevant random data.
[0196] Step 2030, the slave server sends the sales volume of each item to the master server.
[0197] Step 2031, the main server receives the sales volume of each item fed back by each slave server.
[0198] Step 2032: the main server integrates the sales volume of each item fed back by each slave server to obtain an integrated result.
[0199] Step 2033: the main server sends the integration result to the terminal.
[0200] Among them, products are items.
[0201] Specifically, a server cluster can be used to provide product sales forecasting services, and the server cluster may include a master server and a slave server. Relevant personnel can send a product sales request to the server cluster through a terminal, requesting the future sales of products (or items) to be prepared, and the product sales request may include a product identifier, such as a product SKU. The master server in the server cluster can receive the product sales request sent by the terminal, and obtain the original business data corresponding to the product identifier according to the product sales request. The original business data may be the historical sales data of each product in a preset time period before the current time. After the master server obtains the original business data, it divides the original business data into multiple business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and sends a business request to each slave server. For each slave server, the business request sent by the master server to it includes the business data that the slave server is responsible for. The slave server receives the business request sent by the master server, and can determine the target long-tail data according to the business data, for example, according to the daily sales of each product in the business data and the preset threshold, determine the sales of products with smaller sales, and use the sales of these products as the target long-tail data. According to the target long-tail data and the pre-obtained diagonal matrix, determine the correlation matrix corresponding to the target long-tail data, decompose the correlation matrix based on the eigendecomposition, obtain the standardized eigenvector corresponding to the correlation matrix, determine the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector, determine the sales of each item included in the target long-tail data based on the correlation random data, and respond to the business request of the master server based on the sales of each item. After receiving the responses from each slave server, the master server integrates them to obtain the sales of all items requested by the terminal, and feeds them back to the terminal so that the relevant personnel can prepare the goods according to the sales of the items. Among them, if the original business data includes the business data of items with higher sales, the master server can predict its future sales according to the existing prediction method, or it can be distributed to each slave server for prediction. It can be set according to actual needs, and this application does not limit it.
[0202] It should be noted that the specific operations of steps 2021-2033 are consistent with those in the aforementioned embodiment or real-time method. The real-time method is only illustrative of the scenario in which a server cluster provides services. For specific operations, please refer to the aforementioned content and will not be repeated here.
[0203] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any manner without conflict, and this application is not limited thereto.
[0204] The business processing method provided in this embodiment determines the target long-tail data according to the business data included in the business request after receiving the business request, and determines the correlation matrix corresponding to the target long-tail data according to the target long-tail data and the pre-obtained diagonal matrix, and then decomposes the correlation matrix based on characteristic decomposition to obtain the standardized eigenvector corresponding to the correlation matrix, and determines the correlation random number corresponding to the target long-tail data based on the pre-obtained diagonal matrix and the standardized eigenvector, and determines the sales volume of each item included in the target long-tail data based on the correlation random data. Since the zero-value data in the long-tail data is filled with non-zero values and used to predict the future sales volume of the item, the amount of information contained in the long-tail data is increased, and the accuracy of the prediction of the future sales volume of the product is improved, thereby reducing the storage cost.
[0205] Embodiment 3
[0206] This embodiment provides a service processing device, which is used to execute the method of the above-mentioned embodiment 1.
[0207] like Figure 6 , which is a schematic diagram of the structure of the service processing device provided in this embodiment. The service processing device 30 includes a receiving module 31, an acquiring module 32, a determining module 33, a processing module 34 and a sending module 35.
[0208] Among them, the receiving module is used to receive a business request, and the business request includes business data; the acquisition module is used to determine the target long-tail data according to the business data; the determination module is used to determine the correlation matrix corresponding to the target long-tail data according to the target long-tail data and the pre-acquired diagonal matrix; the processing module is used to decompose the correlation matrix based on characteristic decomposition to obtain the standardized eigenvector corresponding to the correlation matrix; based on the diagonal matrix and the standardized eigenvector, determine the correlation random data corresponding to the target long-tail data; based on the correlation random data, determine the sales volume of each item included in the target long-tail data; the sending module is used to respond to the business request based on the sales volume of each item.
[0209] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0210] According to the business processing device provided by the present embodiment, after receiving a business request, the target long-tail data is determined according to the business data included in the business request, and the correlation matrix corresponding to the target long-tail data is determined according to the target long-tail data and a pre-obtained diagonal matrix, and then the correlation matrix is decomposed based on the eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix, and the correlation random number corresponding to the target long-tail data is determined based on the pre-obtained diagonal matrix and the standardized eigenvector, and the sales volume of each item included in the target long-tail data is determined based on the correlation random data. Since the zero-value data in the long-tail data is filled with non-zero values and used to predict the future sales volume of the item, the amount of information contained in the long-tail data is increased, and the accuracy of the prediction of the future sales volume of the product is improved, thereby reducing the storage cost.
[0211] Embodiment 4
[0212] This embodiment further supplements the apparatus provided in the above embodiment.
[0213] As an implementable manner, based on the above embodiment, optionally, the processing module is specifically used to:
[0214] Determine the KL expansion cutoff threshold based on the diagonal matrix and the standardized eigenvector;
[0215] Determine the target random variable based on the KL expansion cutoff threshold;
[0216] Based on the target random variable, determine the correlated random data.
[0217] As another practicable manner, based on the above embodiment, optionally, the receiving module is specifically configured to:
[0218] Receive business requests sent by the main server. The business data includes the historical sales data of the products that need to be processed by the slave server.
[0219] As another practicable manner, based on the above embodiment, optionally, the acquisition module is specifically used to:
[0220] Based on the business data, determine the historical sales data of items whose sales volume is less than the preset conditions;
[0221] The historical sales data of items whose sales volume is less than the preset condition is used as the target long-tail data.
[0222] As another practicable manner, based on the above embodiment, optionally, the processing module is specifically configured to:
[0223] Based on the correlated random data, a pre-trained prediction model is used to determine the sales volume of each item included in the target long-tail data.
[0224] Optionally, the processing module is further configured to:
[0225] Get training data;
[0226] The pre-trained prediction model is obtained by training based on the training data.
[0227] As another practicable manner, based on the above embodiment, optionally, the sending module is specifically configured to:
[0228] Send the sales volume of each item to the main server.
[0229] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0230] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any manner without conflict, and this application is not limited thereto.
[0231] According to the business processing device of the present embodiment, after receiving a business request, the target long-tail data is determined according to the business data included in the business request, and the correlation matrix corresponding to the target long-tail data is determined according to the target long-tail data and a pre-obtained diagonal matrix, and then the correlation matrix is decomposed based on the eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix, and the correlation random number corresponding to the target long-tail data is determined based on the pre-obtained diagonal matrix and the standardized eigenvector, and the sales volume of each item included in the target long-tail data is determined based on the correlation random data. Since the zero-value data in the long-tail data is filled with non-zero values and used to predict the future sales volume of the item, the amount of information contained in the long-tail data is increased, and the accuracy of the prediction of the future sales volume of the product is improved, thereby reducing the storage cost.
[0232] Embodiment 5
[0233] This embodiment provides an electronic device, which is used to execute the method provided in the above embodiment.
[0234] like Figure 7 FIG. 5 is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device 50 includes: at least one processor 51 and a memory 52;
[0235] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method provided in any of the above embodiments.
[0236] According to the electronic device of this embodiment, after receiving a business request, the target long-tail data is determined according to the business data included in the business request, and the correlation matrix corresponding to the target long-tail data is determined according to the target long-tail data and a pre-obtained diagonal matrix, and then the correlation matrix is decomposed based on the eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix, and the correlation random number corresponding to the target long-tail data is determined based on the pre-obtained diagonal matrix and the standardized eigenvector, and the sales volume of each item included in the target long-tail data is determined based on the correlation random data. Since the zero-value data in the long-tail data is filled with non-zero values and used to predict the future sales volume of the item, the amount of information contained in the long-tail data is increased, and the accuracy of the prediction of the future sales volume of the product is improved, thereby reducing the storage cost.
[0237] Embodiment 6
[0238] This embodiment provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method provided in any of the above embodiments is implemented.
[0239] According to the computer-readable storage medium of the present embodiment, after receiving a business request, the target long-tail data is determined according to the business data included in the business request, and the correlation matrix corresponding to the target long-tail data is determined according to the target long-tail data and a pre-obtained diagonal matrix, and then the correlation matrix is decomposed based on the eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix, and the correlation random number corresponding to the target long-tail data is determined based on the pre-obtained diagonal matrix and the standardized eigenvector, and the sales volume of each item included in the target long-tail data is determined based on the correlation random data. Since the zero-value data in the long-tail data is filled with non-zero values and used to predict the future sales volume of the item, the amount of information contained in the long-tail data is increased, and the accuracy of the prediction of the future sales volume of the product is improved, thereby reducing the storage cost.
[0240] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. 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.
[0241] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0242] In addition, each functional unit 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 hardware plus software functional units.
[0243] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0244] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0245] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing a service, characterized in that: Applicable to slave servers, including: Receiving a business request sent by the master server, the business request including business data to be processed by the slave server; the business request is that after the master server receives the product sales request sent by the terminal, it obtains the original business data corresponding to the product identifier according to the product sales request, and divides the original business data into multiple business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and sends them to each slave server; Determine target long-tail data according to the business data; Determine a correlation matrix corresponding to the target long-tail data according to the target long-tail data and a pre-obtained diagonal matrix; Decomposing the correlation matrix based on eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix; Determine the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector; Determining the sales volume of each item included in the target long-tail data based on the relevant random data; Based on the sales volume of each item, respond to the service request of the master server, so that after receiving the responses of each slave server, the master server integrates and obtains the sales volume of all items requested by the terminal, and feeds back to the terminal, so that relevant personnel prepare stocks according to the sales volume of the items; The determining, based on the diagonal matrix and the standardized eigenvector, the correlation random data corresponding to the target long-tail data comprises: Determining a KL expansion cutoff term threshold based on the diagonal matrix and the standardized eigenvector; Determine a target random variable based on the KL expansion cutoff term threshold; Based on the target random variable, determining the correlation random data; The determining, based on the correlation random data, the sales volume of each item included in the target long-tail data includes: Based on the relevant random data, a pre-trained prediction model is used to determine the sales volume of each item included in the target long-tail data.
2. The method according to claim 1, characterized in that Determining target long-tail data according to the business data includes: Determine historical sales data of items whose sales volume is less than a preset condition based on the business data; The historical sales data of items whose sales volume is less than a preset condition is used as the target long-tail data.
3. The method according to claim 1, characterized in that Before determining the sales volume of each item included in the target long-tail data by using a pre-trained prediction model based on the relevant random data, the method further includes: Get training data; The pre-trained prediction model is obtained by training based on the training data.
4. The method according to any one of claims 1 to 3, characterized in that: The responding to the business request based on the sales volume of each item includes: Send the sales volume of each item to the main server.
5. A service processing device, characterized in that: include: A receiving module, used to receive a service request sent by the master server, wherein the service request includes service data to be processed by the slave server; The business request is that after the main server receives the product sales request sent by the terminal, it obtains the original business data corresponding to the product identifier according to the product sales request, and divides the original business data into multiple business data according to the number of currently available slave servers and the current load and remaining computing power of each slave server, and sends them to each slave server; An acquisition module, used to determine target long-tail data according to the business data; A determination module, used to determine a correlation matrix corresponding to the target long-tail data according to the target long-tail data and a pre-acquired diagonal matrix; A processing module, configured to decompose the correlation matrix based on eigendecomposition to obtain a standardized eigenvector corresponding to the correlation matrix; determine the correlation random data corresponding to the target long-tail data based on the diagonal matrix and the standardized eigenvector; and determine the sales volume of each item included in the target long-tail data based on the correlation random data; The sending module is used to respond to the service request of the master server based on the sales volume of each item, so that after receiving the responses from each slave server, the master server integrates and obtains the sales volume of all items requested by the terminal, and feeds back to the terminal, so that relevant personnel prepare stocks according to the sales volume of the items; The processing module is specifically used for: Determining a KL expansion cutoff term threshold based on the diagonal matrix and the standardized eigenvector; Determine a target random variable based on the KL expansion cutoff term threshold; Based on the target random variable, determining the correlation random data; The processing module is specifically used for: Based on the relevant random data, a pre-trained prediction model is used to determine the sales volume of each item included in the target long-tail data.
6. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Electronic commerce industry prosperity extent index system and method based on big data
CN105809289A
Recommendation method and recommendation device for niche products based on Bayesian regression
CN108537638A