CN108387688B - Sensor correction and gas detection method, device and equipment and readable storage medium - Google Patents

Sensor correction and gas detection method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN108387688B
CN108387688B CN201810155561.7A CN201810155561A CN108387688B CN 108387688 B CN108387688 B CN 108387688B CN 201810155561 A CN201810155561 A CN 201810155561A CN 108387688 B CN108387688 B CN 108387688B
Authority
CN
China
Prior art keywords
gas sensor
induction
value
difference
induction values
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810155561.7A
Other languages
Chinese (zh)
Other versions
CN108387688A (en
Inventor
李主求
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201810155561.7A priority Critical patent/CN108387688B/en
Publication of CN108387688A publication Critical patent/CN108387688A/en
Application granted granted Critical
Publication of CN108387688B publication Critical patent/CN108387688B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N33/00Investigating or analysing materials by specific methods not covered by groups G01N1/00 - G01N31/00
    • G01N33/0004Gaseous mixtures, e.g. polluted air
    • G01N33/0006Calibrating gas analysers

Landscapes

  • Chemical & Material Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Medicinal Chemistry (AREA)
  • Food Science & Technology (AREA)
  • Combustion & Propulsion (AREA)
  • Physics & Mathematics (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Or Analyzing Materials By The Use Of Electric Means (AREA)

Abstract

The embodiment of the invention provides a method, a device and equipment for correcting a sensor and detecting gas, and a readable storage medium, wherein the correcting method comprises the following steps: acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period; determining the difference degree between the obtained induction values; updating the average value of the acquired sensing values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold updating condition. By implementing the embodiment of the invention, each time the gas sensor is preheated for a preset time period and started, a plurality of sensing values of the gas sensor are obtained, and when the difference degree between each obtained sensing value and the average value meets the preset threshold value updating condition, the average value of each sensing value is updated to be the threshold value of the gas sensor, and the threshold value reflecting the aging degree of the gas sensor can be obtained along with the starting operation of the gas sensor, so that the negative influence of the aging of the gas sensor on the gas detection result is effectively reduced.

Description

Sensor correction and gas detection method, device and equipment and readable storage medium
Technical Field
The invention relates to the technical field of sensing, in particular to a sensor correction and gas detection method, a sensor correction and gas detection device, sensor correction and gas detection equipment and a readable storage medium.
Background
In order to improve the air quality in the environment, a gas sensor is used for monitoring the relevant information of the gas in the environment in many occasions, and in the specific monitoring, the gas sensor can convert the gas type and the information related to the concentration into an electric signal. The associated gas detection system may then compare these electrical signals to a threshold value to obtain information regarding the presence of the gas under test in the environment, i.e., gas monitoring results such as the type, concentration, and composition of the gas.
However, after the gas sensor is used for a period of time, due to the performance degradation of the component devices of the gas sensor, the aging phenomenon of the gas sensor may occur, the specific values of the electrical signal output by the aged gas sensor and the electrical signal output before aging have a certain difference, the difference is determined by the aging degree of the gas sensor, the larger the aging degree is, the larger the difference is, and the lower the accuracy of the gas detection result obtained by the related gas detection system is.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, and a device for sensor calibration and gas detection, and a readable storage medium, so as to solve the problem of low accuracy of a gas detection result caused by aging of a gas sensor.
According to a first aspect of the present invention, there is provided a sensor calibration method comprising the steps of:
acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
determining the difference degree between the obtained induction values;
updating the average value of the acquired sensing values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold updating condition.
In one embodiment, the degree of difference comprises at least one of:
error value, absolute value of error, variance value, mean variance value.
In one embodiment, the induced value is a voltage value or a current value.
In one embodiment, the method further comprises the steps of:
after updating the threshold value of the gas sensor, performing the following first iteration operation every preset updating time interval during the working state of the gas sensor:
acquiring a plurality of induction values output by the gas sensor in real time;
determining the difference degree between the induction values acquired in real time;
and if the determined difference degree meets the threshold updating condition, updating the average value of all the induction values acquired in real time into the threshold of the gas sensor.
In one embodiment, if the determined degree of difference does not satisfy the threshold update condition, the method further comprises the steps of;
acquiring a preset number of induction values output by the gas sensor in real time, and executing the following second iteration operation:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
acquiring the average value of the induction value which is not replaced and the induction value after replacement;
re-determining the difference degree between the induction values which are not replaced and the induction values which are replaced;
updating the obtained average value to the threshold value of the gas sensor and terminating the second iterative operation if the newly determined degree of difference satisfies the threshold value updating condition;
and if the redetermined difference degree meets the threshold updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the second iteration operation.
According to a second aspect of the present invention, there is provided a gas detection method comprising the steps of:
acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
determining the difference degree between the obtained induction values;
updating the average value of the acquired induction values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold value update condition;
and acquiring the induction value behind the gas sensor, and comparing the acquired induction value with the updated threshold value to obtain a gas detection result.
According to a third aspect of the present invention, there is provided a sensor correction device comprising:
the induction value acquisition module is used for acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
the difference determining module is used for determining the difference degree between the acquired induction values;
and the threshold updating module is used for updating the average value of the acquired induction values into the threshold of the gas sensor when the determined difference degree meets a preset threshold updating condition.
According to a fourth aspect of the present invention, there is provided a gas detection apparatus comprising:
the induction value acquisition module is used for acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
the difference determining module is used for determining the difference degree between the acquired induction values;
the threshold updating module is used for updating the average value of the acquired induction values into the threshold of the gas sensor when the determined difference degree meets a preset threshold updating condition;
and the gas detection module is used for acquiring the induction value behind the gas sensor and comparing the acquired induction value with the updated threshold value to obtain a gas detection result.
According to a fifth aspect of the present invention, there is provided a terminal device comprising:
a processor;
a memory storing processor-executable instructions;
wherein the processor is coupled to the memory for reading program instructions stored by the memory and, in response, performing operations in the sensor calibration method as described above.
According to a sixth aspect of the present invention, there is provided a terminal device comprising:
a processor;
a memory storing processor-executable instructions;
wherein the processor is coupled to the memory for reading program instructions stored in the memory and, in response, performing operations in the gas detection method as described above.
According to a seventh aspect of the present invention, there is provided one or more machine-readable storage media having instructions stored thereon, which when executed by one or more processors, cause a terminal device to perform the operations in the sensor calibration method as described above.
According to an eighth aspect of the present invention, there is provided one or more machine-readable storage media having instructions stored thereon, which when executed by one or more processors, cause a terminal device to perform operations in a gas detection method as described above.
By implementing the embodiment provided by the invention, each time the gas sensor is preheated for a preset time period and started, a plurality of sensing values of the gas sensor are obtained, and when the difference degree between each obtained sensing value and the average value thereof meets the preset threshold value updating condition, the average value of each sensing value is updated to be the threshold value of the gas sensor, and the threshold value reflecting the aging degree of the gas sensor can be obtained along with the starting operation of the gas sensor.
If the updated threshold value and the sensing value behind the gas sensor are compared to obtain the gas detection result, the negative influence of the aging of the gas sensor on the detection result can be effectively reduced, and the gas detection accuracy is improved.
Drawings
FIG. 1 is a flow chart illustrating a method of sensor calibration in accordance with an exemplary embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method of sensor calibration according to another exemplary embodiment of the present invention;
FIG. 3 is a flow chart illustrating a method of sensor calibration according to another exemplary embodiment of the present invention;
FIG. 4 is a flow chart illustrating a method of gas detection in accordance with an exemplary embodiment of the present invention;
FIG. 5 is a block diagram illustrating a sensor calibration arrangement in accordance with an exemplary embodiment of the present invention;
FIG. 6 is a block diagram of a gas detection device shown in an exemplary embodiment of the present invention;
fig. 7 is a hardware configuration diagram of a terminal device according to an exemplary embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The gas sensor (or referred to as a gas sensor) according to the embodiment of the present invention may be a semiconductor gas sensor, a contact combustion gas sensor, an electrochemical gas sensor, or the like. If the gas sensor is arranged in a detecting head, a monitoring device, intelligent household equipment or other gas detection systems, the gas sensor can be used in the scenes of industrial production, transportation, intelligent household and the like, and can be used for detecting the concentration or the existence of combustible, combustible and toxic gases or detecting the consumption of oxygen and the like.
In general, a gas detection system compares a sensing value (which may also be referred to as an electrical signal) output from a gas sensor with a threshold value of the gas sensor to obtain a gas detection result. The threshold value of the gas sensor is a threshold value obtained before the gas sensor is initially put into use, and does not reflect the degree of deterioration of the gas sensor in use, and the greater the degree of deterioration of the gas sensor, the greater the difference between the output electric signal (which may also be referred to as a sensing value) and the output electric signal before deterioration. If the gas detection system in the relevant application scene still compares the threshold value which can not reflect the aging degree of the gas sensor with the electric signal output by the aged gas sensor, the gas detection result with very low accuracy is probably obtained.
In view of the above, the present invention provides a sensor calibration method, which obtains a plurality of sensing values of a gas sensor each time after the gas sensor is started and preheated for a predetermined period of time, updates the average value of the sensing values to the threshold value of the gas sensor when the difference between the obtained sensing values and the average value meets a predetermined threshold value update condition, and obtains the threshold value reflecting the aging degree of the gas sensor along with the start operation of the gas sensor.
In addition, the invention also provides a gas detection method, and the detection method can effectively reduce the negative influence of the aging of the gas sensor on the detection result and improve the gas detection accuracy by comparing the updated threshold value with the sensing value behind the gas sensor to obtain the gas detection result. The sensor calibration method and the gas detection method according to the embodiments of the present invention are described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating a sensor calibration method according to an exemplary embodiment of the present invention, which can be applied to a terminal device, and includes the following steps S101 to S103:
and S101, acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period.
And step S102, determining the difference degree between the acquired induction values.
And step S103, if the determined difference degree meets a preset threshold updating condition, updating the average value of the acquired induction values to the threshold of the gas sensor.
The terminal device applied in the embodiment of the present application may be various computer devices having a sensor calibration function, such as a personal computer, a laptop computer, and a smart phone, or may be a probe having a gas detection function, an environment monitoring device equipped with a gas detection system, a smart home device, or other computer devices.
If the gas sensor is configured with a gas detection system, the operations of embodiments of the present invention may be performed by the gas detection system. When gas needs to be detected, the gas detection system is powered on and starts a gas detection function, then the gas sensor in the gas detection system is powered on and preheated, the gas detection system can start timing, the gas sensor is started to enter a stable working state after the timing reaches a preset time period, and the gas detection system can acquire a plurality of induction values after the gas sensor is started and preheated for the preset time period by receiving a plurality of induction values output by the gas sensor after the timing reaches. The predetermined period of time mentioned here may be set by the designer of the present solution or the sensor manufacturer, depending on the type of gas sensor, for bringing the gas sensor to a steady state. For example, the setting time is 3 minutes, and in other examples, the setting time may be other values, which is not limited in the embodiment of the present invention.
In practical applications, since the types of the gas sensors are different, the types of the gases and the information related to the concentrations thereof are also different, and the sensing values are determined by the operating principle of the gas sensors, and may be current values output by the gas sensors or voltage values output by the gas sensors.
In addition, in order to improve the efficiency of updating the threshold, the plurality of sensing values obtained in the embodiment of the present invention may be sensing values continuously output by the gas sensor, for example: 30 induction values are continuously output within 30 seconds. In other examples, in order to make the updated threshold value reflect the aging degree of the gas sensor in a longer period, a plurality of non-continuous sensing values can be selected from a plurality of sensing values output by the gas sensor after being preheated for a predetermined period and started, such as: non-consecutive 60 responses were selected from the 120 responses output over 2 minutes.
If the gas sensor independently operates outside the gas detection system, the sensing value of the gas sensor is sent to the gas detection system and is used for detection by the gas detection system. The operations of embodiments of the present invention may be performed by entities other than gas detection systems, such as personal computers, laptop computers, smart phones, etc., to which gas sensors may be connected. The devices can control the gas sensor to be preheated for a preset time period and started by sending a command, then can receive the induction values output by the gas sensor after the gas sensor is preheated for the preset time period and started, record the time for receiving the induction values, and then can select a plurality of continuously received induction values from the received induction values.
In the embodiment of the present invention, the average value of the acquired plurality of sensing values is not directly updated to the sensor threshold value, but the average value of the acquired plurality of sensing values is updated to the threshold value of the gas sensor only when the acquired plurality of sensing values is determined to be within the predetermined range, that is, when a predetermined threshold updating condition is satisfied, so that the threshold updating condition is used to limit the degree of difference between the acquired sensing values to the predetermined range.
In one example, the difference between the obtained sensed values and the average value thereof is used to reflect the difference, and the difference between the obtained sensed values can be determined by:
and calculating the average value of the acquired induction values.
And calculating the difference value of each acquired induction value and the average value.
Each calculated difference is compared to a predetermined range of differences.
And if the comparison result indicates that the calculated difference values are within the difference value range, judging that the determined difference degree meets the threshold value updating condition. The range of the difference mentioned here can be set according to the actual requirement and the type of the gas sensor, for example, when the sensing value is a voltage, the range of the difference is set to a value between-0.2V and 0.2V.
In another example, the degree of difference is reflected in the variance of each of the obtained sensed values, and the degree of difference between the obtained sensed values can be determined by:
calculating the variance of each induction value;
and if the variances are all within a predetermined variance range, determining that the determined degree of difference satisfies the threshold update condition. The variance range mentioned here can be set according to actual needs and the type of gas sensor.
In another example, the degree of difference is reflected in the mean square difference of the obtained sensed values, and the degree of difference between the obtained sensed values can be determined by:
calculating the mean square error of each induction value;
and if the mean square deviations are all within a predetermined mean square deviation range, determining that the determined degree of difference satisfies the threshold updating condition. The mean square error range mentioned here can be set according to the actual requirements and the type of gas sensor.
In other examples, the degree of difference may be reflected by other parameters, such as the absolute value of the difference, the deviation, etc., and may be reflected by at least two of the difference, the variance, the absolute value of the difference, and the mean square error.
According to any one of the above embodiments, when it is determined that the degree of difference between the acquired sensing values satisfies the threshold updating condition, the average value of the acquired sensing values may be updated to the threshold of the gas sensor.
The threshold value is updated when the aging degree of the gas sensor is temporarily stable, so that the threshold value can only reflect the aging degree of the gas sensor in a limited time period, if the working time of the gas sensor after updating the threshold value does not exceed the limited time period, the previously updated threshold value can effectively reflect the aging degree after the limited time period to a certain extent, the threshold value does not need to be updated frequently, and gas detection can be carried out according to the previously updated threshold value.
If the working time of the gas sensor after updating the threshold exceeds the limited time period, the aging degree of the gas sensor may reach a higher degree, the previously updated threshold is difficult to effectively reflect the aging degree after the limited time period, and the accuracy of the gas detection result obtained by gas detection according to the previously updated threshold is greatly reduced, so that for the gas sensor which is in a working state for a long time after updating the threshold, an operation of acquiring a plurality of induction values output by the gas sensor in real time needs to be performed once every other preset updating time period, and the difference degree between the induction values acquired in real time is determined; and when the determined difference degree meets the threshold updating condition, updating the average value of all the induction values acquired in real time into the threshold of the gas sensor. Referring specifically to fig. 2, the sensor calibration method shown in fig. 2 may be applied to a terminal device, and includes the following steps S201 to S206:
and step S201, controlling the gas sensor to be started after preheating for a preset time period.
And S202, acquiring a plurality of induction values output by the gas sensor.
And step S203, determining the difference degree between the acquired induction values.
And step S204, if the determined difference degree meets a preset threshold updating condition, updating the average value of the acquired induction values to be the threshold of the gas sensor.
And S205, starting to record the working time of the gas sensor.
And step S206, judging whether the recorded working time reaches a preset updating time period or not, if so, returning to the step S202, and if not, terminating the working state and stopping the operation of correcting the sensor.
The content related to the embodiment of the present invention corresponds to the content related to the embodiment of fig. 1, and is not described herein again.
The updating time period mentioned in the embodiment of the present invention may be set according to the type of the gas sensor and the actual requirement, for example, set to 10 minutes.
In some scenarios, whether the embodiment of fig. 1 or the embodiment of fig. 2 is concerned, if the determined degree of difference does not satisfy the threshold update condition, e.g., any of the calculated differences is not within a predetermined range of differences, or the calculated variance or mean square error is not within a predetermined range of variances or a range of mean square errors, it may be determined that the determined degree of difference does not satisfy the threshold update condition.
For the condition that the threshold updating condition is not met, the embodiment of the invention can acquire the preset number of induction values output by the gas sensor in real time and execute the following iterative operations:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
and re-determining the difference degree between each induction value in the induction values which are not replaced and the induction values which are replaced.
And re-determining the difference degree between each induction value in the induction values which are not replaced and the induction values which are replaced.
If the newly determined degree of difference satisfies the threshold updating condition, the obtained average value is updated to the threshold value of the gas sensor, and the second iterative operation is terminated.
If the newly determined degree of difference satisfies the threshold updating condition, a predetermined number of sensed values output from the gas sensor are acquired in real time, and the iterative operation is performed.
In some scenarios, referring to fig. 3, a specific implementation process may be performed, and the sensor calibration method shown in fig. 3 may be applied to a terminal device, including the following steps S301 to S311:
and step S201, controlling the gas sensor to be started after preheating for a preset time period.
And step S302, acquiring a plurality of induction values output by the gas sensor.
Step S303, determining a difference degree between the acquired sensing values.
And step S304, judging whether the determined difference degree meets a preset threshold updating condition, if so, executing step S305, and if not, executing step S306.
And step S305, updating the average value of the acquired multiple sensing values to the threshold value of the gas sensor.
And step S306, acquiring a preset number of induction values output by the gas sensor.
And step S307, replacing the previously acquired induction values with the re-acquired induction values in sequence according to the output sequence from front to back.
And step S308, acquiring the average value of the induction value which is not replaced and the induction value after replacement.
Step S309, re-determining the difference degree between the induction values not replaced and the induction values after replacement.
And step S310, judging whether the redetermined difference degree meets the threshold updating condition, if so, executing step S311, and if not, returning to step S306.
And step 311, updating the acquired average value to the threshold value of the gas sensor.
In the embodiment of the present invention, the content of obtaining the sensing value, determining the difference degree, and determining whether the difference degree meets the threshold updating condition corresponds to the content in the embodiment related to fig. 1 or fig. 2, and is not described herein again.
For step S306, the predetermined number may be a value 1, or may be other values, such as 30, and may be specifically set according to actual scene requirements.
For step S307, when replacing the old sensing value with the newly acquired sensing value, the replaced old sensing value may be determined in order of increasing time value according to the output time or the receiving time of the sensing value.
As can be seen from the above embodiments, in the solution of the present invention, each time the gas sensor is preheated for a predetermined period of time and started, a plurality of sensing values of the gas sensor may be obtained, and when a difference degree between each obtained sensing value and an average value thereof satisfies a predetermined threshold updating condition, the average value of each sensing value is updated to the threshold of the gas sensor, and the threshold reflecting the aging degree of the gas sensor can be obtained along with the start operation of the gas sensor.
After the threshold value is updated, the equipment with the gas detection system can obtain a gas detection result by comparing the updated threshold value with a sensing value behind the gas sensor, so that the negative influence of the aging of the gas sensor on the detection result is effectively reduced, and the gas detection accuracy is improved. Specific detection process referring to fig. 4, the gas detection method shown in fig. 4 may be applied to a device equipped with a gas detection system, and includes the following steps S401 to S404:
step S401, obtaining a plurality of induction values output by the gas sensor after preheating for a preset time period.
And step S402, determining the difference degree between the acquired induction values.
And S403, if the determined difference degree meets a preset threshold updating condition, updating the average value of the acquired induction values to the threshold of the gas sensor.
And S404, acquiring the induction value behind the gas sensor, and comparing the acquired induction value with the updated threshold value to obtain a gas detection result.
The content related to the embodiment of the present invention corresponds to the content related to any one of the embodiments in fig. 1 to 3, and is not described herein again.
The gas detection result obtained by the embodiment of the invention can be the type, concentration, component and the like of the gas.
For step S404, the specific operation taken to obtain the gas detection result may be determined by the type of the gas sensor or the gas data desired to be detected (such as the type, concentration, and composition of the gas), and will not be described herein again.
In another example, in the gas detection method according to the embodiment of the present invention, after the threshold is updated according to any one of the embodiments shown in fig. 1 to 3, the sensing value behind the gas sensor is obtained, and the obtained sensing value is compared with the updated threshold to obtain the gas detection result.
Corresponding to the embodiments of the method described above, the invention also provides embodiments of the apparatus.
Referring to fig. 5, fig. 5 is a block diagram illustrating a gas sensor calibration apparatus according to an exemplary embodiment of the present invention, which may be applied to a terminal device, including: a sensed value acquisition module 510, a variance determination module 520, and a threshold update module 530.
The sensing value obtaining module 510 is configured to obtain a plurality of sensing values output by the gas sensor after the gas sensor is preheated for a predetermined period.
A difference determining module 520, configured to determine a degree of difference between the acquired sensing values.
A threshold updating module 530, configured to update the average value of the acquired sensing values to the threshold of the gas sensor when the determined difference degree satisfies a predetermined threshold updating condition.
In some examples, the degree of difference includes at least one of:
error value, absolute value of error, variance value, mean variance value.
In other examples, the induced value is a voltage value or a current value.
In other examples, the gas sensor calibration apparatus of this embodiment may further include:
the first iteration module is used for executing the following first iteration operation every preset update time interval after the threshold value of the gas sensor is updated and the gas sensor is in a working state:
acquiring a plurality of induction values output by the gas sensor in real time;
determining the difference degree between the induction values acquired in real time;
and if the determined difference degree meets the threshold updating condition, updating the average value of all the induction values acquired in real time into the threshold of the gas sensor.
In other examples, the gas sensor calibration apparatus of this embodiment may further include:
a second iteration module, configured to, when the determined difference degree does not satisfy the threshold update condition, obtain, in real time, a predetermined number of sensing values output by the gas sensor, and perform the following second iteration operation:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
acquiring the average value of the induction value which is not replaced and the induction value after replacement;
re-determining the difference degree between the induction values which are not replaced and the induction values which are replaced;
updating the obtained average value to the threshold value of the gas sensor and terminating the second iterative operation if the newly determined degree of difference satisfies the threshold value updating condition;
and if the redetermined difference degree meets the threshold updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the second iteration operation.
Referring to fig. 6, fig. 6 is a block diagram illustrating a gas detection apparatus according to an exemplary embodiment of the present invention, which may be applied to a terminal device having a gas detection function, including: a sensed value acquisition module 610, a difference determination module 620, a threshold update module 630, and a gas detection module 640.
The sensing value obtaining module 610 is configured to obtain a plurality of sensing values output by the gas sensor after the gas sensor is preheated for a predetermined period of time.
And a difference determining module 620, configured to determine a degree of difference between the acquired sensing values.
A threshold updating module 630, configured to update the average value of the acquired sensing values to the threshold of the gas sensor when the determined difference degree satisfies a predetermined threshold updating condition.
And the gas detection module 640 is configured to obtain a sensing value after the gas sensor, and compare the obtained sensing value with the updated threshold value to obtain a gas detection result.
The sensing value obtaining module 610, the difference determining module 620 and the threshold updating module 630 of this embodiment correspond to the contents of the embodiment related to fig. 5, and are not described herein again.
The implementation process of the functions and actions of each unit (or module) in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units or modules described as separate parts may or may not be physically separate, and the parts displayed as the units or modules may or may not be physical units or modules, may be located in one place, or may be distributed on a plurality of network units or modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiment of the sensor correction device and/or the gas detection device can be applied to terminal equipment. In particular, it may be implemented by a computer chip or entity, or by an article of manufacture having some functionality. In a typical implementation, the terminal device is a computer, and the computer may be in the form of a personal computer, a laptop computer, a smart phone, a navigation device, an e-mail sending and receiving device, a game console, a tablet computer, a smart home device, or a combination of any of these devices.
The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading, by a processor of the electronic device, corresponding computer program instructions in a readable storage medium such as a nonvolatile memory into a memory for operation, as a logical device. From a hardware aspect, as shown in fig. 7, the present invention is a hardware structure diagram of a terminal device where a sensor calibration apparatus and/or a gas detection apparatus are located, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 7, the terminal device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the terminal device, which is not described again. Wherein the memory and the non-volatile memory are computer readable memories, and the memory of the terminal device can store program instructions executable by the processor; the processor may be coupled to a memory device,
in one embodiment, the processor is configured to read program instructions stored on the storage medium and, in response, perform the following:
acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
determining the difference degree between the obtained induction values;
updating the average value of the acquired sensing values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold updating condition.
In another embodiment, the processor is configured to read program instructions stored on the storage medium and, in response, perform the following:
acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
determining the difference degree between the obtained induction values;
updating the average value of the acquired induction values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold value update condition;
and acquiring the induction value behind the gas sensor, and comparing the acquired induction value with the updated threshold value to obtain a gas detection result.
In other embodiments, the operations performed by the processor may refer to the description related to the embodiments of the sensor calibration method and/or the gas detection method, which is not repeated herein.
In addition, the embodiment of the present invention further provides a machine-readable storage medium (or referred to as a memory of a terminal device), where the machine-readable storage medium stores program instructions, and the program instructions include instructions corresponding to the steps of the above sensor calibration method and/or gas detection method. When executed by one or more processors, cause the terminal device to perform the operations of the sensor calibration method and/or the gas detection method described above.
Embodiments of the invention may take the form of a computer program product embodied on one or more readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having program code embodied therein. Computer-usable readable storage media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of machine-readable storage media include, but are not limited to: phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by a computing device.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method of calibrating a sensor, comprising the steps of:
acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
determining the difference degree between the obtained induction values;
updating the average value of the acquired induction values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold value update condition;
if the determined difference degree does not satisfy the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the following second iteration operation:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
acquiring the average value of the induction value which is not replaced and the induction value after replacement;
re-determining the difference degree between the induction values which are not replaced and the induction values which are replaced;
updating the obtained average value to the threshold value of the gas sensor and terminating the second iterative operation if the newly determined degree of difference satisfies the threshold value updating condition;
and if the redetermined difference degree does not satisfy the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the second iteration operation.
2. The method of claim 1, wherein the degree of difference comprises at least one of:
difference, absolute value of difference, variance, mean variance.
3. The method of claim 1, wherein the induced value is a voltage value or a current value.
4. The method according to claim 1, characterized in that the method further comprises the steps of:
after updating the threshold value of the gas sensor, performing the following first iteration operation every preset updating time interval during the working state of the gas sensor:
acquiring a plurality of induction values output by the gas sensor in real time;
determining the difference degree between the induction values acquired in real time;
and if the determined difference degree meets the threshold updating condition, updating the average value of all the induction values acquired in real time into the threshold of the gas sensor.
5. A method of gas detection, comprising the steps of:
acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
determining the difference degree between the obtained induction values;
updating the average value of the acquired induction values to the threshold value of the gas sensor if the determined degree of difference satisfies a predetermined threshold value update condition;
if the determined difference degree does not satisfy the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the following second iteration operation:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
acquiring the average value of the induction value which is not replaced and the induction value after replacement;
re-determining the difference degree between the induction values which are not replaced and the induction values which are replaced;
updating the obtained average value to the threshold value of the gas sensor and terminating the second iterative operation if the newly determined degree of difference satisfies the threshold value updating condition;
if the redetermined difference degree does not meet the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the second iteration operation;
and acquiring the induction value behind the gas sensor, and comparing the acquired induction value with the updated threshold value to obtain a gas detection result.
6. A sensor calibration device, comprising:
the induction value acquisition module is used for acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
the difference determining module is used for determining the difference degree between the acquired induction values;
a threshold updating module, configured to update an average value of the acquired sensing values to a threshold of the gas sensor when the determined difference degree satisfies a predetermined threshold updating condition, and further configured to:
when the determined difference degree does not satisfy the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the following second iteration operation:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
acquiring the average value of the induction value which is not replaced and the induction value after replacement;
re-determining the difference degree between the induction values which are not replaced and the induction values which are replaced;
updating the obtained average value to the threshold value of the gas sensor and terminating the second iterative operation if the newly determined degree of difference satisfies the threshold value updating condition;
and if the redetermined difference degree does not satisfy the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the second iteration operation.
7. A gas detection apparatus, comprising:
the induction value acquisition module is used for acquiring a plurality of induction values output by the gas sensor after the gas sensor is preheated for a preset time period;
the difference determining module is used for determining the difference degree between the acquired induction values;
a threshold updating module, configured to update an average value of the acquired sensing values to a threshold of the gas sensor when the determined difference degree satisfies a predetermined threshold updating condition, and further configured to:
when the determined difference degree does not satisfy the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the following second iteration operation:
sequentially replacing the induction values acquired before with the induction values acquired in real time according to the output sequence from front to back;
acquiring the average value of the induction value which is not replaced and the induction value after replacement;
re-determining the difference degree between the induction values which are not replaced and the induction values which are replaced;
updating the obtained average value to the threshold value of the gas sensor and terminating the second iterative operation if the newly determined degree of difference satisfies the threshold value updating condition;
if the redetermined difference degree does not meet the threshold value updating condition, acquiring a preset number of induction values output by the gas sensor in real time, and executing the second iteration operation;
and the gas detection module is used for acquiring the induction value behind the gas sensor and comparing the acquired induction value with the updated threshold value to obtain a gas detection result.
8. A terminal device, comprising:
a processor;
a memory storing processor-executable instructions;
wherein the processor is coupled to the memory for reading program instructions stored by the memory and, in response, performing operations in the method of any of claims 1-4.
9. A terminal device, comprising:
a processor;
a memory storing processor-executable instructions;
wherein the processor is coupled to the memory for reading program instructions stored by the memory and, in response, performing the operations of the method of claim 5.
10. One or more machine-readable storage media having instructions stored thereon, which when executed by one or more processors, cause a terminal device to perform operations in a method as recited in any of claims 1-4.
11. One or more machine-readable storage media having instructions stored thereon, which when executed by one or more processors, cause a terminal device to perform operations in the method of claim 5.
CN201810155561.7A 2018-02-23 2018-02-23 Sensor correction and gas detection method, device and equipment and readable storage medium Active CN108387688B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810155561.7A CN108387688B (en) 2018-02-23 2018-02-23 Sensor correction and gas detection method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810155561.7A CN108387688B (en) 2018-02-23 2018-02-23 Sensor correction and gas detection method, device and equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN108387688A CN108387688A (en) 2018-08-10
CN108387688B true CN108387688B (en) 2021-02-09

Family

ID=63069134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810155561.7A Active CN108387688B (en) 2018-02-23 2018-02-23 Sensor correction and gas detection method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN108387688B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109285313B (en) * 2018-08-27 2021-10-12 广东九联科技股份有限公司 Automatic sensor correction method and system for smoke alarm
CN113252096A (en) * 2021-04-30 2021-08-13 河南创仕航空科技有限公司 Sensor initial calibration method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5347474A (en) * 1991-09-19 1994-09-13 Gaztech Corporation Self-calibration of an NDIR gas sensor
US6614230B2 (en) * 2000-02-24 2003-09-02 Robert Bosch Gmbh Method and device for evaluating an ion current sensor signal in an internal combustion engine
WO2008016394A2 (en) * 2006-07-28 2008-02-07 Lawrence Kates System and method for high-sensitivity sensor
CN104949705A (en) * 2015-06-18 2015-09-30 昂纳信息技术(深圳)有限公司 Method for dynamically adjusting threshold of optical fiber sensor

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933127B (en) * 2017-01-17 2019-04-26 杭州老板电器股份有限公司 A kind of control method of gas class sensor
CN107290802B (en) * 2017-07-18 2019-03-01 Oppo广东移动通信有限公司 Proximity sensor calibration method, proximity sensor calibrating installation and intelligent terminal
CN107463289B (en) * 2017-07-26 2020-07-31 Oppo广东移动通信有限公司 Calibration method and device of touch screen, storage medium and terminal
CN107490613B (en) * 2017-07-31 2020-06-23 广东美的制冷设备有限公司 Electrochemical gas sensor, calibration method thereof and air conditioner
CN107461787B (en) * 2017-09-30 2019-07-23 广东美的厨房电器制造有限公司 Cigarette stove linkage processing method, device, storage medium, smoke machine and kitchen range

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5347474A (en) * 1991-09-19 1994-09-13 Gaztech Corporation Self-calibration of an NDIR gas sensor
US6614230B2 (en) * 2000-02-24 2003-09-02 Robert Bosch Gmbh Method and device for evaluating an ion current sensor signal in an internal combustion engine
WO2008016394A2 (en) * 2006-07-28 2008-02-07 Lawrence Kates System and method for high-sensitivity sensor
CN104949705A (en) * 2015-06-18 2015-09-30 昂纳信息技术(深圳)有限公司 Method for dynamically adjusting threshold of optical fiber sensor

Also Published As

Publication number Publication date
CN108387688A (en) 2018-08-10

Similar Documents

Publication Publication Date Title
US8873323B2 (en) Method of executing wear leveling in a flash memory device according to ambient temperature information and related flash memory device
CN110501094A (en) Fault detection and calibration method for electric appliance temperature sensor, air conditioner and computer readable storage medium
US8213236B1 (en) Flash memory
CN108387688B (en) Sensor correction and gas detection method, device and equipment and readable storage medium
CN109347653B (en) Index abnormity discovery method and device
CN106603874B (en) A kind of method that mobile terminal electricity is shown and mobile terminal
CN109556646B (en) Gas sensor calibration method and device, storage medium and terminal
CN112509292B (en) Fault prediction method, device, electronic equipment and computer readable storage medium
KR20220162785A (en) Touch capacitance data adjustment method and device, electronic device, storage medium
CN116256661B (en) Battery fault detection method, device, electronic equipment and storage medium
CN109002216B (en) Touch screen repairing method and device and electronic equipment
JP2014178974A (en) Electronic equipment, method for controlling the same and program
CN112415292B (en) Piezoelectric device on-line detection device and method
CN113835016B (en) DDR chip limit performance test method, test device, equipment and storage medium
CN113032232B (en) Correlation method, correlation device and equipment for performance detection of equipment
CN105717409A (en) Electronic device electric leakage detection method and electronic device electric leakage detection system
CN114857753B (en) Gas concentration detection method, air conditioner, storage medium and device
CN109656901A (en) Data processing method and device, electronic equipment
CN115345230A (en) Single-phase circuit abnormity identification method and system of three-phase electric meter and storage medium
CN112527199B (en) Method and device for prolonging service life of flash memory medium and electronic equipment
CN114185882A (en) Bad data correction method and device, storage medium and electronic equipment
JP2005037233A (en) Capacity estimation method for storage battery
CN109683809B (en) Data storage method and terminal
JP2012173200A (en) Abnormality state detection method and electronic apparatus
JP2006163811A (en) Data control method of nonvolatile memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200318

Address after: 510530 Guangdong city of Guangzhou province YUNPU Whampoa district four Road No. 6

Applicant after: Guangzhou Shiyuan Electronic Technology Company Limited

Address before: 510530 Guangdong city of Guangzhou province YUNPU Whampoa district four Road No. 6

Applicant before: Guangzhou Shiyuan Electronic Technology Company Limited

Applicant before: GUANGZHOU RUIXIN ELECTRONICS Co.,Ltd.

GR01 Patent grant
GR01 Patent grant