Data generating and reporting method of gas sensor module and related device

By generating dynamic baseline values ​​and environmental corrections in real time, combined with threshold judgment, the data processing of the gas sensor module was optimized, the baseline drift problem was solved, and the measurement accuracy and communication efficiency were improved.

CN121831052APending Publication Date: 2026-04-10SHENZHEN ALONDES INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-07
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing gas sensor modules rely on fixed reference values ​​for data processing, which leads to baseline drift, affects the accuracy of measurement data, and makes it difficult to cope with environmental changes during long-term use of the sensor.

Method used

By generating dynamic baseline values ​​in real time and correcting them based on current temperature and humidity, and by using preset change thresholds and alarm thresholds to determine the reporting events for target concentration values, the data reporting strategy is optimized.

Benefits of technology

It improves the accuracy and reliability of gas concentration measurement, optimizes the utilization efficiency of communication resources, and enables timely response to changes in environmental conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121831052A_ABST
    Figure CN121831052A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and provides a data generating and reporting method of a gas sensor module and a related device. Generating a dynamic baseline value corresponding to the gas sensor in real time based on a historical concentration value acquired by the gas sensor within a preset historical time period, and generating an initial concentration value based on the dynamic baseline value and a current concentration acquisition value of the gas sensor; for each gas sensor, correcting the initial concentration value corresponding to the gas sensor based on the current temperature and the current relative humidity to obtain a target concentration value; and for each gas sensor, determining a reporting event of a target concentration value corresponding to the gas sensor based on a preset change threshold value and a preset alarm threshold value corresponding to the gas sensor. The method is helpful for improving the reliability of a gas detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for generating and reporting data for a gas sensor module. Background Technology

[0002] Gas sensor modules, as core components of environmental monitoring systems, are widely used in smart homes, building automation, and industrial safety. Their stable and reliable data generation and reporting capabilities are fundamental to ensuring system performance. Currently, most data processing methods rely on fixed reference values ​​and periodic reporting mechanisms. This static strategy struggles to address the inevitable baseline drift that occurs during long-term sensor use, causing measured data to gradually deviate from the true value and directly impacting the accuracy of subsequent control and decision-making. Summary of the Invention

[0003] This application provides a data generation and reporting method and related apparatus for a gas sensor module, in order to solve the problems mentioned in the background art.

[0004] In a first aspect, this application provides a method for generating and reporting data from a gas sensor module, including: For each gas sensor in the gas sensor module, a dynamic baseline value corresponding to the gas sensor is generated in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and an initial concentration value is generated based on the dynamic baseline value and the current concentration collection value of the gas sensor. For each of the gas sensors, the initial concentration value corresponding to the gas sensor is corrected based on the current temperature and current relative humidity to obtain the target concentration value; For each of the gas sensors, a reporting event for the target concentration value corresponding to the gas sensor is determined based on a preset change threshold and a preset alarm threshold corresponding to the gas sensor.

[0005] Secondly, this application provides a data generation and reporting system for a gas sensor module, comprising: The generation module is used to generate a dynamic baseline value corresponding to each gas sensor in the gas sensor module in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and to generate an initial concentration value based on the dynamic baseline value and the current concentration collection value of the gas sensor. The correction module is used to correct the initial concentration value of each gas sensor based on the current temperature and the current relative humidity to obtain the target concentration value. The determination module is used to determine, for each gas sensor, a reporting event for the target concentration value corresponding to the gas sensor based on a preset change threshold and a preset alarm threshold corresponding to the gas sensor.

[0006] Thirdly, this application provides a terminal device, the terminal device including a processor, a memory and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the data generation and reporting method of the gas sensor module as described in any of the preceding claims.

[0007] Fourthly, this application provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the data generation and reporting method of the gas sensor module as described in any of the preceding claims.

[0008] This application provides a data generation and reporting method and related apparatus for a gas sensor module. The method includes: for each gas sensor in the gas sensor module, generating a dynamic baseline value corresponding to the gas sensor in real time based on historical concentration values ​​collected by the gas sensor within a preset historical time period, and generating an initial concentration value based on the dynamic baseline value and the current concentration value collected by the gas sensor; for each gas sensor, correcting the initial concentration value corresponding to the gas sensor based on the current temperature and current relative humidity to obtain a target concentration value; and for each gas sensor, determining a reporting event for the target concentration value corresponding to the gas sensor based on a preset change threshold and a preset alarm threshold. This method, on the one hand, replaces the fixed reference with a dynamic baseline value that adjusts slowly over time, thereby offsetting the effects of sensor drift and slow changes in the environmental background, thus making the generated initial concentration value more accurately reflect instantaneous gas concentration changes; on the other hand, it uses real-time environmental parameters to specifically correct the initial concentration value, thereby eliminating the interference caused by environmental temperature and humidity fluctuations on the sensor's sensitivity characteristics, thus improving the accuracy and reliability of the final target concentration value; furthermore, it makes intelligent decisions on reporting behavior based on concentration changes and absolute levels, so that data reporting focuses on key information reflecting changes in environmental conditions, thereby optimizing the utilization efficiency of communication resources and responding promptly to abnormal situations. Attached Figure Description

[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 A schematic flowchart illustrating the data generation and reporting method of the gas sensor module provided in this application embodiment; Figure 2 A schematic block diagram of the data generation and reporting system for the gas sensor module provided in this application embodiment; Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0012] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0013] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0014] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0015] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features described herein can be combined with each other.

[0016] Please see Figure 1 , Figure 1 This is a flowchart illustrating the data generation and reporting method of the gas sensor module provided in the embodiments of this application, as shown below. Figure 1 As shown, the method includes steps S1 to S3.

[0017] S1. For each gas sensor in the gas sensor module, generate a dynamic baseline value corresponding to the gas sensor in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and generate an initial concentration value based on the dynamic baseline value and the current concentration collection value of the gas sensor.

[0018] For example, a data buffer is maintained for each gas sensor, continuously storing all verified historical concentration values ​​within a preset historical time period. A statistical distribution-based filtering process identifies a set of low-value readings representative of clean air conditions from this historical data. Subsequently, a weighted average calculation considering the time period is applied to this set of low-value readings; the result is defined as the dynamic baseline value for that gas sensor, which is slowly updated as new data accumulates. After obtaining the dynamic baseline value, the difference between the current concentration reading output by the gas sensor and this dynamic baseline value is calculated; the difference is defined as the initial concentration value, reflecting the concentration change relative to the dynamic background environment.

[0019] S2. For each of the gas sensors, the initial concentration value corresponding to the gas sensor is corrected based on the current temperature and the current relative humidity to obtain the target concentration value.

[0020] For example, the current temperature and relative humidity values ​​measured by the temperature sensing unit and humidity sensing unit, which are located in the same microenvironment as the gas sensor, are acquired simultaneously. Based on these two parameters, a pre-calibrated data table is accessed. This data table records the parameters required to correct the sensor output under different temperature and humidity combinations. Using an interpolation method on a two-dimensional plane, the most accurate correction parameters that best fit the current environmental conditions are calculated based on the position of the current temperature and humidity in the data table. Finally, using the calculated accurate correction parameters, a preset mathematical function transformation is applied to the initial concentration value, and the transformed output is the target concentration value.

[0021] S3. For each gas sensor, determine the reporting event of the target concentration value corresponding to the gas sensor based on the preset change threshold and preset alarm threshold corresponding to the gas sensor.

[0022] For example, firstly, the absolute difference between the target concentration value obtained in the current cycle and the target concentration value successfully transmitted in the last cycle is calculated. This absolute difference is compared with a preset change threshold set individually for the gas sensor. If it exceeds the threshold, a significant change is indicated and a report is required. Simultaneously, the current target concentration value is compared with a preset alarm threshold for the gas sensor. If it exceeds the threshold, an alarm condition is indicated and a report is required. Combining the results of these two comparisons, and based on preset decision logic, the final priority of this reporting event and the timing of the reporting are determined, such as immediate reporting, later reporting, or waiting for the next maintenance reporting cycle.

[0023] The method provided in this embodiment, on the one hand, replaces the fixed reference by introducing a dynamic baseline value that adjusts slowly over time, thereby offsetting the effects of sensor drift and slow changes in the environmental background, and thus making the generated initial concentration value more accurately reflect instantaneous gas concentration changes; on the other hand, by using real-time environmental parameters to specifically correct the initial concentration value, the interference caused by environmental temperature and humidity fluctuations on the sensor's sensitivity characteristics is eliminated, thereby improving the accuracy and reliability of the final target concentration value; furthermore, by making intelligent decisions on reporting behavior based on concentration changes and absolute levels, the data reporting is focused on key information reflecting changes in environmental conditions, thereby optimizing the utilization efficiency of communication resources and responding promptly to abnormal situations.

[0024] In some embodiments, the step of generating a dynamic baseline value corresponding to the gas sensor in real time based on historical concentration values ​​collected by the gas sensor within a preset historical time period includes: S11. Perform real-time noise reduction processing on the raw signal collected by the gas sensor to obtain a preprocessed signal.

[0025] For example, the raw electrical signal, which contains various high-frequency noises and random interferences, is received directly from the sensing element of a gas sensor. First, a digital filter is applied that allows low-frequency components of the signal to pass while suppressing high-frequency components, smoothing the signal curve and filtering out most circuit noise. Then, instantaneous rate-of-change analysis is performed on the filtered signal. If the rate of change of a data point exceeds a reasonable range based on the sensor's physical response characteristics, the point is determined to be potentially affected by pulse interference and marked as invalid. For invalid data points, a replacement value is generated through linear calculation using the values ​​of the valid data points before and after it, thereby ensuring the continuity of the output data stream and ultimately obtaining a smooth and continuous preprocessed signal.

[0026] S12. Store the numerical sequence of the preprocessed signal within the preset historical time period as the historical concentration value.

[0027] For example, the denoised preprocessed signal is sampled at fixed time intervals to form a discrete numerical sequence arranged in chronological order. These values ​​are continuously fed into a first-in, first-out (FIFO) storage area, the capacity of which is designed to cover a preset historical time period. When a new value arrives, if the storage area is full, the oldest value is automatically removed, thus ensuring that the data in the storage area always represents records from the most recent complete preset historical time period. This properly maintained numerical sequence constitutes the set of historical concentration values ​​used for subsequent analysis.

[0028] S13. Based on the statistical percentile method, a subset of data points representing the clean air status is selected from the historical concentration values.

[0029] For example, a statistical analysis is performed on the historical concentration value set stored in the buffer to calculate a specific percentile value for the data set. Then, each value in the historical concentration value set is compared with this calculated percentile value. All data points with values ​​lower than this percentile value are selected to form a candidate data set. This selected candidate data set is considered to represent a subset of sensor readings under clean air conditions within a preset historical time period.

[0030] S14. Apply a weighted moving average algorithm to the subset of data points to calculate the dynamic baseline value.

[0031] For example, a subset of data points representing the clean air condition, selected from the preceding steps, is obtained. Each data point in this subset is assigned a weight coefficient, with higher weights assigned to data points closer to the current time. The values ​​of all data points are multiplied by their corresponding weight coefficients to obtain a weighted value, which is then summed. Finally, this weighted sum is divided by the sum of all weight coefficients, and the quotient is the dynamic baseline value for the current time. This calculation process is performed periodically, allowing the dynamic baseline value to track the long-term, slow changes in sensor characteristics.

[0032] The method provided in this embodiment, on the one hand, obtains a preprocessed signal that is closer to the actual response of the sensor and eliminates instantaneous interference by filtering and replacing invalid points in the original signal, thereby providing a high-quality data foundation for all subsequent calculations; on the other hand, by systematically maintaining a data sequence covering a preset historical time period, it provides sufficient and timely historical data support for dynamic baseline estimation, thereby making the baseline estimation results both historically reliable and adaptable to environmental changes; furthermore, by combining statistical percentile screening and time-weighted averaging, it intelligently extracts background signal features from historical data and generates a dynamic baseline value that reflects long-term trends, thereby providing a reliable reference benchmark for accurately calculating instantaneous concentration changes.

[0033] In some embodiments, the step of selecting a subset of data points representing the clean air status from the historical concentration values ​​based on the statistical percentile method includes: S121, calculating a specified percentile of the historical concentration values ​​within the preset historical time period.

[0034] For example, statistical sorting is performed on all historical concentration values ​​stored in a buffer covering a preset historical time period. The data set is arranged in ascending order of value, forming an ordered data sequence. Based on a pre-defined percentile parameter, the corresponding position index is located within this ordered sequence. A linear interpolation method is used to calculate the specific value corresponding to this position index. This value represents the level of the historical concentration value at the specified percentile, reflecting the statistical characteristics of the lower concentration range within that time period.

[0035] S122. Compare the historical concentration value with the specified percentile.

[0036] For example, each historical concentration value stored in the buffer is compared one by one with a calculated specified percentile. This comparison process traverses the entire historical dataset, generating a comparison result status for each data point. The comparison result status identifies which data points are below the threshold defined by the specified percentile and which data points are above the threshold, providing a basis for subsequent data filtering.

[0037] S123. Filter out all historical concentration values ​​that are lower than the specified percentile.

[0038] For example, based on the results obtained from the aforementioned comparison steps, all data points with values ​​less than a specified percentile are systematically selected from the historical dataset. These selected data points constitute a new subset of data, representing the lower concentration measurements detected by the sensor within a preset historical time period. This selection process is essentially a classification and extraction of historical data based on statistical distribution characteristics.

[0039] S124. The selected set of values ​​is determined as the subset of data points representing the clean air state.

[0040] For example, a subset of low-value data, selected through screening, is formally identified as the dataset representing the clean air condition. This subset of data points will be used as the input data source for subsequent dynamic baseline calculations. This identification process completes the transformation from raw historical data to clean air characterization data, providing a purified input sample for dynamic baseline estimation.

[0041] The method provided in this embodiment, on the one hand, establishes a statistical boundary that distinguishes between normal fluctuations and clean air conditions by calculating a specified percentile of historical concentration values, thereby providing an objective and quantitative standard for data screening; on the other hand, it identifies possible clean air observation values ​​by systematically comparing each historical data with the statistical boundary, thereby preparing candidate data for baseline estimation; and furthermore, it ensures that dynamic baseline calculation is based on the most reliable sample by integrating all data points below the statistical boundary to form a clean air data subset, thereby improving the representativeness and accuracy of the baseline value.

[0042] In some embodiments, the step of correcting the initial concentration value corresponding to the gas sensor based on the current temperature and current humidity to obtain the target concentration value includes: S21, acquiring the current temperature and current humidity measured in real time by the temperature and humidity sensor.

[0043] For example, current physical environment parameters are synchronously read from temperature and humidity sensing units integrated on the same module as the gas sensor. These sensing units continuously monitor the temperature and relative humidity conditions of the microenvironment in which the gas sensor is located, providing digital temperature and humidity readings. The reading process ensures time synchronization with gas concentration acquisition, ensuring spatiotemporal consistency between environmental parameters and gas measurements, and providing matching environmental state information for subsequent compensation processing.

[0044] S22. Based on the current temperature and the current humidity, query the pre-stored compensation parameter table to determine the matching compensation coefficient.

[0045] For example, the current temperature and humidity values ​​are used as query conditions to access a compensation parameter table pre-stored in non-volatile memory. This compensation parameter table contains a set of compensation coefficients experimentally calibrated under different combinations of temperature and humidity. The query process searches for known calibration points in the two-dimensional parameter space that are closest to the current temperature and humidity conditions, and obtains the compensation coefficients corresponding to these calibration points, providing basic parameters for subsequent accurate interpolation calculations.

[0046] S23. The queried neighbor compensation coefficients are processed using a bilinear interpolation algorithm to obtain the exact compensation coefficients applicable to the current environment.

[0047] For example, the four nearest grid points containing the current temperature and humidity point are located in the compensation parameter table, forming a rectangular area. The compensation coefficient values ​​corresponding to these four grid points are read, and then the interpolation weights are calculated based on the relative positions of the current temperature and humidity point within this rectangular area. The calculated weights are used to weight and fuse the compensation coefficients of the four grid points to generate a compensation coefficient that perfectly adapts to the current specific temperature and humidity conditions. This coefficient can accurately reflect the sensor's response characteristics in the current environment.

[0048] S24. Based on the exact compensation coefficient, perform a linear or polynomial transformation on the initial concentration value to obtain the target concentration value.

[0049] For example, the accurate compensation coefficient obtained through interpolation is applied to the correction process of the initial concentration value. Based on a preset transformation model, mathematical operations are performed between the initial concentration value and the compensation coefficient, including linear combinations or polynomial calculations. The transformation process adjusts the initial concentration value to eliminate the effects of temperature and humidity changes, outputting a fully compensated target concentration value, which represents the equivalent gas concentration under standard environmental conditions.

[0050] The method provided in this embodiment, on the one hand, establishes a complete environmental context for gas measurement by synchronously acquiring real-time temperature and humidity data, thereby providing the necessary input parameters for accurate compensation; on the other hand, it establishes a mapping relationship between the current environmental conditions and the sensor response characteristics by querying a pre-stored compensation parameter table, thereby providing a theoretical basis for compensation calculation; furthermore, it achieves fine correction of the initial concentration value through bilinear interpolation calculation and environmental adaptive transformation, thereby generating a target value that accurately reflects the true gas concentration.

[0051] In some embodiments, the step of using a bilinear interpolation algorithm to process the queried neighbor compensation coefficients to obtain the exact compensation coefficients applicable to the current environment includes: S231, based on the current temperature and the current humidity, locating a rectangular area containing four neighboring temperature and humidity grid points in the pre-stored compensation parameter table.

[0052] For example, using the current temperature and humidity values ​​as coordinates, the region is located in the two-dimensional temperature and humidity coordinate system of the compensation parameter table. The four nearest parameter grid points surrounding the current coordinate point are found; these four points constitute a basic interpolation calculation unit. The location process ensures that the current point lies within the rectangular area formed by these four grid points, establishing a correct spatial reference frame for subsequent interpolation calculations.

[0053] S232. Read the compensation coefficients corresponding to the four neighboring grid points from the compensation parameter table.

[0054] For example, after successfully locating four grid points, the compensation coefficient values ​​recorded for these grid points are retrieved from the corresponding storage location in the compensation parameter table. The compensation coefficient for each grid point includes one or more parameters used for concentration correction, which are determined through precise calibration experiments under specific temperature and humidity conditions. The reading process comprehensively collects all the basic data required for interpolation calculations, ensuring the integrity of subsequent calculations.

[0055] S233. Define interpolation weights based on the normalized distances of the current temperature and current humidity relative to the four grid points.

[0056] For example, the relative distances between the current temperature and humidity coordinates and the coordinates of the four grid points are calculated in two dimensions. These relative distances are then normalized and converted into weighting coefficients that characterize the degree of influence. The weighting coefficients reflect the approximation degree between the current point and each grid point; grid points that are closer are assigned higher weights, ensuring that the interpolation result is more biased towards the nearest calibration point.

[0057] S234. The compensation coefficients of the four neighboring grid points are weighted and summed according to the interpolation weights to calculate the exact compensation coefficients.

[0058] For example, the compensation coefficient of each grid point is multiplied by its corresponding interpolation weight to obtain a weighted coefficient value. The weighted coefficient values ​​of all four grid points are summed to obtain the compensation coefficient applicable to the current precise environmental conditions. This calculation process achieves a smooth transition from discrete calibration points to continuous parameter space, and the generated compensation coefficient can accurately reflect the sensor's response characteristics under the current specific temperature and humidity combination.

[0059] The method provided in this embodiment, on the one hand, establishes an accurate interpolation calculation basis by accurately locating the current environmental point in the neighboring grid area of ​​the parameter table, thereby ensuring the matching degree between the compensation coefficient and the current environment; on the other hand, through distance-based weight allocation and weighted fusion calculation, a smooth transition from discrete calibration data to continuous parameter space is achieved, thereby generating adaptive compensation coefficients that are highly matched with environmental conditions; furthermore, through this refined interpolation processing, the compensation accuracy is improved without excessively increasing storage overhead, thereby enhancing the adaptability of gas concentration measurement under various environmental conditions.

[0060] In some embodiments, the step of determining the reporting event of the target concentration value corresponding to the gas sensor based on the preset change threshold and the preset alarm threshold corresponding to the gas sensor includes: S31, calculating the absolute difference between the current target concentration value and the previously reported target concentration value.

[0061] For example, the target concentration value generated in the current measurement cycle and the target concentration value stored in the previous successfully reported cycle are retrieved from the data buffer. These two values ​​are subtracted, and the absolute value of the result is taken to obtain a value reflecting the degree of concentration change between the two measurements. This difference calculation reveals the magnitude of the change in gas concentration since the last report, providing a quantitative basis for assessing the necessity of data reporting.

[0062] S32. Compare the absolute difference with the preset change threshold to determine whether a data change reporting event is triggered.

[0063] For example, the calculated absolute difference is compared with a specific set change threshold for the gas sensor. The comparison result generates a binary status flag: when the absolute difference exceeds the preset change threshold, the flag is set to bit, indicating that a significant concentration change has been detected and a data change reporting event needs to be triggered; otherwise, the flag remains at zero, indicating that the concentration change is within the normal fluctuation range and no reporting is required due to the change.

[0064] S33. Compare the current target concentration value with the preset alarm threshold to determine whether an alarm reporting event is triggered.

[0065] For example, the target concentration value obtained in the current period is directly compared with a pre-set alarm threshold. The comparison result generates another binary status flag: when the target concentration value exceeds the alarm threshold, the flag is set to bit, indicating that a potential dangerous situation has been detected and an alarm reporting event needs to be triggered immediately; otherwise, the flag remains at zero, indicating that the current concentration level is within a safe range and no alarm reporting event needs to be triggered.

[0066] S34. Based on the judgment results of the data change reporting event and the alarm reporting event, determine the final reporting priority and reporting timing.

[0067] For example, considering the triggering status of both data change reporting events and alarm reporting events, the final reporting strategy is determined according to a preset decision logic. When an alarm reporting event is triggered, the highest reporting priority is assigned and immediate transmission is scheduled; when only a data change reporting event is triggered, a normal reporting priority is assigned and transmission is scheduled for the near future; when neither is triggered, a low-frequency periodic reporting mechanism is adopted. Finally, data reporting scheduling is executed based on the determined priority and timing.

[0068] The method provided in this embodiment, on the one hand, quantifies the degree of change in gas concentration by calculating the absolute difference of continuous measurements, thereby providing an objective basis for assessing the necessity of data reporting; on the other hand, it distinguishes different scenarios such as normal fluctuations, significant changes, and dangerous situations by comparing thresholds for the degree of change and the absolute level, thereby realizing a differentiated reporting trigger mechanism; furthermore, it formulates a reporting strategy by combining the judgment results of the two events, so that the reporting behavior takes into account both response timeliness and communication efficiency, thereby optimizing the overall system performance.

[0069] In some embodiments, determining the final reporting priority and reporting timing based on the judgment results of the data change reporting event and the alarm reporting event includes: S341, when the alarm reporting event is triggered, setting the reporting priority to the highest and arranging immediate reporting.

[0070] For example, when the system detects that an alarm reporting event has been triggered, it automatically marks this reporting task as having the highest priority. The highest priority task enjoys priority access to the communication channel and is not subject to the queuing restrictions of other ordinary tasks. Simultaneously, the system interrupts the current queue of tasks awaiting transmission and immediately schedules this highest priority reporting task into the transmission process, ensuring that the alarm information is transmitted with minimal delay.

[0071] S342. When only the data change reporting event is triggered, set the reporting priority to normal and schedule it for reporting in the near future.

[0072] For example, when the system only detects the triggering state of a data change reporting event, but the alarm reporting event has not been triggered, the priority of this reporting task is marked as normal. Normal priority tasks are queued in the sending queue according to the first-in-first-out principle. After the current highest priority task is completed, the system will schedule the sending of this normal priority task within the nearest available communication time window to ensure that significantly changed data can be transmitted in a timely but non-urgent manner.

[0073] S343. When neither of these is triggered, a low-frequency periodic reporting mechanism is activated as a backup strategy.

[0074] For example, when neither data change reporting events nor alarm reporting events are triggered, the system activates a low-frequency periodic reporting mechanism. This mechanism wakes up periodically at relatively long intervals to perform a maintenance data report. This reporting method does not depend on concentration changes or alarm conditions, but rather serves as a safety net strategy to ensure that the system maintains basic communication activity and provides a status heartbeat for system operation in a long-term stable state.

[0075] S344. According to the set final reporting priority, the scheduling protocol frame enters the corresponding communication sending queue.

[0076] For example, based on the reporting priority determined in the aforementioned steps, the encapsulated data protocol frames are scheduled into the corresponding transmission queues. The highest priority protocol frames are directly sent to the emergency transmission channel; ordinary priority protocol frames are sent to the regular transmission queue to wait in order; and periodically reported protocol frames are sent to the background maintenance queue. This scheduling process ensures that communication tasks of different priorities can obtain corresponding communication resources according to their urgency and importance, achieving orderly and efficient data transmission.

[0077] The method provided in this embodiment, on the one hand, ensures timely notification of dangerous situations by assigning the highest priority and immediate sending strategy to alarm events, thereby gaining valuable time for safety response; on the other hand, it maintains communication order while ensuring data timeliness by assigning normal priority and queue sending mode to data change events, thereby improving the utilization efficiency of communication resources; and furthermore, it maintains basic communication activity of the system during stable periods by introducing a guaranteed low-frequency periodic reporting mechanism, thereby providing continuous system status monitoring.

[0078] Please see Figure 2 , Figure 2 A schematic block diagram of the data generation and reporting system for the gas sensor module provided in this application embodiment is shown below. Figure 2 As shown, the data generation and reporting system for the gas sensor module provided in this application embodiment includes: The generation module 110 is used to generate a dynamic baseline value corresponding to each gas sensor in the gas sensor module in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and to generate an initial concentration value based on the dynamic baseline value and the current concentration collection value of the gas sensor.

[0079] The correction module 120 is used to correct the initial concentration value of each gas sensor based on the current temperature and the current relative humidity to obtain the target concentration value.

[0080] The determination module 130 is used to determine, for each of the gas sensors, a reporting event for the target concentration value corresponding to the gas sensor based on a preset change threshold and a preset alarm threshold corresponding to the gas sensor.

[0081] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and each module described above can be referred to the corresponding process in the aforementioned embodiment of the data generation and reporting method of the gas sensor module, and will not be repeated here.

[0082] The data generation and reporting system 100 for the gas sensor module provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 3 The terminal device 200 shown is running on it.

[0083] Please see Figure 3 , Figure 3 The present invention provides a schematic block diagram of the structure of a terminal device 200. The terminal device 200 includes a processor 201 and a memory 202, which are connected via a system bus 203. The memory 202 may include a non-volatile storage medium and internal memory.

[0084] The non-volatile storage medium can store a computer program. The computer program includes program instructions, which, when executed by the processor 201, cause the processor 201 to perform any of the above-mentioned data generation and reporting methods for the gas sensor module.

[0085] The processor 201 provides computing and control capabilities to support the operation of the entire terminal device 200.

[0086] The internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor 201, the processor 201 can execute any of the above-mentioned data generation and reporting methods of the gas sensor module.

[0087] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal device 200 involved in the present application. The specific terminal device 200 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0088] It should be understood that processor 201 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, the general-purpose processor can be a microprocessor or any conventional processor.

[0089] In some embodiments, the processor 201 is configured to run a computer program stored in memory to perform the following steps: For each gas sensor in the gas sensor module, a dynamic baseline value corresponding to the gas sensor is generated in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and an initial concentration value is generated based on the dynamic baseline value and the current concentration collection value of the gas sensor. For each of the gas sensors, the initial concentration value corresponding to the gas sensor is corrected based on the current temperature and current relative humidity to obtain the target concentration value; For each of the gas sensors, a reporting event for the target concentration value corresponding to the gas sensor is determined based on a preset change threshold and a preset alarm threshold corresponding to the gas sensor.

[0090] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the terminal device 200 described above can be referred to the corresponding process of the data generation and reporting method of the aforementioned gas sensor module, and will not be repeated here.

[0091] This application also provides a computer-readable storage medium storing a computer program that, when executed by one or more processors, causes the one or more processors to implement the data generation and reporting method of the gas sensor module provided in this application.

[0092] The computer-readable storage medium can be an internal storage unit of the terminal device 200 in the aforementioned embodiments, such as a hard disk or memory of the terminal device 200. The computer-readable storage medium can also be an external storage device of the terminal device 200, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided with the terminal device 200.

[0093] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for generating and reporting data from a gas sensor module, characterized in that, include: For each gas sensor in the gas sensor module, a dynamic baseline value corresponding to the gas sensor is generated in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and an initial concentration value is generated based on the dynamic baseline value and the current concentration collection value of the gas sensor. For each of the gas sensors, the initial concentration value corresponding to the gas sensor is corrected based on the current temperature and current relative humidity to obtain the target concentration value; For each of the gas sensors, a reporting event for the target concentration value corresponding to the gas sensor is determined based on a preset change threshold and a preset alarm threshold corresponding to the gas sensor.

2. The data generation and reporting method of the gas sensor module according to claim 1, characterized in that, The process of generating a dynamic baseline value corresponding to the gas sensor in real time based on historical concentration values ​​collected by the gas sensor within a preset historical time period includes: The raw signal collected by the gas sensor is subjected to real-time noise reduction processing to obtain a preprocessed signal; The numerical sequence of the preprocessed signal within the preset historical time period is stored as the historical concentration value; A subset of data points representing clean air status was selected from the historical concentration values ​​based on the statistical percentile method; The dynamic baseline value is calculated by applying a weighted moving average algorithm to the subset of data points.

3. The method according to claim 2, characterized in that, The subset of data points representing the clean air status selected from the historical concentration values ​​based on the statistical percentile method includes: Calculate the specified percentile of the historical concentration value within the preset historical time period; Compare the historical concentration value with the specified percentile; Filter out all historical concentration values ​​that are lower than the specified percentile; The selected set of values ​​is determined as the subset of data points representing the clean air condition.

4. The method according to claim 1, characterized in that, The step of correcting the initial concentration value corresponding to the gas sensor based on the current temperature and humidity to obtain the target concentration value includes: The current temperature and current humidity are obtained in real time by the temperature and humidity sensor; Based on the current temperature and the current humidity, the pre-stored compensation parameter table is queried to determine the matching compensation coefficient; The queried neighbor compensation coefficients are processed using a bilinear interpolation algorithm to obtain the exact compensation coefficients applicable to the current environment. The target concentration value is obtained by performing a linear or polynomial transformation on the initial concentration value based on the exact compensation coefficient.

5. The method according to claim 4, characterized in that, The process of using bilinear interpolation to process the queried neighbor compensation coefficients to obtain the exact compensation coefficients applicable to the current environment includes: Based on the current temperature and humidity, locate a rectangular area containing four adjacent temperature and humidity grid points in the pre-stored compensation parameter table; Read the compensation coefficients corresponding to the four neighboring grid points from the compensation parameter table; Interpolation weights are defined based on the normalized distances of the current temperature and current humidity relative to the four grid points; The exact compensation coefficient is calculated by weighting and summing the compensation coefficients of the four neighboring grid points according to the interpolation weights.

6. The method according to claim 1, characterized in that, The reporting event that determines the target concentration value corresponding to the gas sensor based on the preset change threshold and the preset alarm threshold corresponding to the gas sensor includes: Calculate the absolute difference between the current target concentration value and the previously reported target concentration value; The absolute difference is compared with the preset change threshold to determine whether a data change reporting event is triggered. The current target concentration value is compared with the preset alarm threshold to determine whether an alarm reporting event is triggered. Based on the judgment results of the data change reporting event and the alarm reporting event, the final reporting priority and reporting timing are determined.

7. The method according to claim 6, characterized in that, The determination of the final reporting priority and timing based on the judgment results of the data change reporting event and the alarm reporting event includes: When the alarm reporting event is triggered, the reporting priority is set to the highest, and immediate reporting is scheduled. When only the data change reporting event is triggered, the reporting priority is set to normal and scheduled for reporting in the near future; If neither of these conditions is triggered, a low-frequency periodic reporting mechanism is activated as a backup strategy. According to the set final reporting priority, the scheduling protocol frame enters the corresponding communication sending queue.

8. A data generation and reporting system for a gas sensor module, characterized in that, include: The generation module is used to generate a dynamic baseline value corresponding to each gas sensor in the gas sensor module in real time based on the historical concentration values ​​collected by the gas sensor within a preset historical time period, and to generate an initial concentration value based on the dynamic baseline value and the current concentration collection value of the gas sensor. The correction module is used to correct the initial concentration value of each gas sensor based on the current temperature and the current relative humidity to obtain the target concentration value. The determination module is used to determine, for each gas sensor, a reporting event for the target concentration value corresponding to the gas sensor based on a preset change threshold and a preset alarm threshold corresponding to the gas sensor.

9. A terminal device, characterized in that, The terminal device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the data generation and reporting method of the gas sensor module as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the data generation and reporting method of the gas sensor module as described in any one of claims 1 to 7.