A steam heating network prepayment method

By collecting and preprocessing flow data in the steam thermal network system, using the LSTM model to predict heat behavior, and combining staged ladder pricing rules and peak-to-valley thermal price strategies, an accurate prepaid solution is generated, which solves the existing technology The problem of inaccurate prepayment improves the efficiency of system management and the accuracy of cost prediction.

CN118798872BActive Publication Date: 2024-12-13ZHONGTIAN SMART TECH (HANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411287614.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-13
Estimated Expiration
2044-09-14

AI Technical Summary

Technical Problem

The existing steam heat network prepaid system lacks accurate predictions of users' heat usage behavior, resulting in a large deviation between prepaid and actual expenses, affecting the system management efficiency.

Method used

Steam flow data is collected through a flowmeter, Kalman filtering is pre-processed and uploaded to the cloud platform, and thermal behavior prediction is performed using a multi-time scale LSTM model based on inter-sequence attention mechanism, combining staged ladder pricing rules and peak-to-valley thermal prices Strategy to generate accurate prepaid plans.

Benefits of technology

It improves the accuracy of the prepaid plan, reduces cost deviation, enhances the differentiated pricing ability for different heat usage levels and time periods, and improves data quality and early warning capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798872B_ABST
    Figure CN118798872B_ABST
Patent Text Reader

Abstract

The present application discloses a prepayment method for a steam heating network, which relates to the field of steam heating networks, including: collecting steam flow data of users through a flow meter; calculating the fees corresponding to the steam flow data according to a pre-set flow-based segmented tiered pricing rule and a time-based peak-valley heating price strategy; clustering and dividing users according to heat usage patterns based on their historical flow data and historical cost data; training a multi-time scale LSTM model based on an inter-sequence attention mechanism as a heat usage behavior prediction model for users; obtaining the cost data of users and obtaining the account balance information of users; predicting the cost expenditure of target users in a future settlement cycle through the heat usage behavior prediction model; calculating the estimated amount of arrears of users in the next settlement cycle based on the predicted cost expenditure and the current account balance; in view of the poor pertinence of the prepayment scheme for steam heating networks in the prior art, the present application improves the accuracy of the prepayment scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of steam heating network, and in particular to a prepayment method for steam heating network. Background Art

[0002] With the advancement of urbanization and the improvement of residents' living standards, centralized heating has become the main way of heating in northern cities in winter. Heating companies usually adopt a settlement model where heat users pay in advance, that is, users recharge in advance to purchase a certain amount of heat quotas based on their own heat demand estimates and the heating company's pricing rules.

[0003] In the prepayment system of the steam heating network, how to accurately measure and predict the energy consumption of users, and how to formulate a reasonable prepayment plan, are the keys to improving the efficiency of system management. At present, the prepayment method is generally adopted for heat metering and charging, that is, users pay a certain amount of heating fee in advance at the beginning of the heating period, and the heating company settles and refunds according to the actual heat consumption of users. However, due to the lack of accurate prediction of users' heat consumption behavior, heating companies often estimate the prepayment amount based on rough information such as the user's heating area and past heat consumption, resulting in a large deviation between the prepayment and the actual cost. Summary of the invention

[0004] In response to the problem of poor targeting of steam heating network prepayment plans in the prior art, the present application provides a steam heating network prepayment method, which generates targeted prepayment plans by accurately predicting heat usage of different user groups, thereby improving the accuracy of the prepayment plans.

[0005] The purpose of this application is achieved through the following technical solutions:

[0006] The present application provides a steam heating network prepayment method, comprising: collecting steam flow data of users through a flow meter, pre-processing the collected steam flow data and uploading it to a cloud platform server; the cloud platform server calculates the fee corresponding to the steam flow data according to a pre-set flow-based segmented tiered pricing rule and a time-based peak-valley heating price strategy; the cloud platform server clusters and divides users according to their heat usage patterns based on their historical flow data and historical cost data; using the data of each user group after clustering, training a multi-time scale LSTM model based on an inter-sequence attention mechanism as a user's heat usage behavior prediction model; obtaining the user's cost data and the user's account balance information as input; predicting the target user's cost expenditure in a future settlement cycle through the heat usage behavior prediction model; calculating the user's estimated arrears amount in the next settlement cycle based on the predicted cost expenditure and the current account balance; generating a prepayment plan based on the estimated arrears amount and a preset prepayment discount rule, and pushing it to the user;

[0007] Furthermore, the collected steam flow data is preprocessed, including: using the collected steam flow data as the observation value of the Kalman filter algorithm, and establishing the flow state transfer equation and the observation equation according to the fluid continuity equation and the energy conservation equation; wherein the state transfer equation describes the relationship between the real flow rates at adjacent moments, and the observation equation describes the relationship between the observed flow rate and the real flow rate; setting the initial parameters of the Kalman filter algorithm, including the system noise covariance matrix and the observation noise covariance matrix; wherein the system noise covariance reflects the uncertainty of the flow change, which is estimated according to the pressure fluctuation characteristics of the pipe network; the observation noise covariance reflects the measurement error of the flow meter, which is estimated by the accuracy level of the flow meter; recursively executing the prediction and update process of the Kalman filter to obtain the optimal estimated value of the flow at each moment as the denoised flow data; wherein the prediction process predicts the prior flow estimate at the current moment according to the flow estimate value and the state transfer equation at the previous moment; the update process calculates the posterior flow estimate at the current moment according to the observed flow and the prior flow estimate at the current moment, and updates the Kalman filter parameters.

[0008] Preferably, the deviation between the denoised flow data point and its local mean is calculated, and the standard deviation of the deviation is calculated; wherein the local mean is calculated by means of a sliding window, and the window size is adaptively adjusted according to the fluctuation period of the flow; according to the fluctuation characteristics of the flow data, a larger determination threshold is used in time periods with larger fluctuations (such as peak heat consumption periods), and a smaller determination threshold is used in time periods with smaller fluctuations (such as trough heat consumption periods), so as to improve the adaptability of abnormal point determination; data points with deviations greater than the determination threshold are marked as abnormal points, and are eliminated to obtain flow data after eliminating the abnormal points.

[0009] Furthermore, the cloud platform server calculates the cost corresponding to the steam flow data according to the pre-set flow-based tiered pricing rules and the time-based peak-valley heat price strategy, including: extracting the corresponding time period identifier according to the timestamp in the pre-processed steam flow data; matching the extracted time period identifier with the pre-set peak-valley heat price strategy to obtain the heat price type corresponding to the corresponding time period; wherein, the peak-valley heat price strategy divides a day into peak time period, normal time period and valley time period, and sets different heat prices for different time periods; the heat price types include peak time heat price, normal time heat price and valley time heat price.

[0010] Preferably, the method for matching the time period identifier with the time period division in the peak-valley hot price strategy is: pre-constructing a hash mapping table of the peak-valley hot price strategy, with the time period identifier as the key and the corresponding hot price type as the value; wherein, the method for constructing the hash mapping table is: traversing each time period division in the peak-valley hot price strategy; extracting the time period identifier and the corresponding hot price type of the time period division; using the time period identifier as the key and the hot price type as the value, storing them in the hash mapping table; for time period identifiers that are not clearly divided, mapping them to the default hot price type; extracting the time period identifier from the hot data used by the target user; using the extracted time period identifier as the key to search in the hash mapping table; if the corresponding key is found in the hash mapping table, the value corresponding to the key is used as the matching hot price type; if the corresponding key is not found in the hash mapping table, the matching hot price type is set to the default hot price type.

[0011] According to the time period identifier and heat price type, the corresponding tiered heat price and flow boundary are obtained from the pre-set tiered heat price rules; wherein, the tiered heat price rules set different tiered heat prices and flow boundaries for different heat price types; under each heat price type, the flow range is divided into multiple tiers, and the heat price and flow upper limit of each tier are set; the higher the flow tier, the lower the heat price per unit flow.

[0012] Compare the preprocessed flow data with the flow boundary to determine the flow ladder to which the flow data belongs, and calculate the basic cost of the flow data according to the heat price corresponding to the flow ladder; specifically, let the flow data be q, and the flow ladder boundary of the period to which it belongs be , the corresponding tiered heat price is , then when Basic fee ;when Basic fee ; and so on, when Basic fee According to the basic fee of the same user in the same period, the total fee F of the user in the corresponding period is obtained: ,in, The basic fee for each of the m traffic data in a time period. The total fee for each time period in a billing cycle. , get the total cost C of the user in a billing cycle: ,in, , , The total costs of users during peak hours, normal hours, and off-peak hours respectively; , , is the weight coefficient of each time period, , in order to guide users to transfer heat use to off-peak hours.

[0013] Furthermore, the cloud platform server clusters users according to their heat usage patterns based on their historical traffic data and historical cost data, including: obtaining the historical traffic data of each user from the traffic database, extracting the features reflecting the user's heat usage behavior from the historical traffic data, and obtaining a user feature vector containing the average daily heat usage and the peak-to-valley ratio; specifically, accessing the traffic database of the heating system, obtaining the daily heat usage traffic data of each user in the past year based on the user ID, and forming a user historical traffic time series; preprocessing each user's historical traffic time series: using the local mean smoothing method to denoise the traffic data and remove the influence of outliers and random fluctuations; using the linear interpolation method to fill in missing data to ensure the continuity of the time series; extracting key features reflecting the user's heat usage behavior from the preprocessed traffic time series: calculating the daily heat usage , that is, the ratio of the total flow rate to the heating duration on the i-th day: ,in, is the total flow on the i-th day, is the heating duration of the i-th day; calculate the average daily heat consumption , that is, all The arithmetic mean of : , where n is the number of days in the heating season; calculate the daily peak-to-valley ratio , that is, the ratio of the maximum flow rate to the minimum flow rate on the i-th day: ,in, is the hourly flow sequence of the i-th day; calculate the average peak-to-valley ratio , that is, all The arithmetic mean of : , based on the average daily caloric and average peak-to-valley ratio Composition of user feature vector x: , and obtain a structured feature representation that reflects the differences in thermal behavior of different users; the feature vectors of all users are normalized to obtain a normalized user feature matrix.

[0014] According to the user feature vector, the Minkowski distance between users is calculated: ,in, and are two user feature vectors, k is the feature dimension, and p is the Minkowski distance parameter; when p=1, it is the Manhattan distance, and when p=2, it is the Euclidean distance;

[0015] According to the Minkowski distance, construct the distance matrix between users; initialize the clustering results and treat each user as an independent cluster; obtain the minimum distance in the distance matrix The corresponding two clusters are merged into a new cluster; the longest distance (Complete Linkage) is used to calculate the distance between the new cluster and other clusters, and the distance matrix is ​​updated. The calculation formula for the longest distance is: ,in, , , for any three clusters; the cluster merging process is recursively performed until all clusters are merged into one cluster, and a hierarchical tree of user clustering is obtained.

[0016] According to the clustering business requirements, cross-cut at different heights of the clustering hierarchy tree to obtain multiple user clusters representing different heat usage patterns; specifically, according to the clustering business requirements, set the expected cluster number range ; Adaptively determine the optimal number of clusters K: initialize the current number of clusters ; Cross-cut the clustering hierarchy tree to obtain the user clustering results under the current clustering number K; Calculate the silhouette coefficient S and the inter-cluster inertia ratio R of the current clustering result: the silhouette coefficient S measures the compactness and separation of the clustering result. The larger the S value, the better the clustering effect; the inter-cluster inertia ratio R measures the ratio of the variance between clusters to the variance within clusters. The larger the R value, the better the clustering effect; If the current clustering number K is less than , then let K=K+1, repeat the cross-cutting and evaluation process; among all the clustering results obtained, select the clustering result with the largest silhouette coefficient S and the inertia ratio R between clusters greater than the preset threshold as the optimal clustering result; if there is no clustering result that meets the conditions, select the clustering result with the largest silhouette coefficient S as the optimal clustering result; for each user cluster in the optimal clustering result, calculate the cluster center feature vector: the average daily calorific value of the cluster center is equal to the sum of the average daily calorific value of all users in the cluster divided by the number of users in the cluster; the average peak-to-valley ratio of the cluster center is equal to the sum of the average peak-to-valley ratios of all users in the cluster divided by the number of users in the cluster; the cluster center feature vector is used as the typical heat consumption pattern feature of the cluster.

[0017] Perform statistical analysis on the user feature vectors in each user cluster, calculate the cluster center feature vector of each cluster, and use the cluster center feature vector as the typical heat usage pattern feature of the cluster; specifically, perform feature engineering processing on the heat usage data of each user to obtain a standardized user feature vector; wherein the feature engineering processing includes: normalizing the maximum and minimum values ​​of the heat usage and mapping it to the interval [0, 1]; performing unique hot encoding on the heat usage time and converting it into multiple binary features; performing logarithmic transformation on the heat usage frequency to reduce the numerical difference between different frequencies; performing statistical analysis on all user feature vectors in each user cluster, and calculating the mean and standard deviation of each feature dimension; using the feature mean vector of each cluster as the cluster center feature vector of the cluster, and defining it as the typical heat usage pattern feature of the cluster; wherein the calculation formula of the cluster center feature vector is: assuming cluster Contains n users, and the feature vector of each user is ,but The cluster center feature vector of for: , j=1, 2, ....., n. The typical heat usage pattern characteristics of each cluster are compared with the preset heat usage pattern characteristics to identify heat usage pattern clusters of different types of users representing commercial users, ordinary residential users and institutional users;

[0018] Furthermore, the typical heat usage pattern characteristics of each cluster are compared with the preset heat usage pattern characteristics to identify heat usage pattern clusters of different types of users representing commercial users, ordinary residential users and public institution users, including: obtaining a typical heat usage pattern feature vector x for each user cluster; wherein the typical heat usage pattern feature vector is a cluster center feature vector obtained by statistically analyzing the feature vectors of all users in the cluster; obtaining a preset heat usage pattern feature vector y for each group of user types; and calculating the covariance matrix of the typical heat usage pattern feature vector x and the preset heat usage pattern feature vector y. ; The calculation formula of the covariance matrix is: ,in, and are the mean vectors of x and y respectively, represents mathematical expectation;

[0019] Calculate the importance weights of each component of the typical thermal mode feature vector x and the preset thermal mode feature vector y, and construct a weight matrix W; where the weight matrix W is a diagonal matrix with diagonal elements Represents the weight of the i-th feature component; the feature weight is adaptively calculated according to the Fisher discriminant criterion: ,in, and are the means of x and y on the i-th eigencomponent, respectively. and is the corresponding standard deviation; the weighted Mahalanobis distance formula is used to calculate the similarity between the typical thermal mode feature vector x and the preset thermal mode feature vector y: , where ^T represents transposition and ^(-1) represents the inverse matrix; traverse all the typical clustering heat pattern feature vectors and the preset heat pattern feature vectors to obtain a similarity matrix D; the elements of the similarity matrix D represents the weighted Mahalanobis distance between the typical heat usage pattern of the i-th cluster and the j-th preset heat usage pattern;

[0020] Weighted Mahalanobis distance Convert to similarity score : , the exponential function exp() maps the distance to the interval (0, 1]. The smaller the distance, the higher the similarity score, which conforms to the semantic characteristics of similarity. The weighted similarity scores of each cluster obtained by comparison with the preset groups of hot mode features are used to determine the user type by weighted voting. Specifically, for each preset user type, if the corresponding weighted similarity score If the number of votes is greater than the threshold T, the corresponding type gets one vote; the user type with the most votes is used as the label of the corresponding cluster. If multiple types have the same number of votes, the type with the highest weighted similarity score is selected; if the number of votes for all types is zero, the corresponding cluster is marked as other types of users; the cluster labels are output to obtain the user types corresponding to each cluster as the hot pattern clustering recognition result of different user types.

[0021] Furthermore, multiple groups of heat usage characteristics of different user types are preset, including: Commercial users: average daily heat consumption is greater than , the average peak-to-valley ratio is greater than the dynamic threshold ; Ordinary residential users: average daily heat consumption is between and The average peak-to-valley ratio is less than the dynamic threshold ; Institutional users: average daily heat consumption is between and The average peak-to-valley ratio is between the dynamic threshold and between; among them, and They are the upper and lower bounds of the average daily calorie consumption: ; ;in, It is the designed daily average heat consumption of the heating system, reflecting the heating capacity of the system and the overall heat demand of users; ; ;in, and are the average peak-to-valley ratio mean and standard deviation of all cluster centers, reflecting the overall heat consumption fluctuation characteristics of different user groups.

[0022] Furthermore, for the clustered user groups, an LSTM-based hot behavior prediction model is established, including: constructing traffic sequences at three time scales: hourly, daily, and weekly according to the historical traffic data of users in each cluster; aggregating the traffic data at hourly intervals to obtain hourly traffic sequences; aggregating the traffic data at daily intervals to obtain daily traffic sequences; aggregating the traffic data at weekly intervals to obtain weekly traffic sequences; adopting a multi-time scale sliding window method to construct input sequences and hourly output sequences at three time scales: hourly, daily, and weekly, to form multi-time scale training samples; each training sample includes input sequences at three time scales and an hourly output sequence, wherein: the hourly input sequence is the traffic sequence within the hourly sliding window, and the hourly output sequence is the traffic one hour after the sliding window; the daily input sequence is the traffic sequence within the hourly sliding window, and the hourly output sequence is the traffic sequence ... The weekly scale input sequence is the traffic sequence in the daily sliding window; the weekly scale input sequence is the traffic sequence in the weekly sliding window; a multi-time scale LSTM model based on the inter-sequence attention mechanism is constructed; the hourly scale, daily scale and weekly scale input sequences are respectively input into the LSTM network with shared weights to extract the hidden state sequence of each time scale; three attention weight matrices are set to calculate the attention weights of the hourly scale hidden state to the daily scale hidden state and the weekly scale hidden state, as well as the attention weights of the daily scale hidden state to the weekly scale hidden state; the attention weights are used to weightedly fuse the hidden state sequences of different time scales to obtain the fused hidden state sequence; the fused hidden state sequence is mapped to the output layer through the fully connected layer to obtain the predicted value of the hourly scale traffic; a multi-task loss function is set; the error back propagation algorithm is used to minimize the multi-task total loss function , train a multi-time scale LSTM model as a thermal behavior prediction model.

[0023] Furthermore, the expression of the multi-task loss function is as follows: ,in, represents the total loss function; represents the hourly scale loss, represents the daily scale loss and represents weekly scale loss; , , are the weight coefficients of the three prediction task losses respectively.

[0024] Furthermore, the first part is the weighted mean square error loss of hourly scale flow prediction: , where n represents the number of hourly scale samples, i.e., the length of the hourly traffic sequence; Represents the flow prediction value of the model on an hourly scale; Indicates the true value of hourly flow rate; Represents the time weighting coefficient, which is used to assign different weights to the prediction errors at different times. The value range is (0, 1] is the time weighting coefficient, To predict the time, is the current moment, α is the time attenuation factor, and its value range is (0, +∞); is the flow weighting coefficient, is the maximum hourly flow rate, β is the flow weighting index, and its value range is (0, +∞); λ: the penalty weight of the underestimated error, which is used to balance the contribution of the underestimated error and the overestimated error to the loss function, and its value range is [0, +∞).

[0025] The second part is the weighted mean square error loss of daily scale flow prediction:

[0026] , where m represents the number of daily scale samples, i.e., the length of the daily flow sequence; It represents the flow prediction value of the model on a daily scale, which is obtained by accumulating the flow prediction values ​​on an hourly scale; Indicates the true value of daily flow.

[0027] The third part is the weighted mean square error loss of weekly scale traffic prediction: Among them, k represents the number of weekly scale samples, that is, the length of the weekly traffic sequence; It represents the flow prediction value of the model at the weekly scale, which is obtained by accumulating the flow prediction value at the daily scale; Indicates the true value of weekly flow rate.

[0028] Furthermore, the gradient of the total loss function to the model parameters is calculated by the back propagation algorithm:

[0029] ,in, Represents the total loss function The gradient of the model parameter θ is used to guide the direction of parameter update; They represent the gradients of the three prediction task loss functions with respect to the model parameter θ; θ represents the parameter vector of the model, including the weight matrix of the LSTM layer, the attention weight matrix, and the weight matrix of the fully connected layer; Represents the coefficient.

[0030] Calculate the estimated amount of money owed by the user in the next billing cycle, including: Obtain the current account balance of the target user ; Obtain the historical cost data of the target user in the past period as input; Use the trained usage behavior prediction model to predict the cost expenditure of the target user in the next settlement cycle ; Calculate the estimated amount of outstanding payments : .

[0031] Generate a prepaid plan based on the estimated amount of outstanding payments and the preset prepaid discount rules and push it to the user, including: Obtain the calculated estimated amount of outstanding payments ; Get the preset prepaid discount rules for different amount levels, including the corresponding gift amount or discount rate for each amount level; Based on the estimated amount of arrears and prepaid discount rules to generate one or more prepaid plans: Match the preset prepaid amount level, and select the minimum prepaid amount level that is greater than or equal to the estimated arrears amount as the prepaid amount of the payment plan ; Based on payment plan , calculate the corresponding gift amount according to the preset prepaid discount rules or discount rate, get the prepaid discount amount; generate and the final prepaid plan with the corresponding discount amount;

[0032] Preferably, obtain the calculated estimated amount of outstanding payments , as the user's arrears risk measurement; obtain the user's historical arrears record and credit rating, and calculate the user's arrears risk coefficient μ: ,in, is the number of historical arrears of the user, CR is the credit rating of the user, and f() is the preset arrears risk coefficient calculation function; the arrears risk coefficient μ∈(0,1], the larger the value, the higher the arrears risk of the user, and the smaller the value, the better the credit of the user; obtain the preset multi-level prepaid preferential rules, including the basic prepaid amount The proportion of gift fees corresponding to different preferential levels or discount rate ; Based on the estimated amount of outstanding , the arrears risk coefficient μ and the prepaid discount rules, generate an adaptive prepaid discount plan: calculate the adaptive prepaid amount : ,according to Compare with the preset discount level threshold to determine the corresponding discount level; if the discount is in the form of a gift, calculate the gift amount : If the discount is in the form of a discount, calculate the actual payment amount after the discount : , generate a prepaid amount , Gift amount or actual payment amount Prepaid preferential plans; push the generated adaptive prepaid preferential plans to users to guide users to make prepaid recharges.

[0033] Compared with the prior art, the advantages of this application are:

[0034] By using the Kalman filter algorithm to denoise the flow data, the observation error and system noise in the flow data are overcome, and more accurate and reliable flow data is obtained, laying a high-quality data foundation for subsequent cluster analysis, thermal behavior prediction and arrears estimation.

[0035] By setting a tiered heat price strategy based on traffic segmentation and peak and valley differences during time periods, the irrationality of single heat price billing is overcome, and differentiated pricing is achieved for users with different heat usage levels and time periods.

[0036] By adopting a hierarchical clustering method based on Minkowski distance, the defects of traditional clustering algorithms such as being greatly affected by the range of feature values ​​and unstable clustering effects are overcome, and accurate division of different types of users is achieved; by using weighted Mahalanobis distance for similarity calculation, the interference caused by the different contributions of each feature to the similarity calculation is overcome, and a high degree of match between the clustering results and the preset typical heat usage pattern is achieved.

[0037] By constructing a multi-time scale LSTM model based on the inter-sequence attention mechanism, feature representation learning of different time scales is introduced on the basis of the traditional LSTM model, thereby enhancing the model's ability to characterize the periodicity and trend of thermal behavior at different time scales; by designing an asymmetric error loss function that includes time decay weights and traffic level weights, the impact of recent data and high-traffic data on prediction accuracy is highlighted, and by setting an underestimation penalty item, the model's early warning capability for high-risk arrears situations is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The present application will be further described in the form of exemplary embodiments, which will be described in detail by way of the accompanying drawings; these embodiments are not restrictive, and in these embodiments, the same numbers represent the same structures, wherein:

[0039] Figure 1 is an exemplary flow chart of a steam heating network prepayment method according to some embodiments of the present application;

[0040] Figure 2 is an exemplary flow chart of preprocessing steam flow data according to some embodiments of the present application;

[0041] Figure 3 is an exemplary flow chart of obtaining the total cost C in a billing cycle according to some embodiments of the present application;

[0042] Figure 4 is a schematic diagram of a customer's daily data curve according to some embodiments of the present application;

[0043] Figure 5 It is a schematic diagram of a monthly data curve of a certain customer according to some embodiments of the present application;

[0044] Figure 6 This is an exemplary flowchart for obtaining user's hot usage pattern clustering according to some embodiments of the present application. DETAILED DESCRIPTION

[0045] The method and system provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings;

[0046] Figure 1 This is an exemplary flow chart of a steam heating network prepayment method shown in some embodiments of the present application, a steam heating network prepayment method, comprising: collecting the user's steam flow data through a flow meter, pre-processing the collected steam flow data and uploading it to a cloud platform server; the cloud platform server calculates the cost corresponding to the steam flow data according to a pre-set flow-based segmented ladder pricing rule and a time-based peak-valley heat price strategy; the cloud platform server clusters and divides users according to their heat usage patterns based on their historical flow data and historical cost data; using the data of each user group after clustering, training a multi-time scale LSTM model based on an inter-sequence attention mechanism as a user's heat usage behavior prediction model; obtaining the user's cost data and the user's account balance information as input; predicting the target user's cost expenditure in a future settlement cycle through the heat usage behavior prediction model; calculating the user's estimated arrears amount in the next settlement cycle based on the predicted cost expenditure and the current account balance; generating a prepayment plan based on the estimated arrears amount and the preset prepayment discount rules, and pushing it to the user.

[0047] Figure 2This is an exemplary flow chart for preprocessing steam flow data according to some embodiments of the present application. The steam flow data of the user is collected by a flow meter, and the collected steam flow data is preprocessed and uploaded to the cloud platform server; in this embodiment, a flow meter for collecting user steam flow data is installed on the heating pipe network, and the flow meter can adopt common types such as vortex flowmeter, ultrasonic flowmeter or mass flowmeter. The flowmeter continuously collects the real-time steam flow data of the user at a certain time interval (such as 1 minute) to form time series data. The preprocessed flow data is uploaded to the server in the cloud platform via a wired or wireless network for subsequent calculation and analysis. The cloud platform can adopt common cloud service models such as IaaS, PaaS or SaaS to provide big data computing capabilities such as elastic computing, distributed storage, and parallel processing.

[0048] This step uses the Kalman filter algorithm to filter the flow data to remove the influence of observation noise and system errors. Kalman filtering is based on the state space model and estimates the state variables of the dynamic system in noisy observation data through recursive estimation. In pipe network flow monitoring, the state variable we are concerned about is the real flow at each moment. According to the basic principles of fluid mechanics, the flow change in the pipe section is constrained by the fluid continuity equation and the energy conservation equation.

[0049] First, according to the fluid continuity equation, the flow rate in the pipe section satisfies the following relationship: ; where Q is the volume flow rate, ρ is the fluid density, v is the flow velocity, A is the cross-sectional area of ​​the pipe segment, t is the time, and x is the coordinate in the length direction of the pipe segment. The pipe segment is incompressible and has a constant inner diameter. After simplification, we can get: ; Discretize the above equation by difference, and we can get: ; Further deformation can be obtained: ; Secondly, according to the energy conservation equation, the fluid energy in the pipe section satisfies the following relationship: ; Where p is the pressure, g is the gravitational acceleration, and z is the position head. The fluid is incompressible, the inner diameter of the pipe section and the position head remain unchanged, and the gravitational potential energy is ignored. After simplification, we can get: ; Discretize the above equation by difference, and we can get: , and is the velocity at time k and k-1, and is an increment in time and space, and is the pressure at time k and k-1. Further transformation yields: ; Combining the discrete forms of the fluid continuity equation and the energy conservation equation, we can obtain the state transfer equation of the flow: ; Among them, the flow is the state variable, the pressure difference Can be regarded as control quantity , substitute into the original state transfer equation form: ; The specific forms of the state transfer matrix A and the control matrix B can be identified: A=1, ; For the observation equation, since the observation value It is the flow data collected directly, so the observation matrix H=1, and the observation equation is: ; Among them, A is the state transfer matrix, which reflects the autocorrelation of the flow; B is the control matrix, It is the control quantity, reflecting the influence of factors such as valve opening and pipe network pressure on flow rate; is the system noise, which obeys a multivariate Gaussian distribution with a mean of 0. The observation equation can be expressed as: , where H is the observation matrix, which maps the true state to the observation space; is the observation noise, which obeys a multivariate Gaussian distribution with a mean of 0. So far, we have established the state transfer equation and observation equation of Kalman filtering based on the fluid continuity equation and energy conservation equation, adopted the pressure difference as the control variable, and introduced the system noise and observation noise .

[0050] The initial parameters of the Kalman filter algorithm are set as follows: Setting of the system noise covariance matrix Q: First, select a stable pipe network pressure data from the historical data and calculate its mean and variance. If the pressure data obeys the normal distribution, the variance can be used to characterize the uncertainty of pressure fluctuations. Then, according to the state transfer equation, analyze the impact of pressure fluctuations on flow changes. The flow state vector is , where q is the flow value, is the flow rate change rate. Since pressure fluctuations mainly affect the flow rate change rate, the Q matrix can be set as: ,in, is the variance of the pressure data.

[0051] For example, by analyzing historical data, we can find that the mean of the pipe network pressure is 1.0 MPa and the variance is 0.01 MPa^2, so the Q matrix can be set as: , Setting of observation noise covariance matrix R: First, according to the technical specifications of the flow meter, obtain its range and accuracy level. The accuracy level is usually expressed as a percentage of the measured value, such as 1%, 0.5%, etc. Then, based on the accuracy level and range, estimate the variance of the observation noise. The flow meter has a range of 100t / h and an accuracy level of 1%, so the variance of the observation noise can be estimated as: , so the R matrix can be set to: R = [1]. For example, if the flow meter has a range of 50t / h and an accuracy level of 0.5%, the R matrix can be set to: R = [(0.5% × 50) ^ 2] = [0.0625], and the initial state estimate is and the covariance matrix Settings: For the initial state estimate , we can use the initial observed value or a priori estimated value of the flow. The initial observed value is 20t / h, and the initial rate of change is unknown, then It can be set to: X(0) = [20, 0]'. For the initial state estimation covariance matrix , due to the large uncertainty of the initial state estimate, it is usually set to a larger value, such as a multiple of the unit matrix. Set to 100 times the unit matrix, then: In summary, in this embodiment, the initial parameters of the Kalman filter algorithm are set as: ; R = [0.0625]; ; .

[0052] After setting the initial parameters, the Kalman filter algorithm is recursively executed to predict and update the flow at each moment to obtain the filtered flow estimate. Prediction process: Calculate the prior state estimate at the current moment: ,in, is the prior state estimate at the current moment, is the posterior state estimate of the previous moment. Calculate the prior estimate covariance matrix of the current moment: ,in, is the prior estimated covariance matrix at the current moment, is the posterior estimated covariance matrix of the previous moment, is the transpose of A. Update process: Calculate the Kalman gain matrix: , is the Kalman gain, is the prior estimate covariance matrix, H is the observation matrix, and R is the observation noise covariance matrix. Calculate the posterior state estimate at the current moment: ,in, is the posterior state estimate at the current moment, is the observed value at the current moment. Calculate the posterior estimated covariance matrix at the current moment: , where I is the unit matrix. Repeat the prediction and update process until all observation data are processed, and the optimal estimated value of flow at each moment X(k|k) can be obtained as the denoised flow data. Compared with the original observation value, the filtered flow data can effectively suppress the influence of observation noise and system error.

[0053] Figure 3 This is an exemplary flow chart for obtaining the total cost C within a billing cycle as shown in some embodiments of the present application. The cloud platform server calculates the cost corresponding to the steam flow data according to the pre-set segmented ladder pricing rules based on traffic and the peak-valley heat price strategy based on time period; in this embodiment, the cloud platform server pre-sets the segmented ladder pricing rules based on traffic and the peak-valley heat price strategy based on time period to calculate the user's steam cost. The segmented ladder pricing rules divide the traffic into different levels and set different heat prices for each level. The higher the traffic level, the lower the unit heat price, in order to encourage users to save heat. The peak-valley heat price strategy sets different heat prices for different time periods according to the peak and valley time periods of electricity consumption, guiding users to move to the valley time periods with low heat load.

[0054] The corresponding time period identifier is extracted according to the timestamp in the preprocessed steam flow data; the preprocessed steam flow data contains the timestamp of the collection time, in the format of "YYYY-MM-DDHH:mm:ss". The cloud platform server extracts the hours from the timestamp and maps the hours to the time period identifier according to the preset time period division rules. For example, 00:00 to 08:00 is divided into the valley period, 08:00 to 12:00 and 16:00 to 22:00 are divided into the peak period, 12:00 to 16:00 and 22:00 to 00:00 the next day are divided into the normal period, then the time period identifier can be 1, 2, 3 to represent the peak, normal and valley periods respectively.

[0055] Match the extracted time period identifier with the preset peak-valley heat price strategy to obtain the heat price type corresponding to the corresponding time period; wherein, the peak-valley heat price strategy divides a day into peak time period, normal time period and valley time period, and sets different heat prices for different time periods; the cloud platform server matches the extracted time period identifier with the preset peak-valley heat price strategy to obtain the heat price type corresponding to the time period. For example, the peak-valley heat price strategy stipulates that the heat price during the peak time period is 1.2 yuan / GJ, the heat price during the normal time period is 0.8 yuan / GJ, and the heat price during the valley time period is 0.4 yuan / GJ. If the time period identifier is 1, the corresponding heat price type is the peak time heat price of 1.2 yuan / GJ.

[0056] According to the time period identifier and heat price type, the corresponding step heat price and flow boundary are obtained from the pre-set segmented step pricing rules; among them, the segmented step pricing rules set different step heat prices and flow boundaries for different heat price types; under each heat price type, the flow range is divided into multiple levels, and the heat price and flow upper limit of each level are set; the higher the flow level, the lower the heat price per unit flow; the cloud platform server searches for the corresponding step heat price and flow boundary from the segmented step pricing rules according to the time period identifier and heat price type. For example, for the heat price type during the peak period, the segmented step pricing rules stipulate:

[0057] Traffic ladder Flow boundary (GJ) Ladder heat price (yuan / GJ) 1 [0,100) 1.2 2 [100,500) 1.0 3 [500,+∞) 0.8

[0058] When the time period is marked as 1, the traffic boundary is [0, 100, 500], and the step heat price is [1.2, 1.0, 0.8].

[0059] Compare the preprocessed flow data with the flow boundary to determine the flow ladder to which the flow data belongs, and calculate the basic cost of the flow data according to the heat price corresponding to the flow ladder; specifically, let the flow data be q, and the flow ladder boundary of the period to which it belongs be , the corresponding tiered heat price is , then when Basic fee ;when Basic fee ; and so on, when Basic fee ; The cloud platform server compares each pre-processed flow data q with the flow boundary Compare and determine the traffic tier to which q belongs, and then calculate the basic fee f corresponding to the traffic data according to the formula. For example, if q=150, then q belongs to tier 2, and the basic fee f=100×1.2+(150-100)×1.0=170 yuan.

[0060] Figure 4 It is a data curve of a customer's daily data interface. The displayed parameters include differential pressure, pressure, temperature and instantaneous flow. Figure 5 It is the cumulative flow change curve of a customer's monthly data interface, showing the user's flow at the beginning of the specified period, flow at the end of the period, and increased flow. Based on the basic cost of the same user in the same period, the total cost F of the user in the corresponding period is obtained: ,in, is the basic fee corresponding to the m traffic data of the user in the time period; the cloud platform server sums the basic fees corresponding to all traffic data of the same user in the same time period to obtain the total fee F of the user in the time period. For example, the user has 3 traffic data in the peak period, and the basic fees are 170 yuan, 200 yuan, and 250 yuan respectively, then the total fee of the user in the peak period is F=170+200+250=620 yuan.

[0061] The total cost of each period of a user in a billing cycle , get the total cost C of the user in a billing cycle: ,in, , , are the total costs of users during peak hours, normal hours, and valley hours respectively; , , is the weight coefficient of each time period, , in order to guide users to transfer heat to the off-peak period; the cloud platform server performs a weighted summation of the total cost of each period of the user in a billing cycle (such as a month) to obtain the total cost C of the user in the billing cycle. Among them, the weight coefficients of the peak period, normal period and off-peak period are , , ,and , in order to guide users to transfer their usage to off-peak hours. For example, if a user's total cost during the peak hours of a month is 1,000 yuan, the total cost during normal times 2000 yuan, the total cost during off-peak hours is 500 yuan, and the peak, flat and valley weight coefficients are 3, 2 and 1 respectively. The total cost of this user in that month is C=3×1000+2×2000+1×500=7500 yuan.

[0062] Figure 4 This is an exemplary flow chart for obtaining clustering of heat usage patterns of users as shown in some embodiments of the present application. S3, the cloud platform server clusters users according to their heat usage patterns based on their historical traffic data and historical cost data; obtains the historical traffic data of each user from the traffic database, extracts the features reflecting the user's heat usage behavior in the historical traffic data, and obtains the user feature vector containing the average daily heat usage and the peak-to-valley ratio; the specific implementation method is as follows: access the traffic database of the heating system, obtain the daily heat usage traffic data of each user in the past year according to the user identifier, and form a user historical traffic time series. Preprocess the historical traffic time series of each user: use the local mean smoothing method to denoise the traffic data to remove the influence of outliers and random fluctuations; use linear interpolation to fill in missing data to ensure the continuity of the time series. Extract the key features reflecting the user's heat usage behavior from the preprocessed traffic time series: calculate the daily heat usage , that is, the ratio of the total flow rate to the heating duration on the i-th day: ,in, is the total flow on the i-th day, is the heating duration of the i-th day; calculate the average daily heat consumption , that is, all The arithmetic mean is: , where n is the number of days in the heating season; calculate the daily peak-to-valley ratio , that is, the ratio of the maximum flow rate to the minimum flow rate on the i-th day: , where v_i is the hourly flow sequence of the i-th day; calculate the average peak-to-valley ratio , that is, all The arithmetic mean is: . Based on the average daily calorie and average peak-to-valley ratio Composition of user feature vector x: , and obtain the structural feature representation that reflects the difference in thermal behavior of different users. The feature vectors of all users are normalized to obtain the normalized user feature matrix.

[0063] First, we need to prepare user feature data and extract a set of feature vectors for each user, such as the user's age, gender, consumption amount, purchase frequency, etc. The dimension of the feature vector is k. Then, we calculate the Minkowski distance between users based on the user feature vector. The Minkowski distance is a universal distance measurement method, and different distance formulas can be obtained by adjusting the parameter p. The specific calculation formula is: ,in, and are the feature vectors of the two users, and They represent the values ​​of the kth feature. When p=1, the Manhattan distance is obtained; when p=2, the Euclidean distance is obtained.

[0064] Next, we construct the distance matrix between users based on the calculated Minkowski distance. The distance matrix is ​​a symmetric matrix, and the element (i, j) in the matrix represents the distance between user i and user j. The diagonal elements of the distance matrix are 0 because the distance between each user and itself is 0. With the distance matrix, we can start to execute the hierarchical clustering algorithm. The specific steps are as follows: Initialize the clustering results and treat each user as an independent cluster. For example, for n users, there are n clusters initially, and each cluster contains only one user. Find the minimum distance in the distance matrix The corresponding two clusters are merged into a new cluster. For example, if the distance between user i and user j is the smallest, the two clusters they belong to are merged into a new cluster. The longest distance (Complete Linkage) is used to calculate the distance between the new cluster and other clusters, and the distance matrix is ​​updated. The calculation formula for the longest distance is: ,in, , , for any three clusters. This formula means that the distance between the new cluster and other clusters is equal to the maximum distance between the two clusters before the merger and the other clusters. Recursively merge the clusters with the closest distances and update the distance matrix until all clusters are merged into one large cluster. In this process, we can record each merged cluster and the corresponding distance to obtain a hierarchical tree of user clustering. According to the hierarchical tree of clusters and combined with business needs, select the appropriate clustering granularity for segmentation. For example, you can set a threshold. When the distance between clusters is greater than the threshold, stop merging and get the final clustering result.

[0065] According to the clustering business requirements, cross-cut at different heights of the clustering hierarchy tree to obtain multiple user clusters representing different heat usage patterns; specifically, input: user clustering hierarchy tree, expected cluster number range , inertia ratio threshold , output: optimal clustering result ; In the hierarchy tree height Cross-cut at , get K clusters .calculate The silhouette coefficient : ,calculate The average distance to other points in this cluster ,calculate The average distance of all points to the nearest other cluster , . ,calculate The inter-cluster inertia ratio : Mean square between classes , is the j-th class mean vector, μ is the overall mean vector, is the number of samples in the jth class, summing j from 1 to K, and the mean square within the class , For the i-th sample of the j-th class, sum i from 1 to , sum j from 1 to K, . , among the clustering results that meet the inertia ratio condition, select the one with the largest silhouette coefficient; if the inertia ratio condition is not met, directly select the one with the largest silhouette coefficient: .

[0066] In a specific embodiment of the present application, the expected number of clusters is set , inertia ratio threshold When K=2, we cut across the second-to-last layer and get two clusters: , , calculate the silhouette coefficient , the inertia ratio between clusters When K=3, three clusters are obtained by cross-section: , , , calculate the silhouette coefficient , the inertia ratio between clusters When K=4, four clusters are obtained by cross-section: , , , , calculate the silhouette coefficient , the inertia ratio between clusters . Comprehensive comparison shows that: when K=2, the silhouette coefficient is small. Although the inertia is relatively large, the clustering granularity is coarse; when K=3, the silhouette coefficient is significantly improved to 0.58, but the inertia ratio drops to 1.6, which does not exceed the threshold of 2; when K=4, the silhouette coefficient is further improved to 0.63, but the inertia ratio further drops to 1.2. Therefore, although the silhouette coefficient of the clustering result of K=4 is better, the category division is too fragmented and the difference between categories is not obvious. Finally, the clustering result of K=3 is selected as the optimal clustering. While ensuring the compactness within the cluster, it also takes into account the separation between clusters, which is more in line with actual business needs. At this time, the heating users are divided into 3 categories, representing 3 typical heating modes. The heating characteristics of these 3 types of users can be further analyzed to formulate differentiated operation strategies.

[0067] For each user cluster in the optimal clustering result, the cluster center feature vector is calculated. According to the obtained optimal clustering result, three clusters are included: , , The average daily heat consumption and average peak-to-valley ratio data of the current five users are as follows: ; ; ; ; For clustering , calculate the central feature: ; ; Cluster center feature vector For clustering , calculate the central feature: ; ; Cluster center feature vector For clustering , calculate the central feature: ; ; Cluster center feature vector Finally, we get the typical heat usage pattern characteristics of three clusters: The typical heat consumption pattern of is: average daily heat consumption 1.0, average peak-to-valley ratio 2.75, indicating that the overall heat consumption of this type of user is small, and the intraday fluctuation is also small, which may correspond to ordinary residential users; clustering The typical heat consumption pattern of is: average daily heat consumption 2.0, average peak-to-valley ratio 4.2, indicating that the overall heat consumption of this type of users is moderate, and the intraday fluctuation is slightly larger than that of residential users, which may correspond to some public buildings or office places; clustering The typical heat usage pattern is: average daily heat consumption is 3.75, and the average peak-to-valley ratio is 6.2, indicating that the overall heat consumption of this type of users is large, with obvious daily fluctuations, which may correspond to large public buildings, commercial buildings, etc.

[0068] The typical heat usage pattern characteristics of each cluster are compared with the preset heat usage pattern characteristics to identify heat usage pattern clusters of different types of users representing commercial users, ordinary residential users and institutional users, including: Based on the typical heat usage pattern characteristics of the three clusters obtained: , , . Preset the usage pattern feature vectors of three user types (M=3): (commercial users) = [3.5, 6.0]; (ordinary residential users) = [1.2, 3.0]; (Institutional users) = [2.2, 4.5]. Set the design daily average heat consumption of the heating system , feature weight , weighted similarity threshold T=0.5. Calculate the upper and lower bounds of average daily calorie consumption: ; . Calculate the average peak-to-valley ratio dynamic threshold: ; ; ; .

[0069] Clustering , calculate the weighted similarity with the preset user type: , ; , ; , , The voting vector is [0, 1, 0], and the label L_1 = "ordinary resident user". , calculate the weighted similarity with the preset user type: , ; , ; , , The voting vector is [0, 0, 1], and the label L_2 = "institutional user". , calculate the weighted similarity with the preset user type: , S_w(3,1)=0.736, , , , , The voting vector is [1, 0, 0], and the label L_3 = "commercial user". Finally, the user type identification results of 3 clusters are obtained: Cluster Corresponding to "ordinary resident users", clustering Corresponding to "institutional users", clustering Corresponds to "Business User".

[0070] Using the data of each user group after clustering, a multi-time scale LSTM model based on the sequence attention mechanism is trained as a user's hot behavior prediction model; input: historical traffic data of K clusters, hourly, daily and weekly sliding window sizes, number of LSTM network layers and hidden units, attention weight matrix dimension, loss function weight coefficient, number of training iterations and batch size. Output: trained multi-time scale LSTM prediction model. Taking the historical traffic data of as an example, the data preprocessing and feature construction steps have been completed, and the following multi-time scale training samples (simplified to 3 hours, 2 days, and 1 week scales) are obtained: Hourly scale input sequence : [[1.2, 1.5, 1.8], [1.3, 1.6, 1.9], [1.1, 1.4, 1.7]]; daily scale input sequence : [[4.2, 4.5], [4.3, 4.7], [4.1, 4.4]]; Weekly scale input sequence : [[29.5], [30.2], [28.8]]; hourly scale output sequence : [1.4, 1.7, 2.0, 1.5, 1.8, 2.1, 1.3, 1.6, 1.9]. Set the LSTM hidden layer dimension to 32, the attention matrix dimension to 16, and the loss function weight coefficient , , , training iteration number max_epoch=100, batch size n_batch=24.

[0071] During the training process, the hidden states of each time scale are obtained after the 50th iteration as follows: =[[0.32, 0.55, 0.71], [0.35, 0.58, 0.68], [0.29, 0.52, 0.74]]; =[[0.25, 0.48, 0.82], [0.29, 0.51, 0.85], [0.22, 0.45, 0.79]]; =[[0.19, 0.42, 0.91], [0.23, 0.46, 0.88], [0.16, 0.39, 0.94]]. Calculate the attention weight matrix and get: =[[0.28, 0.33, 0.65], [0.32, 0.37, 0.60], [0.24, 0.29, 0.69]]; =[[0.15, 0.25, 0.45], [0.18, 0.28, 0.42], [0.12, 0.22, 0.49]]; =[[0.08, 0.19, 0.28], [0.11, 0.23, 0.25], [0.06, 0.16, 0.31]]. Fusion of hidden states of different scales yields: =[[0.182, 0.317, 0.493], [0.189, 0.324, 0.506], [0.175, 0.310, 0.480]].

[0072] Through the fully connected layer mapping, the hourly scale forecast output is obtained: =[1.52, 1.85, 2.21, 1.61, 1.93, 2.29, 1.45, 1.77, 2.14].

[0073] Further accumulation gives the daily and weekly forecast outputs: =[4.58, 5.06, 4.32]; =[32.1, 34.5, 30.8]. The actual flow value at the current moment is: =[1.4, 1.7, 2.0, 1.5, 1.8, 2.1, 1.3, 1.6, 1.9]; =[4.2, 4.6, 4.0]; =[29.5, 31.6, 28.2]. Set λ=0.2, α=0.01, β=0.5, and the maximum flow value q_max=2.5, then the loss function can be calculated: =[0.99, 0.98, 0.97, 0.99, 0.98, 0.97, 0.99, 0.98, 0.97]; =(y_hour_true / 2.5)^0.5=[0.75, 0.82, 0.89, 0.77, 0.85, 0.92, 0.72, 0.80, 0.87];

[0074] L_hour=1 / 3*((0.990.75(1.52-1.4)^2+0.2max(0,1.4-1.52))

[0075] +(0.980.82*(1.85-1.7)^2+0.2max(0,1.7-1.85))

[0076] +(0.970.89*(2.21-2.0)^2+0.2max(0,2.0-2.21))

[0077] +(0.990.77*(1.61-1.5)^2+0.2max(0,1.5-1.61))

[0078] +(0.980.85*(1.93-1.8)^2+0.2max(0,1.8-1.93))

[0079] +(0.970.92*(2.29-2.1)^2+0.2max(0,2.1-2.29))

[0080] +(0.990.72*(1.45-1.3)^2+0.2max(0,1.3-1.45))

[0081] +(0.980.80*(1.77-1.6)^2+0.2max(0,1.6-1.77))

[0082] +(0.970.87*(2.14-1.9)^2+0.2*max(0,1.9-2.14)))

[0083] =0.153

[0084] L_day=1 / 2*((0.950.87(4.58-4.2)^2+0.2max(0,4.2-4.58))

[0085] +(0.960.90*(5.06-4.6)^2+0.2max(0,4.6-5.06))

[0086] +(0.940.85*(4.32-4.0)^2+0.2*max(0,4.0-4.32)))

[0087] =0.326

[0088] L_week=1 / 1*(0.920.95(32.1-29.5)^2+0.2max(0,29.5-32.1)

[0089] +0.910.97*(34.5-31.6)^2+0.2max(0,31.6-34.5)

[0090] +0.930.93*(30.8-28.2)^2+0.2*max(0,28.2-30.8))

[0091] =2.184

[0092] Total loss function =0.60.153+0.30.326+0.1*2.184=0.408.

[0093] Calculate the gradient of each task loss with respect to the parameters, for example:

[0094] ∂L_hour / ∂W_fc=1 / 3*(0.990.752*(1.52-1.4)h_att(1)

[0095] +0.980.822(1.85-1.7)h_att(2)

[0096] +0.970.892(2.21-2.0)h_att(3)

[0097] +0.990.772(1.61-1.5)h_att(4)

[0098] +0.980.852 (1.93-1.8) h_att (5)

[0099] +0.970.922(2.29-2.1)h_att(6)

[0100] +0.990.722(1.45-1.3)h_att(7)

[0101] +0.980.802(1.77-1.6)h_att(8)

[0102] +0.970.872(2.14-1.9)*h_att(9))

[0103] Then, the gradients of the three tasks are weighted and summed to obtain the gradient of the total loss function to the parameters, and the model parameters are updated using the gradient descent method until the loss function converges or the preset number of iterations is reached. Finally, a trained user thermal behavior prediction model is obtained, which can be used to predict thermal loads at different time scales in the future.

[0104] Estimate the amount of money owed by the user and obtain the current account balance of the target user : Obtain the target user's real-time account balance data by querying the user account database ,For example Get the target user's historical cost data in the past period as input: Get the target user's daily heating cost data in the past period (such as the last month) from the historical transaction database as model input, for example: =[[4.2, 4.5], [4.3, 4.7], [4.1, 4.4], ...], using the trained usage behavior prediction model to predict the target user's expenditure in the next settlement cycle : Input the historical cost data into the trained multi-scale attention LSTM model to predict the user's daily cost data for the next settlement cycle (1 week), for example: =[5.1, 5.3, 4.9, 5.5, 5.2, 4.8, 5.0], sum the predicted daily cost data to get the estimated total cost expenditure for the entire settlement period ,For example: =5.1+5.3+4.9+5.5+5.2+4.8+5.0=35.8 yuan.

[0105] Calculate estimated outstanding balance :Total estimated expenses With current account balance Subtract, if the difference is greater than 0, it means that there is an estimated arrears, and the amount of arrears is ;otherwise If it is 0, there will be no outstanding payment. =max(35.8-100,0)=0 yuan. In this example, because the current balance is greater than the estimated fee, no arrears are expected.

[0106] Generate a prepaid discount plan and obtain the calculated estimated amount of outstanding payments : Get the estimated amount of arrears data from the calculation results, for example Get the preset prepaid discount rules for different amount levels: Get the preset prepaid discount rules from the discount rule configuration database, including different prepaid amount levels Corresponding bonus amount or discount rate ,For example:

[0107] P_pay (yuan) P_prom (yuan) r_disc 50 5 - 100 5 5% 200 15 15%

[0108] Based on the estimated amount of outstanding and prepaid discount rules to generate a prepaid plan: Pre-set prepaid amount To match, in this case is 0, which is less than the lowest level of 50 yuan, and no matching is required. If greater than 0, select greater than or equal to The minimum prepaid tier of the recommended plan is the prepaid amount , and calculate the corresponding prepaid discount amount: For example, if Yuan, then Yuan is the first recommended tier. The corresponding prepaid discount amount is: Yuan, or the actual payment amount is The final prepaid plan is: prepay 100 yuan and get 5 yuan free. If there are multiple gears greater than E_debt, multiple plans can be generated for users to choose from.

Claims

1. A method for prepayment of steam heating network, include: The steam flow data of the user is collected through the flow meter, and the collected steam flow data is pre-processed and uploaded to the cloud platform server; The cloud platform server calculates the cost corresponding to the steam flow data according to the pre-set flow-based segmented tiered pricing rules and time-based peak and valley heating price strategies; The cloud platform server clusters users according to their historical traffic data and historical cost data and their usage patterns; Using the clustered data of each user group, a multi-time scale LSTM model based on the inter-sequence attention mechanism is trained as a user usage behavior prediction model; Get the user's fee data and get the user's account balance information as input; By using the thermal behavior prediction model, the target user's expense in the next settlement cycle is predicted; Calculate the estimated amount of outstanding payments due to the user in the next billing cycle based on the predicted expenditure and the current account balance; Generate a prepaid plan based on the estimated amount of outstanding payments and preset prepaid discount rules and push it to the user; For the clustered user groups, a LSTM-based usage behavior prediction model is established, including: Based on the historical traffic data of users in each cluster, traffic series at three time scales, namely hourly, daily, and weekly, are constructed. Using a multi-time scale sliding window method, we construct input sequences and output sequences at three time scales: hourly, daily, and weekly, to form multi-time scale training samples. Construct a multi-time scale LSTM model based on the inter-sequence attention mechanism; Set up a multi-task loss function; Using the error back propagation algorithm, minimize the total loss function of multiple tasks , train a multi-time scale LSTM model as a thermal behavior prediction model; The expression of the multi-task loss function is as follows: ; in, represents the total loss function; represents the hourly scale loss, represents the daily scale loss and represents weekly scale loss; , , are the weight coefficients of the three prediction task losses respectively.

2. The steam heating network prepayment method according to claim 1, Features: Preprocess the collected steam flow data, including: The collected steam flow data is used as the observation value of the Kalman filter algorithm, and the flow state transfer equation and observation equation are established based on the fluid continuity equation and energy conservation equation; the state transfer equation describes the relationship between the real flow at adjacent moments, and the observation equation describes the relationship between the observed flow and the real flow; Set the initial parameters of the Kalman filter algorithm, including the system noise covariance matrix and the observation noise covariance matrix; the system noise covariance reflects the uncertainty of flow changes and is estimated based on the pressure fluctuation characteristics of the pipe network; the observation noise covariance reflects the measurement error of the flow meter and is estimated based on the accuracy level of the flow meter; The prediction and update process of the Kalman filter is recursively executed to obtain the optimal estimated value of the flow at each moment as the denoised flow data; the prediction process predicts the prior flow estimate at the current moment based on the flow estimate at the previous moment and the state transfer equation; the update process calculates the posterior flow estimate at the current moment based on the observed flow and the prior flow estimate at the current moment, and updates the Kalman filter parameters.

3. The steam heating network prepayment method according to claim 2, Features: Calculate the cost corresponding to the steam flow data, including: Extracting a corresponding time period identifier according to a timestamp in the preprocessed steam flow data; Match the extracted time period identifier with the pre-set peak-valley heating price strategy to obtain the heating price type corresponding to the corresponding time period; wherein the peak-valley heating price strategy divides a day into peak time period, normal time period and valley time period, and sets different heating prices for different time periods; According to the time period identifier and the heat price type, the corresponding step heat price and flow boundary are obtained from the pre-set segmented step pricing rules; wherein the segmented step pricing rules set different step heat prices and flow boundaries for different heat price types; under each heat price type, the flow range is divided into multiple steps, and the heat price and flow upper limit of each step are set; Compare the preprocessed flow data with the flow boundary to determine the flow ladder to which the flow data belongs, and calculate the basic cost of the flow data according to the heat price corresponding to the flow ladder; According to the basic fee of the same user in the same period, the total fee F of the user in the corresponding period is obtained: ; in, The basic fees corresponding to the m pieces of traffic data of the user in the time period; The total cost of each period of a user in a billing cycle , get the total cost C of the user in a billing cycle: ; in, , , are the total costs of users during peak hours, normal hours, and valley hours respectively; , , is the weight coefficient of each time period, .

4. The steam heating network prepayment method according to claim 3, Features: Cluster users according to their usage patterns, including: Obtain the historical traffic data of each user from the traffic database, extract the features reflecting the user's heat usage behavior from the historical traffic data, and obtain the user feature vector containing the average daily heat usage and the peak-to-valley ratio; According to the user feature vector, the Minkowski distance between users is calculated: ; in, and are two user feature vectors, k is the feature dimension, and p is the Minkowski distance parameter; According to the Minkowski distance, a distance matrix between users is constructed; Initialize the clustering results and treat each user as an independent cluster; Get the minimum distance in a distance matrix The corresponding two clusters are merged into a new cluster; The longest distance is used to calculate the distance between the new cluster and other clusters, and the distance matrix is ​​updated. The calculation formula of the longest distance is: ; in, , , for any three clusters; The cluster merging process is recursively performed until all clusters are merged into one cluster, and a hierarchical tree of user clustering is obtained; According to the clustering business requirements, cross-cutting is performed at different heights of the clustering hierarchy tree to obtain multiple user clusters representing different heat usage patterns; Perform statistical analysis on the user feature vectors in each user cluster, calculate the cluster center feature vector of each cluster, and use the cluster center feature vector as the typical hot usage pattern feature of the cluster; The typical heat usage pattern characteristics of each cluster are compared with the preset heat usage pattern characteristics to identify heat usage pattern clusters representing different types of users, such as commercial users, ordinary residential users, and public institution users.

5. The steam heating network prepayment method according to claim 4, Features: Identify clusters of heat usage patterns representing different types of users, including commercial users, general residential users, and institutional users, including: Calculate the weighted similarity between the typical heat usage pattern features of each cluster and the preset heat usage pattern features of each group: The weighted Mahalanobis distance is calculated using the following formula: : ; Where x is the typical usage pattern feature vector of any cluster, y is the preset usage pattern feature vector of any user type; W is a diagonal matrix, and the diagonal elements are the importance weights of each feature; is the covariance matrix of x and y; Weighted Mahalanobis distance Convert to similarity score : ; Compare the weighted similarity scores of each cluster obtained with the preset groups of hot pattern features, and use weighted voting to determine the user type; Output cluster labels and obtain the user types corresponding to each cluster as the clustering recognition results of hot patterns of different user types.

6. The steam heating network prepayment method according to claim 5, Features: Preset multiple groups of heat usage characteristics for different user types, including: Commercial users indicate that their average daily heat consumption is greater than , the average peak-to-valley ratio is greater than the dynamic threshold ; Ordinary residential users said that the average daily heat consumption is between and The average peak-to-valley ratio is less than the dynamic threshold ; Institutional users indicated that their average daily calorie consumption was between and The average peak-to-valley ratio is between the dynamic threshold and between; in, and They are the upper and lower bounds of the average daily calorie consumption: ; ; in, It is the designed daily average heat consumption of the heating system, reflecting the heating capacity of the system and the overall heat demand of users; ; ; in, and are the average peak-to-valley ratio mean and standard deviation of all cluster centers, reflecting the overall heat consumption fluctuation characteristics of different user groups.

7. The steam heating network prepayment method according to claim 1, Features: The first part is the weighted mean square error loss of hourly scale flow prediction: ; Where n represents the number of hourly scale samples; Represents the flow prediction value of the model on an hourly scale; Indicates the true value of hourly flow rate; Represents the time weighting coefficient, and its value range is (0, 1]; is the time weighting coefficient, To predict the time, is the current moment, α is the time attenuation factor, and its value range is (0, +∞); is the flow weighting coefficient, is the maximum hourly flow rate, β is the flow weighting index, and its value range is (0, +∞); λ is the penalty weight for underestimation error, and its value range is [0, +∞) The second part is the weighted mean square error loss of daily scale flow prediction: ; Among them, m represents the number of daily scale samples, that is, the length of the daily flow sequence; represents the flow prediction value of the model on a daily scale; Indicates the true value of daily-scale flow; The third part is the weighted mean square error loss of weekly scale traffic prediction: ; Among them, k represents the number of weekly scale samples, that is, the length of the weekly traffic sequence; It represents the flow prediction value of the model on a weekly scale; Indicates the true value of weekly flow rate.

8. The steam heating network prepayment method according to claim 7, Features: The gradient of the total loss function to the model parameters is calculated by the back-propagation algorithm: ; in, Represents the total loss function The gradient of the model parameters θ; They represent the gradients of the three prediction task loss functions with respect to the model parameters θ; θ represents the parameter vector of the model; Represents the coefficient.