Disclosure of Invention
In view of the above, in order to overcome the defects and shortcomings of the prior art, the invention aims to provide a multi-scale energy consumption model of a city energy system and an energy flow monitoring method thereof, which are used for constructing energy flow monitoring indexes and methods of the city energy system according to energy consumption and energy flow conditions of the city energy system by collecting related data, providing a solving direction based on key links and problems existing in deep learning, mining and early warning of city energy operation, helping city energy safety, economy, green and sustainable development, providing low-carbon, high-efficiency, economical and convenient energy guarantee for high-quality development of city economy, and being beneficial to accelerating realization of city carbon peak and carbon neutralization processes.
Based on the research and design, the invention adopts the following technical scheme:
a multi-scale energy consumption model of an urban energy system is characterized in that the data preparation steps in the construction process are as follows:
According to the characteristic analysis of energy consumption object, selecting historical energy consumption data, environmental data and time data as model input, after data integration combining real load of target time to form training data set The method comprises the steps of acquiring a model input vector formed by historical energy consumption data, environment data and time data, wherein X i represents the model input vector formed by the historical energy consumption data, the environment data and the time data, y i is the real load at the target moment, and N is the data set scale;
The model construction and training comprises selecting the layer number of the depth of the neural network according to the complexity of the actual energy consumption object, inputting the model as corresponding input vector X i, and outputting the expected output as y i, wherein the actual output is The model loss function is constructed as follows:
training the model by adopting a random gradient descent method, wherein θ is a model parameter:
Until the model converges or iterates to the maximum iteration number, thereby obtaining the quantitative relation between the load demand and the influence vector thereof.
Further, in the data preparation process, according to the multi-time scale requirement, the simultaneous moment load and the continuous 23-hour load which are 1 to 4 weeks before the target moment are selected as main historical energy consumption data, meteorological data corresponding to each historical energy consumption is used as environment data, and seasons, weeks and time of the target moment are used as time data.
And one of the energy flow monitoring methods according to the above urban energy system multi-scale energy consumption model:
A1, according to an energy object selection model, historical energy consumption data x1, environmental factors x2 and social factors x3 are input and sent into a multi-scale energy consumption model of the urban energy system to obtain a predicted load y at a future moment;
And step A2, determining parameters including the capacity and the energy consumption threshold of the energy system in the area where the energy consumption object is located, and monitoring the energy flow operation of the energy system in real time by comparing the numerical values of the parameters with the set safety warning limit.
When monitoring the abnormal running state of the object or equipment in the system, the method directly builds an abnormal state judging data model based on the energy object running data and the deep learning method, namely, selecting relevant energy data as input according to the characteristics of the target object and the abnormal state characteristics, extracting the data characteristics based on priori knowledge, extracting deep semantic characteristics in the data by sending the deep semantic characteristics into a deep network, and finally completing the abnormal state judgment by adopting a linear classifier.
The third energy flow monitoring method of the multi-scale energy consumption model of the urban energy system comprises the steps of forming reliable characteristic representation by using a large amount of normal operation data by adopting a semi-supervision learning framework, and training a final classifier for energy flow monitoring by combining a small amount of abnormal data on the basis of the characteristic representation, wherein the method specifically comprises the following steps of:
Step B1, constructing a group of standard operation data of the energy consumption object based on priori knowledge, combining the actual operation data on the basis to form a group of data pairs The distribution is sent into a feature extraction network F (-), and corresponding feature vectors are obtainedTaking the difference between the two as the final characteristic of time operation data
Step B2, for normal operation data or abnormal data which are markers, when the data have small fluctuation or time sequence translation, the actual operation state of the energy consumption object is not changed, so the representation in the feature space is basically consistent, and based on the assumption, a consistency loss function is constructed:
wherein f' is a characteristic representation after shifting or time sequence shifting of the data;
for marked outlier data, in addition to consistency loss, the loss function of the constructed outlier classifier should be considered based on the feature representation:
Lcls(x,y)=CE(y,y')
Wherein y is a label of abnormal data, y' is classifier output, and CE (·) is a cross entropy function;
based on the two, an overall loss function of model training is constructed:
L=Lcls(x,y)+λLcon(x)
Wherein lambda is a preset proportionality coefficient;
In the training process of the model, the parameters of the feature extraction network F (-) are continuously changed, particularly the change is particularly obvious in the initial stage of model training, which leads to larger fluctuation of consistency loss, and in order to improve the stability of model training, the feature extraction network after parameter moving average is adopted as a teacher model to obtain F', so that the learning ability of the original feature extraction network F (-) as a student model is guided.
Further, the method for monitoring the energy flow of the urban energy system specifically comprises the following steps:
Step S1, energy flow monitoring service design of urban energy system
Summarizing urban energy flow monitoring service requirements according to the monitoring requirements of urban energy flows, classifying urban energy flow monitoring service diversity according to the structural characteristics of an energy subsystem, and establishing urban energy flow monitoring service rules and mapping relations;
step S2, energy flow monitoring data preparation of urban energy system
Combing city energy flow monitoring service data, tracing and clearing a source service system, a source channel, a data table, corresponding fields and association matching relations among the li-clear data items aiming at each city energy flow monitoring service data item in the data demand table to form a city energy subsystem monitoring service data demand table, and combining and forming detail service data required by city energy flow monitoring through interfaces and other data channels of the city energy flow monitoring service subsystems;
step S3, energy flow monitoring data processing of urban energy system
For the access of a source service system for urban energy flow monitoring and the data of each subsystem, carrying out data quality check on the extracted urban energy flow monitoring related detail data from the aspects including data integrity, normalization, rationality, accuracy and consistency, and verifying the availability and the effectiveness of the data;
s4, constructing a multi-scale energy consumption model of the urban energy system
Constructing a business data model applicable to each energy subsystem based on the business content, rules and data requirements of urban energy flow monitoring, extracting a certain proportion of data, substituting the data into the urban energy flow monitoring data model for training, verifying the feasibility, rationality and accuracy of the model based on the accuracy, fitting degree and other parameters of the training result, and adaptively adjusting the parameters of the business model to meet the business requirements of urban energy flow monitoring;
step S5, calculating and analyzing energy flow monitoring data of urban energy system
And carrying out data calculation and associated mining by utilizing a multi-scale energy consumption model of the urban energy system to form each energy subsystem and urban energy flow monitoring results.
Further, the step S6 of executing the urban energy system energy flow monitoring further comprises the steps of solidifying the urban energy system energy flow monitoring result, optimizing and perfecting a model according to the deviation condition of the urban energy flow monitoring result and the urban energy flow expected value, setting the monitoring result expression form according to different requirements of urban energy authorities, energy operation enterprises, energy utilization enterprises and the public society, and solidifying the urban energy flow monitoring report mode by utilizing data processing and data mining tools.
Compared with the prior art, the method and the system have the advantages that the energy flow monitoring index and method of the urban energy system are constructed according to the energy consumption and energy flow conditions of the urban energy system by collecting related data, the solution direction is provided based on key links and problems existing in deep learning, mining and early warning of urban energy operation, the safe, economical, green and sustainable development of the power-assisted urban energy is provided, the low-carbon, efficient, economical and convenient energy guarantee is provided for the high-quality development of the urban economy, and the realization of urban carbon peak and carbon neutralization processes is facilitated.
Detailed Description
In order to make the features and advantages of the present patent more comprehensible, embodiments accompanied with figures are described in detail below:
the following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The components generally described and illustrated in the figures herein may be combined in different configurations. Thus, the following detailed description of selected embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention based on the embodiments of the present invention.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
As shown in fig. 1, the embodiment further introduces a design process and a working mechanism of the multi-scale energy consumption model of the urban energy system and the energy flow monitoring method thereof from the aspects of working mechanism and flow, and the design process and the working mechanism are realized in a form of a computer program:
Example 1
The embodiment of the invention discloses an upper platform (hardware) on which energy flow monitoring of an urban energy system can depend based on a multi-scale energy consumption model, which can utilize an energy monitoring system of an energy enterprise such as a power grid company or an urban main department, wherein the energy monitoring system comprises a monitoring end and at least 2 acquisition ends and comprises the following components:
the data acquisition of the acquisition end is carried out, the acquisition end is deployed in an operation monitoring system (such as electric power, gas and the like) of different energy subsystems, and the data of the current type of the local end such as energy consumption, supply quantity, unit energy consumption, cost, emission quantity, reserve, future production plan and the like are automatically acquired or manually recorded through a subsystem monitoring device.
And calculating data of the acquisition end, calculating the operation condition of the accumulated energy subsystem by the acquisition end according to the acquired data of the local end, calculating the difference between the operation index of the current energy subsystem and the total expected value of urban energy according to the summarized index issued by the monitoring end, and providing a current operation index adjustment scheme of the energy subsystem.
The communication between the acquisition end and the monitoring end adopts the public communication network and communication protocol such as the existing telecommunication, including coding, analysis, safety protection, communication protocol, etc., and receives and transmits the statistics and analysis data of the energy subsystem of one monitoring end and at least 2 acquisition ends.
The method comprises the steps of calculating data of monitoring terminals, wherein the monitoring terminals are deployed in operation monitoring systems of large-scale energy enterprises such as power grid companies or urban energy authorities, and the monitoring terminals perform merging calculation according to received urban energy subsystem operation statistical data of at least 2 collecting terminals to give out operation evaluation results of all urban energy subsystems and simultaneously give out main influence factors and influence amplitudes of urban energy flows.
And the monitoring end displays the summarized statistical result and the analysis result on a monitoring large screen, and the display page comprises an overview, each collection end profile, a current value, an accumulated value, main influence factors of urban energy supply and demand, comprehensive evaluation indexes, improvement conditions and the like. The urban energy operation authorities and related energy enterprises can know urban energy flow and structure evolution conditions in time, and the national double-carbon target and the energy double-control target are realized by assistance.
Example two
The platform provided by the first embodiment is combined to perform urban energy system energy flow monitoring design, and the method comprises the following steps:
(1) Urban energy system energy flow monitoring service design
And according to the urban energy flow monitoring service difference classification according to the structural characteristics of the energy subsystem, the urban energy flow monitoring service rules and the mapping relation are established.
(2) Urban energy system energy flow monitoring data preparation
And combing urban energy flow monitoring service data, tracing and clearing the association and matching relation among a source service system, a source channel, a data table, corresponding fields and li-clear data items aiming at each urban energy flow monitoring service data item in the data demand table to form a monitoring service data demand table of each urban energy subsystem, and combining to form detail service data required by urban energy flow monitoring through methods of interfaces, off-line collection and the like of each urban energy flow monitoring service subsystem.
(3) Urban energy system energy flow monitoring data processing
Aiming at the access of a source service system for urban energy flow monitoring and the data of each subsystem, the data quality check is carried out on the extracted urban energy flow monitoring related detail data by utilizing R, python, SPSS, EXCEL and other tools from the aspects of data integrity, normalization, rationality, accuracy, consistency and the like, and the availability and the effectiveness of the data are verified. Based on the actual urban energy flow monitoring service and the data requirement, a data cleaning and conversion rule is formed, invalid data is cleaned, and an effective data set of detail service data is formed. And combining the data table and the incidence mapping relation between the data items to form a detail service data table and monitoring level data corresponding to the monitoring rule.
(4) Urban energy system energy flow monitoring model construction
Based on urban energy flow monitoring service content, rules and data requirements, a service data model applicable to each energy subsystem is constructed, a certain proportion of data is extracted, the data is substituted into the urban energy flow monitoring data model for training, the feasibility, rationality and accuracy of the model are verified based on the accuracy, fitting degree and other parameters of the training result, and meanwhile, the service model parameters are adaptively adjusted to meet the urban energy flow monitoring service requirements.
(5) Urban energy system energy flow monitoring data calculation and analysis
And carrying out data calculation and association mining by using the urban energy flow monitoring model to form energy subsystems and urban energy flow monitoring results, including results of a result chart, a monitoring report and the like, and carrying out design and configuration of PC terminal display content.
(6) Urban energy system energy flow monitoring achievement solidification
Optimizing and perfecting a model according to the deviation condition of the urban energy flow monitoring result and the urban energy flow expected value, setting the monitoring result expression form according to different requirements of urban energy authorities, energy operation enterprises, energy utilization enterprises, the public and the like, and solidifying the urban energy flow monitoring report mode by utilizing tools such as data processing, data mining and the like.
Example III
The algorithm model is further designed by combining the urban energy system energy flow monitoring design provided by the second embodiment of the invention, which comprises the technical route of the urban energy system energy flow monitoring method based on the multi-scale energy consumption model as shown in fig. 1, and the method comprises the following steps:
S1, selecting an energy monitoring type, and dividing the energy of the urban energy system into six categories of coal, petroleum, natural gas, electric power, heating power and cooling power according to a common classification method of the national statistics annual survey in the energy field. On the basis, the energy source types are further subdivided according to specific conditions such as varieties, sources, purposes and the like in each energy source major category, wherein:
(1) Coal is divided into 3 types of lignite, bituminous coal and anthracite according to international coal classification standards;
(2) Petroleum is divided into 4 main energy types of gasoline, diesel oil, kerosene and liquefied petroleum gas;
(3) Various coal, petroleum and natural gas supply sources are divided into local production and foreign input;
(4) The power comprises conventional energy power and renewable energy power, and comprises coal power (a pure coal-condensing electric generator set and a cogeneration coal-power generator set), gas power generation, hydropower, wind power, nuclear power, solar power generation, biomass energy power generation and the like, wherein the power supply is divided into local power generation and external power generation;
(5) The heating power comprises heat supply technologies such as heat and power cogeneration unit heat supply, coal-fired boiler heat supply, gas-fired boiler heat supply, heat pump floor heating and the like, and the local supply quantity is mainly considered.
(6) The cold force comprises cold supply technology of a cold-heat cogeneration unit, cold supply of an electric refrigerator, heat pump and the like, and the local supply quantity is mainly considered.
The basic links of urban energy systems are resource exploitation and collection, processing and conversion, transportation and distribution, demand departments, energy facilities, end uses/useful energy demands. The primary energy is obtained after the energy resource is mined and collected, and the secondary energy is obtained after the primary energy is processed and converted. The secondary energy is transported and distributed to terminal energy demand departments of industry, agriculture, traffic, business, urban and rural life and the like, and various energy utilization facilities provide various end uses of useful energy such as process heat, power, illumination, hot water, cooking, heating, refrigeration and the like for various users. The energy flow has certain loss in each link, such as energy production loss, processing conversion loss, transportation and distribution loss (transportation loss of petroleum products, power transmission and transformation loss of electricity and the like), terminal consumption loss and the like. Various environmental impact problems may also occur during the development, conversion, processing, transportation and storage of energy sources to the utilization process, such as the emission of atmospheric pollutants such as PM10, TSP, SO2, NO2, petroleum hydrocarbons, etc., the emission of CO2, etc., and thus the global climate change.
S2, constructing a deep learning multi-scale energy consumption model;
(1) Data preparation. According to the characteristic analysis of the energy consumption object, the main factors influencing the energy consumption include historical energy consumption data, environment data and time data, so that the three data are selected as model input. Specifically, according to the multi-time scale requirement, selecting the simultaneous load of 1 to 4 weeks before the target time, the simultaneous load of 7 days before and the continuous load of 23 hours before as main historical energy consumption data, using weather data such as temperature and humidity corresponding to each historical energy consumption as environment data, using seasons, weeks, time and the like of the target time as time data, integrating the data, combining the real load of the target time, and forming a training data set Wherein X i represents the actual load at the target time, y i represents the actual load at the target time, and N represents the data set size. And (3) aiming at the multi-space-scale requirement, combining factors such as space distribution, energy consumption characteristics and the like of the energy consumption objects on the basis of the basic data set, and aggregating according to the required scale to obtain the energy consumption data set under different space scales.
(2) Model construction and training. The depth of the neural network is chosen according to the complexity of the actual energy consuming object, typically 3-5 layers. The model input is the corresponding input vector X i, the expected output is y i, and the real output isThe model loss function is constructed as follows:
where θ is a model parameter. Training the model by adopting a random gradient descent method:
Until the model converges or iterates to the maximum iteration number, thereby obtaining the quantitative relation between the load demand and the influence vector thereof.
S3, establishing an energy flow data monitoring method of a deep neural network and semi-supervised learning;
the monitoring of the energy system is to monitor the running state of the energy system in real time through the steps of distributed energy data acquisition, data preprocessing, energy data analysis and the like on the basis of a physical mechanism and an energy consumption model, and guide the operation and maintenance scheduling of the energy system. Common monitoring metrics include energy system characteristics such as energy flow direction, energy structure, energy efficiency, etc., which can be calculated in real time based on the collected energy data. Peak load is also an important task for monitoring an energy system, and the peak load at a specified time needs to be predicted firstly based on a constructed energy consumption model, and then the operation safety of the system is predicted and monitored according to the information such as the system capacity, the margin and the like.
(1) According to the multi-scale model constructed according to the embodiment, historical energy consumption data x1, environmental factors x2 and social factors x3 are input according to the determined energy consumption object selection model, and the historical energy consumption data x1, the environmental factors x2 and the social factors x3 are sent into the multi-scale energy consumption model to obtain a predicted load y at a future moment.
(2) And determining parameters such as capacity and energy consumption threshold of an energy system in an area where the energy consumption object is located, taking an electric power system as an example, recording the installed capacity of the energy consumption object as C, determining an energy consumption threshold parameter tau corresponding to the class of the object according to the energy consumption characteristics and expert knowledge, and then sending three data of y, C and tau to a built energy flow monitoring platform.
(3) And the energy flow monitoring platform at the upper layer monitors the energy flow operation of the energy system in real time by comparing the numerical relation among the predicted load y, the installed capacity C and the threshold parameter tau and combining the set safety warning limit.
Another important monitoring task is to monitor the abnormal operation state of the object or equipment in the system, the coupling factor and the randomness factor of the task are numerous, and the situation is difficult to accurately describe by adopting a physical mechanism, so that an abnormal state judging data model is directly constructed based on the energy object operation data and the deep learning method. The specific process is that the related energy data is selected as input according to the target object characteristics and the abnormal state characteristics, then the data characteristics are extracted based on priori knowledge, then the data are sent into a deep network to extract deep semantic characteristics in the data, and finally the abnormal state judgment is completed by adopting a linear classifier.
In a practical scenario, the energy system is in a normal operation state most of the time, which causes serious unbalance between normal and abnormal energy data distribution, and the scarce abnormal state is a focus of attention really needed for the energy system. On the other hand, the distribution of abnormal data is more distributed than normal data, patterns are numerous, it is difficult to represent by uniform features, and expert knowledge is required to determine specific abnormalities. These two characteristics determine that energy flow monitoring of energy systems is essentially a multi-classification problem with serious imbalance of samples.
In order to solve the problems, the embodiment adopts a semi-supervised learning framework to fully utilize a large amount of normal operation data to condense a reliable characteristic representation, and based on the characteristic representation, a final classifier for energy flow monitoring is trained by combining a small amount of abnormal data.
Firstly, constructing a group of standard operation data of an energy consumption object based on priori knowledge, combining the actual operation data on the basis to form a group of data pairsThe distribution is sent into a feature extraction network F (-), and corresponding feature vectors are obtainedTaking the difference between the two as the final characteristic of time operation data
Second, for normal operation data or abnormal data that is a marker, when data is shifted in a small range or time-series shifted, the operation state in which the energy consumption object is actually located is not changed, so that the representation in the feature space should be substantially consistent. Based on this assumption, a consistency loss function is constructed.
Wherein f' is a characteristic representation of the data after shifting or timing shifting.
For marked outlier data, the loss function of the constructed outlier classifier based on the feature representation should be considered in addition to the consistency loss.
Lcls(x,y)=CE(y,y')
Where y is the label of the outlier, y' is the classifier output, and CE (·) is the cross entropy function.
Based on the two, constructing an overall loss function of model training
L=Lcls(x,y)+λLcon(x)
Where λ is a predetermined scaling factor.
In the training process of the model, the parameters of the feature extraction network F (-) change continuously, particularly the change is obvious in the initial stage of model training, which leads to larger fluctuation of consistency loss. In order to improve the stability of model training, a feature extraction network after parameter moving average is used as a teacher model to obtain F', and the original feature extraction network F (-) is further guided to be used as the learning capability of the student model.
S4, analyzing and evaluating the monitoring result.
The embodiment can evaluate urban energy flow from multiple dimensions of safety, economy, green, efficiency, convenience, sustainability and the like.
The safety is expressed as comprehensive weighted evaluation values of indexes such as probability of occurrence of urban energy operation abnormal events, expected economic loss value, self-sufficient rate of local energy and the like.
The economy is expressed as a comprehensive weighted evaluation value of the indexes such as the average cost of the current unit energy consumption, the annual decline rate of the average cost and the like.
Green represents a comprehensive weighted evaluation value of indexes such as conventional environmental pollutants, total emission amount of greenhouse gases, emission intensity, emission drop amplitude and the like of current energy consumption.
The efficiency is a comprehensive weighted evaluation value of indexes such as energy efficiency, energy efficiency improvement and the like of the current energy consumption.
The method is convenient to be a comprehensive weighted evaluation value of indexes such as availability, coverage, service satisfaction and the like of current energy consumption.
The comprehensive weighted evaluation value of indexes such as supply and demand gaps, economic fluctuation conditions, emission change trend and the like for future energy consumption can be continuously obtained.
And (5) weighting and summarizing the indexes to obtain the comprehensive energy flow evaluation results among different cities.
The above program design scheme provided in this embodiment may be stored in a computer readable storage medium in a coded form, implemented in a computer program, and input basic parameter information required for calculation through computer hardware, and output a calculation result.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations of methods, apparatus (means), and computer program products according to embodiments of the invention. It will be understood that each flow of the flowchart, and combinations of flows in the flowchart, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the invention in any way, and any person skilled in the art may make modifications or alterations to the disclosed technical content to the equivalent embodiments. However, any simple modification, equivalent variation and variation of the above embodiments according to the technical substance of the present invention still fall within the protection scope of the technical solution of the present invention.
The patent is not limited to the best mode, any person can obtain other various forms of multi-scale energy consumption models of the urban energy system and energy flow monitoring methods thereof under the teaching of the patent, and all equivalent changes and modifications made according to the application scope of the invention belong to the coverage scope of the patent.