Gas consumption prediction method based on machine learning

Through a machine learning-based method, combining wireless sensing networks and autoregressive integral sliding average model, dynamically adapting to user behavior and environmental changes, solving the limitations of existing gas consumption prediction methods in terms of accuracy and reliability, and achieving more accurate and reliable gas consumption prediction.

CN119848653AActive Publication Date: 2025-04-18贵州数联慧云数字科技有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411750811.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-18
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

The existing gas consumption prediction methods are difficult to dynamically adapt to user behavior and environmental changes, resulting in limitations in the accuracy and reliability of the prediction results.

Method used

Using a machine learning-based approach, gas usage data and environmental parameters are collected through wireless sensing networks, combined with user behavior analysis and time series analysis, an autoregressive integral sliding average model is constructed, and Bayesian optimization is used to optimize model parameters to adapt to nonlinear and dynamic changes in gas consumption.

Benefits of technology

It significantly improves the accuracy and reliability of gas consumption forecasts, so that the forecast results not only reflect historical trends, but also adapt to possible future changes, provide more accurate data support, and help users and gas suppliers plan gas usage and energy-saving measures more effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848653A_ABST
    Figure CN119848653A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of energy management and prediction, in particular to a gas consumption prediction method based on machine learning, and the method comprises the following steps: S1, collecting gas use related data through a wireless sensor network; s2, identifying a gas use habit of a user; s3, the influence of seasonal changes and weather conditions on gas consumption is evaluated; s4, combining analysis results of S2 and S3 to construct a gas consumption prediction model; s5, optimizing parameters of the gas consumption prediction model; s6, performing short-term and medium-term prediction on the gas consumption by using the model optimized in the S5; s7, according to the actual consumption data and the prediction result, updating parameters of user behavior analysis and environmental impact evaluation; and S8, generating a comprehensive report including a gas consumption prediction result and an energy-saving suggestion. According to the method, through integrating user behaviors and environmental factor analysis, the prediction accuracy is remarkably improved, and the user participation degree and satisfaction degree are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of energy management and forecasting technology, and in particular to a gas consumption forecasting method based on machine learning. Background Art

[0002] In modern society, with the acceleration of urbanization and the improvement of residents' living standards, gas is increasingly used as a major energy source in households and industries. The efficient use of gas and energy management have become an important issue. Traditional gas consumption prediction methods mainly rely on historical consumption data and usually use simple linear regression or time series analysis methods for prediction. Although these methods can provide basic consumption predictions to a certain extent, they usually ignore the diversity of user behavior and the influence of environmental factors, such as seasonal changes, temperature and humidity, resulting in limitations in the accuracy and reliability of the prediction results.

[0003] The main problem facing current gas consumption prediction technology is the lack of dynamic adaptability to user specific behaviors and environmental changes. For example, users' gas usage habits may change due to seasonal changes, weather conditions or personal habits. These changes are often difficult to accurately capture in existing prediction models. In addition, existing methods have poor performance in processing nonlinear data and cannot effectively deal with sudden changes or extraordinary patterns in gas usage, which limits the effectiveness and efficiency of the prediction system in practical applications.

[0004] Therefore, it becomes particularly urgent and necessary to develop a gas consumption prediction method that can comprehensively consider user behavior, environmental factors and their dynamic changes. Summary of the invention

[0005] Based on the above objectives, the present invention provides a gas consumption prediction method based on machine learning.

[0006] The gas consumption prediction method based on machine learning includes the following steps:

[0007] S1: Collect gas usage related data through wireless sensor network, including gas flow, usage time and environmental parameters;

[0008] S2: Based on the data collected in S1, identify the user's gas usage habits through the user behavior analysis algorithm;

[0009] S3: Analyze the environmental parameter data in S1 to evaluate the impact of seasonal changes and weather conditions on gas consumption;

[0010] S4: Combining the analysis results of S2 and S3, using time series analysis technology, a gas consumption prediction model is constructed;

[0011] S5: Use Bayesian optimization method to optimize the parameters of the gas consumption prediction model to adapt to the nonlinear and dynamic changes of gas consumption;

[0012] S6: Using the optimized model in S5, short-term and medium-term forecasts of gas consumption are performed;

[0013] S7: Update the parameters of user behavior analysis and environmental impact assessment using adaptive learning algorithms based on actual consumption data and prediction results;

[0014] S8: Generate a comprehensive report including gas consumption forecast results and energy-saving suggestions, and provide the report to users and gas suppliers through a two-way communication mechanism.

[0015] Optionally, the S1 specifically includes:

[0016] S11: configuring a wireless sensor network, including a flow sensor, a time recorder, and an environmental sensor; wherein the flow sensor is used to measure the real-time flow of gas; the time recorder is used to record the specific time period of gas use; and the environmental sensor is used to capture environmental parameters, including temperature, humidity, and air pressure;

[0017] S12: The flow sensor is deployed at the entrance of the gas pipeline and uses ultrasonic measurement technology to capture gas flow data;

[0018] S13: The time recorder works synchronously with the flow sensor to record the start and end time of each gas use, ensuring the accuracy of the time label of each data point;

[0019] S14: Environmental sensors are deployed in areas where users live or use gas. The environmental sensors include temperature sensors, humidity sensors, and air pressure sensors. The temperature sensor measures ambient temperature data using a thermocouple or thermistor, the humidity sensor measures air humidity data using a capacitive or resistive sensor, and the air pressure sensor measures atmospheric pressure data using a piezoelectric effect.

[0020] S15: sending the data collected in S12, S13 and S14 to the central data processing unit through the wireless transmission module;

[0021] S16: The central data processing unit receives data from each sensor and performs preliminary data synchronization and outlier detection.

[0022] Optionally, the S2 specifically includes:

[0023] S21: Receives data collected from S1, including gas flow, usage time and environmental parameters;

[0024] S22: Performing time series analysis on the received data to identify peak and trough periods of gas usage and periodic patterns of gas usage;

[0025] S23: classifying the gas usage data by using a K-means clustering algorithm, and dividing the users into different groups according to their gas usage patterns, specifically into cooking time and hot water usage time and frequency;

[0026] S24: In each group, the association rule learning algorithm is applied to analyze the cooking time preference and hot water usage habits, and identify the gas usage patterns of users under different time periods and environmental conditions; specifically, the April algorithm is used to mine frequent item sets and association rules, and the formula is:

[0027] Among them, A represents a certain behavior pattern of gas use;

[0028] Among them, B represents another behavior pattern associated with A.

[0029] Optionally, the S3 specifically includes:

[0030] S31: Receives environmental parameter data from S1, including ambient temperature, ambient humidity and atmospheric pressure; and standardizes the environmental parameter data to eliminate the influence between different dimensions;

[0031] S32: performing correlation analysis on the standardized environmental parameter data and the gas consumption data, and calculating the Pearson correlation coefficient between each environmental parameter and the gas consumption;

[0032] S33: Divide the whole year into four seasons and analyze the average gas consumption in each season. The formula is: Among them, F season,k represents the average gas consumption in the kth season, N k is the number of data points in the season, t∈season,k represents all time points belonging to the kth season;

[0033] S34: Combine the analysis results of S32 and S33 to evaluate the impact of environmental parameters and seasonal changes on gas consumption and generate an impact assessment report, which includes the correlation of various environmental parameters on gas consumption and the average gas consumption in each season.

[0034] Optionally, the S4 specifically includes:

[0035] S41: receiving the user gas usage habit data from S2 and the environmental parameters and seasonal change impact data from S3; integrating the user gas usage habit data and the environmental parameter data in time series to form a comprehensive data set D, which includes gas flow, usage time, standardized environmental parameters and seasonal factors;

[0036] S42: Perform a stationarity test on the comprehensive data set D, specifically using a unit root test to verify the stationarity of the time series data;

[0037] S43: If the data is not stable, it is converted into a stable series through difference processing. The difference formula is: Y t ′=Y t -Y t-1 , where ΔF t Indicates the gas usage after differentiation, F t and F t-1 Respectively represent the gas usage at time t and t-1;

[0038] S44: Use the stationary sequence Y′ combined with the standardized environmental parameter E′ and the seasonal factor S to construct an autoregressive integrated moving average model, that is, a gas consumption prediction model, which is expressed as:

[0039]

[0040] Where, ΔF t represents the difference value of gas usage at time t; is a constant term; is the coefficient of the autoregressive term, indicating the weight of the i-th lag term; θ j is the moving average coefficient, which represents the weight of the jth error term; E k,t ′ is the kth standardized environmental parameter at time t; S l,t is the lth seasonal variable at time t; β k is the regression coefficient of environmental parameters; γ l is the regression coefficient of seasonal factors; ∈ t is the error term; p is the autoregressive order; q is the moving average order.

[0041] Optionally, the S5 specifically includes:

[0042] S51: define the objective function of the gas consumption prediction model, specifically using the mean square error as the evaluation index, and the objective function is: Where N is the number of data points; F t is the actual gas usage at time t; is the predicted gas usage at time t;

[0043] S52: Select the parameter set to be optimized for the gas consumption prediction model, including the autoregressive term coefficient Moving average coefficient θ j , regression coefficient β of environmental parameters k and the regression coefficient of the seasonal factor γ l ;

[0044] S53: Use Bayesian optimization method to optimize the objective function;

[0045] S54: According to the optimal parameter combination obtained by Bayesian optimization, the parameter set to be optimized of the gas consumption prediction model is updated.

[0046] Optionally, the S53 specifically includes:

[0047] S531: Construct a proxy model to approximate the distribution of the objective function in the parameter space. The expression of the proxy model is: y = f(x) + ∈, where y is the objective function value; x is the parameter vector, including θ j ,β k and γ l ; f(x) is the true objective function; ∈ is the error term, which obeys the normal distribution;

[0048] S532: Based on the proxy model, the expected improvement criterion is used to select the next sampling point. The expected improvement calculation formula is: EI(x) = E[max(0,f)(x + )-f(x * )|D], where x + is the next sampling point; x * is the current optimal point; D is the historical sampling data set;

[0049] S533: Calculate the sampling point x + The objective function value at the location is updated, and the proxy model is updated, and the new sampling point and its objective function value are added to the historical sampling data set;

[0050] S534: Repeat the above S532 and S533 until a preset stop condition is met, including the maximum number of iterations or the convergence of the objective function value.

[0051] Optionally, the S6 specifically includes:

[0052] S61: Obtain optimized autoregressive integrated moving average model parameters;

[0053] S62: Define the input data for the gas consumption prediction model, including historical gas consumption data, environmental parameters, and seasonal factors, ensuring that the data set covers at least the past year's data to reflect consumption patterns in different seasons;

[0054] S63: Apply the optimized model to make short-term and medium-term gas consumption forecasts;

[0055] S64: Use the sliding window method to update the input data of the model. As new data is added, the historical data in the window is continuously updated to maintain the timeliness and accuracy of the model.

[0056] Optionally, the S7 specifically includes:

[0057] S71: Collect actual gas consumption data and forecasted consumption data, including the short-term and medium-term forecast results from S6 and the actual gas consumption in the corresponding time period;

[0058] S72: Calculate the error between the actual consumption data and the predicted result, and use the mean absolute percentage error as the error evaluation index. The formula is: Where N is the number of data points; F t is the actual gas usage at time t; is the predicted gas usage at time t;

[0059] S73: judging whether the prediction model needs to be updated according to the calculated error value, and triggering the model update when the error exceeds a preset threshold;

[0060] S74: Adopting an adaptive learning algorithm to update the parameters of the user behavior analysis and the environmental impact assessment, the specific steps include:

[0061] S741: Initialize the parameters of the adaptive learning algorithm, including the learning rate η and the momentum μ, which are used to control the step size and speed of parameter update;

[0062] S742: Use the gradient descent method to update the user behavior analysis parameters. The update formula of the gradient descent is: Among them, θ i,t is the behavior parameter of the i-th user at time t; L is the loss function; η is the learning rate; μ is the momentum;

[0063] S743: Update the parameters of the environmental impact assessment using the same gradient descent method;

[0064] S75: re-inputting the updated user behavior analysis parameters and environmental impact assessment parameters into the prediction model to perform the next round of gas consumption prediction;

[0065] S76: Repeat the process from S71 to S75 regularly to ensure that the prediction model can dynamically adapt to user behavior and environmental changes.

[0066] Optionally, the S8 specifically includes:

[0067] S81: Collect and organize the gas consumption forecast results from S6, including short-term and medium-term gas usage forecast data;

[0068] S82: Analyze the prediction results, combine the user behavior analysis data and environmental impact assessment data, and generate energy-saving suggestions, including specific measures to optimize gas usage time, improve equipment efficiency, and reduce waste;

[0069] S83: Prepare a comprehensive report including gas consumption forecast results, energy saving suggestions, user behavior analysis and environmental impact assessment;

[0070] S84: Provide the comprehensive report to the user and the gas supplier through a two-way communication mechanism, including the following steps:

[0071] S841: Generate unique access credentials for each user and gas supplier;

[0072] S842: Upload the comprehensive report to a secure cloud server via the Internet, allowing users and gas suppliers to log in and view the report using access credentials;

[0073] S843: Provide a feedback function to allow users and gas suppliers to make comments and suggestions on the report content through an online platform;

[0074] S844: Update reports regularly, combine the latest gas consumption data and user feedback, and continuously improve and optimize report content and energy-saving suggestions.

[0075] Beneficial effects of the present invention:

[0076] The present invention significantly improves the accuracy and reliability of prediction by integrating user behavior analysis with the influence of environmental parameters. Traditional methods often fail to fully consider the diversity of individual user behaviors and the real-time impact of environmental changes, such as temperature, humidity and seasonal changes. The present invention can dynamically adapt to changes in these factors by using advanced data analysis techniques, such as the autoregressive integrated moving average (ARI MA) model and Bayesian optimization. This method enables gas consumption forecasts to not only reflect historical trends, but also adapt to possible future changes, thereby providing more accurate data support for gas suppliers and users, helping them to more effectively plan gas usage and energy-saving measures.

[0077] The present invention provides prediction results and energy-saving suggestions through a two-way communication mechanism, further enhancing the interaction and communication between users and suppliers. This mechanism not only ensures the transparency and timely update of information, but also allows users to provide feedback based on their actual consumption, so that the prediction model can be continuously optimized and adjusted. This continuous feedback and update cycle ensures the long-term effectiveness and adaptability of the prediction system in actual operation, greatly improves the intelligence level of energy management and user satisfaction, and also promotes the rational use of energy resources and the realization of energy conservation and emission reduction. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0079] Figure 1 A schematic diagram of a method for predicting gas consumption according to an embodiment of the present invention;

[0080] Figure 2 The figure is a schematic diagram of the process of constructing a gas consumption prediction model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0081] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. At the same time, it is explained here that in order to make the embodiments more detailed, the following embodiments are the best and preferred embodiments, and those skilled in the art may also adopt other alternatives to implement some known technologies; and the accompanying drawings are only for more specific description of the embodiments, and are not intended to specifically limit the present invention.

[0082] It should be noted that the references to "one embodiment", "an embodiment", "an exemplary embodiment", "some embodiments" and the like in the specification indicate that the embodiments described may include specific features, structures or characteristics, but not every embodiment may include the specific features, structures or characteristics. In addition, when a specific feature, structure or characteristic is described in conjunction with an embodiment, it should be within the knowledge of a person skilled in the art to implement such feature, structure or characteristic in conjunction with other embodiments (whether or not explicitly described).

[0083] In general, a term can be understood, at least in part, from its use in context. For example, depending, at least in part, on the context, the term "one or more" as used herein can be used to describe any feature, structure, or characteristic in the singular sense, or can be used to describe a combination of features, structures, or characteristics in the plural sense. Additionally, the term "based on" can be understood as not necessarily intended to convey an exclusive set of factors, but can instead, depending, at least in part, on the context, allow for the presence of other factors that are not necessarily explicitly described.

[0084] like Figure 1-Figure 2 As shown, the gas consumption prediction method based on machine learning includes the following steps:

[0085] S1: Collect gas usage related data through wireless sensor network, including gas flow, usage time and environmental parameters (such as temperature and humidity);

[0086] S2: Based on the data collected in S1, identify the user's gas usage habits through the user behavior analysis algorithm;

[0087] S3: Analyze the environmental parameter data in S1 to evaluate the impact of seasonal changes and weather conditions on gas consumption;

[0088] S4: Combining the analysis results of S2 and S3, using time series analysis technology, a gas consumption prediction model is constructed;

[0089] S5: Use Bayesian optimization method to optimize the parameters of the gas consumption prediction model to adapt to the nonlinear and dynamic changes of gas consumption;

[0090] S6: Using the optimized model in S5, short-term and medium-term forecasts of gas consumption are performed;

[0091] S7: Based on actual consumption data and prediction results, use adaptive learning algorithms to update the parameters of user behavior analysis and environmental impact assessment to improve prediction accuracy and system adaptability;

[0092] S8: Generate a comprehensive report including gas consumption forecast results and energy-saving suggestions, and provide the report to users and gas suppliers through a two-way communication mechanism.

[0093] The gas usage data collected in S1 specifically include:

[0094] S11: configuring a wireless sensor network, including a flow sensor, a time recorder, and an environmental sensor; wherein the flow sensor is used to measure the real-time flow of gas; the time recorder is used to record the specific time period of gas use; and the environmental sensor is used to capture environmental parameters, including temperature, humidity, and air pressure;

[0095] S12: The flow sensor is deployed at the entrance of the gas pipeline and uses ultrasonic measurement technology to accurately capture the gas flow data. The ultrasonic measurement technology calculates the gas flow rate based on the propagation time difference of the signal by transmitting and receiving ultrasonic signals.

[0096] S13: The time recorder works synchronously with the flow sensor to record the start and end time of each gas use, ensuring the accuracy of the time label of each data point;

[0097] S14: Environmental sensors are deployed in areas where users live or use gas. Environmental sensors include temperature sensors, humidity sensors, and air pressure sensors. The temperature sensor uses a thermocouple or thermistor to measure ambient temperature data, the humidity sensor uses a capacitive or resistive sensor to measure air humidity data, and the air pressure sensor uses the piezoelectric effect to measure atmospheric pressure data.

[0098] S15: The data collected in S12, S13 and S14 are sent to the central data processing unit through a wireless transmission module; the wireless transmission module uses low-power Bluetooth or Wi-Fi technology to ensure the real-time nature of the data and the energy efficiency of the transmission;

[0099] S16: The central data processing unit receives data from each sensor and performs preliminary data synchronization and outlier detection to provide a clean and integrated data set for subsequent data preprocessing and analysis;

[0100] Through the combination of the above steps, the accuracy and reliability of gas consumption data collection are improved. This method makes gas consumption prediction more accurate, helps optimize gas use and energy conservation, and greatly improves the system's response speed and user satisfaction through real-time data transmission and efficient data processing.

[0101] S2 specifically includes:

[0102] S21: Receives data collected from S1, including gas flow, usage time and environmental parameters;

[0103] S22: Perform time series analysis on the received data to identify peak and low periods of gas use, as well as periodic patterns of gas use; specifically, use an autocorrelation function (ACF) to identify the periodic pattern of gas use, and the formula is: Where τ is the lag period, N is the number of data points, and F t is the gas usage at time t, μ F and σ F are the mean and standard deviation of gas usage, respectively;

[0104] S23: The gas usage data is classified by the K-means clustering algorithm, and users are divided into different groups according to their gas usage patterns, specifically into cooking time and hot water usage time and frequency; the objective function of the K-means clustering algorithm is: Where k is the number of clusters, C i is the i-th cluster, μ i is the mean of the i-th cluster, and F is the i Gas usage data points;

[0105] S24: In each group, the association rule learning algorithm is applied to analyze the cooking time preference and hot water usage habits, and identify the gas usage patterns of users under different time periods and environmental conditions; specifically, the April algorithm is used to mine frequent item sets and association rules, and the formula is:

[0106] Among them, A represents a certain behavior pattern of gas use;

[0107] Among them, B represents another behavior pattern associated with A; through the above-mentioned steps and technologies used in describing user behavior analysis, the identification of user gas usage habits is made more accurate. This method not only improves the accuracy of prediction, but also can dynamically adjust the prediction model according to changes in user behavior, thereby optimizing gas usage efficiency and energy-saving effects.

[0108] S3 specifically includes:

[0109] S31: Receive environmental parameter data from S1, including ambient temperature, ambient humidity and atmospheric pressure; and standardize the environmental parameter data to eliminate the influence between different dimensions, so that the mean value of each parameter is zero and the standard deviation is one. The formula is: Among them, E i,t represents the i-th environmental parameter at time t, and Represent the environmental parameters E i The mean and standard deviation of

[0110] S32: Perform correlation analysis on the standardized environmental parameter data and the gas consumption data, and calculate the Pearson correlation coefficient between each environmental parameter and the gas consumption. The formula is:

[0111] in, represents the correlation coefficient between the i-th environmental parameter and gas consumption, N is the number of data points, and represent the means of standardized environmental parameters and gas consumption respectively;

[0112] S33: Divide the whole year into four seasons (spring, summer, autumn and winter) and analyze the average gas consumption in each season. The formula is: Among them, F season,k represents the average gas consumption in the kth season, N k is the number of data points in the season, t∈season,k represents all time points belonging to the kth season;

[0113] S34: Combined with the analysis results of S32 and S33, the impact of environmental parameters and seasonal changes on gas consumption is evaluated, and an impact assessment report is generated. The report content includes the correlation of various environmental parameters on gas consumption and the average gas consumption in each season; through the standardized processing, correlation analysis, seasonal change modeling and comprehensive evaluation of the environmental parameter data described above, the impact of seasonal changes and weather conditions on gas consumption is systematically analyzed. This method can provide reliable basic data for subsequent gas consumption forecasts, thereby improving the accuracy of the forecast and optimizing gas use and energy saving effects.

[0114] The gas consumption prediction model constructed in S4 specifically includes:

[0115] S41: receiving the user gas usage habit data from S2 and the environmental parameters and seasonal change impact data from S3; integrating the user gas usage habit data and the environmental parameter data in time series to form a comprehensive data set D, which includes gas flow, usage time, standardized environmental parameters and seasonal factors;

[0116] S42: Perform a stationarity test on the comprehensive data set D. Specifically, the unit root test (ADF test) is used to verify the stationarity of the time series data. The formula is: Where, ΔF t Represents the differential value of gas usage at time t; α is the constant term; β is the time trend term; γ is the lag term coefficient; δ is the differential term coefficient; ∈ t is the error term; t is the time; k is the difference order;

[0117] S43: If the data is not stable, it is converted into a stable series through difference processing. The difference formula is: Y t ′=Y t -Y t-1 , where ΔF t Indicates the gas usage after differentiation, F t and F t-1 Respectively represent the gas usage at time t and t-1;

[0118] S44: Use the stationary sequence Y′ combined with the standardized environmental parameter E′ and the seasonal factor S to construct the autoregressive integrated moving average (ARIMA) model, i.e., the gas consumption prediction model, which is expressed as:

[0119]

[0120] Where, ΔF t represents the difference value of gas usage at time t; is a constant term; is the coefficient of the autoregressive term, indicating the weight of the i-th lag term; θ j is the moving average coefficient, which represents the weight of the jth error term; E k,t ′ is the kth standardized environmental parameter (E 1,t ′ is temperature, E 2,t ′ is humidity, E 3,t ' is atmospheric pressure); S l,t is the lth seasonal variable (S 1,t For spring, S 2,t For the season of S 3,t For autumn, S 4,t is winter, the value is 0 or 1); β k is the regression coefficient of environmental parameters; γ l is the regression coefficient of seasonal factors; ∈ t is the error term; p is the autoregressive order; q is the moving average order;

[0121] Through the above method, each step from data integration, stationarity detection, differential processing to building an ARIMA model is described in detail, and a gas consumption prediction model that can comprehensively consider user habits, environmental parameters and seasonal factors is systematically constructed, which helps to improve the overall performance and user satisfaction of the gas consumption prediction system.

[0122] The parameters for optimizing the gas consumption prediction model in S5 specifically include:

[0123] S51: define the objective function of the gas consumption prediction model, specifically using mean square error (MSE) as the evaluation index, and the objective function is: Where N is the number of data points; F t is the actual gas usage at time t; is the predicted gas usage at time t;

[0124] S52: Select the parameter set to be optimized for the gas consumption prediction model, including the autoregressive term coefficient Moving average coefficient θ j , regression coefficient β of environmental parameters k and the regression coefficient of the seasonal factor γ l , and set the initial value and search range of the parameter to be optimized, where: Indicates that the value range is [0,1]; θ jThe value range is [0,1]; β k The value range is [-1,1]; γ l Indicates that the value range is [-1,1];

[0125] S53: Use Bayesian optimization method to optimize the objective function;

[0126] S54: According to the optimal parameter combination obtained by Bayesian optimization, the parameter set to be optimized of the gas consumption prediction model is updated.

[0127] S53 specifically includes:

[0128] S531: Construct a proxy model (such as a Gaussian process regression model) to approximate the distribution of the objective function in the parameter space. The expression of the proxy model is: y = f(x) + ∈, where y is the objective function value (MSE); x is the parameter vector, including θ j ,β k and γ l ; f(x) is the true objective function; ∈ is the error term, which obeys the normal distribution;

[0129] S532: Based on the proxy model, the expected improvement (EI) criterion is used to select the next sampling point. The expected improvement is calculated as follows: EI(x) = E[max(0,f)(x + )-f(x * )|D], where x + is the next sampling point; x * is the current optimal point; D is the historical sampling data set;

[0130] S533: Calculate the sampling point x + The objective function value at the location is updated, and the proxy model is updated, and the new sampling point and its objective function value are added to the historical sampling data set;

[0131] S534: Repeat the above S532 and S533 until the preset stop conditions are met, including the maximum number of iterations or the convergence of the objective function value; through the above steps, the nonlinear and dynamic change problems of gas consumption are systematically solved, and the Bayesian optimization method uses an efficient proxy model and expected improvement criterion to make the parameter optimization process more intelligent and accurate, thereby improving the accuracy and stability of the prediction model and optimizing the gas utilization efficiency and energy saving effect.

[0132] S6 specifically includes:

[0133] S61: Get the optimized autoregressive integrated moving average model parameters, including the autoregressive term coefficients Moving average coefficient (θ j ), regression coefficients of environmental parameters (βk ) and the regression coefficient of seasonal factors (γ l );

[0134] S62: Define the input data for the gas consumption prediction model, including historical gas consumption data, environmental parameters, and seasonal factors, ensuring that the data set covers at least the past year's data to reflect consumption patterns in different seasons;

[0135] S63: Apply the optimized model to predict short-term and medium-term gas consumption. The specific prediction formula is:

[0136]

[0137] Among them, F pred,t+ h represents the predicted gas consumption at time t+h; F t-i Indicates the actual gas consumption at time ti; ∈ t-j represents the error term, which is provided by the historical error data of the model; E k,t ′ represents the standardized environmental parameters at time t; S l,t represents the seasonal variable at time t; h represents the time step of the forecast, with short-term forecasts covering the next 1-3 months and medium-term forecasts covering the next 3-12 months;

[0138] S64: Use the sliding window method to update the input data of the model. As new data is added, the historical data in the window is continuously updated to maintain the timeliness and accuracy of the model.

[0139] S7 specifically includes:

[0140] S71: Collect actual gas consumption data and forecasted consumption data, including the short-term and medium-term forecast results from S6 and the actual gas consumption in the corresponding time period;

[0141] S72: Calculate the error between the actual consumption data and the predicted results, and use the mean absolute percentage error (MAPE) as the error evaluation index. The formula is: Where N is the number of data points; F t is the actual gas usage at time t; is the predicted gas usage at time t;

[0142] S73: judging whether the prediction model needs to be updated according to the calculated error value, and triggering the model update when the error exceeds a preset threshold;

[0143] S74: Adopting an adaptive learning algorithm to update the parameters of the user behavior analysis and the environmental impact assessment, the specific steps include:

[0144] S741: Initialize the parameters of the adaptive learning algorithm, including the learning rate η and the momentum μ, which are used to control the step size and speed of parameter update;

[0145] S742: Use the gradient descent method to update the user behavior analysis parameters (such as time and frequency parameters in gas usage habits). The gradient descent update formula is: Among them, θ i,t is the behavior parameter of the i-th user at time t; L is the loss function, usually MAPE; η is the learning rate; μ is the momentum;

[0146] S743: Use the same gradient descent method to update the environmental impact assessment parameters (such as regression coefficients of temperature, humidity, and atmospheric pressure). The update formula is: Among them, β k,t is the regression coefficient of the kth environmental parameter at time t; other symbols are defined as above;

[0147] S75: re-inputting the updated user behavior analysis parameters and environmental impact assessment parameters into the prediction model to perform the next round of gas consumption prediction;

[0148] S76: Repeat the process from S71 to S75 regularly to ensure that the prediction model can dynamically adapt to user behavior and environmental changes and improve prediction accuracy;

[0149] Through the organic combination of the above steps, the dynamic adaptation problem of the prediction model is systematically solved. By regularly evaluating the error between the actual consumption data and the prediction results and using an adaptive learning algorithm to update the parameters, it is ensured that the model can respond to changes in user behavior and environment in a timely manner, thereby improving the accuracy and stability of the prediction.

[0150] S8 specifically includes:

[0151] S81: Collect and organize the gas consumption forecast results from S6, including short-term and medium-term gas usage forecast data;

[0152] S82: Analyze the prediction results, combine the user behavior analysis data and environmental impact assessment data, and generate energy-saving suggestions, including specific measures to optimize gas usage time, improve equipment efficiency, and reduce waste;

[0153] S83: Prepare a comprehensive report including gas consumption forecast results, energy-saving recommendations, user behavior analysis, and environmental impact assessment; the gas consumption forecast results are used to show the short-term and medium-term gas consumption forecast values, and attached charts of the forecast data; energy-saving recommendations are used to provide personalized energy-saving measures based on the analysis results; user behavior analysis is used to summarize the user's gas usage habits and patterns; and environmental impact assessment is used to illustrate the impact of environmental parameters and seasonal changes on gas consumption;

[0154] S84: Provide the comprehensive report to the user and the gas supplier through a two-way communication mechanism, including the following steps:

[0155] S841: Generate unique access credentials for each user and gas supplier to ensure security and privacy of reports;

[0156] S842: Upload the comprehensive report to a secure cloud server via the Internet, allowing users and gas suppliers to log in and view the report using access credentials;

[0157] S843: Provide feedback function, so that users and gas suppliers can make comments and suggestions on the report content through the online platform. The two-way communication mechanism ensures that the feedback can be delivered to the report generation system in time for improvement;

[0158] S844: Update the report regularly, combine the latest gas consumption data and user feedback, continuously improve and optimize the report content and energy-saving suggestions, and notify users and gas suppliers to check for updates through the same two-way communication mechanism; through the above steps, the information transmission and feedback problems are systematically solved. The two-way communication mechanism not only ensures the timely delivery and privacy security of the report, but also provides a channel for user feedback, so that the report content can be continuously improved and optimized, thereby improving the efficiency of gas use and user satisfaction.

[0159] The present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention. In order to make the public have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention, but those skilled in the art can fully understand the present invention without the description of these details. In addition, in order to avoid unnecessary confusion about the essence of the present invention, well-known methods, processes, procedures, components and circuits are not described in detail.

[0160] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A gas consumption prediction method based on machine learning, characterized in that: The following steps are involved: S1: Collect gas usage related data through wireless sensor network, including gas flow, usage time and environmental parameters; S2: Based on the data collected in S1, identify the user's gas usage habits through the user behavior analysis algorithm; S3: Analyze the environmental parameter data in S1 to evaluate the impact of seasonal changes and weather conditions on gas consumption; S4: Combining the analysis results of S2 and S3, using time series analysis technology, a gas consumption prediction model is constructed; S5: Use Bayesian optimization method to optimize the parameters of the gas consumption prediction model to adapt to the nonlinear and dynamic changes of gas consumption; S6: Using the optimized model in S5, short-term and medium-term forecasts of gas consumption are performed; S7: Update the parameters of user behavior analysis and environmental impact assessment using adaptive learning algorithms based on actual consumption data and prediction results; S8: Generate a comprehensive report including gas consumption forecast results and energy-saving suggestions, and provide the report to users and gas suppliers through a two-way communication mechanism.

2. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S1 specifically includes: S11: configuring a wireless sensor network, including a flow sensor, a time recorder, and an environmental sensor; wherein the flow sensor is used to measure the real-time flow of gas; the time recorder is used to record the specific time period of gas use; and the environmental sensor is used to capture environmental parameters, including temperature, humidity, and air pressure; S12: The flow sensor is deployed at the entrance of the gas pipeline and uses ultrasonic measurement technology to capture gas flow data; S13: The time recorder works synchronously with the flow sensor to record the start and end time of each gas use, ensuring the accuracy of the time label of each data point; S14: Environmental sensors are deployed in areas where users live or use gas. The environmental sensors include temperature sensors, humidity sensors, and air pressure sensors. The temperature sensor measures ambient temperature data using a thermocouple or thermistor, the humidity sensor measures air humidity data using a capacitive or resistive sensor, and the air pressure sensor measures atmospheric pressure data using a piezoelectric effect. S15: sending the data collected in S12, S13 and S14 to the central data processing unit through the wireless transmission module; S16: The central data processing unit receives data from each sensor and performs preliminary data synchronization and outlier detection.

3. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S2 specifically includes: S21: Receives data collected from S1, including gas flow, usage time and environmental parameters; S22: Performing time series analysis on the received data to identify peak and trough periods of gas usage and periodic patterns of gas usage; S23: classifying the gas usage data by using a K-means clustering algorithm, and dividing the users into different groups according to their gas usage patterns, specifically into cooking time and hot water usage time and frequency; S24: In each group, the association rule learning algorithm is applied to analyze the cooking time preference and hot water usage habits, and identify the gas usage patterns of users under different time periods and environmental conditions; specifically, the Apriori algorithm is used to mine frequent item sets and association rules, and the formula is: Support Among them, A represents a certain behavior pattern of gas use; Confidence Among them, B represents another behavior pattern associated with A.

4. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S3 specifically includes: S31: Receives environmental parameter data from S1, including ambient temperature, ambient humidity and atmospheric pressure; and standardizes the environmental parameter data to eliminate the influence between different dimensions; S32: performing correlation analysis on the standardized environmental parameter data and the gas consumption data, and calculating the Pearson correlation coefficient between each environmental parameter and the gas consumption; S33: Divide the whole year into four seasons and analyze the average gas consumption in each season. The formula is: Among them, F season,k represents the average gas consumption in the kth season, N k is the number of data points in the season, t∈season,k represents all time points belonging to the kth season; S34: Combine the analysis results of S32 and S33 to evaluate the impact of environmental parameters and seasonal changes on gas consumption and generate an impact assessment report, which includes the correlation of various environmental parameters on gas consumption and the average gas consumption in each season.

5. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S4 specifically includes: S41: receiving the user gas usage habit data from S2 and the environmental parameters and seasonal change impact data from S3; and integrating the user gas usage habit data and the environmental parameter data in time series to form a comprehensive data set D, which includes gas flow, usage time, standardized environmental parameters and seasonal factors; S42: Perform a stationarity test on the comprehensive data set D, specifically using a unit root test to verify the stationarity of the time series data; S43: If the data is not stable, it is converted into a stable series through difference processing. The difference formula is: Y t ′=Y t -Y t-1 , where ΔF t Indicates the gas usage after differentiation, F t and F t-1 Respectively represent the gas usage at time t and t-1; S44: Use the stationary sequence Y′ combined with the standardized environmental parameter E′ and the seasonal factor S to construct an autoregressive integrated moving average model, that is, a gas consumption prediction model, which is expressed as: Where, ΔF t represents the difference value of gas usage at time t; is a constant term; is the coefficient of the autoregressive term, indicating the weight of the i-th lag term; θ j is the moving average coefficient, which represents the weight of the jth error term; E k,t ′ is the kth standardized environmental parameter at time t; S l,t is the lth seasonal variable at time t; β k is the regression coefficient of environmental parameters; γ l is the regression coefficient of seasonal factors; ∈ t is the error term; p is the autoregressive order; q is the moving average order.

6. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S5 specifically includes: S51: define the objective function of the gas consumption prediction model, specifically using the mean square error as the evaluation index, and the objective function is: Where N is the number of data points; F t is the actual gas usage at time t; is the predicted gas usage at time t; S52: Select the parameter set to be optimized for the gas consumption prediction model, including the autoregressive term coefficient Moving average coefficient θ j , regression coefficient β of environmental parameters k and the regression coefficient of the seasonal factor γ l ; S53: Use Bayesian optimization method to optimize the objective function; S54: According to the optimal parameter combination obtained by Bayesian optimization, the parameter set to be optimized of the gas consumption prediction model is updated.

7. The method for predicting gas consumption based on machine learning according to claim 6, characterized in that: The S53 specifically includes: S531: Construct a proxy model to approximate the distribution of the objective function in the parameter space. The expression of the proxy model is: y = f(x) + ∈, where y is the objective function value; x is the parameter vector, including and γ l ; f(x) is the true objective function; ∈ is the error term, which obeys the normal distribution; S532: Based on the proxy model, the expected improvement criterion is used to select the next sampling point. The expected improvement calculation formula is: EI(x) = E[max(0,f)(x + )-f(x * )|D], where x + is the next sampling point; x * is the current optimal point; D is the historical sampling data set; S533: Calculate the sampling point x + The objective function value at the location is updated, and the proxy model is updated, and the new sampling point and its objective function value are added to the historical sampling data set; S534: Repeat the above S532 and S533 until a preset stop condition is met, including the maximum number of iterations or the convergence of the objective function value.

8. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S6 specifically includes: S61: Obtain optimized autoregressive integrated moving average model parameters; S62: Define the input data for the gas consumption prediction model, including historical gas consumption data, environmental parameters, and seasonal factors, ensuring that the data set covers at least the past year's data to reflect consumption patterns in different seasons; S63: Apply the optimized model to make short-term and medium-term gas consumption forecasts; S64: Use the sliding window method to update the input data of the model. As new data is added, the historical data in the window is continuously updated to maintain the timeliness and accuracy of the model.

9. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S7 specifically includes: S71: Collect actual gas consumption data and forecasted consumption data, including the short-term and medium-term forecast results from S6 and the actual gas consumption in the corresponding time period; S72: Calculate the error between the actual consumption data and the predicted result, and use the mean absolute percentage error as the error evaluation index. The formula is: Where N is the number of data points; F t is the actual gas usage at time t; is the predicted gas usage at time t; S73: judging whether the prediction model needs to be updated according to the calculated error value, and triggering the model update when the error exceeds a preset threshold; S74: Adopting an adaptive learning algorithm to update the parameters of the user behavior analysis and the environmental impact assessment, the specific steps include: S741: Initialize the parameters of the adaptive learning algorithm, including the learning rate η and the momentum μ, which are used to control the step size and speed of parameter update; S742: Use the gradient descent method to update the user behavior analysis parameters. The update formula of the gradient descent is: Among them, θ i,t is the behavior parameter of the i-th user at time t; L is the loss function; η is the learning rate; μ is the momentum; S743: Update the parameters of the environmental impact assessment using the same gradient descent method; S75: re-inputting the updated user behavior analysis parameters and environmental impact assessment parameters into the prediction model to perform the next round of gas consumption prediction; S76: Repeat the process from S71 to S75 regularly to ensure that the prediction model can dynamically adapt to user behavior and environmental changes.

10. The method for predicting gas consumption based on machine learning according to claim 1, characterized in that: The S8 specifically includes: S81: Collect and organize the gas consumption forecast results from S6, including short-term and medium-term gas usage forecast data; S82: Analyze the prediction results, combine the user behavior analysis data and environmental impact assessment data, and generate energy-saving suggestions, including specific measures to optimize gas usage time, improve equipment efficiency, and reduce waste; S83: Prepare a comprehensive report including gas consumption forecast results, energy saving suggestions, user behavior analysis and environmental impact assessment; S84: Provide the comprehensive report to the user and the gas supplier through a two-way communication mechanism, including the following steps: S841: Generate unique access credentials for each user and gas supplier; S842: Upload the comprehensive report to a secure cloud server via the Internet, allowing users and gas suppliers to log in and view the report using access credentials; S843: Provide a feedback function to allow users and gas suppliers to make comments and suggestions on the report content through an online platform; S844: Update reports regularly, combine the latest gas consumption data and user feedback, and continuously improve and optimize report content and energy-saving suggestions.

Citation Information

Patent Citations

  • Gas load combination prediction method based on support vector regression

    CN107730054A

  • Analysis method for gas consumption behavior of gas user

    CN108256752A

  • Fuel gas short-term load prediction method based on long short-term memory neural network

    CN115471008A

  • Fuel gas transmission loss prediction method for intelligent fuel gas and Internet of Things system

    CN115796408A

  • Fuel gas consumption prediction method based on artificial intelligence

    CN117370759A