Time- and space-based diagnostic and processing methods for heating and cooling anomalies

By employing a time- and space-based anomaly diagnosis method, combined with K-means clustering and the KNN algorithm, the problem of missing anomaly identification in heating and cooling systems was solved, achieving higher diagnostic accuracy and data integrity, and improving the control precision of heating and cooling systems.

CN117235642BActive Publication Date: 2026-03-13HEBEI UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-01
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies are prone to missing abnormal data when identifying abnormal data in heating and cooling systems, resulting in low accuracy, especially when adjacent data are all abnormal.

Method used

A time- and space-based anomaly diagnosis method is adopted. By clustering analysis of room temperature data of related users, combined with K-means clustering and KNN algorithm, anomalies are identified and imputed. The room temperature change rate is used for diagnosis, and appropriate time window width and sliding step size are selected to improve diagnostic accuracy.

Benefits of technology

It significantly improves the accuracy and precision of anomaly diagnosis, ensures the integrity and reliability of data, reduces the number of diagnoses, and improves the control precision of heating and cooling systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117235642B_ABST
    Figure CN117235642B_ABST
Patent Text Reader

Abstract

This invention relates to the field of abnormal data processing technology, and in particular to a time- and space-based method for diagnosing and processing abnormal heating and cooling data. The method includes the following steps: Step S1, extracting diagnostic-related data from the heating and cooling platform; Step S2, determining user room temperature data standards; Step S3, converting individual user room temperature data into rate of change data; Step S4, using a time window to segment the rate of change data for diagnostic purposes; Step S5, after determining the window parameters, using K-means clustering to detect and diagnose the rate of change data of the selected data within the time window, deleting abnormal data and determining a normal room temperature dataset; Step S6, performing data imputation based on the deletion and missing data in the normal room temperature dataset. This invention clusters users with similar correlations in their energy consumption data and combines this with a time-series related sliding time window method, significantly improving the accuracy of abnormal diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of abnormal data processing technology, and in particular to a time- and space-based method for diagnosing and processing abnormal heating and cooling data. Background Technology

[0002] The increasing application of internet technology in the heating sector has enabled the online collection of heating system operating parameters, promoting the development of smart heating technology. Installing room temperature data acquisition devices at the user side provides a direct reflection of heating and cooling effects and facilitates refined control of the heating and cooling systems. However, due to factors such as equipment installation location, data transmission anomalies, and human interference, data anomalies and missing data often occur, which is detrimental to understanding room temperature variation patterns and controlling the heating system. Therefore, establishing a reasonable data processing procedure for room temperature data to obtain accurate data is essential.

[0003] Chinese Patent Publication No. CN115840897A discloses a method for processing anomalies in temperature sensor data, comprising: acquiring historical and current temperature data monitored by the temperature sensor and fitting a target data sequence; segmenting the target data sequence to obtain target data segments; acquiring the weight of each target data segment; determining the degree of anomaly in the current temperature data based on the weight of each target data segment, the average similarity between all historical and current temperature data corresponding to each target data segment, and the number of target data segments; and determining whether there is a potential anomaly in the currently used water heater based on the degree of anomaly in the current temperature data. It is evident that the method for processing anomalies in temperature sensor data has the following problems: when identifying anomalies, the object of identification is the measured temperature data; when adjacent data are all anomalies, it is easy to miss identification, resulting in low identification accuracy. Summary of the Invention

[0004] To address this, the present invention provides a time- and space-based method for diagnosing and processing abnormal heating and cooling data, which overcomes the problem in the prior art where the object of identification for abnormal data is the measured temperature data, and where it is easy to miss identification when adjacent data are all abnormal data.

[0005] To achieve the above objectives, the present invention provides a time- and space-based method for diagnosing and processing abnormal heating and cooling data, comprising:

[0006] Step S1: Extract user room temperature data, user pipeline information, and temperature data of the user's geographical location from the heating and cooling platform for diagnosis.

[0007] Step S2: Select a diagnostic interval centered on a single diagnostic user, cluster related users whose energy consumption is related to the single diagnostic user and filtered according to the correlation within the diagnostic interval, and determine the user room temperature data standard based on the room temperature data of each related user.

[0008] Step S3: Perform preliminary data diagnosis on the room temperature data of a single diagnostic user and delete the abnormal data in the preliminary diagnosis. Record the remaining data as the original data and convert the original data into rate of change data.

[0009] Step S4: The rate of change data is divided into time windows to diagnose the data of each time window. Based on the ambient temperature data of the geographical location of the individual diagnostic user, the diagnostic time is divided into several diagnostic time periods. The corresponding window width is determined within each diagnostic time period. The sliding step size of the window is determined based on the window width and the temperature data of the geographical location of the diagnostic user.

[0010] Step S5: After the window parameters are determined, the K-means clustering method is used to detect and diagnose the rate of change of the data selected by the time window, select abnormal data for deletion, and determine the normal room temperature dataset.

[0011] Step S6: Based on the deletion and missing data in the normal room temperature dataset, the KNN algorithm is used to fill in the data to obtain a complete room temperature dataset.

[0012] The user room temperature data includes room temperature data detected periodically by the platform at various times; the temperature data for diagnosing the user's geographical location includes the daily maximum temperature, daily minimum temperature, and daily average temperature.

[0013] Furthermore, in step S2, the diagnostic interval is determined based on the cold and hot energy transfer path and distance threshold of the energy supply network for a single diagnostic user as the center;

[0014] The heat and cold energy transfer path of the energy supply network is the heating / cooling direction of the energy supply network where the diagnosed user is located.

[0015] Furthermore, the distance threshold is determined based on the energy temperature consumption per unit distance on the energy supply pipeline.

[0016] The distance thresholds for each branch network on the energy supply pipeline where the center is located are different.

[0017] Furthermore, in step S2, the correlation between each user within the diagnostic interval and a single diagnostic user is determined by the following formula:

[0018] R = r × α,

[0019] Where R is the user relevance within the distance threshold, r is the Pearson correlation coefficient between the user and a single diagnosed user, and α is the spatial correlation coefficient between the user and a single diagnosed user.

[0020] Furthermore, in step S3, the raw data is sorted according to the acquisition time sequence, and the raw data is converted into rate of change data according to a preset change duration. The specific calculation formula is as follows:

[0021]

[0022] Among them, A i+n For the transformed rate of change data, α i For the room temperature data of the i-th user, α i+n For the (i+n)th user's room temperature data, deleted or uncollected data are denoted as empty, t is the preset change duration, t=n×T, and n≥2, and T is the collection period of user room temperature data.

[0023] Further, in step S4, the temperature change rate and the temperature difference between adjacent dates are calculated based on the temperature data, the diagnosis time is divided into several diagnosis time periods, and the window width is determined based on the number of dates in a single diagnosis time period and the average date interval corresponding to the temperature difference exceeding the temperature difference threshold during each day.

[0024] Each diagnosis period must be at least three days.

[0025] Further, in step S4, the average daily temperature difference within a single diagnostic time period is determined based on the temperature data of the geographical location of the center, and the value of the sliding step size is determined based on the window width of the single diagnostic time period and the average daily temperature difference.

[0026] Further, the number of diagnoses is calculated based on the window width and the sliding step size, and the adjustment method for the time window diagnosis is determined based on the number of diagnoses and a preset threshold number, wherein:

[0027] If the window width is less than the preset window width and / or the window sliding step is less than the preset sliding step, prioritize adjusting the window parameters that have not reached the preset value;

[0028] If the window width is greater than the preset window width and the window sliding step is greater than the preset sliding step, the window sliding step will be adjusted first.

[0029] Furthermore, the duration corresponding to the window width is greater than or equal to three times the duration of the temperature data change cycle.

[0030] Furthermore, in step S5, the abnormal data screening method is to use K-means clustering to identify abnormal room temperature data within the time window. When the data identification process within the window is completed, the next time window is selected sequentially according to the sliding step size, and abnormal room temperature identification is performed on the data within the window until the abnormal identification of all data is completed.

[0031] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention uses a time- and space-related anomaly diagnosis method applied to the room temperature data processing of heating and cooling systems. It clusters users with similar correlations in their energy consumption data into one category, realizing spatially related heating and cooling anomaly diagnosis. Combined with the time-related sliding window method, it significantly improves the accuracy of anomaly diagnosis. It uses the room temperature change rate to identify outliers, which improves the identification accuracy compared to the original data. It uses the KNN algorithm to fill in missing values, and the filled data can be regarded as the true value.

[0032] Furthermore, in the data diagnosis and processing method of the present invention, the diagnosis interval is determined based on the heat transfer path of the energy supply network where the individual diagnosed user is located and the heating distance threshold, and the diagnosis interval is determined based on the factors affecting the degree of correlation, which improves the correlation of the identified associated users and makes the acquired associated users more accurate.

[0033] Furthermore, in the data diagnostic processing method of the present invention, the original data is transformed into rate of change data, and the diagnosis of the original data is transformed into the diagnosis of the rate of change. This allows for the simultaneous diagnosis of whether adjacent data is abnormal, avoiding interference from abnormal data in the judgment of other data, and further improving the accuracy of the diagnosis.

[0034] Furthermore, in the data diagnostic processing method of the present invention, the diagnostic time is divided into several diagnostic time periods. The window width and sliding step size of the time window are selected in a targeted manner in different diagnostic time periods. On the one hand, this can improve the rationality of the diagnosis of different temperature ranges. Then, the corresponding data window width is determined according to the number of dates in a single diagnostic time period and the maximum temperature difference between adjacent dates, which further improves the diagnostic accuracy of the corresponding time period. On the other hand, by selecting an appropriate window width and sliding step size according to the actual temperature changes in different diagnostic time periods, the diagnostic efficiency of the present invention is improved, and the number of diagnostics is effectively reduced.

[0035] Furthermore, in the data diagnostic processing method of the present invention, the sliding step size is determined based on the average daily temperature difference, which can ensure that the data in each window is within a relatively stable range, thereby improving the accuracy of data diagnosis within the window and further improving the overall diagnostic accuracy.

[0036] Furthermore, in the data diagnosis processing method of the present invention, calculating the number of diagnoses for the currently determined window parameters and determining the adjustment method for the time window diagnosis based on the preset number threshold can avoid inaccurate diagnosis results due to insufficient diagnosis data, thereby improving the reliability of the diagnosis results.

[0037] Furthermore, in the data diagnostic processing method of this invention, the combination of K-means clustering and time window identification is more accurate than the two methods alone in identifying abnormal data, thus ensuring the accuracy of the diagnostic results. Attached Figure Description

[0038] Figure 1 This is a flowchart of the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention;

[0039] Figure 2 This is a schematic diagram of the sliding time window algorithm of the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention;

[0040] Figure 3 This is a room temperature distribution map of measuring point 1 in the time- and space-based heating and cooling anomaly data diagnosis and processing method of this invention.

[0041] Figure 4 This is a comparison chart showing the accuracy of outlier identification for different window widths in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0042] Figure 5 This is a comparison chart showing the accuracy of outlier identification with different sliding step sizes in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0043] Figure 6 This is a data imputation diagram for 10% missing values ​​in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0044] Figure 7 This is a data imputation diagram for 30% missing values ​​in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0045] Figure 8 This is a data imputation diagram for 50% missing values ​​in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0046] Figure 9 This is a KNN filling result diagram of measurement point 1 in the time and space-based heating and cooling anomaly data diagnosis and processing method of the present invention. Detailed Implementation

[0047] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.

[0048] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0049] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.

[0050] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0051] Please see Figure 1 The diagram shows a flowchart of the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention; the present invention provides a time- and space-based heating and cooling anomaly data diagnosis and processing method, including:

[0052] Step S1: Extract user room temperature data, user pipeline information, and temperature data of the user's geographical location from the heating and cooling platform for diagnosis.

[0053] Step S2: Select a diagnostic interval centered on a single diagnostic user, cluster related users whose energy consumption is related to the single diagnostic user and filtered according to the correlation within the diagnostic interval, and determine the user room temperature data standard based on the room temperature data of each related user.

[0054] Step S3: Perform preliminary data diagnosis on the room temperature data of a single diagnostic user and delete the abnormal data in the preliminary diagnosis. Record the remaining data as the original data and convert the original data into rate of change data.

[0055] Step S4: The rate of change data is divided into time windows to diagnose the data of each time window. Based on the ambient temperature data of the geographical location of the individual diagnostic user, the diagnostic time is divided into several diagnostic time periods. The corresponding window width is determined within each diagnostic time period. The sliding step size of the window is determined based on the window width and the temperature data of the geographical location of the diagnostic user.

[0056] Step S5: After the window parameters are determined, the K-means clustering method is used to detect and diagnose the rate of change of the data selected by the time window, select abnormal data for deletion, and determine the normal room temperature dataset.

[0057] Step S6: Based on the deletion and missing data in the normal room temperature dataset, the KNN algorithm is used to fill in the data to obtain a complete room temperature dataset.

[0058] The user room temperature data includes room temperature data detected periodically by the platform at various times; the temperature data for diagnosing the user's geographical location includes the daily maximum temperature, daily minimum temperature, and daily average temperature.

[0059] This invention employs a time- and space-related anomaly diagnosis method for processing room temperature data in heating and cooling systems. It clusters users with similar energy consumption data into a single category, enabling spatially related heating and cooling anomaly diagnosis. Combined with a time-related sliding window method, it significantly improves the accuracy of anomaly diagnosis. The invention also utilizes the room temperature change rate to identify outliers, improving the accuracy of identification compared to the original data. Finally, it uses the KNN algorithm to impute missing values, making the imputed data comparable to true values.

[0060] Specifically, in step S2, the diagnostic interval is determined based on the cold and hot energy transfer path and distance threshold of the energy supply network for a single diagnostic user as the center.

[0061] The heat and cold energy transfer path of the energy supply network is the heating / cooling direction of the energy supply network where the diagnosed user is located.

[0062] Specifically, the distance threshold is determined based on the energy temperature consumption per unit distance on the energy supply pipeline.

[0063] The distance thresholds for each branch network on the energy supply pipeline where the center is located are different.

[0064] It is understandable that the energy temperature consumption per unit distance on the energy supply network increases with energy transmission. The distance between users on the energy supply network and diagnostic users is determined based on the energy temperature consumption. The diagnostic interval is an interval selected with a single diagnostic user as the center. Users within the diagnostic interval and located on the same energy supply network as the diagnostic user can be correlated and selected as associated users.

[0065] In practice, on the same branch of the same energy supply network, the initial energy supply temperature of each user differs depending on the direction of the hot or cold energy flow. Therefore, by controlling the distance threshold, the initial temperature difference at the energy input end of users within the diagnostic range can be minimized, reducing the impact on indoor temperature. Generally, a distance threshold of 15km is suitable for a single well-insulated heating branch. Since the number of energy supply pipes and connected users varies from branch to branch, different distance thresholds can be set according to the actual pipe differences and the number of users to ensure that the initial temperature difference at the energy input end of users within the distance threshold is within a preset temperature difference range, which generally does not exceed 2℃.

[0066] Specifically, in step S2, the correlation between each user within the diagnostic interval and a single diagnostic user is determined by the following formula:

[0067] R = r × α,

[0068] Pearson correlation coefficient of related users

[0069] Where R is the user relevance within the distance threshold, r is the Pearson correlation coefficient between the user and a single diagnosed user, and x i y i Let the room temperature of the two users be at time i. Let α be the average room temperature of the two users, and let α be the spatial correlation coefficient between the user and a single diagnosed user. α can be set as α = 10 + L1 / L0, or determined according to the heat transfer sequence of the user on the pipeline. L1 is the distance between the associated user and the center, and L0 is the preset distance between the associated user and the center, generally taken as the maximum value of the distances between the associated users and the center within the diagnostic range.

[0070] In the process of filtering related users using relevance, the users are first initially filtered using a preset Pearson correlation coefficient standard value. Users whose Pearson correlation coefficient is greater than or equal to the preset Pearson correlation coefficient standard value are recorded as first related users. Then, the first related users are filtered again using a preset relevance standard value. Users with a relevance greater than or equal to the preset relevance are selected as the final related users used for clustering.

[0071] For example, a preset relevance standard value R = 8.5 is determined for users within a distance threshold, and a preset Pearson correlation coefficient standard value of 0.8 is determined. When the Pearson correlation coefficient of an associated user is greater than or equal to the preset Pearson correlation coefficient, the user is determined as the first associated user. Then, the spatial correlation coefficient α is determined, and appropriate associated users can be selected based on the determined spatial correlation coefficient.

[0072] In the data diagnosis and processing method of the present invention, the diagnosis interval is determined based on the heat transfer path of the energy supply network where a single diagnostic user is located and the heating distance threshold. The diagnosis interval is also determined based on the factors that affect the degree of correlation, which improves the correlation of the identified associated users and makes the acquired associated users more accurate.

[0073] Specifically, in step S3, the raw data is sorted according to the acquisition time sequence, and the raw data is converted into rate of change data according to a preset change duration. The specific calculation formula is as follows:

[0074]

[0075] Among them, A i+n For the transformed rate of change data, α i For the room temperature data of the i-th user, α i+n For the (i+n)th user's room temperature data, deleted or uncollected data are denoted as empty, t is the preset change duration, t=n×T, and n≥2, and T is the collection period of user room temperature data.

[0076] In the specific implementation process, the acquired user room temperature data is used for preliminary data diagnosis, and data that deviates significantly from the user room temperature data standard is deleted. The remaining data after deletion is recorded as the original data, and the original data is denoted as a1, a2, ..., an. The rate of change between a1 and a3, a3 and a5 up to a(n-3) and a(n-1) is calculated and denoted as A3, A5, ..., A(n-1). The rate of change between a2 and a4, a4 ​​and a6 up to a(n-2) and an is calculated and denoted as A4, A6, ..., An. The two sets of rate of change are arranged in ascending order of their serial numbers to obtain the rate of change data sequence A3, A4, A5, ..., An. It can be understood that the start time of a single diagnostic time period is the acquisition time corresponding to a3, and the end time of a single diagnostic time period is the acquisition time corresponding to an. Since the acquisition of room temperature data is highly continuous, the influence of a1 and a2 on the overall data is almost non-existent. Therefore, the times of a1 and a2 are not considered and are not within the diagnostic time range of this invention.

[0077] In the data diagnostic processing method of the present invention, the original data is transformed into change rate data, and the diagnosis of the original data is transformed into the diagnosis of the change rate. This allows for the simultaneous diagnosis of whether adjacent data is abnormal, avoiding interference from abnormal data in the judgment of other data, and further improving the accuracy of the diagnosis.

[0078] Specifically, if the data α at a certain moment in the original data... i If the data is deleted or not collected, then the A related to this data will be calculated. i+n And A i All are recorded as empty.

[0079] Transforming the original data using the rate of change of data makes the transformed individual data able to represent the relationship between the data before and after the transformation, and makes it easier to discover unreasonable data.

[0080] Please see Figure 2 The diagram shows a sliding time window algorithm for the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0081] Specifically, in step S4, the temperature change rate and the temperature difference between adjacent dates are calculated based on the temperature data, the diagnosis time is divided into several diagnosis time periods, and the window width is determined based on the number of dates in a single diagnosis time period and the average date interval corresponding to the temperature difference exceeding the temperature difference threshold during each day.

[0082] Each diagnosis period must be at least three days.

[0083] In practice, the rate of temperature change is the ratio of the average temperature of the current date to the average temperature of the previous day. The temperature difference between adjacent dates includes the difference between the highest and lowest temperatures of adjacent dates.

[0084] If the rate of temperature change is not within the allowable range, or if the difference between the highest and lowest temperatures on adjacent days is greater than the preset temperature difference, then the temperature change on that day is considered large, and the period of large temperature change is the diagnostic time period node.

[0085] The system has a preset first temperature change rate q1 and a second temperature change rate q2, where q1 < q2. When the actual temperature change rate q satisfies q1 ≤ q ≤ q2, it is determined that the temperature change rate is within the allowable range. When the actual temperature change rate q < q1 or q > q2, it is determined that the temperature change rate is outside the allowable range. The preset temperature difference value is 7℃. If the difference between the highest and / or lowest temperature values ​​of adjacent dates is greater than 7℃, it is determined that the temperature change is large. If the difference between the highest and lowest temperature values ​​of adjacent dates is less than 7℃, it is determined that the temperature change is small.

[0086] Dates in which either the rate of temperature change or the magnitude of temperature change fails to meet the preset requirements are designated as diagnostic time period nodes.

[0087] It is understandable that different diagnostic time periods may contain the same or different numbers of dates. When using a data window, the applicable scope of the window is that the start date of the window is the same as the start date of a single diagnostic time period, and the end date of the window is the same as the end date of a single diagnostic time period. A data window cannot cover the dates in adjacent diagnostic time periods at the same time.

[0088] In implementation, the temperature difference between days is the difference between the temperature of a single date and the temperatures of all dates within the corresponding single diagnostic time period. When determining the window width, a preset temperature difference threshold and a preset window width are set. For example, the preset window width is 3 days, and the corresponding preset temperature difference threshold is 2℃. Within a diagnostic time period, if the time corresponding to the shortest date difference exceeding the temperature difference threshold is less than the time corresponding to the preset window width, the actual window width is the shortest date difference exceeding the temperature difference threshold. If the shortest date exceeding the temperature difference threshold is greater than or equal to the preset window width and is greater than 7 days, the actual window width setting must be greater than the preset window width, optionally set to 5 days. If the shortest date exceeding the temperature difference threshold is greater than or equal to the preset window width and less than or equal to 7 days, the actual window width is set to the preset window width.

[0089] In the data diagnostic processing method of this invention, the diagnostic time is divided into several diagnostic time periods. The window width and sliding step size of the time window are selected in a targeted manner for different diagnostic time periods. On the one hand, this can improve the rationality of the diagnosis for different temperature ranges. Furthermore, the data window width is determined according to the number of dates and the maximum temperature difference between adjacent dates in a single diagnostic time period, which further improves the diagnostic accuracy of the corresponding time period. On the other hand, by selecting an appropriate window width and sliding step size according to the actual temperature changes in different diagnostic time periods, the efficiency of the diagnosis of this invention is improved, and the number of diagnoses is effectively reduced.

[0090] Specifically, in step S4, the average daily temperature difference within a single diagnostic time period is determined based on the temperature data of the geographical location of the center, and the value of the sliding step size is determined based on the window width of the single diagnostic time period and the average daily temperature difference.

[0091] For example, if the average daily temperature difference for a single diagnostic time period is 10℃, and the window width is 3 days, there are preset first standard values ​​of 8℃ and second standard values ​​of 12℃ for the average daily temperature difference. There are also preset first sliding step sizes of 6 hours, which correspond to the case where the average daily temperature difference is less than or equal to the first standard value; second sliding step sizes of 4 hours, which correspond to the case where the average daily temperature difference is greater than the first standard value and less than or equal to the second standard value; and third sliding step sizes of 2 hours, which correspond to the case where the average daily temperature difference is greater than the second standard value.

[0092] Since 8℃ < 10℃ < 12℃, the second sliding step size of 4 hours is selected.

[0093] When the window width is other values, the wider the corresponding window width, the larger the set sliding step duration value.

[0094] In the specific implementation process, a sliding sorting window model is first established in the change rate data sequence A3, A4, A5, ..., An. A total of n room temperature data need to be identified as abnormal room temperature. It is assumed that the window width of the room temperature data within the window is 3 days and the sliding step size of the window is 1 day. During the identification process, only the room temperature data within the window is identified as abnormal room temperature. After the room temperature data within the window is processed, the window moves according to the sliding step size to identify the room temperature data in the next window as abnormal room temperature. This process is repeated until all abnormal room temperature data are identified.

[0095] In the data diagnostic processing method of the present invention, the sliding step size is determined based on the average daily temperature difference, which can ensure that the data in each window is within a relatively stable range, improve the accuracy of data diagnosis within the window, and further improve the overall diagnostic accuracy.

[0096] Specifically, the number of diagnoses is calculated based on the window width and the sliding step size, and the adjustment method for the time window diagnosis is determined based on the number of diagnoses and a preset threshold number, wherein:

[0097] If the window width is less than the preset window width and / or the window sliding step is less than the preset sliding step, prioritize adjusting the window parameters that have not reached the preset value;

[0098] If the window width is greater than the preset window width and the window sliding step size is greater than the preset sliding step size, the window sliding step size will be adjusted first. The number of diagnostic attempts is determined by the following formula:

[0099] Number of diagnoses:

[0100] Where N is the number of diagnoses, M is the diagnosis time period, D is the window width, d is the window sliding step size, and N is an integer;

[0101] In the specific implementation process, if If the value of is not an integer, then the last diagnosis time is the end time of the current diagnosis period.

[0102] For example, if the preset threshold for the number of diagnoses is 80, the diagnosis period M is 100 days, the window width D is 4 days, the window sliding step size d is 0.8 days, the preset window width is 3 days, the preset window sliding step size is 1 day, and the actual number of diagnoses is greater than the preset threshold for the number of diagnoses, then under the condition that D≥3d, the window sliding step size is adjusted first.

[0103] In the data diagnostic processing method of the present invention, the method of calculating the number of diagnostics for the currently determined window parameters and adjusting the time window diagnosis method according to the preset number threshold can avoid inaccurate diagnostic results due to insufficient diagnostic data and improve the reliability of diagnostic results.

[0104] Specifically, the duration corresponding to the window width is greater than or equal to three times the duration of the temperature data change cycle.

[0105] It is understood that the time taken for temperature to change cyclically in the Earth's environment is 1 day. Therefore, in this invention, the temperature change cycle is 1 day, and the window width is much larger than the temperature change cycle. This ensures that most of the data can be filtered out as abnormal data through data trends during the subsequent data diagnosis process, while retaining normal data. This makes the detection of data entering the window later more accurate in the subsequent detection process. However, if the window width is set to 2 days or 1 day, it is impossible to filter out abnormal data through trends, which may retain abnormal data that has not been filtered out, which is not conducive to the identification of abnormal data.

[0106] Specifically, in step S5, the abnormal data screening method is to use K-means clustering to identify abnormal room temperature data within the time window. When the data identification process within the window is completed, the next time window is selected sequentially according to the sliding step size, and abnormal room temperature identification is performed on the data within the window until the abnormal identification of all data is completed.

[0107] When choosing to use the K-means clustering method, the 3σ criterion and the quartile method were selected as comparisons.

[0108] The specific method of the 3σ criterion is as follows: assuming the sample dataset is x1, x2, ..., x... n The standard deviation of the sample is:

[0109]

[0110] Among them, v i For deviation,

[0111] If the following condition is satisfied: |v i |>3σ(i=1,2,…,n),

[0112] Then the data x i Remove.

[0113] The quartile method is a way of describing data using five statistical measures: the minimum, the first quartile, the median, the third quartile, and the maximum.

[0114] Q1 = (n+1) × 25%

[0115] Q2 = (n+1) × 50%

[0116] Q3 = (n+1) × 75%

[0117] IQR = Q3 - Q1

[0118] MAX = Q³ + 1.5IQR

[0119] MIN = Q1 - 1.5IQR

[0120] In the formula, Q1 is the first quartile, which is the 25th percentile of the sample data arranged in ascending order; Q2 is the second quartile, which is the 50th percentile of the sample data arranged in ascending order; Q3 is the third quartile, which is the 75th percentile of the sample data arranged in ascending order; n is the total number of data points; IQR is the value between the first and third quartiles; MAX is the maximum value; and MIN is the minimum value. Data points with room temperature greater than MAX or less than MIN are considered outliers and deleted.

[0121] Understandably, for K-means clustering, the optimal number of clusters is determined based on the silhouette coefficient (SIL). Then, based on the optimal clustering result, the distance from each point within a cluster to the cluster center is calculated. If the distance exceeds a threshold, it is considered an outlier. The silhouette coefficient describes the similarity of a target within its own cluster to other clusters. Its range is from -1 to +1; a larger value indicates a higher degree of matching between the target and its own cluster, resulting in a better clustering result. By calculating the silhouette coefficient for different numbers of clusters, the cluster number corresponding to the maximum SIL value is selected as the optimal clustering result for the data. The silhouette coefficient formula is as follows:

[0122]

[0123] Where S is the silhouette coefficient; a(i) is the average distance of sample i in the same class; b(i) is the average distance of sample i in the next class closest to it; and max is the maximum value.

[0124] Example 1:

[0125] This invention analyzes room temperature measurement data from two heating users in Shijiazhuang City from February 13, 2021 to March 11, 2022. The room temperature data logger at measuring point 1 was installed in the bedroom; it was a socket type and collected data every 20 minutes, totaling 1869 data points (assuming no outliers). The room temperature data logger at measuring point 2 (used to verify the accuracy of the KNN imputation method) was also installed in the bedroom; it was a switch type and collected data every 20 minutes, totaling 432 data points, as detailed in Table 1.

[0126] Table 1 Heating User Information

[0127] Measurement point number Installation location Types of room temperature data loggers Room location 1 bedroom Socket type corner 2 bedroom Switch type middle

[0128] Please see Figure 3 As shown, it is a room temperature distribution map of measuring point 1 in the time and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0129] At measuring point 1, the room temperature remained stable between 18 and 22°C under heating conditions. 130 outliers from a normally distributed range of 15 to 28°C were randomly inserted. The normal room temperature and the room temperature after outlier insertion at measuring point 1 are plotted as follows: Figure 3 .

[0130] K-means clustering combined with a time window was used for outlier identification. The data time interval was 1 hour, the window width for room temperature data was 3 days, and the sliding step size was 1 day. Before sliding, 58 outliers were identified, and after sliding, 123 outliers were identified. In one embodiment, the silhouette coefficients (SILs) for cluster numbers from 2 to 15 were calculated, and the clustering results are shown in Table 2. The table shows that the SIL evaluation index is highest when the number of clusters is 8, indicating that the optimal clustering category is 8.

[0131] Table 2 Profile Coefficients

[0132]

[0133] Based on SPSS and Python software, the sliding time window was combined with the 3σ criterion, quartile method and K-means clustering method to identify outliers.

[0134] The key to user classification is to select an appropriate distance threshold. For this purpose, for user at measurement point 1, we selected related users within 15 kilometers of this user and calculated the Pearson correlation coefficient between their indoor temperature and that of other users.

[0135] Comparative Example 1:

[0136] The difference between this comparative example and Example 1 is that it uses the 3σ criterion combined with a time window for identification. The time interval of the selected data is 1 hour, the window width of the room temperature data within the window is 3 days, and the sliding step of the window is 1 day. Data with deviations greater than 3σ are removed. A total of 34 outliers were identified before sliding and 52 outliers were identified after sliding.

[0137] Comparative Example 2:

[0138] The difference between this comparative example and Example 1 is that the quartile method is used in combination with time windows for identification. The time interval of the selected data is 1 hour, the window width of the room temperature data in the window is 3 days, and the sliding step of the window is 1 day. Data with room temperature greater than MAX or less than MIN on the box plot are removed. A total of 65 outliers were identified before sliding and 104 outliers were identified after sliding.

[0139] Compared with traditional methods, the addition of the sliding time window method significantly improved the accuracy of outlier identification, as shown in Table 3. The K-means clustering method based on the sliding time window achieved the highest accuracy in identifying outliers; therefore, this invention employs K-means clustering for outlier identification.

[0140] Table 3 Outlier Identification Results

[0141]

[0142] Regarding evaluation metrics, the F1 score is used to measure the accuracy of outlier identification. The F1 score is the harmonic mean of precision and recall, balancing accuracy and recall.

[0143] Precision (P) represents the proportion of samples that were actually predicted as anomalous out of all samples predicted as anomalous. Recall (R) represents the proportion of samples that were actually anomalous out of all samples predicted as anomalous. Precision and recall are determined by the following formulas:

[0144] Calculate the F1 score F, where F ranges from [0, 1]. The closer F is to 1, the higher the accuracy.

[0145]

[0146]

[0147] In the formula, P is precision, R is recall, F is F1 score, TP is detected true anomaly data, FP is detected false anomaly data, and FN is undetected anomaly data;

[0148] The accuracy of the filling is measured by relative error, and the absolute value of the relative error δ is calculated by the following formula:

[0149]

[0150] ΔA=A 测量 -A 真实 ,

[0151] In the formula, δ is the relative error, ΔA is the absolute error, and L is the true value.

[0152] Please see Figure 3 and Figure 4 As shown, Figure 3 This is a comparison chart showing the accuracy of outlier identification for different window widths in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention. Figure 4 This is a comparison chart showing the accuracy of outlier identification with different sliding step sizes in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0153] Analysis of the impact of sliding window width on processing results:

[0154] To compare the accuracy of different sliding window widths in identifying anomalous room temperature data, K-means clustering was performed using window widths ranging from 2 to 7 days, with a fixed sliding step size of 1 day. The results of the clustering for outlier identification are shown below. Figure 4 .Depend on Figure 4 It can be seen that the recognition accuracy is highest when the fixed sliding step size is 1 day and the window width is 3 days, with F being 97.24%. After that, the accuracy gradually decreases as the window width increases.

[0155] Analysis of the impact of sliding step size on processing results:

[0156] Different sliding step sizes should also affect the accuracy of identifying abnormal room temperature data. K-means clustering was performed with sliding step sizes ranging from 40 minutes to 24 hours and a fixed window width of 3 days. The clustering results for identifying outliers are as follows: Figure 5 .Depend on Figure 5 It can be seen that when the fixed window width is 3 days, the recognition accuracy decreases as the window width increases. The highest recognition accuracy (98.43%) is achieved when the sliding step size is between 40 minutes and 4 hours. Since the recognition accuracy is the same for both 40 minutes and 4 hours, but the 4-hour step size requires less data and a shorter detection time, a reasonable step size selection can not only improve recognition accuracy but also reduce detection time. Considering the influence of ambient temperature on indoor temperature, the ambient temperature difference has the greatest impact on the compensation setting when selecting the sliding step size. Therefore, a window width of 3 days and a sliding step size of 4 hours are ultimately adopted for subsequent research.

[0157] Outlier identification was performed using the 3σ criterion, quartile method, and K-means clustering, and the F1 scores are summarized in Table 4. Table 4 shows that when the time interval for the rate of change is 40 minutes, the F1 score using K-means clustering is 89.83%, while the F1 score using K-means clustering directly on the original data is 61.71%. The appropriate selection of room temperature change time intervals further improved the accuracy of outlier identification.

[0158] Table 4 shows the F1 score identified at measurement point 1 at different time intervals.

[0159] Time interval (minutes) 3σ criterion Quartile method K-means clustering 20 73.79% 65.49% 80.75% 40 46.15% 85.47% 89.83% 60 41.46% 69.99% 62.43% 120 26.66% 65.28% 35.45% 180 23.09% 54.75% 28.94%

[0160] In summary, a time interval of 40 minutes, a window width of 3 days, and a sliding step of 4 hours were used in conjunction with K-means clustering to further identify outliers. The maximum F1 scores identified are shown in Table 5. Table 5 shows that using different time intervals can further improve accuracy.

[0161] Table 5. F1 scores based on sliding recognition at different time intervals for measurement point 1.

[0162] method The time interval is 40 minutes. The time interval is 1 hour 3σ criterion 88.21% 84.96% Quartile method 93.44% 90.27% K-means 98.84% 98.36%

[0163] Please see Figure 6 , Figure 7 as well as Figure 8 As shown, Figure 6 This is a data imputation map showing 10% missing values ​​in the time- and space-based heating and cooling anomaly data diagnosis and processing method of this invention. Figure 7 This is a data imputation map showing 30% missing values ​​in the time- and space-based heating and cooling anomaly data diagnosis and processing method of this invention. Figure 8 This is a data imputation diagram for 50% missing values ​​in the time- and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0164] After abnormal data diagnosis and deletion, the KNN algorithm was used to impute the data. Data from measurement point 2 from February 7, 2021 to March 4, 2021 were used to verify the KNN algorithm. 10%, 30%, and 50% of the data were randomly deleted. Data within the two hours closest to the missing value (with a neighbor count of 6) were selected for KNN imputation. The imputation accuracy was characterized by the absolute values ​​of the maximum deviation and the relative error. The maximum deviation between the imputed value and the actual value was no more than 0.99%, and the maximum absolute value of the relative error was no more than 3.90%. Specific values ​​are shown in Table 6.

[0165] Table 6. Error between actual missing values ​​and imputed values

[0166]

[0167]

[0168] In summary, the accuracy of the KNN algorithm in imputation was verified. For data with missing values ​​less than 10% and non-contiguous missing values, the maximum relative error did not exceed 1%, and the average relative error did not exceed 0.5%, showing a high degree of agreement with the actual values. Furthermore, it also demonstrated good accuracy in handling large amounts of missing data.

[0169] Please see Figure 9 As shown, it is a KNN filling result diagram of measuring point 1 in the time and space-based heating and cooling anomaly data diagnosis and processing method of the present invention.

[0170] For the KNN algorithm's imputation results, the missing values ​​of measure point 1 were imputed using the KNN algorithm. Based on experience, 6 neighbors were selected. After combining K-means clustering to identify outliers with sliding parameters of 40-minute time intervals, 3-day window widths, and 4-hour sliding steps, the imputation results for February 13, 2021 to February 20, 2021 are shown below. Figure 9 The absolute value of the relative error after filling is no more than 1.04%, and the absolute value of the average relative error is 0.18%. According to the processed data, the room temperature is mainly distributed between 18 and 22℃ during the heating season.

[0171] By maintaining the same sliding parameters and using K-means clustering to identify outliers, for all data from February 13, 2021 to March 11, 2021, with a neighbor count of 6, the absolute value of the relative error after imputation does not exceed 1.05%, and the absolute value of the average relative error is 0.13%, demonstrating high accuracy.

[0172] In the data diagnostic processing method of this invention, the combination of K-means clustering and time window is used for identification, which has a higher accuracy rate than the two methods alone in identifying abnormal data, thus ensuring the accuracy of the diagnostic results.

[0173] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

[0174] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for diagnosing and processing heating and cooling anomaly data based on time and space, characterized in that, include: Step S1: Extract user room temperature data, user pipeline information, and temperature data of the user's geographical location from the heating and cooling platform for diagnosis. Step S2: Select a diagnostic interval centered on a single diagnostic user, cluster related users whose energy consumption is related to the single diagnostic user and filtered according to the correlation within the diagnostic interval, and determine the user room temperature data standard based on the room temperature data of each related user. Step S3: Perform preliminary data diagnosis on the room temperature data of a single diagnostic user and delete the abnormal data in the preliminary diagnosis. Record the remaining data as the original data and convert the original data into rate of change data. Step S4: The rate of change data is divided into time windows to diagnose the data of each time window. Based on the ambient temperature data of the geographical location of the individual diagnostic user, the diagnostic time is divided into several diagnostic time periods. The corresponding window width is determined within each diagnostic time period. The sliding step size of the window is determined based on the window width and the temperature data of the geographical location of the diagnostic user. Step S5: After the window parameters are determined, the K-means clustering method is used to detect and diagnose the rate of change of the data selected by the time window, select abnormal data for deletion, and determine the normal room temperature dataset. Step S6: Based on the deletion and missing data in the normal room temperature dataset, the KNN algorithm is used to fill in the data to obtain a complete room temperature dataset. The user room temperature data includes room temperature data detected periodically by the platform at various times; the temperature data for diagnosing the user's geographical location includes the daily maximum temperature, daily minimum temperature, and daily average temperature.

2. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 1, characterized in that, In step S2, the diagnostic interval is determined based on the cold and hot energy transfer path and distance threshold of the energy supply network for a single diagnostic user as the center. The heat and cold energy transfer path of the energy supply network is the heating / cooling direction of the energy supply network where the diagnosed user is located.

3. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 2, characterized in that, The distance threshold is determined based on the energy temperature consumption per unit distance on the energy supply pipeline. The distance thresholds for each branch network on the energy supply pipeline where the center is located are different.

4. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 2, characterized in that, In step S2, the correlation between each user within the diagnostic interval and a single diagnostic user is determined by the following formula: R=r×α, Where R is the user relevance within the distance threshold, r is the Pearson correlation coefficient between the user and a single diagnosed user, and α is the spatial correlation coefficient between the user and a single diagnosed user.

5. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 4, characterized in that, In step S3, the raw data is sorted according to the acquisition time sequence, and the raw data is converted into rate of change data according to a preset change duration. The specific calculation formula is as follows: Among them, A i+n For the transformed rate of change data, α i For the room temperature data of the i-th user, α i+n For the (i+n)th user's room temperature data, deleted or uncollected data are denoted as empty, t is the preset change duration, t=n×T, and n≥2, and T is the collection period of user room temperature data.

6. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 5, characterized in that, In step S4, the temperature change rate and the temperature difference between adjacent dates are calculated based on the temperature data. The diagnosis time is divided into several diagnosis time periods. The window width is then determined based on the number of dates in a single diagnosis time period and the average date interval corresponding to the temperature difference exceeding the temperature difference threshold during each day. Each diagnosis period must be at least three days.

7. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 6, characterized in that, In step S4, the average daily temperature difference within a single diagnostic time period is determined based on the temperature data of the geographical location of the center, and the value of the sliding step size is determined based on the window width of the single diagnostic time period and the average daily temperature difference.

8. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 7, characterized in that, The number of diagnoses is calculated based on the window width and the sliding step size, and the adjustment method for the time window diagnosis is determined based on the number of diagnoses and a preset threshold number, wherein: If the window width is less than the preset window width and / or the window sliding step is less than the preset sliding step, prioritize adjusting the window parameters that have not reached the preset value; If the window width is greater than the preset window width and the window sliding step is greater than the preset sliding step, the window sliding step will be adjusted first.

9. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 8, characterized in that, The duration corresponding to the window width is greater than or equal to three times the duration of the temperature data change cycle.

10. The time- and space-based heating and cooling anomaly data diagnosis and processing method according to claim 9, characterized in that, In step S5, the abnormal data screening method is to use K-means clustering to identify abnormal room temperature data within the time window. When the data identification process within the window is completed, the next time window is selected sequentially according to the sliding step size, and abnormal room temperature identification is performed on the data within the window until all data abnormalities are identified.

Citation Information

Patent Citations

  • Temperature sensor data exception processing method

    CN115840897A

  • Environmental protection data counterfeiting detection method based on time sequence sliding window discrete coefficient

    CN112101969A

  • Transformer area user-transformer relation abnormity diagnosis method and device

    CN112699913A