Electric power measurement material storage prediction method, system, equipment and medium

Through the data-driven prediction method and ARIMA model, the problem of supply and demand imbalance in traditional warehousing management is solved, accurate prediction of power metering materials warehousing is achieved, and inventory management efficiency and resource allocation optimization are improved.

CN120409765APending Publication Date: 2025-08-01INSPUR ARTIFICIAL INTELLIGENCE RES INST CO LTD SHANDONG CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510434272.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Traditional warehousing management methods are difficult to accurately predict the demand for power metering materials, resulting in unbalanced supply and demand, and problems of backlog or insufficient inventory, affecting the stable operation of the power system and waste of resources.

Method used

Using a data-driven prediction method, we collect, clean and process historical metrological material data, train and evaluate using ARIMA model, build an optimal prediction model, and combine real-time data to perform warehousing prediction of power metrological material.

Benefits of technology

Accurate prediction of the warehousing of power metering materials has been achieved, inventory management efficiency has been improved, resource waste has been avoided, and stable supply of the power system has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409765A_ABST
    Figure CN120409765A_ABST
Patent Text Reader

Abstract

The invention provides an electric power measurement material storage prediction method, system, equipment and medium, and belongs to the technical field of electric power measurement material storage, and the method comprises the steps: collecting historical measurement material data, carrying out the cleaning and processing, and then carrying out the feature processing of feature selection, feature coding and time sequence feature construction, and obtaining a data sample; dividing the data sample into a training set and a test set, training the ARIMA model by using the training set, and performing model performance evaluation by using the test set in combination with a mean square error algorithm to obtain an optimal prediction model; and collecting real-time metering material data, performing cleaning and processing, performing feature processing, and inputting the optimal prediction model to perform storage data prediction of electric power metering materials. According to the method, the storage condition of the electric power measurement materials can be predicted, so that the problem of supply and demand imbalance in traditional storage management is solved, stock overstock and resource waste are reduced, and efficient operation of an electric power system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electric power metering material storage, and in particular relates to an electric power metering material storage prediction method, system, equipment and medium. Background Art

[0002] With the development of the power industry, the demand for power metering materials continues to grow. Accurately forecasting the storage of power metering materials is crucial for ensuring the stable operation of the power system and the quality of service. However, because the demand for power metering materials is affected by a variety of factors, including seasonal changes, market demand fluctuations, technological updates, and changes in policies and regulations, the management of electronic metering materials is very complex. Specifically, the demand for electricity usage varies from season to season, which leads to corresponding fluctuations in the demand for power metering materials. The market demand for power metering materials is difficult to accurately grasp due to factors such as the macroeconomic situation and changes in users' electricity usage habits. The application of new technologies will make old metering equipment obsolete, which in turn affects the demand for materials and their storage methods.

[0003] Traditional warehouse management methods struggle to accurately forecast demand for power supplies, leading to inefficient inventory management and significant resource waste. Specifically, traditional warehouse management methods struggle to cope with complex and volatile demand conditions, and are prone to supply-demand imbalances in material reserves. This can lead to either inventory backlogs and wasted resources, or insufficient inventory that impacts the normal operation of the power system. Therefore, to more accurately manage warehousing and ensure efficient power system operation, accurately forecasting the storage status of power metering materials at all levels is a critical issue that needs to be addressed. Summary of the Invention

[0004] In a first aspect, an embodiment of the present application provides a method for predicting the storage of electric power metering materials, comprising the following steps: S1. Collect historical measurement material data and clean and process it; S2. Perform feature selection, feature coding, and time series feature construction on the processed historical measurement material data to obtain data samples; S3. Divide the data sample into a training set and a test set. Use the training set to train the ARIMA model. Then use the test set combined with the mean square error algorithm to evaluate the model performance and obtain the optimal prediction model. S4. After collecting real-time metering material data and cleaning and processing it, it performs feature processing and inputs it into the optimal prediction model to predict the storage data of power metering materials.

[0005] Furthermore, the specific steps of step S1 are as follows: S11. Collect historical measurement material data at all levels of storage within a set time period within the power enterprise; the historical measurement material data includes historical measurement material storage data, supply and demand data, and market trend data; S12. Import the collected historical material measurement data into the Python Pandas library to perform missing value processing, outlier processing, duplicate data processing, outlier processing, and data smoothing. The data is then converted into a format that matches the ARIMA model to complete data cleaning. S13. Summarize the historical measurement material data after cleaning according to the target unit time.

[0006] Furthermore, the specific steps of step S2 are as follows: S21. Use the Numpy library in Python to calculate the Pearson correlation coefficient between each data feature in the historical measurement material data and the measurement material target inventory quantity feature; S22. Arrange the Pearson correlation coefficients in ascending order and remove data features corresponding to Pearson correlation coefficients below a set threshold to obtain preliminary screened data features; S23. Use the random forest model to evaluate the feature importance of the initially selected data features, and sort the importance evaluation results from high to low to obtain the final selected data features; S24. Analyze the relationship between the final screened data features, interact the associated data features, construct polynomial features and cross features, and add them to the final screened data features; S25. Encode the final filtered data features according to their types, construct time series features, and add them to the final filtered data features to obtain data samples.

[0007] Furthermore, the specific steps of step S24 are as follows: S241. According to the demand relationship in the filtered data features, the storage data features and the demand data features in the historical measurement material data are obtained as the original features, and the square and multiplication interaction is performed to form a polynomial feature; S242. Based on the supply relationship in the filtered data features, obtain the storage quantity data features and the available supply quantity data features in the historical measurement material data as the original features and combine them to obtain the cross feature; S243. Add the polynomial features and the cross features to the final filtered data features.

[0008] Furthermore, the specific steps of step S25 are as follows: S251. Classify the selected data features in turn; If it is a categorical data feature, proceed to step S252; If it is a numerical data feature, go to step S253; If it is a time data feature, go to step S254; S252. Use one-hot encoding to convert categorical data features into numerical features, and go to step S255; S253. Perform normalization on numerical data features to eliminate the influence of dimensions, and go to step S255; S254. Decompose time data features according to the target unit time; S255. Create a measurement material inventory feature within the lag period based on the finally selected data features, calculate the moving average storage volume feature of the measurement materials within the agreed period, use the average storage volume feature of the measurement materials per unit time as the seasonal feature, and use the linear regression method to estimate the trend feature of the time series to complete the construction of the time series feature; S256. Add the constructed time series features to the finally selected data features to obtain data samples.

[0009] Furthermore, the specific steps of step S3 are as follows: S31. Import the data samples into the Statsmodels library and divide them into a training set and a test set; S32. Construct an ARIMA model and determine the model parameters, where the model parameters include the autoregressive order, the differencing order, and the moving average order; S33. Use the training set to train the ARIMA model; S34. During the training process, input the data features screened from the test set into the ARIMA model for prediction to obtain the predicted measurement material inventory feature and use it as the predicted value; S35. Use the measurement material inventory feature within the historical lag period in the data features screened from the test set as the actual value; S36. Calculate the mean squared error between the predicted value and the actual value, and use matplotlib to draw a comparison chart of the actual value and the predicted value; S37. Verify whether the mean squared error between the predicted value and the actual value is less than the set threshold; If so, go to step S39; If not, go to step S38; S38. Adjust the model parameters of the ARMIA model and return to step S33; S39. Use the trained ARIMA model as the optimal prediction model.

[0010] Furthermore, the specific steps of step S4 are as follows: S41. Obtain real-time measurement material data and perform data cleaning and processing according to step S1; S42. Perform feature processing on the processed real-time metering material data, including feature selection, feature encoding, and construction of time series features according to step S2; S43. Input the real-time metering material data after feature processing into the optimal prediction model to obtain the predicted value of the warehousing data of power metering materials; S44. Guide the warehousing planning of power metering materials according to the predicted value of the warehousing data of power metering materials.

[0011] In a second aspect, an embodiment of the present application further provides a power metering material warehousing prediction system, including: A data acquisition module, configured to collect historical metering material data and perform cleaning and processing. The historical metering material data includes warehousing data, supply and demand situation data, and market trend data of historical metering materials; A data feature processing module, configured to perform feature processing including feature selection, feature encoding, and construction of time series features on the processed historical metering material data to obtain data samples; A prediction model construction and training module, configured to divide the data samples into a training set and a test set, train the ARIMA model using the training set, and perform performance evaluation using the test set to obtain an optimal prediction model; A warehousing prediction module, configured to collect real-time metering material data, perform cleaning and processing, then perform feature processing, and input it into the optimal prediction model to predict the warehousing data of power metering materials.

[0012] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps of the power metering material warehousing prediction method as described in the first aspect.

[0013] In a fourth aspect, an embodiment of the present application further provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the power metering material warehousing prediction method as described in the first aspect.

[0014] It can be seen from the above technical solutions that the present invention has the following advantages: In the power metering material warehousing prediction method, system, equipment and medium provided by this application, by using a data-driven prediction method, accurate prediction of power metering material warehousing is realized, avoiding the problem of supply-demand imbalance in traditional warehousing management methods, improving the performance of warehousing management, effectively avoiding inventory backlogs and resource waste, and at the same time preventing the impact of insufficient inventory on the normal services of the power system; through the comprehensive collection, cleaning, feature selection and feature construction of historical metering material data and real-time metering material data, the quality and effectiveness of the data are ensured, enabling the prediction model to make full use of the information in the data and improving the accuracy of the prediction; through the training and evaluation process of the ARIMA model, mean square error evaluation and parameter adjustment are realized to ensure obtaining the optimal prediction model, providing high-performance prediction for warehousing prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the present invention, the accompanying drawings required for description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0016] Figure 1 It is a schematic flowchart of the power metering material warehousing prediction method of the present invention.

[0017] Figure 2 It is a schematic diagram of the power metering material warehousing prediction system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] In the following, the specific steps of the power metering material warehousing prediction method will be described in detail, and various embodiments of the present disclosure will be described more comprehensively. The present disclosure can have various embodiments, and adjustments and changes can be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but the present disclosure should be understood to cover all adjustments, equivalents and / or alternative solutions falling within the spirit and scope of the various embodiments of the present disclosure.

[0019] Exemplarily speaking, with the development of the power industry, the demand for power metering materials has been continuously increasing. Accurately predicting the warehousing situation of power metering materials plays an important role in maintaining the stable operation of the power system and improving service quality. However, the demand for power metering materials is affected by multiple complex factors, such as changes in electricity demand caused by seasonal changes, unstable market demand due to macroeconomic and user habits fluctuations, and accelerated technological iteration resulting in accelerated elimination of old equipment, ultimately leading to extremely complex management of power metering materials.

[0020] Specifically, the seasonal differences in electricity usage directly lead to corresponding fluctuations in the demand for electricity metering materials. At the same time, market dynamics such as the ups and downs of the macroeconomic situation and the changes in users' electricity consumption behavior patterns make it particularly difficult to accurately grasp the market demand for electricity metering materials. In addition, the continuous emergence and application of new technologies have accelerated the process of replacing old metering equipment, further affecting the demand structure and storage strategies of materials.

[0021] Traditional warehouse management models are difficult to make accurate material demand predictions in the face of complex and changing demand environments, which not only leads to low inventory management efficiency but also causes serious waste of resources. Specifically, the traditional model is prone to problems of supply-demand mismatch in material reserves: either there is a serious backlog of inventory, occupying a large amount of resources; or there is a shortage of inventory, unable to meet the normal service needs of the power system. Therefore, in order to achieve refined management of the warehouse and ensure the efficient and stable operation of the power system, how to accurately predict the warehouse conditions of electricity metering materials at all levels has become an urgent problem to be solved.

[0022] In response to the above problems, this embodiment provides a method for predicting the warehouse of electricity metering materials. By using historical metering material data and the ARIMA model, the warehouse conditions of electricity metering materials can be predicted, thus solving the problem of supply-demand imbalance in traditional warehouse management, reducing inventory backlogs and resource waste, and ensuring the efficient operation of the power system.

[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0024] Please refer to Figure 1 The flowchart of the method for predicting the warehouse of electricity metering materials in a specific embodiment is shown. The method includes the following steps: S1. Collect historical metering material data and perform cleaning and processing; It should be noted that collecting and cleaning historical metering material data provides a data basis for predicting the warehouse of metering materials, ensures the data quality of the input prediction model, avoids prediction deviations caused by data errors or omissions, and improves prediction accuracy; S2. Perform feature processing including feature selection, feature encoding, and construction of time series features on the processed historical metering material data to obtain data samples; It should be noted that through feature selection, encoding, and construction of time series features, the data features that are most relevant and important to the target inventory quantity are screened out, and reasonable time series features are constructed to ensure the effective use of data for the prediction model, enhance the capture ability of the prediction model for key information, and improve the prediction accuracy; S3. Divide the data samples into a training set and a test set, use the training set to train the ARIMA model, and then use the test set to evaluate the model performance in combination with the mean squared error algorithm to obtain the optimal prediction model; It should be noted that the ARIMA model is trained using the training set and evaluated using the test set, and the optimal prediction model is obtained by continuously optimizing the model performance, ensuring that the model has a high prediction accuracy and can accurately predict the warehousing data; S4. After collecting, cleaning, and processing the real-time metering material data, perform feature processing, and input it into the optimal prediction model to predict the warehousing data of the power metering materials; It should be noted that the warehousing data of the power metering materials is predicted by using the real-time metering material data in combination with the optimal prediction model, so that the warehousing management can be adjusted according to the real-time prediction results, ensuring the reasonable allocation of warehousing resources and guaranteeing the stability of the material supply of the power system.

[0025] In this embodiment, by collecting and processing the historical metering material data, constructing and training the ARIMA prediction model, the accurate prediction of the warehousing data of the power metering materials is realized, which not only improves the efficiency and accuracy of inventory management, but also optimizes the resource allocation of the power system.

[0026] Furthermore, as a refinement and extension of the specific implementation manner of the above embodiment, in order to fully illustrate the specific implementation process in this embodiment, another method for predicting the warehousing of power metering materials is provided, and this method includes the following steps: S1. Collect historical metering material data and perform cleaning and processing; the specific steps of step S1 are as follows: S11. Collect the historical metering material data of each level of warehousing within a set time length in the power enterprise; the historical metering material data includes the warehousing data, supply and demand situation data, and market trend data of the historical metering materials; It should be noted that the warehousing data of historical measurement materials provides the storage volume of each level of warehousing over a past period (such as in the past 5 years), which is the key for the ARIMA model to understand the change trend and periodicity of the storage volume; when collecting the warehousing data of historical measurement materials, it includes the storage volume data in different time periods so that the prediction model can capture seasonal, periodic or trend changes, which helps the prediction model better understand the past warehousing situation and make future predictions accordingly; the collection of the warehousing data of historical measurement materials may involve records of each level of warehousing, historical statistical data or storage volume information in the database, etc.; and ensuring the integrity and accuracy of the data is crucial for establishing a reliable prediction model, so attention needs to be paid to the data collection method and the guarantee of data quality during the collection process; Exemplarily, the supply and demand situation data of historical measurement materials may include supplier information, customer demand information, storage capacity information and inventory information; The supplier information includes information such as the name, contact information, supply capacity, production capacity, delivery time, etc. of the supplier. Understanding the situation of the supplier can help the model accurately predict the future supply situation; The customer demand information includes information such as the customer's demand volume, order situation, delivery time, payment situation, etc.; by mastering the customer's demand situation, it can help the prediction model more accurately estimate the future demand volume; the storage capacity information is the storage capacity situation of each level of warehousing and is also an important part of the supply and demand situation data. Understanding the storage capacity limits of each level of warehousing can help the model predict a reasonable storage level; The inventory information includes information such as the existing inventory volume, inventory turnover rate, expired or damaged situation, etc.; The market trend data of historical measurement materials includes industry growth trend data, price trend data, and technology development trend data; The industry growth trend data includes the overall growth trend data of the power and communication industries, the expansion or contraction of the market in the next few years, etc. Understanding the development trend of the industry can help predict future demand volume and storage demand; The price trend data includes data on the price fluctuations of measurement materials, the change trend of raw material prices, and data on market price competition. The price trend data has an important impact on both inventory management and supply-demand balance; S12. Import the collected historical measurement material data into the Pandas library of Python for missing value processing, outlier processing, duplicate data processing, outlier processing and data smoothing, and convert it into a format matching the ARIMA model to complete data cleaning; It should be noted that the Pandas library is a data analysis library in Python. For handling missing values, linear interpolation is used to fill in the missing date data, and the mean value is used to fill in a small amount of missing specific data. For outlier handling, outliers beyond a reasonable range can be corrected or deleted according to business logic. For duplicate data handling, duplicate data records are detected and deleted. For outlier detection, the box plot method is used to detect outliers and then they are deleted or replaced with the mean value. For data smoothing, moving smoothing is performed on time series data to eliminate noise. S13. Aggregate the cleaned historical metering material data according to the target unit time; Exemplarily, the cleaned historical metering material data can be aggregated according to target unit times such as daily, weekly, monthly, etc. It should be noted that collecting historical metering material data including warehousing data, supply and demand situation data, and market trend data enables the prediction model to comprehensively consider various factors, more comprehensively reflect the actual situation of power metering materials, and improve the accuracy of prediction results. Using the Pandas library in Python for comprehensive data cleaning ensures the integrity and accuracy of the data, eliminates noise and anomalies in the data, and converts the data into a format suitable for processing by the ARIMA model, providing uniformly formatted data for subsequent feature processing and model training, and improving data processing efficiency and quality. Aggregating the data according to the target unit time makes the data consistent in the time dimension, facilitating subsequent time series analysis and feature construction, and enabling the prediction model to better capture the patterns and trends in the time series. S2. Perform feature processing including feature selection, feature encoding, and time series feature construction on the processed historical metering material data to obtain data samples. The specific steps of step S2 are as follows: S21. Use the Numpy library in Python to calculate the Pearson correlation coefficient between each data feature in the historical metering material data and the target inventory quantity feature of the metering material; Exemplarily, for the following historical power material metering data in Python: data = { 'date': pd.date_range(start='2018-01-01', end='2023-12-31', freq='M'), 'storage_quantity': np.random.randint(100, 1000, size=72),# Storage quantity of each level of warehousing 'demand': np.random.randint(50, 500, size=72),# Monthly demand 'supply': np.random.randint(40, 400, size=72), # Monthly supply 'price': np.random.uniform(10, 100, size=72),# Measuring the price of materials }; Define the following feature processing function to calculate the Pearson correlation coefficient between the data features and the target inventory quantity features of the measured materials: def feature_processing(df): features = df.drop(columns=['date']) target = features['storage_quantity'] feature_names = features.columns correlation_matrix = np.corrcoef(features.T) pearson_correlations = correlation_matrix[0] correlation_df = pd.DataFrame({ 'Feature': feature_names, 'Pearson_Correlation': pearson_correlations }) print(correlation_df) It should be noted that the Numpy library is a Python computing library that screens data features by calculating the Pearson correlation coefficient, quantitatively identifying data features with high correlation with target inventory quantity features. This reduces the interference of irrelevant features, improves the accuracy of feature selection, and helps improve the prediction efficiency and accuracy of the forecasting model. S22. Arrange the Pearson correlation coefficients in ascending order and remove data features corresponding to Pearson correlation coefficients below a set threshold to obtain preliminary screened data features; For example, the Pearson correlation coefficient threshold can be set to 0.1, and the data features corresponding to the Pearson correlation coefficients below the threshold are eliminated to obtain a preliminary screened data feature list; S23. Use the random forest model to evaluate the feature importance of the preliminarily screened data features using the random forest model, and arrange the importance evaluation results in descending order to obtain the finally screened data features selected_features; Exemplarily, the finally screened data features are obtained through the RandomForestRegressor function: X = df[selected_features].values y = df['storage_quantity'].values rf = RandomForestRegressor(random_state = 42) rf.fit(X, y) importances = rf.feature_importances_ importance_df = pd.DataFrame({ 'Feature': selected_features, 'Importance': importances }) importance_df=importance_df.sort_values(by='Importance', ascending=False) print("\nThe finally screened data features and their importance:") print(importance_df) return importance_df['Feature'] S24. Analyze the relationships between the finally screened data features, interact the related data features, construct polynomial features and cross features, and add them to the finally screened data features; S25. Encode the finally screened data features according to their types, construct time series features, and then add them to the finally screened data features to obtain data samples; It should be noted that through the Pearson correlation coefficient and the random forest model for feature selection, irrelevant and redundant features are removed, and features highly correlated with the target inventory quantity of measurement materials are retained, improving the accuracy and efficiency of the prediction model; S3. Divide the data samples into a training set and a test set, use the training set to train the ARIMA model, and then use the test set combined with the mean squared error algorithm to evaluate the model performance to obtain the optimal prediction model. The specific steps of step S3 are as follows: S31. Import the data samples into the Statsmodels library and divide them into a training set and a test set; S32. Construct an ARIMA model and determine the model parameters, where the model parameters include the autoregressive order, the differencing order, and the moving average order; Exemplarily, use the build_model function to construct an ARIMA(p, d, q) model, and initialize the values of p, d, and q. For example, p = 5, d = 1, and q = 0 can be initialized; Among them, p is the autoregressive order, indicating that the values of p time points are used to predict the current value, d is the differencing order, and q is the moving average order, indicating that the prediction errors of the past q time points are used to predict the current value; The specific steps for constructing the ARIMA(p, d, q) model are as follows: First, perform d-order differencing on the original time series to obtain a stationary series ; Among them, the first-order differencing is expressed as:

[0027] The d-order differencing is expressed as:

[0028] Exemplarily, if d = 2, then = ( - ) - ( - ) = - 2 +

[0029] Secondly, construct the following autoregressive term to characterize the linear relationship between the current value and the values of the past p time points : ; Among them, i takes integer values from 1 to p, is the autoregressive coefficient; Exemplarily, when p = 2, it means using and to predict ; Thirdly, construct the following moving translation term for and the prediction errors of the past q time points characterize the linear relationship between; ; where j takes an integer value between 1 and q, is the moving translation coefficient; Then introduce the constant term m, and finally obtain the ARIMA(p, d, q) formula as follows: ; S33. Use the training set to train the ARIMA model; It should be noted that the autoregressive coefficient of the ARIMA model is determined through training , the moving translation coefficient , the constant term c, and continuously adjust the differencing order d, the autoregressive order p, and the moving translation order q; S34. During the training process, input the data features screened from the test set into the ARIMA model for prediction, and obtain the predicted measurement material inventory features as the predicted values; S35. Use the measurement material inventory features within the historical lag period in the data features screened from the test set as the actual values; S36. Calculate the mean square error between the predicted value and the actual value, and use matplotlib to plot the comparison graph of the actual value and the predicted value; S37. Verify whether the mean square error between the predicted value and the actual value is less than the set threshold; If so, go to step S39; If not, go to step S38; S38. Adjust the model parameters of the ARMIA model and return to step S33; S39. Use the trained ARIMA model as the optimal prediction model; It should be noted that during the construction, training, and evaluation process of the ARIMA model, the optimal prediction model is obtained by continuously adjusting the model parameters, ensuring the accuracy and reliability of the prediction; S4. After collecting, cleaning, and processing the real-time measurement material data, perform feature processing and input it into the optimal prediction model for predicting the warehousing data of power measurement materials; The specific steps of step S4 are as follows: S41. Obtain the real-time measurement material data and perform data cleaning and processing according to step S1; S42. Perform feature processing on the processed real-time measurement material data according to step S2, including feature selection, feature encoding, and time series feature construction; S43. Input the real-time measurement material data that has completed feature processing into the optimal prediction model to obtain the predicted value of the warehousing data of power measurement materials; S44. Guide the warehousing planning of power metering materials according to the predicted values of the warehousing data of power metering materials; It should be noted that by inputting real-time data into the optimal prediction model, the dynamic prediction of the warehousing data of power metering materials is realized, and the warehousing planning is guided according to the prediction results, improving the efficiency and accuracy of inventory management.

[0030] In an embodiment of the present invention, based on steps S24 and S25, a possible embodiment will be given below to non-restrictively elaborate on its specific implementation scheme.

[0031] The specific steps of step S24 are as follows: S241. According to the demand relationship in the screened data features, obtain the storage quantity data feature and the demand quantity data feature in the historical metering material data as the original features, perform square and multiplication interactions, and sum them to form polynomial features; Exemplarily, for the storage data in the historical metering material data and the demand quantity data perform square and multiplication operations to obtain the square of the storage data as the first feature, obtain the square of the demand data as the second feature, obtain the product of the storage data and the demand data as the third feature, and sum the first feature , the second feature and the third feature to obtain polynomial features, and capture non-linear features through the polynomial features; S242. According to the supply relationship in the screened data features, obtain the storage quantity data feature and the available supply quantity data feature in the historical metering material data as the original features for combination to obtain cross features; Exemplarily, for the storage data in the historical metering material data and the available supply quantity data perform multiplication operation to obtain the cross feature , and capture the interaction feature between the storage data and the available supply quantity data through the cross feature ; S243. Add the polynomial features and the cross features to the finally screened data features; It should be noted that by constructing polynomial features and cross features, the relationship between data features is captured, improving the complexity and prediction ability of the prediction model; The specific steps of step S25 are as follows: S251. Classify each screened data feature in turn; If it is a categorical data feature, go to step S252; If it is a numerical data feature, go to step S253; If it is a time data feature, go to step S254; Exemplarily, use the ColumnTransformer function to process the data features; S252. Use one-hot encoding to convert categorical data features into numerical features, and go to step S255; Exemplarily, use the OneHotEncoder function for one-hot encoding; S253. Perform normalization on numerical data features to eliminate the influence of dimensions, and go to step S255; S254. Decompose time data features according to the target unit time; S255. Create the inventory feature of measurement materials within the lag period based on the finally selected data features, calculate the moving average storage feature of measurement materials within the agreed period, use the average storage feature of measurement materials per unit time as the seasonal feature, and use the linear regression method to estimate the trend feature of the time series to complete the construction of time series features; Exemplarily, for the lag time feature, let be the storage at time t, and the lag feature of lag m periods is ; Taking m = 1 to represent the previous month as an example, if the storage at time t is , and the storage of the previous month , then the lag time feature is 210; Through the lag feature, the time dependence of the data can be captured. If there is a relationship between the storage of this month and the previous month, for example, if the storage of the previous month is large, this month may adjust the procurement or usage strategy accordingly, then the lag feature can introduce this relationship into the ARIMA model and learn the pattern in this time series; Calculate the seasonal feature through the following formula:

[0032] where s is the season, is the average storage of the s-th season, is the number of data within the s-th season, is the storage at time t; Taking the first quarter of spring as an example, assume the storage in spring 2020 is , the storage in spring 2021 is , and the storage in spring 2022 is ; Then the seasonal feature of spring is ; Capture the changes in seasonal demand in the warehousing of electricity metering materials through seasonal characteristics. For example, the increase in electricity consumption in summer leads to corresponding changes in the demand and storage volume of metering materials. By calculating seasonal characteristics, the ARIMA model can capture periodic patterns to accurately predict future storage volumes. For trend characteristics, construct a time series of the inventory characteristics of metering materials based on the time variable t. , and fit through linear regression. , obtaining the trend characteristics. ; Where a and b are coefficients obtained from linear regression estimation, is the error term; Taking 60 data points from January 2020 to December 2024 as an example, the time t ranges from 1 to 60, and fit the relationship between the inventory of metering materials and the time variable t through linear regression. If a is taken as 200, b is taken as 3, and for June 2022, then t = 30, then the calculated trend characteristics are obtained as ; Through trend characteristics, the long-term upward or downward trend of the inventory characteristics of metering materials can be captured. By estimating this trend and using it as a feature, the model can better predict the future trend of storage volume. S256. Add the constructed time series characteristics to the finally selected data characteristics to obtain data samples. It should be noted that different types of data characteristics are classified and processed, and time series characteristics are constructed, providing more feature information for the prediction model and improving the prediction accuracy of the prediction model.

[0033] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0034] As Figure 2 shown, the following is an embodiment of the electricity metering material warehousing prediction system provided by the embodiments of the present disclosure. This system belongs to the same inventive concept as the electricity metering material warehousing prediction methods in the above embodiments. For the details not described in detail in the embodiments of the electricity metering material warehousing prediction system, reference can be made to the embodiments of the above electricity metering material warehousing prediction methods.

[0035] The system includes: A data acquisition module for collecting historical metering material data and performing cleaning and processing. The historical metering material data includes warehousing data, supply and demand situation data, and market trend data of historical metering materials. A data feature processing module, which is used to perform feature processing including feature selection, feature encoding, and time series feature construction on the processed historical metering material data to obtain data samples; A prediction model construction and training module, which is used to divide the data samples into a training set and a test set, train the ARIMA model using the training set and evaluate the performance using the test set to obtain an optimal prediction model; A warehousing prediction module, which is used to collect real-time metering material data, clean and process it, then perform feature processing, and input it into the optimal prediction model to predict the power metering material warehousing data.

[0036] In this embodiment, through the data acquisition module, the feature processing module, the prediction model construction module, and the training and warehousing prediction module, the full process automation from data collection to the application of the prediction result is realized, improving the efficiency and accuracy of warehousing prediction.

[0037] The power metering material warehousing prediction method provided by the embodiment of this application can be applied to an electronic device. Those skilled in the art can understand that the structure of the electronic device involved in the embodiment of the present invention does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. In the embodiment of the present invention, the electronic device includes, but is not limited to, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown in the figure, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the embodiment of the present application described and / or claimed herein.

[0038] The electronic device may include a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, a key, a camera, a display screen, and a SIM card interface, etc.

[0039] It can be understood that the structure schematically shown in the embodiment of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0040] The processor may include one or more processing units. For example, the processor may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0041] Among them, the processor may be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.

[0042] A memory may also be provided in the processor for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can save the instructions or data that the processor has just used or recycled. If the processor needs to use the instruction or data again, it can be directly called from this memory. This avoids repeated accesses, reduces the waiting time of the processor, and thus improves the system efficiency.

[0043] The above-mentioned electronic device implements the technical solution of the power metering material storage prediction method of the present application, which includes collecting historical metering material data, cleaning and processing it; performing feature processing including feature selection, feature encoding, and time series feature construction on the processed historical metering material data to obtain data samples; dividing the data samples into a training set and a test set, training the ARIMA model using the training set, and then using the test set combined with the mean square error algorithm to evaluate the model performance to obtain an optimal prediction model; collecting real-time metering material data, cleaning and processing it, then performing feature processing, and inputting it into the optimal prediction model for predicting the storage data of power metering materials, achieving accurate prediction of the storage data of power metering materials, improving the efficiency and accuracy of inventory management, optimizing the resource allocation of the power system, reducing the operation cost, and improving the overall operation efficiency.

[0044] In the storage medium provided by the present application, there is a program product capable of implementing the power metering material storage prediction method.

[0045] The power metering material storage prediction method includes: Collect historical metrological material data and perform cleaning and processing; Perform feature processing including feature selection, feature encoding, and time series feature construction on the processed historical metrological material data to obtain data samples; Divide the data samples into a training set and a test set, use the training set to train the ARIMA model, and then use the test set combined with the mean square error algorithm to evaluate the model performance to obtain an optimal prediction model; After collecting and cleaning and processing the real-time metrological material data, perform feature processing and input it into the optimal prediction model for predicting the warehousing data of power metrological materials.

[0046] In some possible implementation manners, the power metrological material warehousing prediction method of the present disclosure can be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section of this specification.

[0047] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0048] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A power metering material warehousing prediction method, characterized in that, The steps include: S1. Collect historical measurement material data and clean and process it; S2. Perform feature selection, feature coding, and time series feature construction on the processed historical measurement material data to obtain data samples; S3. Divide the data sample into a training set and a test set. Use the training set to train the ARIMA model. Then use the test set combined with the mean square error algorithm to evaluate the model performance and obtain the optimal prediction model. S4. After collecting real-time metering material data and cleaning and processing it, feature processing is performed and input into the optimal prediction model to predict the storage data of power metering materials.

2. The power metering material warehousing prediction method according to claim 1, wherein The specific steps of step S1 are as follows: S11. Collect historical measurement material data at all levels of storage within a set time period within the power enterprise; the historical measurement material data includes historical measurement material storage data, supply and demand data, and market trend data; S12. Import the collected historical material measurement data into the Python Pandas library to perform missing value processing, outlier processing, duplicate data processing, outlier processing, and data smoothing. The data is then converted into a format that matches the ARIMA model to complete data cleaning. S13. Summarize the historical measurement material data after cleaning according to the target unit time.

3. The power metering material storage prediction method according to claim 2, wherein The specific steps of step S2 are as follows: S21. Use the Numpy library in Python to calculate the Pearson correlation coefficient between each data feature in the historical measurement material data and the measurement material target inventory quantity feature; S22. Arrange the Pearson correlation coefficients in ascending order and remove data features corresponding to Pearson correlation coefficients below a set threshold to obtain preliminary screened data features; S23. Use the random forest model to evaluate the feature importance of the initially selected data features, and sort the importance evaluation results from high to low to obtain the final selected data features; S24. Analyze the relationship between the final screened data features, interact the associated data features, construct polynomial features and cross features, and add them to the final screened data features; S25. Encode the final filtered data features according to their types, construct time series features, and then add them to the final filtered data features to obtain data samples.

4. The power metering material storage prediction method according to claim 3, wherein The specific steps of step S24 are as follows: S241. According to the demand relationship in the filtered data features, the storage data features and the demand data features in the historical measurement material data are obtained as the original features, and the square and multiplication interaction is performed to form a polynomial feature; S242. Based on the supply relationship in the filtered data features, obtain the storage quantity data features and the available supply quantity data features in the historical measurement material data as the original features and combine them to obtain the cross feature; S243. Add the polynomial features and the cross features to the final filtered data features.

5. The power metering material warehousing prediction method according to claim 4, wherein The specific steps of step S25 are as follows: S251. Classify the selected data features in turn; If it is a categorical data feature, proceed to step S252; If it is a numerical data feature, go to step S253; If it is a time - type data feature, go to step S254; S252. Use one - hot encoding to convert categorical data features into numerical features, and go to step S255; S253. Perform normalization on numerical data features to eliminate the influence of dimensions, and go to step S255; S254. Decompose time - type data features according to the target unit time; S255. Based on the finally selected data features, create the inventory features of measurement materials within the lag period, calculate the moving average storage features of measurement materials within the agreed period, use the average storage features of measurement materials per unit time as seasonal features, and use the linear regression method to estimate the trend features of the time series to complete the construction of time - series features; S256. Add the constructed time - series features to the finally selected data features to obtain data samples.

6. The power metering material storage prediction method according to claim 5, characterized in that, The specific steps of step S3 are as follows: S31. Import the data samples into the Statsmodels library and divide them into a training set and a test set; S32. Construct an ARIMA model and determine the model parameters, where the model parameters include the autoregressive order, the differencing order, and the moving average order; S33. Use the training set to train the ARIMA model; S34. During the training process, input the data features screened from the test set into the ARIMA model for prediction, obtain the predicted inventory features of measurement materials and use them as predicted values; S35. Use the inventory features of measurement materials within the historical lag period in the data features screened from the test set as actual values; S36. Calculate the mean squared error between the predicted value and the actual value, and use matplotlib to draw a comparison chart of the actual value and the predicted value; S37. Verify whether the mean squared error between the predicted value and the actual value is less than the set threshold; If so, go to step S39; If not, go to step S38; S38. Adjust the model parameters of the ARMIA model and return to step S33; S39. Use the trained ARIMA model as the optimal prediction model.

7. The power metering material warehousing prediction method according to claim 6, characterized in that The specific steps of step S4 are as follows: S41. Obtain real - time measurement material data and perform data cleaning and processing according to step S1; S42. Perform feature processing including feature selection, feature encoding, and time - series feature construction on the processed real - time measurement material data according to step S2; S43. Input the real - time measurement material data that has completed feature processing into the optimal prediction model to obtain the predicted value of the warehousing data of power measurement materials; S44. Guide the warehousing planning of power measurement materials according to the predicted value of the warehousing data of power measurement materials.

8. A power metering material warehousing prediction system, characterized in that Including: A data acquisition module, used to collect historical measurement material data and perform cleaning and processing, where the historical measurement material data includes the warehousing data of historical measurement materials, supply - demand situation data, and market trend data; A data feature processing module, used to perform feature processing including feature selection, feature encoding, and time - series feature construction on the processed historical measurement material data to obtain data samples; A prediction model construction and training module, which is used to divide data samples into a training set and a test set, train an ARIMA model using the training set and evaluate the performance using the test set to obtain an optimal prediction model; A warehousing prediction module, which is used to collect real-time metering material data, clean and process it, then perform feature processing, and input it into the optimal prediction model for power metering material warehousing data prediction.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the power metering material warehousing prediction method according to any one of claims 1 to 7 when executing the program.

10. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, it implements the steps of the power metering material warehousing prediction method according to any one of claims 1 to 7.