Gas energy monitoring method based on Internet of Things
Through IoT technology and multi-source data fusion, deep learning and Bayesian networks, the problems of data diversity and slow response in gas energy monitoring are solved, real-time monitoring and dynamic adjustment of gas flow and combustion efficiency are achieved. Improves the system's response efficiency and security.
Patent Information
- Application Number
- CN202411425109.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing gas energy monitoring methods are in the problem of reduced analytical accuracy and slow system response due to data diversity and complexity, especially the effectiveness of gas flow regulation and early warning functions caused by the complexity of deep learning models and the lengthy preprocessing steps. Affected.
Using the Internet of Things-based gas energy monitoring method, multi-source data is collected through intelligent sensors, edge devices perform data cleaning, denoising and feature extraction, data fusion and preprocessing are used to build distributed storage and energy consumption prediction model, real-time monitoring and regulation of gas flow and combustion efficiency, establish multi-level early warning mechanisms and feedback loops, use Bayesian networks and fuzzy logic to deal with uncertainty, and combine reinforcement learning algorithms to optimize control strategies.
It significantly improves the quality and consistency of gas data, realizes real-time monitoring and dynamic adjustment of gas flow and combustion efficiency, enhances the system's response efficiency and safety, and ensures rapid response and energy efficiency management of the gas system in abnormal situations.
Smart Images

Figure CN119155315A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gas energy monitoring, and in particular to a gas energy monitoring method based on the Internet of Things. Background Art
[0002] Gas energy refers to the use of gaseous fuels such as natural gas, liquefied petroleum gas, coalbed methane, shale gas, etc. as energy. The gas is mainly composed of hydrocarbon compounds and can release heat energy when burned. Therefore, it is widely used in power generation, heating, cooking, industrial production and other fields.
[0003] Chinese Patent Publication No.: CN117871771B discloses a gas energy monitoring method based on big data, including collecting gas data information through sensors, meters and monitoring equipment, preprocessing and storing the collected data; presetting the combustion efficiency and gas flow according to the gas efficiency, and obtaining the gas combustion efficiency adaptation coefficient through the gas pressure and temperature after data preprocessing; establishing a gas energy consumption prediction neural network model based on deep learning and combined with the preprocessed gas data information to provide data support for subsequent monitoring processes; adjusting the gas flow according to the gas energy consumption prediction; real-time monitoring of the use of gas energy, combined with the gas combustion efficiency adaptation coefficient and the adjusted gas flow, to comprehensively monitor the gas system. This method collects gas data through sensors, instruments and monitoring equipment, and improves data quality through data preprocessing. However, the diversity and complexity of data sources, data noise or sensor errors will affect the accuracy of the analysis, resulting in calculation errors of the gas combustion efficiency change coefficient or a decrease in the accuracy of the energy consumption prediction model. At the same time, the system design includes real-time monitoring and adjustment mechanisms, but the neural network model based on deep learning and complex preprocessing steps will increase the calculation time and affect the real-time response speed of the system. If the system cannot process and respond to data changes in a timely manner, it will affect the effectiveness of the timely adjustment and early warning functions of the gas flow.
[0004] Therefore, those skilled in the art provide a gas energy monitoring method based on the Internet of Things to solve the problems raised in the above background technology. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention provides a gas energy monitoring method based on the Internet of Things to solve the problems raised in the above background technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: A gas energy monitoring method based on the Internet of Things comprises the following steps:
[0007] S1. Multi-source data collection: Use smart sensors to collect gas-related data and send the data to edge devices or cloud platforms via wireless networks;
[0008] S2. Data preprocessing: Perform data cleaning, denoising and feature extraction on edge devices, perform multi-source data fusion, perform anomaly detection and processing, and filter abnormal data;
[0009] S3. Data transmission: Encrypted communication protocol is used for data transmission, and data buffering and retransmission mechanism is used during the transmission process to ensure data integrity;
[0010] S4, distributed storage: store data in the distributed database system of the cloud platform;
[0011] S5. Build an energy consumption prediction model: Based on deep learning, use historical and real-time data to train the energy consumption prediction model, and the model adopts an online learning mechanism to dynamically adjust the prediction parameters;
[0012] S6. Real-time monitoring and adjustment: According to the energy consumption prediction results, the gas flow and combustion efficiency are adjusted in real time, and the adjustment parameters are optimized through the adaptive control algorithm;
[0013] S7. Multi-level warning mechanism: Set up multi-level warnings based on monitoring data and forecast results, send alarm notifications, and provide optimization suggestions and decision support based on monitoring data;
[0014] S8, Feedback loop: Collect system operation data, analyze feedback, and adjust prediction models and control strategies to adjust gas flow and combustion efficiency based on real-time and historical data;
[0015] S9. Equipment monitoring and maintenance: Remotely monitor system status, perform remote diagnosis and maintenance, and implement data encryption, access control, and privacy protection measures.
[0016] Preferably, the multi-source data collection in step S1 uses a Kalman filter algorithm to perform multi-source data fusion to process gas-related data collected by multiple sensors;
[0017] Multi-source data fusion includes the following formula:
[0018] State prediction equation:
[0019]
[0020] in, is the state prediction at that moment, A is the state transfer matrix, B is the control input matrix, u k is the control input, w k is the process noise;
[0021] Covariance prediction equation:
[0022] P k|k-1 =AP k-1|k-1 AT +Q,
[0023] Among them, P k|k-1 is the predicted state covariance matrix, Q is the process noise covariance matrix;
[0024] Kalman gain calculation:
[0025] K k =P k|k-1 H T (HP k|k-1 H T +R) -1 ,
[0026] Among them, K k is the Kalman gain, H is the observation matrix, and R is the observation noise covariance matrix;
[0027] State update equation:
[0028]
[0029] in, is the updated state estimate, z k is the actual measured value;
[0030] Covariance update equation:
[0031] P k|k =(IK k H)P k|k-1 ,
[0032] Among them, P k|k is the updated state covariance matrix.
[0033] Preferably, in the data preprocessing of step S2, the algorithm formula of the Gaussian mixture model is used to process the denoising and anomaly detection of multi-source data, which can effectively extract the main features in the data and filter out noise and abnormal data;
[0034] Gaussian mixture models are used to cluster data and detect abnormal data points;
[0035] Probability density estimation:
[0036]
[0037] Where p(x) is the probability density of the input data x, K is the number of components of the Gaussian mixture model, and π i is the weight of the i-th Gaussian component, is the probability density function of the ith Gaussian distribution with mean μ i and covariance Σ i ;
[0038] Expectation-Maximization Algorithm:
[0039] Expected step: Calculate the probability of each data point belonging to each Gaussian component:
[0040]
[0041] Among them, γ i (z n ) is the data point z n The probability of belonging to the i-th Gaussian component;
[0042] Maximization step: Update the parameters π of the Gaussian distribution i , μ i ,Σ i :
[0043]
[0044] Anomaly detection: Calculate the probability density of each data point based on the Gaussian mixture model, set a threshold, and define points below the threshold as anomalies. Filter out abnormal data and retain normal data for further processing.
[0045] Preferably, in the distributed storage of step S4, a consistent hashing algorithm formula is used to achieve efficient data distribution and consistency assurance in the distributed database system of the cloud platform, and the consistent hashing algorithm formula steps are:
[0046] Hash ring construction: nodes N1, N2, ..., N n Mapped to the hash ring, the hash function is used to calculate the position of each node:
[0047]
[0048] in, is the unique identifier of the node;
[0049] Data sharding: For each data item D j , calculate its hash value H(D j ) and assign them to the nodes in the clockwise direction:
[0050]
[0051] Data item D j Stored at node N k , where N k is to satisfy H(D j )≤H(N k ) nodes;
[0052] Node addition and deletion: When adding or deleting a node, the data between adjacent nodes is affected, reducing the amount of data redistribution. The new node Nnew Position H(N new ) is determined, the data needs to be redistributed by its clockwise nodes.
[0053] Preferably, in the energy consumption prediction model construction of step S5, the energy consumption prediction model is constructed based on the algorithm formula of the long short-term memory network, which can process time series data and capture long-term dependencies in the data. The long short-term memory network is a special recursive neural network that is good at processing and predicting time series data and retains long-term dependency information through its memory units;
[0054] The LSTM network unit structure includes: input gate, forget gate and output gate;
[0055] Input gate: i t =σ(W i ·[h t-1 ,x t ]+b i ),
[0056] Among them, i t is the activation value of the input gate, W i is the weight matrix of the input gate, [h t-1 ,x t ] is the hidden state h of the previous moment t-1 and the current input x t , b i is the bias of the input gate, σ is the activation function;
[0057] Forget gate: f t =σ(W f ·[h t-1 ,x t ]+b f ),
[0058] Among them, f t is the activation value of the forget gate, W f is the weight matrix of the forget gate, b f is the bias of the forget gate;
[0059] Output gate: o t =σ(W o ·[h t-1 ,x t ]+b o ),
[0060] Among them, t is the activation value of the output gate, W o is the weight matrix of the output gate, b o is the bias of the output gate.
[0061] Preferably, in the real-time monitoring and adjustment of step S6, the gas flow rate and combustion efficiency are optimized and adjusted based on the energy consumption prediction results, and the algorithm formula based on the model predictive control is used to realize dynamic optimization control of the gas system;
[0062] Model predictive control is a control algorithm that achieves dynamic regulation of the system by predicting the future behavior of the system and optimizing the control input. It is used for multivariable control problems with constraints. The steps of the model predictive control algorithm are as follows:
[0063] System state equation: x k+1 =Ax k +Bu k ,
[0064] Among them, x k is the system state vector, u k is the control input vector, A and B are the state transfer matrix and control matrix of the system;
[0065] Output equation: y k =Cx k +Du k ,
[0066] Among them, y k is the system output, C and D are the output matrices;
[0067] Optimization goal:
[0068] Among them, N is the prediction time domain length, r k+i is the reference trajectory or target value;
[0069] Constraints: x min ≤x k ≤x max ,u min ≤u k ≤u max ,
[0070] Constraints ensure that states and control inputs are within safe and operable ranges.
[0071] Preferably, in the multi-level early warning mechanism of step S7, a Bayesian network is used to analyze monitoring data and prediction results, so as to issue early warnings in a timely manner, provide optimization suggestions and decision support, and the steps of the Bayesian network are:
[0072] Bayesian network structure: Establish node V = {V1, V2, ..., V n}, each node represents a monitoring variable, a directed acyclic graph is used to represent the causal relationship between variables, and the edge E represents the dependency relationship between variables;
[0073] Conditional probability table: For each node Vi , define the conditional probability table P(V i ∣Pa(V i )), where Pa(V i ) indicates V i The parent node set of
[0074] Joint probability distribution: The joint probability is calculated using the chain rule:
[0075]
[0076] Warning probability calculation: Through Bayesian reasoning, the probability of warning event A is calculated based on the current observation data O:
[0077]
[0078] Among them, P(A|O) is the conditional probability of the observed data when the warning event occurs, and P(A) is the prior probability of the warning event;
[0079] Multi-level warning threshold: Set different levels of warning thresholds α1, α2, ..., α m , corresponding to different risk levels:
[0080]
[0081] Preferably, in the multi-level early warning mechanism of step S7, fuzzy logic is used to process uncertainty and fuzzy information to provide optimization suggestions and decision support, and its algorithm steps are:
[0082] Fuzzification: Convert input variables into fuzzy sets and define fuzzy variables using fuzzy membership functions;
[0083] Fuzzy rule base: Build a rule base and define control rules through IF-THEN statements;
[0084] Reasoning engine: According to the fuzzy rule base, it reasons the input fuzzy set and generates the output fuzzy set;
[0085] Defuzzification: Convert fuzzy control output into precise values for specific decision support, using the centroid method to calculate the output value:
[0086]
[0087] Preferably, in the feedback loop of step S8, the system operation data is collected and the feedback is analyzed based on the reinforcement learning algorithm, and the prediction model and control strategy are adjusted. The deep Q network is a reinforcement learning algorithm, which learns the optimal control strategy by interacting with the environment and is used for complex control systems;
[0088] Reinforcement learning involves the interaction between the agent and the environment. The agent changes the state of the environment s by taking action a to obtain a reward r. The goal of the agent is to maximize the cumulative reward by learning the strategy π. The steps are:
[0089] State space S: defines the state space of the system;
[0090] Action space A: defines control actions;
[0091] Reward function R(s,a): Define the reward function to evaluate the quality of each action:
[0092] R(s,a)=-(α·energy consumption deviation+β·operation cost+γ·safety risk),
[0093] Among them, α, β, and γ are weight coefficients that measure the influence of different factors.
[0094] Preferably, the deep Q network structure uses a neural network to approximate the Q function Q(s, a; θ), where θ is a network parameter, and the agent learns the best strategy by updating the Q function, the steps of which are:
[0095] Q function update: The goal of the Q function is to minimize the following loss function:
[0096]
[0097] Among them, γ is the discount factor, which measures the importance of future rewards, and θ - are the parameters of the target Q network, used to stabilize the training process;
[0098] Experience replay: Experience (s, a, r, s′) is stored in the experience replay buffer D, and random sampling training is performed:
[0099] (s,a,r,s′)~U(D),
[0100] Target Q network: Use an independent target Q network to calculate the target value and periodically update the target network parameters θ - =θ.
[0101] The present invention provides a gas energy monitoring method based on the Internet of Things. It has the following beneficial effects:
[0102] 1. The present invention effectively reduces sensor noise and data errors by using multi-source data fusion technology and advanced data preprocessing algorithms, significantly improves the quality and consistency of gas data, solves the problem of reduced analysis accuracy caused by the diversity and complexity of data sources, and reduces the calculation error of the gas combustion efficiency change coefficient and the deviation of the energy consumption prediction model.
[0103] 2. The present invention realizes real-time monitoring and dynamic adjustment of gas flow and combustion efficiency by performing data preprocessing on edge devices and introducing model predictive control optimization and adjustment, effectively dealing with the problem of slow system response speed caused by the complexity of deep learning models and lengthy preprocessing steps, ensuring the effectiveness of gas flow regulation and early warning functions, and improving the overall response efficiency of the system.
[0104] 3. The present invention uses Bayesian networks for risk assessment and fuzzy logic control to process uncertain information and build a multi-level early warning mechanism. It can provide timely warnings and optimization suggestions based on monitoring data and prediction results, solve the problem that traditional monitoring methods lack real-time safety alarms and early warning functions, improve the safety of the system, ensure that the gas system can respond quickly and take necessary measures when abnormal situations occur, and ensure the safe operation and energy efficiency management of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0105] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0106] In order to make the technical personnel in the technical field understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in combination with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a partial embodiment of the present invention, not a complete embodiment. Based on the embodiment of the present invention, other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present invention.
[0107] The present invention is described in detail below in conjunction with the accompanying drawings:
[0108] Example:
[0109] Please see attached Figure 1 , an embodiment of the present invention provides a gas energy monitoring method based on the Internet of Things, comprising the following steps: S1, multi-source data acquisition: using smart sensors to collect gas-related data to send the data to an edge device or a cloud platform via a wireless network;
[0110] S2. Data preprocessing: Perform data cleaning, denoising and feature extraction on edge devices, perform multi-source data fusion, perform anomaly detection and processing, and filter abnormal data;
[0111] S3. Data transmission: Encrypted communication protocol is used for data transmission, and data buffering and retransmission mechanism is used during the transmission process to ensure data integrity;
[0112] S4, distributed storage: store data in the distributed database system of the cloud platform;
[0113] S5. Build an energy consumption prediction model: Based on deep learning, use historical and real-time data to train the energy consumption prediction model, and the model adopts an online learning mechanism to dynamically adjust the prediction parameters;
[0114] S6. Real-time monitoring and adjustment: According to the energy consumption prediction results, the gas flow and combustion efficiency are adjusted in real time, and the adjustment parameters are optimized through the adaptive control algorithm;
[0115] S7. Multi-level warning mechanism: Set up multi-level warnings based on monitoring data and forecast results, send alarm notifications, and provide optimization suggestions and decision support based on monitoring data;
[0116] S8, Feedback loop: Collect system operation data, analyze feedback, and adjust prediction models and control strategies to adjust gas flow and combustion efficiency based on real-time and historical data;
[0117] S9. Equipment monitoring and maintenance: Remotely monitor system status, perform remote diagnosis and maintenance, and implement data encryption, access control, and privacy protection measures.
[0118] The benefits of S1 are to ensure the comprehensiveness and diversity of data, improve the flexibility and efficiency of data transmission, and realize real-time monitoring; the benefits of S2 are to effectively remove noise and outliers in the data, improve data quality, ensure the accuracy and consistency of data, and provide high-quality data support for subsequent analysis; the benefits of S3 are to prevent data leakage and tampering, and ensure the reliability and continuity of data transmission; the benefits of S4 are to improve the scalability and high availability of data storage, reduce the risk of single point failures, and ensure the persistence and rapid access of data; the benefits of S5 are to improve the accuracy of energy consumption prediction, and maintain the stability and real-time performance of prediction performance; the benefits of S6 are to ensure that the gas system operates in the optimal state, improve the system response speed and regulation accuracy, and reduce energy waste and operating costs; the benefits of S7 are to help quickly identify and respond to potential risks, and improve the safety and reliability of the system; the benefits of S8 are to help continuously improve prediction models and control strategies, and ensure continuous optimization and efficient operation of the system; the benefits of S9 are to reduce equipment downtime and maintenance costs, ensure system security and data privacy, and enhance the overall security protection capabilities of the system.
[0119] The multi-source data collection in step S1 uses the Kalman filter algorithm to perform multi-source data fusion to process the gas-related data collected by multiple sensors;
[0120] Multi-source data fusion includes the following formula:
[0121] State prediction equation:
[0122]
[0123] in, is the state prediction at that moment, A is the state transfer matrix, B is the control input matrix, u k is the control input, w k is the process noise;
[0124] Covariance prediction equation:
[0125] P k|k-1 =AP k-1|k-1 A T +Q,
[0126] Among them, P k|k-1 is the predicted state covariance matrix, Q is the process noise covariance matrix;
[0127] Kalman gain calculation:
[0128] K k =P k|k-1 H T (HP k|k-1 H T +R) -1 ,
[0129] Among them, K k is the Kalman gain, H is the observation matrix, and R is the observation noise covariance matrix;
[0130] State update equation:
[0131]
[0132] in, is the updated state estimate, z k is the actual measured value;
[0133] Covariance update equation:
[0134] P k|k =(IK k H)P k|k-1 ,
[0135] Among them, P k|k is the updated state covariance matrix.
[0136] The Kalman filter algorithm fuses the gas data collected by multiple sensors through a series of prediction and update steps, mainly achieving the following functions:
[0137] Predict future states: Based on the current model and control input, predict the future state changes of the system to provide a basis for real-time adjustment and control;
[0138] Measuring prediction uncertainty: By calculating the covariance matrix, the uncertainty of the state prediction is quantified to provide a reference for subsequent state updates;
[0139] Fusion of multi-source data: Use Kalman gain to effectively combine prediction and actual observation data, reduce noise and error, and improve the accuracy of state estimation;
[0140] Dynamically adjust state estimation: continuously update the state and covariance matrix, so that the system can adapt to changing environmental conditions and observation information, and optimize the monitoring and control performance of the gas system;
[0141] The Kalman filter algorithm significantly improves the accuracy and reliability of the gas energy monitoring system through multi-source data fusion, realizes real-time, efficient and accurate gas data processing, solves the error impact caused by data diversity and complexity, and lays a solid foundation for subsequent regulation, control and early warning decisions.
[0142] In the data preprocessing of step S2, the algorithm formula of Gaussian mixture model is used to process the denoising and anomaly detection of multi-source data, which can effectively extract the main features in the data and filter out noise and abnormal data;
[0143] Gaussian mixture models are used to cluster data and detect abnormal data points;
[0144] Probability density estimation:
[0145]
[0146] Where p(x) is the probability density of the input data x, K is the number of components of the Gaussian mixture model, and π i is the weight of the i-th Gaussian component, is the probability density function of the ith Gaussian distribution with mean μ i and covariance Σ i ;
[0147] Expectation-Maximization Algorithm:
[0148] Expected step: Calculate the probability of each data point belonging to each Gaussian component:
[0149]
[0150] Among them, γ i (z n ) is the data point z n The probability of belonging to the i-th Gaussian component;
[0151] Maximization step: Update the parameters π of the Gaussian distribution i , μ i ,Σ i :
[0152]
[0153] Anomaly detection: Calculate the probability density of each data point based on the Gaussian mixture model, set a threshold, and define points below the threshold as anomalies. Filter out abnormal data and retain normal data for further processing.
[0154] The Gaussian mixture model uses probability density estimation and expectation maximization algorithm to denoise and detect anomalies in multi-source data, mainly achieving the following functions:
[0155] Accurately modeling data distribution: It can treat data as a mixture of multiple Gaussian distributions, accurately capture the complex distribution characteristics of data, and effectively extract the main features in the data;
[0156] Adaptive data classification and feature extraction: Through the algorithm, data points can be adaptively assigned to each Gaussian component, and model parameters can be dynamically adjusted to improve the model's fit to the data. It can effectively cluster multi-source data and help identify the inherent patterns and structures of the data.
[0157] Efficient anomaly detection: Using probability density estimation of data points to filter out anomalies and noise data by setting thresholds is critical to improving the overall quality of the data set and the reliability of subsequent analysis;
[0158] The Gaussian mixture model clusters, extracts features, and detects anomalies from multi-source data through complex probabilistic modeling and parameter optimization, effectively improving the quality and efficiency of data preprocessing. It can cope with the complexity and diversity of data and provide a high-quality data foundation for subsequent analysis and decision-making.
[0159] In the distributed storage of step S4, the consistent hashing algorithm formula is used to achieve efficient data distribution and consistency guarantee in the distributed database system of the cloud platform. The consistent hashing algorithm formula steps are as follows:
[0160] Hash ring construction: nodes N1, N2, ..., N n Mapped to the hash ring, the hash function is used to calculate the position of each node:
[0161]
[0162] in, is the unique identifier of the node;
[0163] Data sharding: For each data item D j , calculate its hash value H(D j ) and assign them to the nodes in the clockwise direction:
[0164]
[0165] Data item D j Stored at node N k , where Nk is to satisfy H(D j )≤H(N k ) nodes;
[0166] Node addition and deletion: When adding or deleting a node, the data between adjacent nodes is affected, reducing the amount of data redistribution. The new node N new Position H(N new ) is determined, the data needs to be redistributed by its clockwise nodes.
[0167] The consistent hashing algorithm achieves efficient data distribution and consistency assurance in distributed storage through the following methods:
[0168] Consistent hashing maps nodes and data items to a hash ring, using hash functions to ensure uniform distribution of data among nodes, reducing load imbalance. Data is always stored in clockwise nodes on the ring to avoid being concentrated in a few nodes.
[0169] The significant advantage of the algorithm lies in its dynamic adjustment capability. The addition or deletion of a node will affect some of its adjacent nodes and data, reducing the amount of data that needs to be redistributed, significantly improving the scalability and maintenance efficiency of the system. Local adjustments avoid the high cost of large-scale data migration in traditional hashing methods and are used in large-scale distributed systems.
[0170] Through the consistent hashing algorithm, the distributed storage system can maintain data consistency and accessibility when facing node changes. The redistribution of data is local and limited, ensuring the transparency of the system to users and the continuity of services during expansion and maintenance.
[0171] The consistent hashing algorithm achieves advantages such as load balancing, flexible expansion, and strong data consistency in distributed storage systems through a clever hash ring structure and efficient data distribution strategy, making it suitable for use in distributed databases on cloud platforms, especially in dynamic environments that require frequent adjustment of the number of nodes.
[0172] In the construction of the energy consumption prediction model in step S5, the energy consumption prediction model is constructed based on the algorithm formula of the long short-term memory network. The model can process time series data and capture the long-term dependencies in the data. The long short-term memory network is a special recursive neural network that is good at processing and predicting time series data and retains long-term dependency information through its memory units.
[0173] The LSTM network unit structure includes: input gate, forget gate and output gate;
[0174] Input gate: i t =σ(W i ·[h t-1 ,x t ]+b i),
[0175] Among them, i t is the activation value of the input gate, W i is the weight matrix of the input gate, [h t-1 ,x t ] is the hidden state h of the previous moment t-1 and the current input x t , b i is the bias of the input gate, σ is the activation function;
[0176] Forget gate: f t =σ(W f ·[h t-1 ,x t ]+b f ),
[0177] Among them, f t is the activation value of the forget gate, W f is the weight matrix of the forget gate, b f is the bias of the forget gate;
[0178] Output gate: o t =σ(W o ·[h t-1 ,x t ]+b o ),
[0179] Among them, t is the activation value of the output gate, W o is the weight matrix of the output gate, b o is the bias of the output gate.
[0180] The long short-term memory network achieves efficient processing of time series data through the synergy of input gate, forget gate and output gate, and mainly realizes the following functions:
[0181] By selectively retaining historical information through the forget gate and adding new useful information through the input gate, the key patterns can be kept in memory over a long time span, which is particularly important for time series problems such as gas energy consumption prediction.
[0182] The input gate and the forget gate work together to dynamically adjust the state update of the memory unit. The input gate selectively accepts new input information, while the forget gate controls the retention or discarding of past memory content. This mechanism enables LSTM to effectively extract useful features in a noisy environment, filter out irrelevant or harmful information, and improve the accuracy and stability of predictions.
[0183] Through the output gate, the impact of the memory unit state on the next output can be flexibly adjusted. The output gate determines the output amount after the current memory content is processed by the activation function, ensuring that the model output can reflect historical information and adapt to changes in the current input. The flexibility enables LSTM to process complex and diverse energy consumption data;
[0184] LSTM effectively solves the defect of traditional RNN in handling long-term dependency problems through the combination of input gate, forget gate and output gate. It can effectively remember and utilize long-term information when processing time series data, and filter unnecessary content through dynamic gating mechanism to improve the accuracy and robustness of prediction. These characteristics make LSTM an ideal tool for energy consumption prediction and other time series prediction tasks.
[0185] In the real-time monitoring and adjustment of step S6, the gas flow rate and combustion efficiency are optimized and adjusted based on the energy consumption prediction results, and the algorithm formula based on the model predictive control is used to realize the dynamic optimization control of the gas system;
[0186] Model predictive control is a control algorithm that achieves dynamic regulation of the system by predicting the future behavior of the system and optimizing the control input. It is used for multivariable control problems with constraints. The steps of the model predictive control algorithm are as follows:
[0187] System state equation: x k+1 =Ax k +Bu k ,
[0188] Among them, x k is the system state vector, u k is the control input vector, A and B are the state transfer matrix and control matrix of the system;
[0189] Output equation: y k =Cx k +Du k ,
[0190] Among them, y k is the system output, C and D are the output matrices;
[0191] Optimization goal:
[0192] Among them, N is the prediction time domain length, r k+i is the reference trajectory or target value;
[0193] Constraints: x min ≤x k ≤x max ,u min ≤u k ≤u max ,
[0194] Constraints ensure that states and control inputs are within safe and operable ranges.
[0195] Model predictive control can achieve dynamic optimization control of gas flow and combustion efficiency by predicting the future state of the system and optimizing control input in real-time monitoring and regulation. It mainly achieves the following functions:
[0196] Model predictive control predicts the system state and output at multiple moments in the future through the system state equation and output equation. Based on the prediction, model predictive control optimizes the control input at current and future moments to ensure that the system can still maintain the optimal operating state in dynamic changes and reduce regulation lag;
[0197] Model predictive control is particularly good at handling multivariable control problems and complex constraints. By setting upper and lower limits on the state and control inputs, model predictive control can effectively handle the system's operating limitations and safety requirements during the optimization process, making model predictive control particularly suitable for complex gas systems and able to find a balance between safety and efficiency.
[0198] Model predictive control recalculates the optimal control input in each control cycle, and real-time optimization enables the control strategy to adapt to the actual operating status and environmental changes of the system. Through real-time monitoring and adjustment, model predictive control ensures that the gas system can continue to operate in an efficient and safe manner, even when the operating conditions change rapidly.
[0199] In the multi-level early warning mechanism of step S7, the Bayesian network is used to analyze the monitoring data and prediction results, so as to issue early warnings in time, provide optimization suggestions and decision support. The steps of the Bayesian network are:
[0200] Bayesian network structure: Establish node V = {V1, V2, ..., V n}, each node represents a monitoring variable, a directed acyclic graph is used to represent the causal relationship between variables, and the edge E represents the dependency relationship between variables;
[0201] Conditional probability table: For each node V i , define the conditional probability table P(V i ∣Pa(V i )), where Pa(V i ) indicates V i The parent node set of
[0202] Joint probability distribution: The joint probability is calculated using the chain rule:
[0203]
[0204] Warning probability calculation: Through Bayesian reasoning, the probability of warning event A is calculated based on the current observation data O:
[0205]
[0206] Among them, P(A|O) is the conditional probability of the observed data when the warning event occurs, and P(A) is the prior probability of the warning event;
[0207] Multi-level warning threshold: Set different levels of warning thresholds α1, α2, ..., α m , corresponding to different risk levels:
[0208]
[0209] Bayesian networks use structured probability models, combined with conditional probability and reasoning mechanisms, to achieve multi-level early warning and decision support, mainly to achieve the following functions:
[0210] The Bayesian network is constructed through a directed acyclic graph of nodes and edges, which visualizes the monitoring variables and their causal relationships in complex systems. Its modeling method enables the system to clarify the dependencies between variables, which helps to identify key influencing factors and evaluate their impact on the overall system;
[0211] Based on the conditional probability table and joint probability distribution, the Bayesian network can update the variable status and the probability distribution of the system as a whole in real time. Through Bayesian reasoning, the probability of warning events is calculated based on the observed data, so that the system can identify potential risks in a timely manner and improve the accuracy of warnings.
[0212] By setting multi-level warning thresholds, the Bayesian network can respond accordingly to different risk levels. The grading mechanism ensures that the system can provide warnings and suggestions at different risk levels to avoid excessive alarms or ignoring potential threats.
[0213] In the multi-level early warning mechanism of step S7, fuzzy logic is used to process uncertainty and fuzzy information to provide optimization suggestions and decision support. The algorithm steps are as follows:
[0214] Fuzzification: Convert input variables into fuzzy sets and define fuzzy variables using fuzzy membership functions;
[0215] Fuzzy rule base: Build a rule base and define control rules through I F-THEN statements;
[0216] Reasoning engine: According to the fuzzy rule base, it reasons the input fuzzy set and generates the output fuzzy set;
[0217] Defuzzification: Convert fuzzy control output into precise values for specific decision support, using the centroid method to calculate the output value:
[0218]
[0219] Fuzzy logic can effectively handle uncertainty and fuzzy information through fuzzification, rule base, reasoning engine and defuzzification steps, provide optimization suggestions and decision support for the system, and mainly achieve the following functions:
[0220] Fuzzy logic converts precise inputs into fuzzy sets. Through the fuzzification step, the system can cope with uncertainty and ambiguity. For example, when temperature and pressure cannot be clearly defined as "high" or "low", fuzzy logic can handle gray areas and provide gradual and incomplete judgments.
[0221] Through the fuzzy rule base and reasoning engine, complex logical reasoning is performed according to multiple input conditions. Fuzzy rules can reflect the experience and intuition of experts, describe complex multi-variable relationships through simple I F-THEN structures, and provide flexible and powerful reasoning capabilities, so that the system can make reasonable decisions under multi-variable and uncertain conditions.
[0222] Through the defuzzification step, fuzzy logic converts fuzzy reasoning results into specific operation values. The fuzzy to precise conversion ensures that the system output can be directly used for actual control and regulation. The precise value calculated using the center of gravity method provides a quantitative reference for decision support and directly guides the optimization operation of the system.
[0223] In the feedback loop of step S8, the system operation data is collected and feedback is analyzed based on the reinforcement learning algorithm to adjust the prediction model and control strategy. The deep Q network is a reinforcement learning algorithm that learns the optimal control strategy by interacting with the environment and is used in complex control systems.
[0224] Reinforcement learning involves the interaction between the agent and the environment. The agent changes the state of the environment s by taking action a to obtain a reward r. The goal of the agent is to maximize the cumulative reward by learning the strategy π. The steps are:
[0225] State space S: defines the state space of the system;
[0226] Action space A: defines control actions;
[0227] Reward function R(s,a): Define the reward function to evaluate the quality of each action:
[0228] R(s,a)=-(α·energy consumption deviation+β·operation cost+γ·safety risk),
[0229] Among them, α, β, and γ are weight coefficients that measure the influence of different factors.
[0230] The deep Q network enables the intelligent agent to adaptively optimize the control strategy through interaction and learning in a complex and changing environment. By defining the state and action space, the intelligent agent can explore different operations of the system, evaluate their impact on the system state, and gradually learn the optimal control strategy.
[0231] Through the reward function, the deep Q network can integrate multiple objectives such as energy consumption deviation, operating costs and safety risks. During the learning process, the intelligent agent takes into account short-term benefits, balances long-term goals, and avoids over-optimization of a single aspect. By strengthening the feedback mechanism, the intelligent agent continuously adjusts its action strategy to obtain the optimal long-term benefits.
[0232] The deep Q network structure uses a neural network to approximate the Q function Q(s,a;θ), where θ is the network parameter. By updating the Q function, the agent learns the best strategy. The steps are:
[0233] Q function update: The goal of the Q function is to minimize the following loss function:
[0234]
[0235] Among them, γ is the discount factor, which measures the importance of future rewards, and θ - are the parameters of the target Q network, used to stabilize the training process;
[0236] Experience replay: Experience (s, a, r, s′) is stored in the experience replay buffer D, and random sampling training is performed:
[0237] (s,a,r,s′)~U(D),
[0238] Target Q network: Use an independent target Q network to calculate the target value and periodically update the target network parameters θ - =θ.
[0239] Through Q function updates, the deep Q network continuously adjusts the parameters of the Q network, making the estimated value of each state-action pair closer to the actual reward. This process makes the agent tend to choose the action that can obtain the maximum long-term reward at each decision, thereby achieving the gradual optimization of the strategy.
[0240] The experience replay mechanism breaks the correlation of time series data and improves the diversity of samples by storing and randomly sampling experience. The mechanism effectively utilizes existing experience data, avoids learning bias caused by data correlation, and significantly improves the training efficiency of the Q network and the effect of strategy optimization.
[0241] The introduction of the target Q network provides a stable target value calculation method for the training of the deep Q network. Since the parameter update of the target Q network is delayed, the training oscillation caused by frequent changes in the Q network parameters is avoided.
[0242] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. Gas energy monitoring method based on the Internet of Things, It is characterized in that The steps include: S1. Multi-source data collection: Use smart sensors to collect gas-related data and send the data to edge devices or cloud platforms via wireless networks; S2. Data preprocessing: Perform data cleaning, denoising and feature extraction on edge devices, perform multi-source data fusion, perform anomaly detection and processing, and filter abnormal data; S3. Data transmission: Encrypted communication protocol is used for data transmission, and data buffering and retransmission mechanism is used during the transmission process to ensure data integrity; S4, distributed storage: store data in the distributed database system of the cloud platform; S5. Build an energy consumption prediction model: Based on deep learning, use historical and real-time data to train the energy consumption prediction model, and the model adopts an online learning mechanism to dynamically adjust the prediction parameters; S6. Real-time monitoring and adjustment: According to the energy consumption prediction results, the gas flow and combustion efficiency are adjusted in real time, and the adjustment parameters are optimized through the adaptive control algorithm; S7. Multi-level warning mechanism: Set up multi-level warnings based on monitoring data and forecast results, send alarm notifications, and provide optimization suggestions and decision support based on monitoring data; S8, Feedback loop: Collect system operation data, analyze feedback, and adjust prediction models and control strategies to adjust gas flow and combustion efficiency based on real-time and historical data; S9. Equipment monitoring and maintenance: Remotely monitor system status, perform remote diagnosis and maintenance, and implement data encryption, access control, and privacy protection measures.
2. According to the gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that The multi-source data acquisition in step S1 uses a Kalman filter algorithm to perform multi-source data fusion to process gas-related data collected by multiple sensors; Multi-source data fusion includes the following formula: State prediction equation: in, is the state prediction at that moment, A is the state transfer matrix, B is the control input matrix, u k is the control input, w k is the process noise; Covariance prediction equation: P k|k-1 =AP k-1|k-1 From T +Q, Among them, P k|k-1 is the predicted state covariance matrix, Q is the process noise covariance matrix; Kalman gain calculation: K k =P k|k-1 H T (HP k|k-1 H T +R) -1 , Among them, K k is the Kalman gain, H is the observation matrix, and R is the observation noise covariance matrix; State update equation: in, is the updated state estimate, z k is the actual measured value; Covariance update equation: P k|k =(I-K k H)P k|k-1 , Among them, P k|k is the updated state covariance matrix.
3. According to the gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the data preprocessing of step S2, the algorithm formula of the Gaussian mixture model is used to process the denoising and anomaly detection of multi-source data, which can effectively extract the main features in the data and filter out noise and abnormal data; Gaussian mixture models are used to cluster data and detect abnormal data points; Probability density estimation: Where p(x) is the probability density of the input data x, K is the number of components of the Gaussian mixture model, and π i is the weight of the i-th Gaussian component, is the probability density function of the ith Gaussian distribution with mean μ i and covariance Σ i ; Expectation-Maximization Algorithm: Expected step: Calculate the probability of each data point belonging to each Gaussian component: Among them, γ i (z n ) is the data point z n The probability of belonging to the i-th Gaussian component; Maximization step: Update the parameters π of the Gaussian distribution i , μ i ,Σ i : Anomaly detection: Calculate the probability density of each data point based on the Gaussian mixture model, set a threshold, and define points below the threshold as anomalies. Filter out abnormal data and retain normal data for further processing.
4. According to the gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the distributed storage of step S4, a consistent hashing algorithm formula is used to achieve efficient data distribution and consistency assurance in the distributed database system of the cloud platform. The consistent hashing algorithm formula steps are: Hash ring construction: node N 1 , N 2 ,…,N n Mapped to the hash ring, the hash function is used to calculate the position of each node: in, is the unique identifier of the node; Data sharding: For each data item D j , calculate its hash value H(D j ) and assign them to the nodes in the clockwise direction: Data item D j Stored at node N k , where N k is to satisfy H(D j )≤H(N k ) nodes; Node addition and deletion: When adding or deleting a node, the data between adjacent nodes is affected, reducing the amount of data redistribution. The new node N new Position H(N new ) is determined, the data needs to be redistributed by its clockwise nodes.
5. According to the gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the energy consumption prediction model construction of step S5, the energy consumption prediction model is constructed based on the algorithm formula of the long short-term memory network. The model can process time series data and capture long-term dependencies in the data. The long short-term memory network is a special recursive neural network that is good at processing and predicting time series data and retains long-term dependency information through its memory units. The LSTM network unit structure includes: input gate, forget gate and output gate; Input gate: i t =σ(W i ·[h t-1 ,x t ]+b i ), Among them, i t is the activation value of the input gate, W i is the weight matrix of the input gate, [h t-1 ,x t ] is the hidden state h of the previous moment t-1 and the current input x t , b i is the bias of the input gate, σ is the activation function; Forget gate: f t =σ(W f ·[h t-1 ,x t ]+b f ), Among them, f t is the activation value of the forget gate, W f is the weight matrix of the forget gate, b f is the bias of the forget gate; Output gate: o t =σ(W o ·[h t-1 ,x t ]+b o ), Among them, t is the activation value of the output gate, W o is the weight matrix of the output gate, b o is the bias of the output gate.
6. The gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the real-time monitoring and adjustment of step S6, the gas flow rate and combustion efficiency are optimized and adjusted based on the energy consumption prediction results, and the algorithm formula based on the model predictive control is used to realize dynamic optimization control of the gas system; Model predictive control is a control algorithm that achieves dynamic regulation of the system by predicting the future behavior of the system and optimizing the control input. It is used for multivariable control problems with constraints. The steps of the model predictive control algorithm are as follows: System state equation: x k+1 =Ax k +Bu k , Among them, x k is the system state vector, u k is the control input vector, A and B are the state transfer matrix and control matrix of the system; Output equation: y k =Cx k +Du k , Among them, y k is the system output, C and D are the output matrices; Optimization goal: Among them, N is the prediction time domain length, r k+i is the reference trajectory or target value; Constraints: x min ≤x k ≤x max ,u min ≤u k ≤u max , Constraints ensure that states and control inputs are within safe and operable ranges.
7. The gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the multi-level early warning mechanism of step S7, the Bayesian network is used to analyze the monitoring data and prediction results, so as to issue early warnings in a timely manner, provide optimization suggestions and decision support, and the steps of the Bayesian network are as follows: Bayesian network structure: Establish node V = {V 1 ,V 2 ,…,V n }, each node represents a monitoring variable, a directed acyclic graph is used to represent the causal relationship between variables, and the edge E represents the dependency relationship between variables; Conditional probability table: For each node V i , define the conditional probability table P(V i ∣Pa(V i )), where Pa(V i ) indicates V i The parent node set of Joint probability distribution: The joint probability is calculated using the chain rule: Warning probability calculation: Through Bayesian reasoning, the probability of warning event A is calculated based on the current observation data O: Among them, P(A|O) is the conditional probability of the observed data when the warning event occurs, and P(A) is the prior probability of the warning event; Multi-level warning threshold: Set different levels of warning thresholds α 1 , α 2 , …, α m , corresponding to different risk levels:
8. The gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the multi-level early warning mechanism of step S7, fuzzy logic is used to process uncertainty and fuzzy information to provide optimization suggestions and decision support. The algorithm steps are as follows: Fuzzification: Convert input variables into fuzzy sets and define fuzzy variables using fuzzy membership functions; Fuzzy rule base: Build a rule base and define control rules through IF-THEN statements; Reasoning engine: According to the fuzzy rule base, it reasons the input fuzzy set and generates the output fuzzy set; Defuzzification: Convert fuzzy control output into precise values for specific decision support, using the centroid method to calculate the output value:
9. The gas energy monitoring method based on the Internet of Things according to claim 1, It is characterized in that In the feedback loop of step S8, the system operation data is collected and feedback is analyzed based on the reinforcement learning algorithm, and the prediction model and control strategy are adjusted. The deep Q network is a reinforcement learning algorithm that learns the optimal control strategy by interacting with the environment and is used in complex control systems. Reinforcement learning involves the interaction between the agent and the environment. The agent changes the state of the environment s by taking action a to obtain a reward r. The goal of the agent is to maximize the cumulative reward by learning the strategy π. The steps are: State space S: defines the state space of the system; Action space A: defines control actions; Reward function R(s,a): Define the reward function to evaluate the quality of each action: R(s,a)=-(α·energy consumption deviation+β·operation cost+γ·safety risk), Among them, α, β, and γ are weight coefficients that measure the influence of different factors.
10. The gas energy monitoring method based on the Internet of Things according to claim 9, It is characterized in that The deep Q network structure uses a neural network to approximate the Q function Q(s,a;θ), where θ is a network parameter. By updating the Q function, the agent learns the best strategy. The steps are: Q function update: The goal of the Q function is to minimize the following loss function: Among them, γ is the discount factor, which measures the importance of future rewards, and θ - are the parameters of the target Q network, used to stabilize the training process; Experience replay: Experience (s, a, r, s′) is stored in the experience replay buffer D, and random sampling training is performed: (s,a,r,s′)~U(D), Target Q network: Use an independent target Q network to calculate the target value and periodically update the target network parameters θ - =θ.
Citation Information
Patent Citations
A gas energy monitoring method based on big data
CN117871771B
Fuel gas sensing intelligent control method based on cloud-side cooperation
CN117092918A
Energy management and control method and system based on AI intelligent park
CN117314094A
Gas energy monitoring method based on big data
CN117871771A
Intelligent gas meter full life cycle management system and method
CN118628285A
Cited By
Construction and data acquisition method and system of gear motor control network
CN119483350A
Energy consumption data security sharing method for coal mine energy management
CN119945739A
Machine room equipment environment monitoring method and system based on Internet of Things
CN120085596A
Fuel gas monitoring method based on edge cloud collaboration
CN120163576A
Oil product data analysis method and system based on deep learning
CN120429552A
