Gas consumption habit prediction method, device and equipment and storage medium
By integrating learning models and updating model parameters, the problem of the gas industry's difficulty in understanding users' gas usage habits has been solved, enabling accurate prediction of users' gas usage habits and improving the service quality and resource allocation efficiency of gas companies.
Patent Information
- Application Number
- CN202411499907.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The gas industry struggles to efficiently process and utilize the massive amounts of user gas consumption data accumulated by IoT gas meters, failing to fully understand user gas consumption habits, resulting in room for improvement in areas such as customer service, fault warning, and resource scheduling.
By learning and mining gas usage habits from users' gas usage data through an ensemble learning model, and by using a pre-trained gas usage habit prediction model and continuously adjusting and updating the model parameters, a gas usage habit prediction model for specific users can be gradually obtained, thereby achieving accurate prediction of users' gas usage habits.
It enables accurate prediction of different users' gas usage habits, improves the service quality and resource allocation efficiency of gas companies, and supports gas anomaly detection and data sharing.
Smart Images

Figure CN119006222A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of gas technology, and in particular to a method, device, equipment and storage medium for predicting gas usage habits. Background Art
[0002] With the rapid development of Internet of Things technology, the gas industry is gradually moving towards an intelligent and data-based era. The widespread application of IoT gas meters not only realizes real-time monitoring and remote control of gas usage, but also accumulates a large amount of user gas usage data. These data contain rich user behavior information, which is of great significance for improving the service quality of gas companies and optimizing resource allocation. However, how to efficiently process and utilize these data and dig out users' gas usage habits has become a key issue that needs to be solved in the gas industry. Summary of the invention
[0003] The main purpose of this application is to provide a gas usage habit prediction method, device, equipment and storage medium to achieve mining and prediction of gas usage habits of different users.
[0004] To achieve the above objectives, the present application provides a method for predicting gas usage habits, comprising: Obtaining gas usage data of the user, wherein the gas usage data is labeled with information on gas usage habits; Extracting features from the gas usage data to obtain at least one set of gas usage feature data, and inputting each set of the gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; The parameters of the gas usage habit prediction model are updated based on the gas usage habit prediction result and the annotation information.
[0005] Optionally, each group of the gas usage characteristic data is input into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result, including: for any group of gas usage characteristic data, performing feature comparison on the gas usage characteristic data with all standard feature data in a preset feature library, and determining the gas usage behavior corresponding to the gas usage characteristic data based on the comparison result; generating the gas usage habit prediction result based on each of the gas usage characteristic data and the gas usage behavior corresponding to the gas usage characteristic data.
[0006] Optionally, the preset feature library includes at least two feature sub-libraries. Before inputting each group of the gas usage feature data into a pre-trained gas usage habit prediction model, the method also includes: obtaining the user's geographical information and time information; performing feature comparison on the gas usage feature data with all standard feature data in the preset feature library, and determining the gas usage behavior corresponding to the gas usage feature data based on the comparison result, including: determining a target feature sub-library from all the feature sub-libraries based on the geographical information and the time information; performing feature comparison on the gas usage feature data with all standard feature data in the target feature sub-library, and determining the gas usage behavior corresponding to the gas usage feature data based on the comparison result.
[0007] Optionally, the gas usage characteristic data is subjected to feature comparison with all standard characteristic data in the target characteristic sub-library respectively, and the gas usage behavior corresponding to the gas usage characteristic data is determined based on the comparison result, including: performing similarity calculation on the gas usage characteristic data and each of the standard characteristic data in the target characteristic sub-library respectively to obtain multiple similarity values; filtering out the highest similarity value from all the similarity values, and taking the gas usage behavior corresponding to the highest similarity value as the gas usage behavior corresponding to the gas usage characteristic data.
[0008] Optionally, the gas usage characteristic data includes at least time characteristics, flow characteristics and flow velocity characteristics; the gas usage habit prediction result is generated based on each of the gas usage characteristic data and the gas usage behavior corresponding to the gas usage characteristic data, including: for any gas usage characteristic data, taking the time characteristics and the gas usage behavior corresponding to the gas usage characteristic data as sub-gas usage habits; and generating the gas usage habit prediction result based on the sub-gas usage habits corresponding to each of the gas usage characteristic data.
[0009] Optionally, after acquiring the gas usage data of the user, the method further includes: performing data cleaning on the gas usage data, wherein the data cleaning at least includes removing abnormal values, removing duplicate gas usage data, and removing noise information.
[0010] Optionally, the training step of the gas usage habit prediction model includes: obtaining a training data set, the training data set including a plurality of gas usage sample data with labeled information; performing feature extraction on the gas usage sample data to obtain gas usage sample feature data; using the gas usage sample feature data as input and the gas usage habit prediction results as output to train an integrated learning model, and optimizing the parameters of the integrated learning model based on the labeled information and the gas usage habit prediction results, and repeating this step until the gas usage habit prediction model is obtained.
[0011] In addition, to achieve the above-mentioned purpose, the present application also provides a gas usage habit prediction device, including: an acquisition module, used to obtain the user's gas usage data, the gas usage data carries annotation information of the gas usage habits; a prediction module, used to extract features from the gas usage data to obtain at least one group of gas usage feature data, and input each group of the gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; a model updating module, used to update the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
[0012] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the gas usage habit prediction method as described in any one of the above is implemented.
[0013] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the gas usage habit prediction method as described in any one of the above is implemented.
[0014] The gas usage habit prediction method of the present application obtains the gas usage data of the user, which carries the gas usage habits annotated by the user; then extracts features from the gas usage data to obtain at least one group of gas usage feature data, and inputs each group of gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; finally, the parameters of the gas usage habit prediction model are updated based on the gas usage habit prediction result and the annotated information, and the parameters of the gas usage habit prediction model are adjusted and updated by continuously using the gas usage data of the user, and finally a gas usage habit prediction model only for the user can be obtained, so that the obtained gas usage habit prediction result will be more accurate, thereby realizing the mining and prediction of the gas usage habits of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a scenario example of the gas usage habit prediction method provided by this application; Figure 2 This is one of the flow charts of the gas usage habit prediction method of the embodiment of the present application; Figure 3 This is the second flowchart of the gas usage habit prediction method of the embodiment of the present application; Figure 4 This is the third flow chart of the method for predicting gas usage habits in an embodiment of the present application; Figure 5 This is the fourth flow chart of the gas usage habit prediction method of the embodiment of the present application; Figure 6 is a schematic diagram of a gas usage habit prediction device according to an embodiment of the present application; Figure 7An example of a physical structure diagram of an electronic device is provided; In the figure: 110, data acquisition device; 120, data processing server; 130, user terminal; 600, gas usage habit prediction device; 610, acquisition module; 620, prediction module; 630, model update module; 710, processor; 720, communication interface; 730, memory; 740, communication bus.
[0016] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] With the rapid development of Internet of Things technology, the gas industry is gradually moving towards an intelligent and data-based era. The widespread application of Internet of Things gas meters not only realizes real-time monitoring and remote control of gas usage, but also accumulates a large amount of user gas usage data. These data contain rich user behavior information, which is of great significance for improving the service quality of gas companies, mining data value and optimizing resource allocation.
[0019] However, traditional methods of processing gas usage data have many shortcomings. On the one hand, due to the huge amount of data, traditional data processing methods are difficult to efficiently complete a series of tasks such as data collection, storage, and analysis; on the other hand, the lack of effective data mining technology means cannot fully explore the potential patterns in users' gas usage habits, resulting in gas companies having a large room for improvement in customer service, fault warning, resource scheduling, etc. Therefore, how to efficiently process and utilize these data and mine users' gas usage habits has become a key issue that the gas industry needs to solve urgently.
[0020] Based on this, the embodiments of the present application provide a method, device, equipment and storage medium for predicting gas usage habits. By using an integrated learning model to learn and mine the user's gas usage habits from the user's gas usage data, and by continuously adjusting and updating the model parameters, a gas usage habit prediction model only for the user is gradually obtained to predict the user's gas usage habits; ultimately, different gas usage habit prediction models can be obtained for different users, and the gas usage habit data of each user obtained can be applied in gas anomaly detection, gas data sharing and other scenarios.
[0021] For ease of understanding, this specification provides a scenario example of a gas safety monitoring method. The scenario example is applied in Figure 1 In the application environment shown, the application scenario may include a data acquisition device 110, a data processing server 120 and a user terminal 130. The data processing server 120 may establish communication connections with the data acquisition device 110 and the user terminal 130 respectively through the Internet or the like.
[0022] In this scenario example, the gas meter may be an ultrasonic gas meter, and the data acquisition device 110 may be an ultrasonic sensor, which is arranged in the ultrasonic gas meter. It is understood that the ultrasonic gas meter uses the physical property that the propagation speed of ultrasonic waves in gas is affected by the gas flow rate, and indirectly calculates the gas flow rate by accurately measuring the time difference between the ultrasonic sensor transmitting and receiving ultrasonic waves (i.e., the time difference metering method), and further obtains the gas consumption.
[0023] In this scenario example, the data collection device 110 can send the collected gas usage to the data processing server 120 in real time, or send the user's gas usage data to the data processing server 120 once every certain period of time. As an example, the data collection device 110 can record the gas usage and collection time once when the gas usage reaches a certain value (for example, 0.01m³ or 0.1m³), and the data collection device 110 can upload the gas usage data recorded on the previous day to the data processing server 120 at zero o'clock every day.
[0024] The user terminal 130 may be a user terminal 130 used by residents. Residents may upload information about all devices that require gas in their residences through the user terminal 130. Residents may also mark the gas usage data generated when using gas, for example, they may mark the gas-using devices they use and the corresponding gas usage behaviors. The user terminal 130 then uploads the above device information and marked information to the data processing server 120, so that the data processing server 120 stores the above data and predicts gas usage habits based on the above data.
[0025] In this scenario example, the data processing server 120 may be a server corresponding to the gas management platform, and the gas usage habit prediction method of the embodiment of the present application may be executed by the data processing server 120. Specifically, after the data processing server 120 receives the gas usage data sent by the data acquisition device 110, it may first send the gas usage data to the user terminal 130 for the user to view and mark the gas usage data; further, the data processing server 120 receives the marking information sent by the user terminal 130, and finally inputs the marked gas usage data into the pre-trained gas usage habit prediction model to obtain the gas usage habit prediction result for the user's gas usage data; finally, the data processing server 120 may send the gas usage habit prediction result to the user terminal 130 for the user to view. If the user believes that the accuracy of the prediction result is low, the user may continue to choose to mark the gas usage data. At this time, the data processing server 120 may continue to adjust and update the parameters of the gas usage habit prediction model based on the user's marking information until the user believes that the accuracy of the prediction result reaches the expected level.
[0026] It is worth mentioning that the data processing server 120 can train different gas usage habit prediction models based on the gas usage data of different users, and the model parameters of these gas usage habit prediction models can be stored in the data processing server 120 corresponding to the user information.
[0027] In addition, the user terminal 130 in this scenario example can also provide users with functions such as online gas purchase, gas purchase reminders, and kitchen-related information push, so that users can more conveniently understand their gas usage, improve the user's life convenience, and enhance the user's ability to manage and control gas usage.
[0028] With reference to the scenario example of the gas usage habit prediction method in the aforementioned embodiment, the gas usage habit prediction method in the embodiment of the present application is introduced in detail below.
[0029] Figure 2 FIG. 1 is one of the flow charts of the method for predicting gas usage habits in an embodiment of the present application. The method for predicting gas usage habits can be executed by the data processing server in the aforementioned embodiment. Figure 2 As shown, the gas usage habit prediction method may include the following steps: Step 210: Obtain the user's gas usage data, where the gas usage data carries annotation information of the gas usage habits.
[0030] Step 220: extract features from the gas usage data to obtain at least one set of gas usage feature data, and input each set of gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result.
[0031] Step 230: Update the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
[0032] It should be noted that the gas usage habit prediction model in the embodiment of the present application can be trained based on the random forest model. In addition, the gas usage data can be any data that can characterize the user's gas usage, such as the user's gas usage, gas flow rate, timestamp, gas usage equipment data, etc. In this embodiment, the gas usage data mainly includes gas usage, gas flow rate, and timestamp.
[0033] In step 210, different methods can be used to collect gas usage data of users for different gas meters. As an example, if the gas meter is a diaphragm gas meter, the diaphragm gas meter is a volumetric instrument, which mainly realizes measurement by converting volume into mechanical motion. Common volumes are 0.01m³ and 0.1m³. That is, one rotation of the mechanical character wheel represents 0.01m³ or 0.1m³ of gas. The gas meter can collect gas usage data by recording the pulse signal generated by the rotation of the mechanical character wheel and the time point of each pulse.
[0034] As another example, if the gas meter is an ultrasonic gas meter, the ultrasonic sensor in the ultrasonic gas meter can be used to measure the gas flow rate and obtain gas usage data. Specifically, the ultrasonic sensor can collect the pulse signal generated by the gas meter at a high frequency (for example, once per second) to obtain the flow rate and amount of gas. The firmware of the ultrasonic gas meter can count the gas consumption at each sampling moment in real time, but in order to reduce the amount of data, it can be recorded once every time a certain gas consumption (for example, 0.01m³ or 0.1m³) is reached.
[0035] Both of the above methods realize the collection of gas usage data through the built-in firmware of the gas meter. In some embodiments, the collection of gas usage data can also be realized by setting an external device on the gas meter. As an example, a magnetic sensor can be set at the outer shell of the gas meter with a magnetic steel wheel. The magnetic sensor can detect the position change of the magnet and convert the mechanical movement into an electrical signal. The magnetic sensor converts the mechanical signal of the wheel rotation into an electrical signal. The wheel rotation count of the gas meter is obtained based on the electrical signal, and then the gas usage data is obtained. As another example, a sound collection device can be set at the outer shell of the gas meter with a magnetic steel wheel. The sound collection device collects the sound signal emitted by the rotation of the gas meter wheel. The wheel rotation count of the gas meter is obtained based on the sound signal, and then the gas usage data is obtained. As another example, the gas usage data can also be collected by shooting the gas meter code disk or display screen with a camera.
[0036] In this embodiment, any of the above methods can be selected to collect gas usage data from the gas meter; further, the gas meter or other collection device can be set to upload the previous day's gas usage data to the data processing server at midnight every day, so that the data processing server can predict the user's gas usage habits based on the previous day's gas usage data.
[0037] After the gas meter or other collection device uploads the gas usage data to the data processing server, the data processing server can first send the gas usage data to the user terminal, so that the user can view and mark the gas usage data through the user terminal. As an example, if there is a set of data in the gas usage data: 0.8m³ of gas from 12:00 to 13:00 noon, and the gas usage during this period is generated when the user uses a gas stove to cook, then the user can mark the period, the gas usage and the corresponding gas flow rate, and the marking information may include: gas stove, cooking behavior and 12:00-13:00.
[0038] The user terminal then feeds the above-mentioned annotation information back to the data processing server, and the data processing server can cache the annotation information and gas usage data accordingly. These annotation information helps the data processing server to train the corresponding gas usage habit prediction model.
[0039] In some embodiments, after obtaining the gas usage data of the user, the gas usage habit prediction method may further include: performing data cleaning on the gas usage data, where the data cleaning at least includes removing outliers, removing duplicate gas usage data, and removing noise information.
[0040] In this embodiment, after the data processing server obtains the user's gas usage data, it can first perform data cleaning processing on the gas usage data to remove outliers, duplicate data, noise, etc., to ensure the accuracy of the subsequent use of the gas usage data to train the gas usage habit prediction model.
[0041] Specifically, the process of removing outliers can be: identifying outliers through statistical methods (such as standard deviation, median absolute deviation, etc.) or rule-based methods (such as upper and lower thresholds). For example, if the gas consumption in a day is much higher than the historical average, it may be an outlier. For detected outliers, you can choose to delete or replace them. If it is a false alarm, you can delete it directly; if it is a measurement error, you can replace it with the average of the neighboring values. This can avoid negative impacts on model training and make the model more stable and reliable.
[0042] The process of removing duplicate gas usage data can be as follows: by checking the unique identifier of each record (such as recording time, gas usage, etc.), determine whether there are identical records. If so, delete the redundant duplicate records and keep only one. Before deleting, the consistency of the data should be checked to ensure that the information of all duplicate records is exactly the same. This can prevent the analysis results from being artificially amplified and ensure the authenticity and accuracy of the statistical data.
[0043] Noise information usually refers to irrelevant or inaccurate data, which may be caused by gas equipment failure, transmission errors, etc. The process of removing noise information can be: identifying noise through filtering algorithms (such as median filters), cluster analysis, etc. For the identified noise information, you can choose to ignore or repair it. For example, if the gas consumption data of a certain period of time deviates significantly from the normal range, you can consider replacing it with the average value of the data before and after the period. This can improve data quality, make model training more effective, and make prediction results more accurate.
[0044] In step 220, after obtaining the gas usage data after data cleaning, feature extraction can be performed on the gas usage data. Since the present embodiment processes the gas usage data for a period of time (e.g., one day) at the same time, the obtained gas usage data may include data such as gas usage volume under various gas usage behaviors. Therefore, after feature extraction of the gas usage data, the obtained gas usage feature data can be grouped.
[0045] In some embodiments, the gas usage characteristic data may include at least a time characteristic, a flow characteristic, and a flow velocity characteristic, so each group of gas usage characteristic data may include a time characteristic, a flow characteristic, and a flow velocity characteristic. Since different gas appliances (such as gas water heaters, gas stoves, wall-mounted boilers, etc.) or different gas usage behaviors have certain differences in their gas usage characteristic data, in this embodiment, the gas usage characteristic data may be grouped according to the time characteristic, or may be grouped according to the flow velocity characteristic.
[0046] Furthermore, each set of gas usage characteristic data can be input into a pre-trained gas usage habit prediction model, and the gas usage habit prediction model predicts the user's gas usage habits based on the gas usage characteristic data to obtain a gas usage habit prediction result. It should be noted here that the gas usage habits described in the embodiments of the present application may refer to: what gas usage behavior the user usually performs in what time period, and the gas usage behavior may include (but not limited to): cooking, bathing, heating, etc.
[0047] Figure 3 This is the second flow chart of the method for predicting gas usage habits in the embodiment of the present application. Figure 3As shown, in some embodiments, step 220 inputs each set of gas usage characteristic data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result, which may include the following steps: Step 310: For any set of gas usage characteristic data, the gas usage characteristic data are respectively compared with all standard characteristic data in a preset characteristic library, and the gas usage behavior corresponding to the gas usage characteristic data is determined based on the comparison result.
[0048] Step 320: Generate a gas usage habit prediction result based on each gas usage characteristic data and the gas usage behavior corresponding to the gas usage characteristic data.
[0049] Specifically, a feature library (i.e., a preset feature library) may be established in advance, which stores standard feature data for different gas-using equipment, different gas-using behaviors, and different working conditions. These standard feature data may include average flow rate, flow range, flow change mode (such as flow change during startup, stability, and shutdown), etc. As an example, if the gas-using equipment is a gas water heater, the corresponding standard feature data may be: average flow rate 0.5-4m³ / h, flow range 0.5-5m³, gas flow rate increases rapidly when the gas water heater is started and then runs smoothly, and gas flow rate drops rapidly to 0m³ / h when the gas water heater is shut down.
[0050] It should be noted that since gas equipment may be subject to aging, failure, maintenance, etc., the standard feature data in the preset feature library needs to be updated and calibrated regularly.
[0051] Taking a set of gas usage characteristic data as an example, when a set of gas usage characteristic data is input into the gas usage habit prediction model, the gas usage habit prediction model will compare the characteristics of the set of gas usage characteristic data with all the standard characteristic data in the preset characteristic library to find the standard characteristic data that is most similar to the set of gas usage characteristic data in the preset characteristic library. After finding the standard characteristic data that is most similar to the set of gas usage characteristic data, the gas usage behavior corresponding to the most similar standard characteristic data can be used as the gas usage behavior corresponding to the set of gas usage characteristic data. Finally, the gas usage behaviors corresponding to each set of gas usage characteristic data are summarized to obtain the gas usage habit prediction results.
[0052] As an example, if the extracted gas usage feature data is grouped as: feature data A, feature data B, the gas usage habit prediction model compares feature data A with all standard feature data in the preset feature library, and determines that the standard feature data most similar to feature data A is standard feature data numbered 10#, and the gas usage behavior corresponding to standard feature data numbered 10# is to use a gas water heater to take a bath between 19:00 and 20:00 in the evening; similarly, the gas usage habit prediction model compares feature data B with all standard feature data in the preset feature library, and determines that the standard feature data most similar to feature data B is standard feature data numbered 6#, and the gas usage behavior corresponding to standard feature data numbered 6# is to use a gas stove to cook at 7:00 in the morning. Therefore, the gas usage habit prediction result finally generated can be: users usually use gas stoves to cook at 7:00 in the morning and use gas water heaters to take a bath between 19:00 and 20:00 in the evening.
[0053] In order to take into account seasonal and regional factors, the accuracy and applicability of gas usage habit prediction are further improved. In some embodiments, the preset feature library includes at least two feature sub-libraries. Before inputting each group of gas usage feature data into the pre-trained gas usage habit prediction model, the gas usage habit prediction method may also include: obtaining the user's geographical information and time information. Step 310 may also include: determining a target feature sub-library from all feature sub-libraries based on the geographical information and time information; performing feature comparison on the gas usage feature data and all standard feature data in the target feature sub-library, and determining the gas usage behavior corresponding to the gas usage feature data based on the comparison results.
[0054] It is understandable that the use of gas is different in different seasons or regions. For example, in terms of water temperature, the water temperature in winter is lower than that in summer. Therefore, when using a gas water heater to heat the same amount of water, the amount of gas required in winter is greater than that in summer. Similarly, in the same season, the water temperature in the south is generally higher than that in the north. Therefore, when using a gas water heater to heat the same amount of water, the amount of gas required in the north is greater than that in the south.
[0055] Based on this, the embodiment of the present application sets different feature sub-libraries for different seasons and different regions, and the standard feature data corresponding to the same gas equipment in different feature sub-libraries will have certain differences. It should be noted that the number of feature sub-libraries can be determined according to the number of seasons and regions, and is not specifically limited here.
[0056] In this embodiment, when a user logs in to the gas management platform through a user terminal, the user can enter his / her own regional information, or the data processing server of the gas management platform can automatically obtain the user's regional information from other databases. In addition, the data processing server can read the local time through the operating system and use the local time as the user's time information.
[0057] After obtaining the user's region information and time information, the data processing server can select a target feature sub-library from all feature sub-libraries based on the region information and time information. In this embodiment, a label can be set for each feature sub-library, and the label contains the region information (such as city or province) and season information (such as spring, summer, autumn, winter) corresponding to the feature sub-library. The label format can be: region_season. By comparing the user's region information with the region information on each feature sub-library label, and matching the user's time information with the season information on each feature sub-library label, the corresponding target feature sub-library can be found.
[0058] Furthermore, the gas usage habit prediction model will compare the characteristics of the group of gas usage characteristic data with all the standard characteristic data in the target characteristic sub-library to find the standard characteristic data that is most similar to the group of gas usage characteristic data in the preset characteristic library. After finding the standard characteristic data that is most similar to the group of gas usage characteristic data, the gas usage behavior corresponding to the most similar standard characteristic data can be used as the gas usage behavior corresponding to the group of gas usage characteristic data. Finally, the gas usage behaviors corresponding to each group of gas usage characteristic data are summarized to obtain the gas usage habit prediction result.
[0059] Figure 4 This is the third flow chart of the method for predicting gas usage habits in the embodiment of the present application. Figure 4 As shown, in some embodiments, step 310 compares the gas usage characteristic data with all standard characteristic data in a preset characteristic library, and determines the gas usage behavior corresponding to the gas usage characteristic data based on the comparison result, which may include the following steps: Step 410: Calculate similarity between the gas usage characteristic data and each standard characteristic data in the target characteristic sub-library to obtain multiple similarity values.
[0060] Step 420: Filter out the highest similarity value from all similarity values, and use the gas usage behavior corresponding to the highest similarity value as the gas usage behavior corresponding to the gas usage feature data.
[0061] In this embodiment, a suitable similarity algorithm can be selected to calculate the similarity between the gas usage feature data and the standard feature data, for example, similarity algorithms such as Euclidean distance, Manhattan distance, and cosine similarity. In addition, a set of gas usage feature data can be represented in the form of a vector, and similarly, the standard feature data can also be represented in the form of a vector, so as to facilitate subsequent similarity calculation.
[0062] Specifically, the gas usage feature data is subjected to a similarity calculation with each standard feature data in the target feature sub-library, thereby obtaining a similarity value respectively, and these similarity values can be pre-stored in a list. Furthermore, the highest similarity value can be found from all similarity values by traversing the entire list and recording the maximum value. Specifically, the maximum value can be found by using built-in functions in the programming language or writing logic by yourself. After finding the highest similarity value, the standard feature data that is most similar to the gas usage feature data can be found based on the similarity value, and the gas usage behavior can be further determined based on the standard feature data.
[0063] After the gas usage behaviors corresponding to each set of gas usage characteristic data are determined, a gas usage habit prediction result can be generated based on each gas usage characteristic data and the corresponding gas usage behaviors. In some embodiments, generating a gas usage habit prediction result based on each gas usage characteristic data and the gas usage behaviors corresponding to the gas usage characteristic data may include: for any gas usage characteristic data, using the time characteristics and the gas usage behaviors corresponding to the gas usage characteristic data as sub-gas usage habits; and generating a gas usage habit prediction result based on the sub-gas usage habits corresponding to each gas usage characteristic data.
[0064] It should be noted that the prediction results of gas usage habits can be presented in the form of what time corresponds to what gas usage behavior, including but not limited to the distribution of gas usage time, cooking preferences, bathing habits, etc. This information is of great value to gas companies, marketing companies and users themselves. Gas companies can formulate more refined gas management strategies and optimization suggestions based on this; marketing companies can obtain data support such as user home conditions and living habits to formulate more accurate marketing strategies; users can obtain personalized gas usage suggestions, such as optimizing gas usage time, adjusting the use of gas appliances, etc., to improve gas efficiency and safety.
[0065] In this embodiment, the time characteristics and gas usage behaviors corresponding to a group of gas usage characteristic data can be firstly taken as a sub-gas usage habit, and then the sub-gas usage habits corresponding to each group of gas usage characteristic data can be integrated to obtain the final gas usage habit prediction result.
[0066] In step 230, the obtained gas usage habit prediction result can also be used to reversely optimize the gas usage habit prediction model for the user. Specifically, the gas usage habit prediction model can be evaluated based on the gas usage habit prediction result and the annotation information and using a variety of indicators. Common evaluation indicators include but are not limited to accuracy, precision, recall, F1 score, mean square error (MSE), root mean square error (RMSE), R² score, etc.
[0067] Furthermore, based on the evaluation results, the reasons for the prediction errors of the current gas usage habit prediction model are analyzed. For example, the prediction errors can be intuitively displayed using graphs such as confusion matrix and residual plot. Finally, the parameters of the gas usage habit prediction model are adjusted based on the error between the gas usage habit prediction results and the labeled information.
[0068] Therefore, the gas usage habit prediction model continuously receives new gas usage feature data to update and optimize parameters, thereby continuously improving the accuracy of the gas usage habit prediction model for the user's gas usage habits. In this way, it is also possible to use the gas usage habit prediction function while training the gas usage habit prediction model, thereby improving the stability and accuracy of the gas usage habit prediction model.
[0069] In an embodiment of the present application, before a user uses the gas usage habit prediction model, a basic gas usage habit prediction model can be trained through a large amount of conventional gas usage data. This basic gas usage habit prediction model has low prediction accuracy and specificity, but can achieve the most basic gas usage habit prediction.
[0070] Figure 5 This is the fourth flow chart of the method for predicting gas usage habits in the embodiment of the present application. Figure 5 As shown, in some embodiments, the training step of the gas usage habit prediction model may include: Step 510: Obtain a training data set, where the training data set includes a plurality of gas usage sample data with labeled information.
[0071] Step 520: extract features from the gas usage sample data to obtain gas usage sample feature data.
[0072] Step 530: train an integrated learning model using the gas usage sample feature data as input and the gas usage habit prediction results as output, and optimize the parameters of the integrated learning model based on the annotation information and the gas usage habit prediction results. Repeat this step until a gas usage habit prediction model is obtained.
[0073] Specifically, historical gas usage data of different groups of people can be used as training data sets, and these historical gas usage data are gas usage sample data. Before using the gas usage sample data to train the model, these gas usage sample data can be labeled first, and the labeled information may include information such as gas equipment, gas usage, gas flow rate, time, etc.
[0074] Furthermore, feature extraction is performed on the gas usage sample data with the annotated information to obtain gas usage sample feature data, which may include velocity features, flow features, time features, etc. The gas usage sample feature data is further input into a pre-built ensemble learning model, and the ensemble learning model outputs a prediction result of gas usage habits. It should be noted that the ensemble learning model used in this embodiment may be a random forest model.
[0075] Finally, the parameters of the integrated learning model can be optimized based on the labeled information and the gas usage habit prediction results. By continuously training the integrated learning model with gas usage sample data, the required gas usage habit prediction model can be obtained.
[0076] Therefore, an integrated learning model is used to learn and mine the user's gas usage habits from the user's gas usage data, and by continuously adjusting and updating the model parameters, a gas usage habit prediction model that is only for the user is gradually obtained to predict the user's gas usage habits. Seasonal and regional factors are taken into account, and the accuracy of the gas usage habit prediction model is greatly improved, realizing the mining and prediction of gas usage habits of different users.
[0077] Based on the above embodiments, the embodiments of the present application also provide a gas usage habit prediction device. Figure 6 Schematic diagram of a gas usage habit prediction device according to an embodiment of the present application. Figure 6 As shown, the gas usage habit prediction device 600 may include an acquisition module 610, a prediction module 620 and a model updating module 630 connected in sequence.
[0078] Among them, the acquisition module 610 is used to obtain the user's gas usage data, and the gas usage data carries the annotation information of the gas usage habits; the prediction module 620 is used to extract features from the gas usage data to obtain at least one group of gas usage feature data, and input each group of gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; the model update module 630 is used to update the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
[0079] Thus, the user's gas usage data is obtained through the acquisition module 610, and these gas usage data carry the gas usage habits annotated by the user; then the prediction module 620 performs feature extraction on the gas usage data to obtain at least one group of gas usage feature data, and each group of gas usage feature data is input into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; finally, the model update module 630 updates the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information, and adjusts and updates the parameters of the gas usage habit prediction model by continuously using the gas usage data of the user, and finally a gas usage habit prediction model only for the user can be obtained, so that the obtained gas usage habit prediction result will be more accurate, thereby realizing the mining and prediction of the gas usage habits of different users.
[0080] In some embodiments, the prediction module 620 can be specifically used to: for any group of gas usage characteristic data, perform feature comparison on the gas usage characteristic data with all standard feature data in a preset feature library, and determine the gas usage behavior corresponding to the gas usage characteristic data based on the comparison result; and generate a gas usage habit prediction result based on each gas usage characteristic data and the gas usage behavior corresponding to the gas usage characteristic data.
[0081] In some implementations, the acquisition module 610 can be specifically used to: acquire the user's region information and time information. The prediction module 620 can also be specifically used to: determine a target feature sub-library from all feature sub-libraries based on the region information and time information; perform feature comparison on the gas usage feature data with all standard feature data in the target feature sub-library, and determine the gas usage behavior corresponding to the gas usage feature data based on the comparison result.
[0082] In some embodiments, the prediction module 620 can also be specifically used to: calculate the similarity between the gas usage characteristic data and each standard characteristic data in the target characteristic sub-library to obtain multiple similarity values; filter out the highest similarity value from all similarity values, and use the gas usage behavior corresponding to the highest similarity value as the gas usage behavior corresponding to the gas usage characteristic data.
[0083] In some embodiments, the gas usage characteristic data includes at least time characteristics, flow characteristics, and flow velocity characteristics; the prediction module 620 can also be specifically used to: for any gas usage characteristic data, use the time characteristics and the gas usage behavior corresponding to the gas usage characteristic data as sub-gas usage habits; based on the sub-gas usage habits corresponding to each gas usage characteristic data, generate a gas usage habit prediction result.
[0084] In some implementations, the acquisition module 610 may be specifically used to: perform data cleaning on the gas usage data, where the data cleaning at least includes removing abnormal values, removing duplicate gas usage data, and removing noise information.
[0085] In some embodiments, the training steps of the gas usage habit prediction model include: obtaining a training data set, the training data set including a plurality of gas usage sample data with labeled information; performing feature extraction on the gas usage sample data to obtain gas usage sample feature data; using the gas usage sample feature data as input and the gas usage habit prediction results as output to train an integrated learning model, and optimizing the parameters of the integrated learning model based on the labeled information and the gas usage habit prediction results, and repeating this step until the gas usage habit prediction model is obtained.
[0086] It should be noted that for details not disclosed in the gas usage habit prediction device of this embodiment, please refer to the details disclosed in the embodiments of the gas usage habit prediction method in the embodiments of this specification, and they will not be repeated here.
[0087] Based on the above embodiments, Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the gas usage habit prediction method, which includes: obtaining the gas usage data of the user, the gas usage data having the annotation information of the gas usage habit; performing feature extraction on the gas usage data to obtain at least one set of gas usage feature data, and inputting each set of gas usage feature data into the pre-trained gas usage habit prediction model to obtain the gas usage habit prediction result; and updating the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
[0088] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0089] On the basis of the above embodiments, on the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the gas usage habit prediction method provided by the above methods, which method includes: obtaining the user's gas usage data, the gas usage data carrying annotation information of the gas usage habits; performing feature extraction on the gas usage data to obtain at least one group of gas usage feature data, and inputting each group of gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; and updating the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
[0090] On the basis of the above embodiments, on another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the gas usage habit prediction method provided by the above methods, the method comprising: obtaining the user's gas usage data, the gas usage data carrying annotation information of the gas usage habits; performing feature extraction on the gas usage data to obtain at least one set of gas usage feature data, and inputting each set of gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; and updating the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
[0091] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0092] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
Claims
1. A method for predicting gas usage habits, characterized in that: include: Obtaining gas usage data of the user, wherein the gas usage data is labeled with information on gas usage habits; Extracting features from the gas usage data to obtain at least one set of gas usage feature data, and inputting each set of the gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; updating the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information; The training steps of the gas usage habit prediction model include: Acquire a training data set, wherein the training data set includes a plurality of gas usage sample data with labeled information; Extracting features from the gas usage sample data to obtain gas usage sample feature data; The gas usage sample characteristic data is used as input and the gas usage habit prediction result is used as output to train the integrated learning model, and the parameters of the integrated learning model are optimized based on the annotation information and the gas usage habit prediction result. This step is repeated until the gas usage habit prediction model is obtained.
2. The method for predicting gas usage habits according to claim 1, characterized in that: The step of inputting each group of gas usage characteristic data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result includes: For any set of gas usage characteristic data, the gas usage characteristic data are respectively compared with all standard characteristic data in a preset characteristic library, and the gas usage behavior corresponding to the gas usage characteristic data is determined based on the comparison result; The gas usage habit prediction result is generated based on each of the gas usage characteristic data and the gas usage behavior corresponding to the gas usage characteristic data.
3. The method for predicting gas usage habits according to claim 2, characterized in that: The preset feature library includes at least two feature sub-libraries. Before inputting each group of the gas usage feature data into the pre-trained gas usage habit prediction model, the method further includes: Obtaining the user's geographical information and time information; The step of comparing the gas usage characteristic data with all standard characteristic data in a preset characteristic library, and determining the gas usage behavior corresponding to the gas usage characteristic data based on the comparison result, includes: Determining a target feature sub-library from all the feature sub-libraries based on the region information and the time information; The gas usage characteristic data are respectively compared with all standard characteristic data in the target characteristic sub-library, and the gas usage behavior corresponding to the gas usage characteristic data is determined based on the comparison result.
4. The method for predicting gas usage habits according to claim 3, characterized in that: The step of comparing the gas usage characteristic data with all standard characteristic data in the target characteristic sub-library, and determining the gas usage behavior corresponding to the gas usage characteristic data based on the comparison result, includes: Respectively calculating similarity between the gas usage characteristic data and each of the standard characteristic data in the target characteristic sub-library to obtain a plurality of similarity values; The highest similarity value is screened out from all the similarity values, and the gas usage behavior corresponding to the highest similarity value is used as the gas usage behavior corresponding to the gas usage characteristic data.
5. The method for predicting gas usage habits according to claim 2, characterized in that: The gas usage characteristic data at least includes time characteristics, flow characteristics and flow velocity characteristics; The generating the gas usage habit prediction result based on each of the gas usage characteristic data and the gas usage behavior corresponding to the gas usage characteristic data includes: For any gas usage characteristic data, the time characteristic and the gas usage behavior corresponding to the gas usage characteristic data are used as a sub-gas usage habit; Based on the sub-gas usage habits corresponding to each of the gas usage characteristic data, the gas usage habit prediction result is generated.
6. The method for predicting gas usage habits according to claim 1, characterized in that: After obtaining the gas usage data of the user, the method further includes: The gas usage data is cleaned, and the data cleaning at least includes removing abnormal values, removing duplicate gas usage data, and removing noise information.
7. A gas usage habit prediction device, characterized in that: include: An acquisition module, used to acquire the user's gas usage data, wherein the gas usage data carries annotation information of the gas usage habits; A prediction module is used to extract features from the gas usage data to obtain at least one group of gas usage feature data, and input each group of the gas usage feature data into a pre-trained gas usage habit prediction model to obtain a gas usage habit prediction result; wherein the training step of the gas usage habit prediction model includes: obtaining a training data set, the training data set includes a plurality of gas usage sample data with labeled information; extracting features from the gas usage sample data to obtain gas usage sample feature data; training an integrated learning model with the gas usage sample feature data as input and the gas usage habit prediction result as output, and optimizing the parameters of the integrated learning model based on the labeled information and the gas usage habit prediction result, and repeating this step until the gas usage habit prediction model is obtained; A model updating module is used to update the parameters of the gas usage habit prediction model based on the gas usage habit prediction result and the annotation information.
8. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the gas usage habit prediction method as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the gas usage habit prediction method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Remote meter reading data processing method and device, gas meter system and gas cloud platform
CN111327706A
Model training method and device, behavior prediction method and device, storage medium and equipment
CN111797858A
Water consumption prediction method and device of water heater, electronic equipment and storage medium
CN114087789A
Gas user behavior prediction method based on big data analysis
CN118798658A
User behavior prompt generation method and apparatus, and terminal device and medium
WO2019218465A1
Cited By
Equipment gas consumption data determination method, electronic equipment and storage medium
CN121388553A
