Product guarantee resource prediction method and device and electronic equipment
By building a product guarantee resource prediction model and optimizing it with the sparrow search algorithm, the problem of inaccurate resource prediction in traditional product guarantee solutions is solved, and more efficient resource management and storage is achieved.
Patent Information
- Application Number
- CN202411910970.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-25
AI Technical Summary
Traditional product guarantee plans are difficult to adjust in time according to actual conditions, resulting in inaccurate resource prediction and high prediction errors.
By analyzing the use of product guarantee resources, building a guarantee resource prediction model, and using the sparrow search algorithm to optimize the model to achieve more accurate resource prediction.
It improves the accuracy of product guarantee resource prediction, reduces prediction errors, and helps enterprises manage and store resources more effectively.
Smart Images

Figure CN119886421A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a product guarantee resource prediction method. Background Art
[0002] Traditional product assurance plans are too extensive and backward, and cannot be adjusted in a timely manner according to actual conditions. Therefore, "precision assurance" has gradually become the trend of product assurance. Accurate demand forecasting is an important means to promote precision assurance. Reasonable forecasting of product assurance resources can effectively reduce resource waste and store corresponding product assurance resources reasonably according to the forecast results. Due to various uncertainties, when predicting the required product assurance resources, how to more accurately predict the required assurance resources and reduce the forecast error has become an urgent problem to be solved in product assurance. Summary of the invention
[0003] In order to solve the above technical problems, a security resource prediction model is constructed by analyzing the actual usage of product security resources, and the prediction model is optimized using the sparrow search algorithm to achieve the prediction of product security resources.
[0004] In a first aspect, an embodiment of the present invention provides a product guarantee resource prediction method, comprising:
[0005] Collect usage data of product support resources and establish a historical usage data set, wherein the historical usage data set includes daily time data and data on the type and / or quantity of usage of the product support resources corresponding to the time;
[0006] Constructing fused feature data, encoding the historical usage data, and inputting the encoding into a feature extraction model to obtain a feature representation FT of time-related daily time feature data; extracting natural cycle features based on the historical usage data to obtain a representation FC of cycle feature data; fusing the daily time feature data and the cycle feature data to obtain fused feature data;
[0007] Construct a product support resource prediction model, and use the sparrow search algorithm to solve the model to obtain an optimized prediction model;
[0008] Input daily time data into the optimized forecasting model and output product support resource forecast results.
[0009] In some embodiments, encoding the historical usage data includes:
[0010] The daily time data is coded according to three types: natural day of the week, whether it is a holiday, and whether it is weather that affects security. The natural day of the week includes Monday to Sunday. The natural day of the week is coded as Ja, and J takes the value of 1, 2, 3, 4, 5, 6 or 7 corresponding to Monday to Sunday, and a takes the value of several zeros; holidays are coded as 1b, non-holidays are coded as 1b0, and b takes the value of several zeros; weather that affects security is coded as 1c0, and weather that does not affect security is coded as 1c; the principle of a, b, and c taking the values of several zeros is to prevent all codes from being repeated.
[0011] In some embodiments, the input feature extraction model obtains a feature representation FT of the day time feature data related to the day time, including:
[0012] The encoded day-time data is sequentially sent to the Embedding model to obtain the day-time feature data representation of the day-time related data. After that, different types of features are extracted again and normalized through a fully connected network layer to obtain the final single-dimensional time feature vector FT.
[0013] In some embodiments, the extracting natural cycle features based on the historical usage data includes:
[0014] With two natural cycles as the period, the data set is constructed as a periodic matrix B:
[0015]
[0016] The convolutional neural network is used to extract the daily periodic features through a one-dimensional convolution kernel. At this time, the one-dimensional convolution kernel slides along the daily time. Then the convolution kernel will extract the natural cycle features and normalize them to obtain the periodic feature representation FC.
[0017] In some embodiments, the fusion of the daily time feature data and the period feature data obtains the fused feature data F S , including: feature fusion according to weights
[0018] F S =0.6F C +0.4F T .
[0019] In some embodiments, the constructing of the product support resource prediction model and solving the model using a sparrow search algorithm to obtain an optimized prediction model includes:
[0020] Build a classic LSTM model, input FS into the model, and output a set of solutions - product guarantee resource prediction values Using the cross entropy loss function:
[0021]
[0022] y i To ensure the actual data value of resources for products, Predict data values for product security resources;
[0023] The sparrow algorithm optimizes the network parameters W = {w1, w2, w3, ... w m}:
[0024] Randomly, in the output of a set of solutions, each solution represents a virtual sparrow, and according to the Loss value of each solution, the current group is divided into producers and followers, where producers are some solutions / sparrows with smaller loss values;
[0025] For the producer, the position update formula is as follows, and the optimal value in the current group is found:
[0026]
[0027] In the formula, Iter represents the position of the i-th sparrow in the j-th dimensional space in the l+1th iteration; max represents the maximum number of iterations; α is a random number between (0, 1]; Q is a random number that obeys the standard normal distribution; L represents a 1×d matrix with all 1s; d is the dimension of the objective function; R2 and ST are the alarm value and safety threshold, respectively;
[0028] For the follower, the update formula is as follows:
[0029]
[0030] In the formula, represents the best position of the l+1th generation discoverer, that is, the solution with the smallest Loss value; represents the worst position of the discoverer of the first generation; A represents a 1×d matrix with only 1 or -1;
[0031] Randomly select an individual in the current iteration, and the update formula is as follows:
[0032]
[0033] In the formula, represents the best position of the lth iteration; β is a normally distributed random number with a variance of 1 and a mean of 0; K is a random number between [-1, 1]; f w is the worst Loss value of the current race; f i is the Loss value (i.e. fitness) of the i-th sparrow; f g is the optimal Loss value of the current population; ε is a constant to prevent the denominator from being 0.
[0034] Traverse and calculate the Loss values of all (virtual) sparrows in the output set of solutions. If the new Loss value is better than the historical optimal solution, the historical optimal solution is updated; if the termination condition is currently met, the iteration is terminated, otherwise the producers and followers are regrouped and iterated;
[0035] The optimal solution with the smallest Loss value obtained by the sparrow algorithm is assigned to the corresponding parameter w of the network model to obtain the trained optimized prediction model.
[0036] In a second aspect, an embodiment of the present invention provides a product guarantee resource prediction device, which is used to implement a product guarantee resource prediction method described in the first aspect, including:
[0037] A collection module, used to collect usage data of product support resources and establish a historical usage data set, wherein the historical usage data set includes daily time data and data on usage type and / or quantity of product support resources corresponding to the time;
[0038] Constructing a fusion feature data module, which is used to encode the historical usage data and input it into a feature extraction model to obtain a feature representation FT of time-related time feature data; extracting natural cycle features based on the historical usage data to obtain a representation FC of period feature data; fusing the time feature data and the period feature data to obtain fused feature data;
[0039] Construct a product support resource prediction model module, which is used to construct a product support resource prediction model, and use the sparrow search algorithm to solve the model to obtain an optimized prediction model;
[0040] The product support resource prediction module is used to input daily time data into the optimized prediction model and output the product support resource prediction results.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0042] at least one memory for storing program instructions;
[0043] At least one processor is used to call the program instructions stored in the memory, and execute the steps of the product guarantee resource prediction method described in the first aspect according to the obtained program instructions.
[0044] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a product support resource prediction method described in the first aspect.
[0045] The technical solution provided by the embodiments of the present invention brings at least the following beneficial effects:
[0046] The present invention constructs a product security resource prediction model, reconstructs the initial data, i.e., the usage data of the product security resources, into fused feature data, constructs a product security resource prediction model, and uses the sparrow algorithm to solve the LSTM model to obtain an optimized prediction model, thereby realizing the prediction of product security resources. The product security resource prediction model constructed by the present invention is more in line with the actual application of product security resources, and the sparrow algorithm is used to accelerate the solution of the model, thereby optimizing the prediction process of security resources.
[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a schematic diagram of the overall process of the method of the present invention;
[0049] Figure 2 It is a schematic diagram of constructing time characteristic data FT of the method of the present invention;
[0050] Figure 3 It is a schematic diagram of the structural period characteristic data FC of the method of the present invention. DETAILED DESCRIPTION
[0051] The embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0052] Embodiment 1:
[0053] This embodiment provides a product guarantee resource prediction method, including:
[0054] Collect usage data of product support resources and establish a historical usage data set, wherein the historical usage data set includes daily time data and data on the type and / or quantity of usage of product support resources corresponding to the time;
[0055] Historical usage data set, for example, on October 19, 2024, Sunday, a holiday, heavy rain affected the weather of the guarantee, the product guarantee resource was spare parts, and 2 pieces were used; in another example, the product guarantee resource was personnel, and 5 people were used.
[0056] Constructing fused feature data, encoding the daily time data of the historical usage data, and inputting the encoding into the feature extraction model to obtain the feature representation FT of the time-related time feature data; extracting the natural cycle feature based on the historical usage data to obtain the representation FC of the cycle feature data; fusing the time feature data and the cycle feature data to obtain the fused feature data;
[0057] The day time data of the historical usage data is encoded, including:
[0058] The daily time data set is coded according to three types: natural day of the week, whether it is a holiday, and whether it is weather that affects security. Natural days of the week include Monday to Sunday. Natural days of the week are coded as Ja, and J takes the value of 1, 2, 3, 4, 5, 6 or 7 corresponding to Monday to Sunday. The value of a takes a number of 0s; holidays are coded as 1b, non-holidays are coded as 1b0, and b takes a number of 0s; weather that affects security is coded as 1c0, and weather that does not affect security is coded as 1c; the principle that a, b, and c take the value of several 0s is to prevent all codes from being repeated.
[0059] Exemplarily, as shown in Table 1, the day time data of the historical usage data is encoded.
[0060] Table 1. Example of encoding of historical usage day time dataset
[0061]
[0062] Input the feature extraction model to obtain the feature representation FT of the daily time feature data related to the daily time, including:
[0063] The encoded daily time data set is sequentially fed into the Embedding model to obtain the feature representation of the daily time-related data. Then, the features of different types (including three types: day of the week, whether it is a holiday, and whether it affects the weather security) are extracted again and normalized through a fully connected network layer to obtain the final single-dimensional time feature vector FT.
[0064] For example, October 19, 2024, Sunday, a holiday, heavy rain affects the weather security, and is encoded as (7000, 10000, 100); October 20, 2024, Monday, a non-holiday, heavy rain affects the weather security, and is encoded as (1000, 100000, 100); October 21, 2024, Tuesday, a non-holiday, cloudy weather does not affect the weather security, and is encoded as (2000, 100000, 10); the encoded data is sent to the Embedding model in sequence, and then feature extraction and normalization are performed again through a fully connected network layer to obtain the final single-dimensional time feature vector FT as (5, 6, 9).
[0065] The natural cycle feature extraction is performed based on the daily time data of the historical usage data, including:
[0066] With two natural weeks as the cycle, the data set is constructed as a daily cycle time matrix B:
[0067]
[0068] The convolutional neural network is used to extract the daily cycle features through a one-dimensional convolution kernel. The step length of the convolution is 1. At this time, the one-dimensional convolution kernel slides along the daily time. Then the convolution kernel will extract the natural cycle features. The step length of the convolution is 7, and normalization is performed to obtain the natural cycle feature representation FC.
[0069] The daily time feature data and the period feature data are fused to obtain the fused feature data F S , including: feature fusion according to weights
[0070] F S =0.6F C +0.4F T .
[0071] For example, F T =(a1, a2, a3.....a n ), F c =(b1, b2, b3.....b n ),So:
[0072] F s =(0.6b1+0.4a1, 0.6b2+0.4a2, 0.6b3+0.4a3,...0.6b n +0.4a n ).
[0073] The above data is normalized to [0, 1], and the normalization method of the data is:
[0074]
[0075] Among them, x is the data in the data set that needs to be normalized, x max is the maximum value in the data set that needs to be normalized this time, x min is the minimum value in the data set that needs to be normalized this time, is the normalized result.
[0076] Construct a product guarantee resource prediction model, and use the sparrow search algorithm to solve the model, that is, train the model, solve the model network parameter W, and obtain an optimized prediction model, which includes:
[0077] Build a classic LSTM model, input FS into the model, and output a set of solutions - product guarantee resource prediction values The number of vectors input to FS is the number of measured values that should be matched to the output solution. The cross entropy loss function is used:
[0078]
[0079] y i is the actual data value of product guarantee resources on the i-th day, Predict data values for product security resources;
[0080] The sparrow algorithm optimizes the network parameters W = {w1, w2, w3, ... w m ]:
[0081] Randomly, in the output of a set of solutions, each solution represents a virtual sparrow, and according to the Loss value of each solution, the current group is divided into producers and followers, where producers are some solutions / sparrows with smaller loss values;
[0082] For the producer, the position update formula is as follows, and the optimal value in the current group is found:
[0083]
[0084] In the formula, Iter represents the position of the i-th sparrow in the j-th dimensional space in the l+1th iteration; max represents the maximum number of iterations; α is a random number between (0, 1]; Q is a random number that obeys the standard normal distribution; L represents a 1×d matrix with all 1s; d is the dimension of the objective function; R2 and ST are the alarm value and safety threshold, respectively;
[0085] For the follower, the update formula is as follows:
[0086]
[0087] In the formula, represents the best position of the l+1th generation discoverer, that is, the solution with the smallest Loss value; represents the worst position of the first generation discoverer; A represents a 1×d matrix that is only 1 or -1;
[0088] Randomly select an individual in the current iteration, and the update formula is as follows:
[0089]
[0090] In the formula, represents the best position of the lth iteration; β is a normally distributed random number with a variance of 1 and a mean of 0; K is a random number between [-1, 1]; f w is the worst Loss value of the current race; f i is the Loss value (i.e. fitness) of the i-th sparrow; f g is the optimal Loss value of the current population;
[0091] Traverse and calculate the Loss values of all (virtual) sparrows in the output set of solutions. If the new Loss value is better than the historical optimal solution, the historical optimal solution is updated; if the termination condition is currently met, the iteration is terminated, otherwise the producers and followers are regrouped and iterated;
[0092] The optimal solution with the minimum Loss value obtained by the sparrow algorithm is assigned to the corresponding parameter w of the network model to obtain the trained optimized prediction model.
[0093] Input the daily time data into the optimized prediction model and output the prediction result of product support resources: on November 9, 2024, 1 spare part of product support resources will be used. If the training data is for a one-year period, the product support resources for the whole year can be predicted; if the training data is for two months, the prediction is for two months.
[0094] Embodiment 2
[0095] This embodiment provides a product guarantee resource prediction device, which is used to implement a product guarantee resource prediction method, including:
[0096] A collection module, used to collect usage data of product support resources and establish a historical usage data set, wherein the historical usage data set includes daily time data and data on usage type and / or quantity of product support resources corresponding to the time;
[0097] Constructing a fusion feature data module, which is used to encode the historical usage data and input it into a feature extraction model to obtain a feature representation FT of time-related time feature data; extracting natural cycle features based on the historical usage data to obtain a representation FC of period feature data; fusing the time feature data and the period feature data to obtain fused feature data;
[0098] Construct a product support resource prediction model module, which is used to construct a product support resource prediction model, and use the sparrow search algorithm to solve the model to obtain an optimized prediction model;
[0099] The product support resource prediction module is used to input daily time data into the optimized prediction model and output the product support resource prediction results.
[0100] Embodiment 3
[0101] Provided is an electronic device comprising: a processor; and a memory for storing processor executable instructions; wherein the processor implements the steps of the above-mentioned product guarantee resource prediction method by running the executable instructions.
[0102] Example 4
[0103] A computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the above-mentioned product guarantee resource prediction method are implemented.
Claims
1. A product support resource prediction method, characterized in that: include: Collect usage data of product support resources and establish a historical usage data set, wherein the historical usage data set includes daily time data and data on the type and / or quantity of usage of the product support resources corresponding to the time; Constructing fused feature data, encoding the historical usage data, and inputting the encoding into a feature extraction model to obtain a feature representation FT of time-related time feature data; extracting natural cycle features based on the historical usage data to obtain a representation FC of period feature data; fusing the time feature data and the period feature data to obtain fused feature data; Construct a product support resource prediction model and use the sparrow search algorithm to solve the model to obtain an optimized prediction model; Input daily time data into the optimized forecasting model and output product support resource forecast results.
2. The product support resource prediction method according to claim 1, characterized in that: The encoding of the historical usage data comprises: The daily time data is coded according to three types: natural day of the week, whether it is a holiday, and whether it is weather that affects security. The natural day of the week includes Monday to Sunday. The natural day of the week is coded as Ja, and J takes the value of 1, 2, 3, 4, 5, 6 or 7 corresponding to Monday to Sunday, and a takes the value of several zeros; holidays are coded as 1b, non-holidays are coded as 1b0, and b takes the value of several zeros; weather that affects security is coded as 1c0, and weather that does not affect security is coded as 1c; the principle of a, b, and c taking the values of several zeros is to prevent all codes from being repeated.
3. The product support resource prediction method according to claim 2, characterized in that: The input feature extraction model obtains a feature representation FT of the day time feature data related to the day time, including: The encoded day-time data is sequentially sent to the Embedding model to obtain the feature representation of the day-time feature data related to the day-time. After that, different types of features are extracted again and normalized through a fully connected network layer to obtain the final single-dimensional day-time feature vector FT.
4. The product support resource prediction method according to claim 3, characterized in that: The extracting natural cycle features based on the historical usage data includes: With two natural cycles as the period, the data set is constructed as a periodic matrix B: The convolutional neural network is used to extract the daily periodic features through a one-dimensional convolution kernel. At this time, the one-dimensional convolution kernel slides along the daily time. Then the convolution kernel will extract the natural cycle features and normalize them to obtain the periodic feature representation FC.
5. The product support resource prediction method according to claim 4, characterized in that: The fusion of the daily time feature data and the period feature data to obtain the fused feature data Fs includes: performing feature fusion according to the weights F S =0.6F C +0.4F T 。 6. The product support resource prediction method according to claim 5, characterized in that: The product guarantee resource prediction model is constructed, and the model is solved by using a sparrow search algorithm to obtain an optimized prediction model, including: Build a classic LSTM model, input Fs into the model, and output a set of solutions - product guarantee resource prediction values Using the cross entropy loss function: y i To ensure the actual data value of resources for products, Predict data values for product security resources; The sparrow algorithm optimizes the network parameters W = {w1, w2, w3, ... w m }: Randomly, in the output of a set of solutions, each solution represents a virtual sparrow, and according to the Loss value of each solution, the current group is divided into producers and followers, where producers are some solutions / sparrows with smaller loss values; For the producer, the position update formula is as follows, and the optimal value in the current group is found: In the formula, Iter represents the position of the i-th sparrow in the j-th dimensional space in the l+1th iteration; max represents the maximum number of iterations; α is a random number between (0, 1]; Q is a random number that obeys the standard normal distribution; L represents a 1×d matrix with all 1s; d is the dimension of the objective function; R2 and ST are the alarm value and safety threshold, respectively; For the follower, the update formula is as follows: In the formula, represents the best position of the 1+1 generation discoverer, that is, the solution with the smallest Loss value; represents the worst position of the discoverer of the first generation; A represents a 1×d matrix with only 1 or -1; Randomly select an individual in the current iteration, and the update formula is as follows: In the formula, represents the best position of the lth iteration; β is a normally distributed random number with a variance of 1 and a mean of 0; K is a random number between [-1, 1]; f w is the worst Loss value of the current race; f i is the Loss value (i.e. fitness) of the i-th sparrow; f g is the optimal Loss value of the current population; Traverse and calculate the Loss values of all (virtual) sparrows in the output set of solutions. If the new Loss value is better than the historical optimal solution, the historical optimal solution is updated; if the termination condition is currently met, the iteration is terminated, otherwise the producers and followers are regrouped and iterated; The optimal solution with the minimum Loss value obtained by the sparrow algorithm is assigned to the corresponding parameter w of the network model to obtain the trained optimized prediction model.
7. A product guarantee resource prediction device, used to implement the method according to any one of claims 1 to 6, characterized in that: include: A collection module, used to collect usage data of product support resources and establish a historical usage data set, wherein the historical usage data set includes daily time data and data on usage type and / or quantity of product support resources corresponding to the time; Constructing a fusion feature data module, for encoding the historical usage data, inputting the encoding into a feature extraction model to obtain a feature representation FT of time-related daily time feature data; extracting natural week period features based on the historical usage data to obtain a representation FC of period feature data; fusing the time feature data and the period feature data to obtain fused feature data; Construct a product support resource prediction model module, which is used to construct a product support resource prediction model, and use the sparrow search algorithm to solve the model to obtain an optimized prediction model; The product support resource prediction module is used to input daily time data into the optimized prediction model and output the product support resource prediction results.
8. An electronic device, characterized in that: include: at least one memory for storing program instructions; At least one processor is used to call the program instructions stored in the memory, and execute the steps of the method described in any one of claims 1 to 6 according to the obtained program instructions.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of any method described in claims 1 to 6 are implemented.