User gas consumption prediction method and system, terminal and storage medium

By combining the user's historical gas use data and geometeorological data, using prediction models to predict the user's future gas usage, the problem of low prediction accuracy in the prior art is solved, and more accurate gas usage prediction is achieved.

CN120013577APending Publication Date: 2025-05-16SHENZHEN GAS CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411909361.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the prior art, only historical gas data is used to predict user gas usage, ignoring the influence of external environmental variables, resulting in low prediction accuracy.

Method used

By obtaining the target user's historical gas usage data and geometeorological data, the trained gas usage prediction model is used to predict the user's future gas usage usage volume by combining user gas usage habits and external environmental factors.

Benefits of technology

It improves the accuracy of gas usage prediction, takes into account a variety of influencing factors, and enhances the reliability of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013577A_ABST
    Figure CN120013577A_ABST
Patent Text Reader

Abstract

The invention discloses a user gas consumption prediction method and system, a terminal and a storage medium. The method comprises the following steps: acquiring historical gas consumption of a target user at each moment in a first time period to obtain a historical gas consumption data sequence; a target geographic area is determined according to the position of the target user, geographic meteorological data of the target geographic area at each moment in a first time period or a second time period is obtained, a geographic meteorological data sequence is obtained, and the first time period is located before the second time period; inputting the historical gas consumption data sequence and the geographic meteorological data sequence into a trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used for reflecting the predicted gas consumption of the target user at each moment in the second time period. According to the method, the gas consumption habit of the user is combined with the external environmental factors, and various influence factors related to the gas consumption are fully considered, so that the prediction model can more accurately predict the gas consumption of the user in the future.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of gas management, and in particular to a method, system, terminal and storage medium for predicting user gas usage. Background Art

[0002] In urban gas management, users' gas usage patterns are often complex and changeable. Gas usage is not only affected by users' own habits, but also significantly affected by the external environment. Accurately predicting users' gas usage is crucial to optimizing gas supply, reducing costs, and improving service quality.

[0003] At present, the main method is to conduct statistical analysis on the historical gas usage data of users to predict the gas usage of users. However, predicting the gas usage of users based only on historical gas usage data ignores the impact of other external environmental variables on gas usage, resulting in low prediction accuracy.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the invention

[0005] The technical problem to be solved by the present invention is that, in view of the above-mentioned defects of the prior art, a method, system, terminal and storage medium for predicting user gas usage are provided, aiming to solve the problem that the prior art only relies on historical gas usage data to predict the user's gas usage, ignoring the impact of other external environmental variables on gas usage, resulting in low prediction accuracy.

[0006] The technical solution adopted by the present invention to solve the problem is as follows:

[0007] In a first aspect, an embodiment of the present invention provides a method for predicting user gas usage, the method comprising:

[0008] Obtain the historical gas consumption of the target user at each moment in the first time period to obtain a historical gas consumption data sequence;

[0009] Determine a target geographical area according to the location of the target user, obtain geographical meteorological data of the target geographical area at each moment in the first time period or the second time period, and obtain a geographical meteorological data sequence; wherein the first time period is before the second time period;

[0010] The historical gas consumption data sequence and the geographic meteorological data sequence are input into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period.

[0011] In one embodiment, the first time period is the past twenty-four hours, and the second time period is the next twenty-four hours;

[0012] The characteristic variables of each of the historical gas consumption in the historical gas consumption data sequence include: time, season, and holiday;

[0013] Each of the geographic meteorological data in the geographic meteorological data sequence includes: temperature, humidity, wind speed, precipitation and altitude.

[0014] In one embodiment, the training method of the trained gas consumption prediction model includes:

[0015] Acquire a training data set; wherein each of the training data includes a historical gas consumption data sequence and a geographical meteorological data sequence for training, and an actual gas consumption data sequence as a true label;

[0016] Selecting one training data from the training data set, training the gas consumption prediction model according to the training data, and calculating the model loss value;

[0017] Determining whether the model loss value meets the preset training requirements, and if not, updating the parameters of the gas consumption prediction model according to the model loss value;

[0018] Continue to execute the step of selecting one training data from the training data set until the model loss value meets the training requirement, thereby obtaining the trained gas consumption prediction model.

[0019] In one embodiment, the trained gas consumption prediction model includes a factor time series feature extraction module and a factor fusion feature extraction module, and the historical gas consumption data sequence and the geographic meteorological data sequence are input into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence, including:

[0020] The geographic meteorological data sequence is divided into a geographic data sequence and a meteorological data sequence, and the meteorological data sequence is divided into meteorological factor sequences corresponding to a plurality of meteorological factors;

[0021] According to the geographic data and the meteorological factor sequences, the meteorological time series features corresponding to the meteorological factors are obtained through the factor time series feature extraction module;

[0022] According to each of the meteorological time series characteristics and the historical gas consumption data sequence, a predicted gas consumption data sequence is obtained through the factor fusion feature extraction module.

[0023] In one embodiment, according to the geographic data and each of the meteorological factor sequences, the meteorological time series features corresponding to each of the meteorological factors are obtained through the factor time series feature extraction module, including:

[0024] Perform feature extraction based on the geographic data to obtain abstract features of the geographic data;

[0025] For each of the meteorological factor sequences, summing the meteorological factor sequence and the abstract features of the geographic data is performed to obtain summed data;

[0026] Inputting the summed data into a convolution kernel module for feature dimension reduction to obtain first tensor data of a preset scale;

[0027] The first tensor data is input into the fully connected layer for deep feature extraction to obtain the meteorological time series features corresponding to the meteorological factor sequence.

[0028] In one embodiment, according to each of the meteorological time series features and the historical gas consumption data sequence, the predicted gas consumption data sequence is obtained through the factor fusion feature extraction module, including:

[0029] According to each of the meteorological time series characteristics, the geographical meteorological time series characteristics are obtained through the factor fusion feature extraction module;

[0030] According to the historical gas consumption data sequence, the gas consumption time series characteristics are obtained through the factor fusion feature extraction module;

[0031] According to the geographical meteorological time series characteristics and the gas consumption time series characteristics, a fusion time series characteristic is obtained through the factor fusion feature extraction module;

[0032] A predicted gas consumption data sequence is generated according to the fused time series features.

[0033] In one embodiment, the factor fusion feature extraction module is used to:

[0034] Acquire input data, and integrate the input data into second tensor data of a preset size;

[0035] Input the second tensor data into a fully connected layer to obtain time series features;

[0036] Wherein, if the input data is each of the meteorological time series characteristics, the output time series characteristics are the geographical meteorological time series characteristics;

[0037] If the input data is the historical gas usage data sequence, the output time series feature is the gas usage time series feature;

[0038] If the input data is the geographic meteorological time series characteristics and the gas consumption time series characteristics, the output time series characteristics are the fused time series characteristics.

[0039] In a second aspect, an embodiment of the present invention further provides a user gas usage prediction system, the system comprising:

[0040] A gas consumption data acquisition module is used to acquire the historical gas consumption of the target user at each moment in the first time period to obtain a historical gas consumption data sequence;

[0041] A geographic meteorological data acquisition module, used to determine a target geographic area according to the location of the target user, and acquire the geographic meteorological data of the target geographic area at each moment in the first time period or the second time period to obtain a geographic meteorological data sequence; wherein the first time period is before the second time period;

[0042] The gas consumption prediction module is used to input the historical gas consumption data sequence and the geographical meteorological data sequence into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period.

[0043] In a third aspect, an embodiment of the present invention further provides a terminal, comprising a memory and one or more processors; the memory stores one or more programs; the program comprises instructions for executing any of the user gas usage prediction methods described above; and the processor is used to execute the program.

[0044] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are suitable for being loaded and executed by a processor to implement the steps of any of the above-mentioned methods for predicting user gas usage.

[0045] Beneficial effects of the present invention: The embodiment of the present invention obtains the historical gas consumption of the target user at each moment in the first time period to obtain a historical gas consumption data sequence; determines the target geographical area by the location of the target user, obtains the geographical meteorological data of the target geographical area at each moment in the first time period or the second time period, and obtains a geographical meteorological data sequence, wherein the first time period is before the second time period; inputs the historical gas consumption data sequence and the geographical meteorological data sequence into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period. The present invention combines the user's gas consumption habits with external environmental factors, and fully considers a variety of influencing factors related to gas consumption, so that the prediction model can more accurately predict the user's future gas consumption. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] Figure 1 It is a flow chart of a method for predicting user gas usage provided by an embodiment of the present invention.

[0048] Figure 2 It is a schematic diagram of the model training process provided by an embodiment of the present invention.

[0049] Figure 3 It is a schematic diagram of geographical meteorological data provided by an embodiment of the present invention.

[0050] Figure 4 It is a schematic diagram of gas usage data provided by an embodiment of the present invention.

[0051] Figure 5 It is a schematic diagram of the overall architecture of the model provided by an embodiment of the present invention.

[0052] Figure 6 It is a schematic diagram of the principle of the factor time series feature extraction module provided in an embodiment of the present invention.

[0053] Figure 7 It is a schematic diagram of the principle of the factor fusion feature extraction module provided in an embodiment of the present invention.

[0054] Figure 8 It is a module schematic diagram of a user gas usage prediction system provided by an embodiment of the present invention.

[0055] Fig. 9 It is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The present invention discloses a method, system, terminal and storage medium for predicting user gas usage. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0057] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0058] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0059] In view of the above-mentioned defects of the prior art, the present invention provides a method for predicting user gas usage. The method comprises: obtaining the historical gas usage of the target user at each moment in the first time period to obtain a historical gas usage data sequence; determining the target geographical area according to the location of the target user, obtaining the geographical meteorological data of the target geographical area at each moment in the first time period or the second time period to obtain a geographical meteorological data sequence; wherein the first time period is before the second time period; inputting the historical gas usage data sequence and the geographical meteorological data sequence into a trained gas usage prediction model to obtain a predicted gas usage data sequence; the predicted gas usage data sequence is used to reflect the predicted gas usage of the target user at each moment in the second time period. The present invention combines the user's gas usage habits with external environmental factors, and fully considers a variety of influencing factors related to gas usage, so that the prediction model can more accurately predict the user's future gas usage.

[0060] like Figure 1 As shown, the method specifically comprises the following steps:

[0061] Step S100, obtaining the historical gas consumption of the target user at each moment in the first time period, and obtaining a historical gas consumption data sequence;

[0062] Step S200: determining a target geographical area according to the location of the target user, acquiring geographical meteorological data of the target geographical area at each moment in the first time period or the second time period, and obtaining a geographical meteorological data sequence; wherein the first time period is before the second time period;

[0063] Step S300: input the historical gas consumption data sequence and the geographic meteorological data sequence into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period.

[0064] Specifically, the target user refers to a user who expects to predict his future natural gas usage. The first time period is a past time range, such as the past day or week. The detailed gas usage records of the user in the first time period are collected, which can be counted by hour or more precise time intervals. The gas usage at all times collected is arranged in chronological order, that is, a historical gas usage data sequence is obtained, which reflects the gas usage habits and patterns of the target user in the past period of time. Secondly, it is also necessary to determine the location of the target user, and a related, larger regional range is defined according to the location, that is, the target geographical area is obtained. This area represents the geographical space where environmental factors (such as climate) that affect the gas usage of the target user act. In this embodiment, two-dimensional geographic meteorological data within a certain range around the location point is used as an influencing factor. Compared with using the geographic meteorological data of a single location point as an influencing factor, the scope of the geographical area becomes larger and contains more information. Collect the geographic meteorological data of the target geographical area at each moment in the first time period or the second time period in the future, and arrange them in chronological order, that is, a geographic meteorological data sequence is obtained. The historical gas consumption data sequence and the geographic meteorological data sequence are input into the trained gas consumption prediction model together. After calculation, the model outputs a new data sequence, which represents the predicted gas consumption of the target user at each moment in the second time period. This prediction result can help related enterprises and departments to make resource allocation, supply and demand balance and other tasks in advance, and improve operational efficiency and service quality.

[0065] In short, this embodiment can predict the gas consumption data sequence of the second time period in the future based on the gas consumption data sequence of the first time period in the past and the geographical meteorological data sequence; or predict the gas consumption data sequence of the second time period in the future based on the gas consumption data sequence of the first time period in the past and the geographical meteorological data sequence of the second time period in the future. Compared with the latter, the former reduces the prediction link of geographical meteorological data and can save computing overhead; compared with the former, the latter uses geographical meteorological data that better matches the prediction time period and can improve the prediction accuracy. Users can choose which prediction method to use according to their own needs.

[0066] In one implementation, the first time period is the past twenty-four hours, and the second time period is the future twenty-four hours.

[0067] In one implementation, the characteristic variables of each of the historical gas usage in the historical gas usage data sequence include: time, season, and holiday;

[0068] Each of the geographic meteorological data in the geographic meteorological data sequence includes: temperature, humidity, wind speed, precipitation and altitude.

[0069] like Figure 2 As shown, one of the key steps of this embodiment is the selection of influencing factors: in order to fully consider the impact of various factors on user gas consumption, an influencing factor group can be constructed from four perspectives: time, season, holiday, and geographical meteorology.

[0070] The influencing factors from the time perspective include: hours and gas usage, day and week. Regarding hours and gas usage: Gas usage varies significantly in different time periods of the day. Usually, gas usage is higher in the morning and evening because users may cook and bathe during these time periods. Regarding day and week: Gas usage usually increases on weekends due to more family gatherings and leisure activities, while gas usage on weekdays is relatively stable.

[0071] The influencing factors from the seasonal perspective include: winter, summer, and seasonal changes. About winter: Gas consumption usually increases in winter, mainly for heating and hot water needs, especially in cold areas. About summer: Gas consumption in summer may decrease due to reduced hot water use, but in some areas, cooking needs still exist. About seasonal changes: When the seasons change, the adjustment of user gas consumption is usually more obvious, especially in spring and autumn.

[0072] The factors influencing the holiday perspective include: holiday gas consumption peak and long holiday effect. Regarding holiday gas consumption peak: During holidays, family dinners and gatherings are frequent, resulting in a significant increase in gas consumption. Regarding the long holiday effect: During long holidays (such as the Spring Festival and National Day), due to family reunions and outings, users' gas consumption patterns will change significantly.

[0073] The influencing factors from the geographical and meteorological perspective include: temperature, humidity, wind speed, precipitation, and altitude. Among them, the first four correspond to dynamic meteorological perspectives, and the last one corresponds to a static geographical perspective. About temperature: Temperature is the main meteorological factor affecting gas consumption. Low temperature weather will lead to an increase in heating demand, thereby increasing gas consumption. About humidity: In a high humidity environment, users may use hot water more frequently to improve comfort and increase gas consumption. About wind speed: Strong winds may increase heating demand, especially in cold weather. Higher wind speeds will reduce the perceived temperature, prompting users to use more gas. About precipitation: Precipitation weather often causes users to stay at home more, which may increase cooking and hot water use, thereby increasing gas consumption. About altitude: The temperature in high-altitude areas is usually lower, and users' heating and hot water needs will increase accordingly, leading to an increase in gas consumption.

[0074] In view of the above-determined influencing factor group, the input data of the gas consumption prediction model is determined to be the historical gas consumption data series and the geographical meteorological data series:

[0075] The historical gas usage data sequence includes: several historical gas usages arranged in chronological order, i.e., the gas usage of the user. The characteristic variables of each historical gas usage include: time, including hour and date. Season, which is automatically classified into four seasons: spring, summer, autumn, and winter according to the date. Holidays, for example, you can use the holiday calendar to identify whether it is a holiday.

[0076] The geographic meteorological data sequence includes: a plurality of geographic meteorological data arranged in chronological order. Each geographic meteorological data includes: temperature, such as hourly temperature data; humidity, such as hourly air humidity data; wind speed, such as hourly wind speed data; precipitation, such as hourly precipitation data; altitude, such as altitude information.

[0077] In one implementation, the training method of the trained gas consumption prediction model includes:

[0078] Acquire a training data set; wherein each of the training data includes a historical gas consumption data sequence and a geographical meteorological data sequence for training, and an actual gas consumption data sequence as a true label;

[0079] Selecting one training data from the training data set, training the gas consumption prediction model according to the training data, and calculating the model loss value;

[0080] Determining whether the model loss value meets the preset training requirements, and if not, updating the parameters of the gas consumption prediction model according to the model loss value;

[0081] Continue to execute the step of selecting one training data from the training data set until the model loss value meets the training requirement, thereby obtaining the trained gas consumption prediction model.

[0082] Specifically, the model training step is similar to the inference step in that the model input data are both historical gas consumption data series and geographic meteorological data series, but the difference is that the model training step has real labels for evaluating the model prediction performance. In actual application, the corresponding training data set is constructed according to the influencing factor group determined above:

[0083] First, it is clear that the target variable to be predicted is mainly the gas consumption of the user, which can be recorded as daily, weekly or monthly gas consumption (such as cubic meters). In this embodiment, the hourly gas consumption is used as the predicted gas consumption.

[0084] Then, the influencing factors of various angles related to the user's gas usage are used to form a training data set, where each training data includes a set of historical gas consumption data sequences and geographic meteorological data sequences for training, and an actual gas consumption data sequence as a true label. The historical gas consumption data sequence can reflect the influencing factors of three angles: time, season, and holiday, and the geographic meteorological data sequence can reflect the influencing factors of the geographic meteorological angle. The gas consumption prediction model is iteratively trained through this training data set. Each round of training will use the predicted data output by the model and the true label to calculate the model loss value, and update the model parameters guided by the model loss value to improve the model prediction accuracy. In the subsequent model prediction, the prediction effect of the model can be continuously monitored, and prediction evaluation and evaluation feedback can be performed to promote model retraining and achieve the purpose of continuously updating model parameters.

[0085] In one implementation, the sources of historical data used to construct the training data set are as follows:

[0086] User gas usage data: Extract user gas usage data from the smart gas meter database of the city gas company to ensure data integrity and time alignment.

[0087] Time and holiday data: When obtaining the user's gas usage data, the corresponding gas usage time is also obtained, and the seasonal and holiday characteristics are obtained based on the time.

[0088] Geographical meteorological data: Obtain multiple sets of two-dimensional meteorological and geographic data of surrounding distances from the meteorological information center based on the user's location information, including hourly temperature, humidity, wind speed, precipitation, and altitude.

[0089] Furthermore, after obtaining the above historical data, it is necessary to perform data cleaning operations on the historical data before using it to construct a training data set, wherein the data cleaning operations include integrity checking, consistency checking, and exception handling;

[0090] For completeness check: check whether there are missing values ​​in user gas consumption data and meteorological data, fill in the values ​​in the same period for minor missing values, and make range selection for major missing values ​​to ensure that the final data has corresponding data at each time point.

[0091] For consistency check: ensure the consistency of timestamps in different data sources, unify the time format, and avoid problems caused by time zone differences.

[0092] Abnormal processing: For data such as gas consumption and temperature, perform outlier detection (such as Z-score, IQR, etc.), and use data from the same period to process obviously erroneous data.

[0093] Furthermore, after obtaining the cleaned historical data, it is necessary to merge and divide the cleaned historical data to obtain a training data set, which specifically includes the following steps:

[0094] For data merging operations: Geographical meteorological data is two-dimensional regional data. The same type of data is merged according to the channel dimension to generate a geographic meteorological data set, such as Figure 3 As shown in the figure, for temperature, humidity, wind speed and precipitation, which are dynamic data, the original multiple time data (3*3) are merged to obtain the meteorological data set (n*3*3). For static data such as altitude, they are directly saved in a size of 3*3 to obtain the geographic data set. The gas consumption data is one-dimensional data. They are merged in a table by row to generate a gas consumption data set (n*3). Figure 4 As shown, the gas usage data includes time, season, holiday and gas usage, wherein spring, summer, autumn and winter in the seasons are represented by 1, 2, 3 and 4 respectively, and whether it is a holiday is 1 for yes and 0 for no.

[0095] For the data partitioning operation: the data set is divided into a training data set, a validation data set, and a test data set according to a preset ratio, wherein the preset ratio may be 7:1.5:1.5.

[0096] For example, if the first time period is the historical 24 hours and the second time period is the future 24 hours, the model prediction task is to use the historical 24 hours gas consumption data sequence and the historical 24 hours meteorological data sequence to predict the future 24 hours gas consumption data sequence; or, use the historical 24 hours gas consumption data sequence and the future 24 hours meteorological data sequence to predict the future 24 hours gas consumption data sequence. The former example is used below for illustration.

[0097] From the training data set constructed above, it can be seen that the following sets of data are needed for gas consumption prediction model training: one set is the historical 24-hour hourly dynamic meteorological data (24*3*3) and static geographic data (3*3), one set is the historical 24-hour hourly gas consumption data (24*4), and the corresponding true label is a set of hourly gas consumption data for the next 24 hours (24*4).

[0098] Model training: Select Adam (Adaptive Moment Estimation) as the optimizer for training, select Mean Squared Error (MSE) as the loss function, set the number of iterations to 500, and the learning rate to 0.01.

[0099] Model prediction: Input the geographic meteorological data sequence and gas consumption data sequence of the past 24 hours, and after model prediction, generate the gas consumption data sequence of the next 24 hours.

[0100] Prediction evaluation: Use the root mean square error (RMSE) to compare the prediction results with the actual situation.

[0101] Evaluation feedback: Each time, the root mean square error between the prediction results and the actual situation in the most recent week is calculated. If the error exceeds the threshold, the model is retrained using the updated historical data, otherwise it is not retrained.

[0102] In one implementation, the trained gas consumption prediction model includes a factor time series feature extraction module and a factor fusion feature extraction module, and the historical gas consumption data sequence and the geographic meteorological data sequence are input into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence, including:

[0103] The geographic meteorological data sequence is divided into a geographic data sequence and a meteorological data sequence, and the meteorological data sequence is divided into meteorological factor sequences corresponding to a plurality of meteorological factors;

[0104] According to the geographic data and the meteorological factor sequences, the meteorological time series features corresponding to the meteorological factors are obtained through the factor time series feature extraction module;

[0105] According to each of the meteorological time series characteristics and the historical gas consumption data sequence, a predicted gas consumption data sequence is obtained through the factor fusion feature extraction module.

[0106] The gas consumption prediction model mainly includes two functional modules: factor time series feature extraction module and factor fusion feature extraction module. Among them, the factor time series feature extraction module is mainly used to extract meteorological time series features under specific geographical conditions. Specifically, the geographical meteorological data sequence includes static geographical data, such as altitude data, and dynamic meteorological data sequence. The meteorological data sequence is divided into several parallel meteorological factor sequences, and each meteorological factor sequence corresponds to a different meteorological factor, such as temperature, humidity, wind speed and precipitation. The geographical data and each meteorological factor sequence are input into the factor time series feature extraction module, which will extract the deep features of the geographical data and each meteorological factor sequence and perform feature fusion to obtain the meteorological time series features of different meteorological factors under specific geographical conditions. Finally, according to the meteorological time series features of each meteorological factor and the historical gas consumption data sequence, the factor fusion feature extraction module is used to perform feature fusion analysis to predict the gas consumption of the target user at different times in the second time period in the future.

[0107] In one implementation, according to the geographic data and the meteorological factor sequences, the meteorological time series features corresponding to the meteorological factors are obtained through the factor time series feature extraction module, including:

[0108] Perform feature extraction based on the geographic data to obtain abstract features of the geographic data;

[0109] For each of the meteorological factor sequences, summing the meteorological factor sequence and the abstract features of the geographic data is performed to obtain summed data;

[0110] Inputting the summed data into a convolution kernel module for feature dimension reduction to obtain first tensor data of a preset scale;

[0111] The first tensor data is input into the fully connected layer for deep feature extraction to obtain the meteorological time series features corresponding to the meteorological factor sequence.

[0112] Specifically, Figure 5 and Figure 6 As shown in the figure, in the factor time series feature extraction module, the geographic data (3*3) is firstly extracted using a 2*2 convolution kernel to obtain the abstract features of the geographic data (3*3). Then, for any set of meteorological factors (24*3*3), after summing the abstract features of the geographic data, two layers of 2*2 convolution kernels are used to perform feature dimensionality reduction processing to obtain the first tensor data of 24*1*1. Finally, the fully connected layer is used to extract the deep feature representation of the first tensor data to obtain the output result of the factor time series feature extraction module (24*1). The factor time series feature extraction module fuses the static altitude factor with the other four meteorological factors and extracts features, so as to better obtain the meteorological time series features under specific geographical conditions.

[0113] For example, Figure 5 As shown in the figure, the types of meteorological factors are set to be temperature, humidity, precipitation and wind speed. For the geographic meteorological data sequence, the meteorological factor sequences corresponding to the geographic data and temperature, humidity, precipitation and wind speed are respectively transferred to the factor time series feature extraction module in batches to obtain the features of temperature, humidity, precipitation and wind speed at the time series angle (24*1), that is, the meteorological time series features corresponding to temperature, humidity, precipitation and wind speed.

[0114] In one implementation, according to each of the meteorological time series features and the historical gas consumption data sequence, the predicted gas consumption data sequence is obtained through the factor fusion feature extraction module, including:

[0115] According to each of the meteorological time series characteristics, the geographical meteorological time series characteristics are obtained through the factor fusion feature extraction module;

[0116] According to the historical gas consumption data sequence, the gas consumption time series characteristics are obtained through the factor fusion feature extraction module;

[0117] According to the geographical meteorological time series characteristics and the gas consumption time series characteristics, a fusion time series characteristic is obtained through the factor fusion feature extraction module;

[0118] A predicted gas consumption data sequence is generated according to the fused time series features.

[0119] Specifically, each meteorological time series feature only reflects the change of a certain aspect of the meteorological state over time under specific geographical conditions. Therefore, this embodiment will fuse different meteorological time series features through the factor fusion feature extraction module, and further consider the relationship between different meteorological factors, so as to obtain a comprehensive description of the evolution of the comprehensive meteorological conditions in a specific geographical area over time, that is, to obtain the geographical meteorological time series feature. The historical gas consumption data sequence contains the historical gas consumption at different times in the past. The gas consumption characteristics at different times are extracted by the factor fusion feature extraction module, so as to analyze the change pattern of the target user's gas consumption over time, season, and holiday, that is, to obtain the gas consumption time series feature. It should be noted that the factor fusion feature extraction module is mainly used to perform feature engineering work, and the feature engineering work performed on different data can be performed in this module. Finally, the geographical meteorological time series features and the gas consumption time series features are input into the factor fusion feature extraction module, and the two features are fused and analyzed by the factor fusion feature extraction module, that is, the fused time series features are obtained. Since the fused time series features comprehensively consider meteorological factors, geographical factors and the target users' own gas usage patterns at different times, seasons and holidays, the fused time series features can accurately predict the target users' gas usage at different times in the second time period in the future.

[0120] For example, the four meteorological time series features of temperature, humidity, precipitation and wind speed are fused through the factor fusion feature extraction module to obtain the fused geographical meteorological time series features (24*1). For gas consumption data, the gas consumption feature extraction module is used to extract the features of the historical gas consumption data sequence to obtain the gas consumption time series features, and then the gas consumption time series features and the geographical meteorological time series features are fused with the help of the factor fusion feature extraction module, and the final result is the future gas consumption forecast (24*1).

[0121] In one implementation, the factor fusion feature extraction module is used to:

[0122] Acquire input data, and integrate the input data into second tensor data of a preset size;

[0123] Input the second tensor data into a fully connected layer to obtain time series features;

[0124] Wherein, if the input data is each of the meteorological time series characteristics, the output time series characteristics are the geographical meteorological time series characteristics;

[0125] If the input data is the historical gas usage data sequence, the output time series feature is the gas usage time series feature;

[0126] If the input data is the geographic meteorological time series characteristics and the gas consumption time series characteristics, the output time series characteristics are the fused time series characteristics.

[0127] Specifically, the input data of the factor fusion feature extraction module is divided into multiple types, and different input data corresponds to different output data.

[0128] If the input data of the factor fusion feature extraction module is all meteorological time series features, it means that the current feature engineering work of this module is to fuse the time series features of different meteorological factors, integrate the input meteorological time series features into tensor data, and use a fully connected layer to fuse the tensor data, and finally output the geographic meteorological time series features.

[0129] If the input data of the factor fusion feature extraction module is a historical gas consumption data sequence, it means that the current feature engineering work of the module is to fuse the gas consumption characteristics of different times, seasons, and holidays, integrate the input historical gas consumption data sequence into tensor data, and use a fully connected layer to fuse the tensor data, and finally output the gas consumption time series characteristics.

[0130] If the input data of the factor fusion feature extraction module is the geographical meteorological time series features and the gas consumption time series features, it means that the current feature engineering work of this module is to integrate the time series features of geographical meteorology and gas consumption habits, integrate the input geographical meteorological time series features and gas consumption time series features into tensor data, and use a fully connected layer to fuse the tensor data, and finally output the fused time series features.

[0131] For example, Figure 7 As shown in the figure, the factor fusion feature extraction module has multiple functions. Function 1: Integrate k kinds of meteorological time series features (24*1) to generate 24*k tensor data, use the fully connected layer to fuse the tensor data, generate geographic meteorological time series features (24*1), and extract the relationship between multiple features by fusing meteorological time series features. The fused features will better provide environmental guidance for subsequent gas consumption forecasting. Function 2: Integrate the historical gas consumption data sequence (24*4) to generate tensor data, use the fully connected layer to fuse the tensor data, and generate gas consumption time series features (24*1). Function 3: Integrate the geographic meteorological time series features with the gas consumption time series features to generate tensor data, use the fully connected layer to fuse the tensor data, and generate fused time series features (24*1). It can be seen that the factor fusion feature extraction module is widely used in the gas consumption prediction model, and is used in the fusion of meteorological factors, the fusion of gas consumption factors, and the fusion of meteorological fusion factors and gas consumption fusion factors.

[0132] The advantages of the present invention are:

[0133] 1. The present invention uses influencing factors from multiple angles to expand the feature extraction source and construct a data set for time series model training. In the selection of meteorological and geographical features, it is no longer limited to the selection of point data, but expanded to regional data to better reflect the changes in meteorological and geographical conditions in a certain area over a period of time.

[0134] 2. The present invention constructs a time series prediction model that focuses on the fusion of multi-factor features, which helps to extract the deep-level features of influencing factors and enables the model to better capture the relationship between key features when facing multidimensional data.

[0135] 3. The present invention constructs an effect feedback mechanism to realize adaptive adjustment of the model in the prediction scenario, which will significantly enhance the adaptability of the model to dynamic changes in data.

[0136] 4. The present invention proposes a whole process framework from data to model and then to update, realizing the complete process from raw data to gas consumption forecast. Through this series of measures, the stability and reliability of the model in practical applications can be significantly improved.

[0137] Based on the above embodiments, the present invention also provides a user gas consumption prediction system, such as Figure 8 As shown, the system comprises:

[0138] The gas consumption data acquisition module 01 is used to acquire the historical gas consumption of the target user at each moment in the first time period to obtain a historical gas consumption data sequence;

[0139] The geographic meteorological data acquisition module 02 is used to determine the target geographic area according to the location of the target user, and acquire the geographic meteorological data of the target geographic area at each moment in the first time period or the second time period to obtain a geographic meteorological data sequence; wherein the first time period is before the second time period;

[0140] The gas consumption prediction module 03 is used to input the historical gas consumption data sequence and the geographic meteorological data sequence into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period.

[0141] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Fig. 9 As shown. The terminal includes a processor, a memory, a network interface, and a display screen connected through a system bus. Among them, the processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for predicting user gas consumption is implemented. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen.

[0142] Those skilled in the art will understand that Fig. 9 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0143] In one implementation, the terminal stores one or more programs in its memory, and is configured to be executed by one or more processors. The one or more programs include instructions for performing a method for predicting user gas usage.

[0144] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0145] In summary, the present invention discloses a method, system, terminal and storage medium for predicting user gas usage. The method comprises: obtaining the historical gas usage of a target user at each moment in a first time period to obtain a historical gas usage data sequence; determining a target geographical area according to the location of the target user, obtaining the geographical meteorological data of the target geographical area at each moment in the first time period or the second time period to obtain a geographical meteorological data sequence; wherein the first time period is before the second time period; inputting the historical gas usage data sequence and the geographical meteorological data sequence into a trained gas usage prediction model to obtain a predicted gas usage data sequence; the predicted gas usage data sequence is used to reflect the predicted gas usage of the target user at each moment in the second time period. The present invention combines the user's gas usage habits with external environmental factors, fully considering a variety of influencing factors related to gas usage, so that the prediction model can more accurately predict the user's future gas usage.

[0146] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for predicting user gas usage, characterized in that: The method comprises: Obtain the historical gas consumption of the target user at each moment in the first time period to obtain a historical gas consumption data sequence; Determine a target geographical area according to the location of the target user, obtain geographical meteorological data of the target geographical area at each moment in the first time period or the second time period, and obtain a geographical meteorological data sequence; wherein the first time period is before the second time period; The historical gas consumption data sequence and the geographic meteorological data sequence are input into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period.

2. The method for predicting user gas usage according to claim 1, characterized in that: The first time period is the past twenty-four hours, and the second time period is the next twenty-four hours; The characteristic variables of each of the historical gas consumption in the historical gas consumption data sequence include: time, season, and holiday; Each of the geographic meteorological data in the geographic meteorological data sequence includes: temperature, humidity, wind speed, precipitation and altitude.

3. The method for predicting user gas usage according to claim 1, characterized in that: The training method of the trained gas consumption prediction model includes: Acquire a training data set; wherein each of the training data includes a historical gas consumption data sequence and a geographical meteorological data sequence for training, and an actual gas consumption data sequence as a true label; Selecting one training data from the training data set, training the gas consumption prediction model according to the training data, and calculating the model loss value; Determining whether the model loss value meets the preset training requirements, and if not, updating the parameters of the gas consumption prediction model according to the model loss value; Continue to execute the step of selecting one training data from the training data set until the model loss value meets the training requirement, thereby obtaining the trained gas consumption prediction model.

4. The method for predicting user gas usage according to claim 1, characterized in that: The trained gas consumption prediction model includes a factor time series feature extraction module and a factor fusion feature extraction module. The historical gas consumption data sequence and the geographic meteorological data sequence are input into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence, including: The geographic meteorological data sequence is divided into a geographic data sequence and a meteorological data sequence, and the meteorological data sequence is divided into meteorological factor sequences corresponding to a plurality of meteorological factors; According to the geographic data and the meteorological factor sequences, the meteorological time series features corresponding to the meteorological factors are obtained through the factor time series feature extraction module; According to each of the meteorological time series characteristics and the historical gas consumption data sequence, a predicted gas consumption data sequence is obtained through the factor fusion feature extraction module.

5. The method for predicting user gas usage according to claim 4, characterized in that: According to the geographic data and the meteorological factor sequences, the meteorological time series features corresponding to the meteorological factors are obtained through the factor time series feature extraction module, including: Perform feature extraction based on the geographic data to obtain abstract features of the geographic data; For each of the meteorological factor sequences, summing the meteorological factor sequence and the abstract features of the geographic data is performed to obtain summed data; Inputting the summed data into a convolution kernel module for feature dimension reduction to obtain first tensor data of a preset scale; The first tensor data is input into the fully connected layer for deep feature extraction to obtain the meteorological time series features corresponding to the meteorological factor sequence.

6. The method for predicting user gas usage according to claim 4, characterized in that: According to each of the meteorological time series characteristics and the historical gas consumption data sequence, the predicted gas consumption data sequence is obtained through the factor fusion feature extraction module, including: According to each of the meteorological time series characteristics, the geographical meteorological time series characteristics are obtained through the factor fusion feature extraction module; According to the historical gas consumption data sequence, the gas consumption time series characteristics are obtained through the factor fusion feature extraction module; According to the geographical meteorological time series characteristics and the gas consumption time series characteristics, a fusion time series characteristic is obtained through the factor fusion feature extraction module; A predicted gas consumption data sequence is generated according to the fused time series features.

7. The method for predicting user gas usage according to claim 6, characterized in that: The factor fusion feature extraction module is used for: Acquire input data, and integrate the input data into second tensor data of a preset size; Input the second tensor data into a fully connected layer to obtain time series features; Wherein, if the input data is each of the meteorological time series characteristics, the output time series characteristics are the geographical meteorological time series characteristics; If the input data is the historical gas usage data sequence, the output time series feature is the gas usage time series feature; If the input data is the geographic meteorological time series characteristics and the gas consumption time series characteristics, the output time series characteristics are the fused time series characteristics.

8. A user gas consumption prediction system, characterized in that: The system comprises: A gas consumption data acquisition module is used to acquire the historical gas consumption of the target user at each moment in the first time period to obtain a historical gas consumption data sequence; A geographic meteorological data acquisition module, used to determine a target geographic area according to the location of the target user, and acquire the geographic meteorological data of the target geographic area at each moment in the first time period or the second time period to obtain a geographic meteorological data sequence; wherein the first time period is before the second time period; The gas consumption prediction module is used to input the historical gas consumption data sequence and the geographical meteorological data sequence into the trained gas consumption prediction model to obtain a predicted gas consumption data sequence; the predicted gas consumption data sequence is used to reflect the predicted gas consumption of the target user at each moment in the second time period.

9. A terminal, characterized in that: The terminal includes a memory and one or more processors; the memory stores one or more programs; the program contains instructions for executing the user gas usage prediction method as described in any one of claims 1-7; and the processor is used to execute the program.

10. A computer-readable storage medium having a plurality of instructions stored thereon, characterized in that: The instructions are suitable for being loaded and executed by a processor to implement the steps of the user gas usage prediction method as described in any one of claims 1-7.