A processing method for collecting temperature data in an internet of things
By combining timers and interrupts, along with sliding windows and variance thresholds to filter out abnormal data, the problem of inaccurate latency in temperature data acquisition was solved, improving data accuracy and reducing storage space, thus achieving more accurate temperature data reading and smaller storage requirements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN UNIV OF POSTS & TELECOMM
- Filing Date
- 2024-12-11
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies suffer from inaccurate temperature data acquisition due to delays, resulting in abnormal and noisy data. Furthermore, the delay in sensor data reading operations is difficult to calculate accurately, affecting data accuracy.
Precise delay is achieved by combining timers and interrupts, setting reasonable interrupt priorities, filtering abnormal data by using sliding windows and variance thresholds, and reducing data storage space through difference comparison and normalization operations.
It improves the accuracy of temperature data acquisition, filters out abnormal data, reduces data storage space, and achieves more accurate temperature data reading and smaller storage requirements.
Smart Images

Figure CN122195586A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer data processing, and specifically relates to a method for processing temperature data collected by the Internet of Things. Background Technology
[0002] In production and daily life, it is often necessary to collect temperature data in real time. In environmental monitoring, real-time collection of temperature data of natural environments such as the atmosphere and water bodies provides important data for studying climate change and predicting future weather changes. In industrial production, monitoring the temperature of equipment and products on the production line can help companies optimize equipment and production processes, improve product quality, and reduce energy consumption. In the medical field, it is also used to monitor the temperature of medical equipment such as CT scanners, assisted breathing equipment, and MRI machines.
[0003] However, during temperature data acquisition, noise from the electronic equipment itself, abnormal events, operational errors, or other unknown factors can cause some of the acquired temperature data to be abnormal. Furthermore, since most sensors have strict timing requirements during data reading, current methods for delaying sensor data reading operations utilize loop control of program execution time. This delay processing is imprecise, only achieving millisecond-level delays. This is because factors such as the CPU being interrupted and executing interrupt services, the optimization level used during program compilation, and the impact of MCU cache size on instruction execution speed make it difficult to accurately calculate the delay time. Inaccurate delays can lead to abnormal or noisy data when reading temperature data.
[0004] The range of ambient temperature and electronic device temperature data that are usually measured is not large; the difference between the maximum and minimum temperature values generally does not exceed 1000 degrees Celsius. Summary of the Invention
[0005] Based on the above characteristics, this invention proposes a method for processing temperature data collected by the Internet of Things (IoT). Firstly, to address the problem of inaccurate data acquisition delays, this method uses a combination of timers and interrupts to achieve precise delays. Specifically, the delay task is handled within an interrupt service routine. A reasonable interrupt priority is set according to the characteristics of the system used to prevent delay interrupts from being ignored or delayed, ensuring timely response. Secondly, for abnormal data, a variance threshold is set to filter out outlier data. Finally, to reduce data storage space, the collected data undergoes difference comparison and normalization operations, converting the collected data into smaller values to reduce data storage space.
[0006] The purpose of this method is to improve the accuracy of data acquisition, filter out abnormal data from the acquired data, and reduce data storage space after normalization and difference comparison of the data.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A method for processing temperature data collected by the Internet of Things (IoT) includes the following steps:
[0009] Step 1: Use a timer to delay the timeout and handle the delay task in an interrupt service routine.
[0010] Step 2: Based on the system application, set reasonable interrupt priorities for interrupt delay tasks;
[0011] Step 3: First, set the sliding window size wz and step size sl to segment the collected data, and calculate the mean u and variance δ of the feature values of the current window data;
[0012] Step 4: Set the variance threshold: Choose a suitable variance threshold. Typically, a suitable value for k is determined based on the specific circumstances of the problem or through experimentation, retaining values within the range [uk*δ, u+k*δ] and filtering out outliers.
[0013] Step 5: In order to reduce data storage space, adjacent data are compared one by one in the same static window. If the difference between adjacent data does not reflect the temperature change trend, that is, the temperature is very close, the second number in the adjacent data is represented by a specific value to reduce storage.
[0014] Step 6: To reduce data storage space, normalize the data in a static window to integers, turning the original large values into smaller values using ASCII encoding to save storage space. Attached Figure Description
[0015] Figure 1 Data read without precise delay;
[0016] Figure 2 Data read when precise delay is implemented (steps one and two);
[0017] Figure 3 Comparison of data file sizes read without implementing this invention and read after implementing this invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings.
[0019] To achieve the above objectives, the present invention provides the following technical solution:
[0020] A method for processing temperature data collected by the Internet of Things (IoT) includes the following steps:
[0021] Step 1: Use a timer to delay the timeout and handle the delay task in an interrupt service routine.
[0022] Step 2: Based on the system application, set reasonable interrupt priorities for interrupt delay tasks;
[0023] Step 3: First, set the sliding window size wz and step size sl to segment the read data, and calculate the mean u and variance δ of the feature values of the current window data;
[0024] Step 4: Set the variance threshold: Select a suitable variance threshold. Typically, a suitable value for k is determined based on the specific circumstances of the problem or through experimentation, retaining values within the range [uk*δ, u+k*δ] and filtering out outliers.
[0025] Step 5: In order to reduce data storage space, adjacent data are compared one by one in a static window. Since the difference between adjacent data does not reflect the temperature change trend, that is, the adjacent temperatures are extremely close, a specific number is used to represent the next data in the adjacent data. The specific number is represented by a code that occupies a small amount of storage space, thereby reducing the amount of storage.
[0026] Step 6: To reduce data storage space, normalize the data in a static window, take the mean of this window as the base, subtract all data from the base, replace the original number with the difference, and process the original data into smaller data. When storing, use ASCII encoding, keep the original specific values unchanged, and finally perform Gzip compression.
[0027] The above description is merely a preferred embodiment of the present invention and is not intended to limit the technical solution of the present invention in any way. Those skilled in the art should understand that, without departing from the spirit and principles of the present invention, the technical solution can be modified and replaced in several simple ways, and these modifications and replacements are all within the scope of protection covered by the claims.
Claims
1. A method for processing temperature data acquired through the Internet of Things (IoT). Its first feature is that temperature data acquisition and reading uses a combination of timers and interrupts to achieve delay. The timer is used to place the delay task in the interrupt service and set a reasonable interrupt priority to ensure that the delay interrupt can be responded to in a timely manner. Its second feature is that in the sliding window, a suitable threshold is determined based on the specific situation of temperature data in different scenarios or through experiments to filter out outliers with excessively large or small variance values; its third feature is that in order to reduce data storage space, in the static window, adjacent temperature data are compared one by one. When the difference between adjacent data cannot reflect the temperature change trend, that is, the temperatures are very close, the next data in the adjacent data is represented by a specific number. Its fourth feature is that, in order to reduce data storage space, the data in a static window is normalized, and the mean of this window is taken as the base. Other data are replaced by the difference between the original data and the base. The specific number processed in the previous step is not processed and the original specific number is retained.
2. The method for processing temperature data acquired via the Internet of Things according to claim 1, characterized in that: Temperature data acquisition and reading uses a combination of timers and interrupts to achieve delay. The timer is used to place the delay task in the interrupt service routine and set an appropriate interrupt priority to ensure that the delay interrupt can be responded to in a timely manner.
3. The method for processing temperature data acquired via the Internet of Things according to claim 2, characterized in that: In the sliding window, a suitable threshold is determined based on the temperature data range in different scenarios or through experiments to filter out outliers with excessively large or small variance values.
4. The method for processing temperature data acquired via the Internet of Things according to claim 3, characterized in that: To reduce data storage space, adjacent temperature data are compared one by one in the static window. If the difference between adjacent data does not reflect the temperature change trend, that is, if the temperatures are very close, the next data is used to represent the temperature with a specific value.
5. The method for processing temperature data acquired via the Internet of Things according to claim 4, characterized in that: To reduce data storage space, the data in a static window is normalized, and the mean of this window is used as the base. Other data are replaced with the difference between the original data and the base. Specific values processed in the previous step are not processed and are retained.