Gas detector output method, device, equipment and storage medium
By combining median filtering and weighted filtering algorithms, noise interference in the gas detector and signal fluctuations are eliminated, and the principle of rapid rise and slow decline is adopted to solve the problem of unstable output of the gas detector, achieving fast and stable gas Concentration measurement.
Patent Information
- Application Number
- CN202111042694.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-07
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-09-07
AI Technical Summary
There is environmental interference in the existing gas detectors during the acquisition of signal voltage, resulting in the output gas concentration not stable and fast enough, and the signal fluctuations of the sensor itself are difficult to be effectively filtered out.
Combining the median filtering algorithm and the weighted filtering algorithm, the noiseless voltage signal is first obtained through median filtering, and then the sensor's own signal fluctuations are eliminated through weighted filtering, and the output voltage is outputted using the principle of rapid rise and slow decline to ensure the stability and rapid gas concentration.
The test gas concentration of the gas detector output is achieved quickly and stabilizing, eliminating the influence of signal fluctuations of the sensor itself, and improving the accuracy and reliability of the output.
Smart Images

Figure CN113960113B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of gas detectors, and in particular relates to a gas detector output method, device, equipment and storage medium. Background Art
[0002] Gas detector is an instrument for detecting gas concentration. The instrument is suitable for dangerous places where flammable or toxic gases exist, and can continuously detect the content of the measured gas in the air within the lower explosion limit for a long time. It can be widely used in various industries such as gas, petrochemical, metallurgy, steel, coking, electricity, etc. where flammable or toxic gases exist. It is an ideal monitoring instrument to ensure property and personal safety.
[0003] In the process of collecting the signal voltage of the gas detector, there is always interference from the environment to the gas detector signal. In order to eliminate the influence of these interferences on the gas detector signal, it is necessary to filter the collected gas detector signal voltage.
[0004] At present, common software filtering methods include median filtering, arithmetic mean filtering, sliding average filtering, etc. These filtering algorithms can filter out interference signals, but they cannot filter out the sensor's own signal fluctuations. The gas detector's own signal fluctuations will also affect the concentration of the gas sensor output, resulting in the output test gas concentration not being stable and fast enough.
[0005] Therefore, there is an urgent need for a method that enables a gas detector to output a test gas concentration quickly and stably. Summary of the invention
[0006] The purpose of the present invention is to overcome the defects of the prior art and provide a gas detector output method, system, device and storage medium. By combining different filtering algorithms, a median filtering algorithm is first used to obtain a noise-free voltage signal, and then a weighted filtering algorithm is used to eliminate the sensor's own signal fluctuations to stabilize the output test gas concentration. The output voltage is then output based on the principle of fast rise and slow fall, so as to achieve a fast and stable output test gas concentration.
[0007] The object of the present invention is achieved through the following technical solutions:
[0008] The gas detector output method comprises the following steps:
[0009] S1: Collect the sensor signal voltage in the gas detector to obtain sampling voltage data;
[0010] S2: intercept a section of sampled voltage data to eliminate noise interference and obtain noise-free voltage data;
[0011] S3: sorting the noise-free voltage data to obtain ordered noise-free voltage data;
[0012] S4: Assign different weights to each voltage value in the ordered noise-free voltage data, and obtain the output voltage value through weighted filtering;
[0013] S5: Repeat steps S1 - S4, compare the magnitudes of the output voltage value M1 and the output voltage value M2. If M2 > M1, calculate the gas concentration based on the voltage value M2; if M2 < M1 and M2 is less than Mn, calculate the gas concentration based on Mn;
[0014] Among them, the voltage value M1 is the previous output voltage value, M2 is the subsequent output voltage value, and Mn is the protection threshold to prevent fluctuations;
[0015] S6: Output the gas concentration calculated in step S5.
[0016] Further, in step S2, median filtering is specifically used to eliminate noise interference.
[0017] Further, Mn = 0.95 * M1.
[0018] Further, the method of assigning weights is that the weights assigned from the middle value to both sides decrease successively.
[0019] Further, the weights decreased each time are equal.
[0020] Further, steps S1 - S6 are executed cyclically to maintain the stable output of the gas detector.
[0021] On the other hand, the present invention also provides a gas detector output device, including:
[0022] A data acquisition unit, configured to acquire the sensor signal voltage in the gas detector to obtain sampled voltage data;
[0023] An interference elimination unit, configured to intercept a section of the sampled voltage data to eliminate noise interference and obtain noise-free voltage data;
[0024] A voltage sorting unit, configured to sort the noise-free voltage data to obtain ordered noise-free voltage data;
[0025] A weight calculation unit, configured to assign different weights to each voltage value in the ordered noise-free voltage data, and obtain the output voltage value through weighted filtering;
[0026] A concentration calculation unit, configured to calculate the gas concentration based on the magnitudes of the previous output voltage value and the subsequent output voltage value;
[0027] A gas concentration output unit, configured to output the gas concentration.
[0028] On the other hand, the present application provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement any one of the above-mentioned gas detector output methods.
[0029] On the other hand, the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement any one of the above-mentioned gas detector output methods.
[0030] The beneficial effects of the present invention are:
[0031] (1) The present invention combines different filtering algorithms, first adopts a median filtering algorithm to obtain a noise-free voltage signal, and then adopts a weighted filtering algorithm to eliminate the sensor's own signal fluctuations, so as to stabilize the output test gas concentration.
[0032] (2) The present invention eliminates the voltage value of the sensor's own signal fluctuation by weighted filtering, adopts the principle of fast rise and slow fall to output voltage, and calibrates a certain voltage difference through the standard gas concentration. When there is a gas leak in the on-site environment, a voltage change will occur to obtain a voltage difference, and then the obtained voltage difference is compared with the standard concentration voltage difference to obtain the actual gas concentration, thereby achieving a fast and stable output test gas concentration. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flowchart of the gas detector output method provided in Example 1 of the present invention.
[0034] Figure 2 This is a structural block diagram of the gas detector output device provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0035] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0036] It should be noted that in order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.
[0037] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Example 1
[0039] As attached Figure 1 FIG. 1 is a flowchart of a gas detector output method provided in this embodiment. The method specifically includes the following steps:
[0040] Step 1: Collect the sensor signal voltage in the gas detector to obtain sampling voltage data.
[0041] Step 2: intercept a section of sampled voltage data to eliminate noise interference and obtain noise-free voltage data. Optionally, in the section of voltage data intercepted in this embodiment, the number of voltage values is an odd number, and the intercepted set of sampled voltage data is X1, X2, X3, X4...X n The median value Y of the sampled voltage is obtained by sorting. The sampled voltage is obtained by intercepting the sampled voltage data multiple times and sorting them. This embodiment eliminates noise interference and filters out interference signals by means of median filtering. The number of medians of a group of sampled voltages obtained in this embodiment is an even number, so that the voltage value can be processed by weighted filtering later. The median values Y1, Y2, Y3, Y4...Y of a group of sampled voltages are obtained. n .
[0042] Step 3: Sort the noise-free voltage data to obtain ordered noise-free voltage data. The median values Y1, Y2, Y3, Y4, etc. of the even-numbered sampled voltages obtained in step 2 after median filtering are sorted. n The sorting can be performed from large to small or from small to large. In this embodiment, the sorting is performed from small to large. A set of ordered noise-free voltage data obtained is Z1, Z2, Z3, Z4, ... Zn.
[0043] Step 4: assign different weights to each voltage value in the ordered noise-free voltage data, and obtain the output voltage value through weighted filtering. In this embodiment, the two voltages in the middle of the voltage value are assigned the largest proportional coefficient, and the proportional coefficients are assigned to both sides in turn. By calculating (Z1*a1+Z2*a2+…+Z n / 2 *a n / 2 +Z n / 2+1 *a n / 2+1 …+Z n *a n ) / 2(a1+a2+…+a n / 2)Obtain the weighted filtered voltage value M. According to the principle of small probability events, it is considered that the maximum and minimum values in a set of data are small probabilities, so their weights are also the smallest, while the occurrence probability of the intermediate values is the largest. Therefore, the two intermediate voltage values are given the largest proportionality coefficient, and the proportionality coefficient decreases sequentially from the middle to both sides.
[0044] Step Five: Repeat Steps S1 - S4, compare the magnitudes of the output voltage value M1 and the output voltage value M2. If M2 > M1, calculate the gas concentration based on the voltage value M2; if M2 < M1 and M2 is less than Mn, calculate the gas concentration based on Mn.
[0045] Among them, the voltage value M1 is the previous output voltage value, M2 is the subsequent output voltage value, and Mn is the protection threshold to prevent fluctuations. When gas leaks, the voltage of the sensor in the gas detector will rise, so the previous voltage is less than the subsequent voltage, and the subsequent voltage will be used for concentration calculation. And if there is a situation where the previous voltage is greater than the subsequent voltage, it may be caused by interference. To prevent the concentration display from fluctuating back and forth, a protection threshold to prevent fluctuations can be set. If the subsequent voltage is less than the previous voltage and smaller than the protection threshold to prevent fluctuations, the protection threshold is used to calculate the gas concentration, which can尽量 avoid the inaccurate output of the measured gas concentration caused by interference. According to actual applications, when the protection threshold is 0.95 times the previous voltage value, the concentration of the measured gas output by the gas detector is more stable.
[0046] Step Six: Output the gas concentration calculated in Step Five.
[0047] Loop through the above Steps One to Six to maintain the stable and rapid output of the gas concentration by the gas detector.
[0048] The gas detector output method provided in this embodiment combines different filtering algorithms. First, the median filtering algorithm is used to obtain a noise-free voltage signal, and then the weighted filtering algorithm is used to eliminate the signal fluctuations of the sensor itself, making the output measured gas concentration stable. Then, the principle of fast rising and slow falling is used to output the voltage, achieving the fast and stable output of the measured gas concentration.
[0049] Embodiment 2
[0050] As shown in the appendix Figure 2 is the structural block diagram of the gas detector output device provided in this embodiment. This gas detector output device can be applied to various fixed terminals such as computers and various mobile terminals such as smartphones and tablets. The device includes:
[0051] A data acquisition unit for collecting the sensor signal voltage in the gas detector to obtain sampled voltage data.
[0052] The interference elimination unit is used to intercept a section of sampled voltage data to eliminate noise interference and obtain noise-free voltage data.
[0053] The voltage sorting unit is used to sort the noise-free voltage data to obtain ordered noise-free voltage data.
[0054] The weight calculation unit is used to assign different weights to each voltage value in the ordered noise-free voltage data, and obtain the output voltage value through weighted filtering.
[0055] The concentration calculation unit is used to calculate the gas concentration according to the magnitude of the previous output voltage value and the next output voltage value.
[0056] The gas concentration output unit is used to output the gas concentration.
[0057] The beneficial effects of the gas detector output device provided in this embodiment are detailed in the previous embodiments and will not be repeated here.
[0058] Example 3
[0059] This preferred embodiment provides a computer device, which can implement the steps in any embodiment of the gas detector output method provided in the embodiments of the present application. Therefore, the beneficial effects of the gas detector output method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0060] Example 4
[0061] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps of any embodiment of the gas detector output method provided in the embodiment of the present invention.
[0062] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0063] Since the instructions stored in the storage medium can execute the steps in any gas detector output method embodiment provided in the embodiments of the present invention, the beneficial effects that can be achieved by any gas detector output method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0064] The above basic examples of the present invention and their further selected examples can be freely combined to form multiple embodiments, all of which are embodiments that can be adopted and claimed by the present invention. In the scheme of the present invention, each selected example can be arbitrarily combined with any other basic example and selected example. Those skilled in the art will know that there are many combinations.
[0065] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A gas detector output method, characterized in that: It includes the following steps: S1: Collect the sensor signal voltage in the gas detector to obtain sampled voltage data; S2:截取一段采样电压数据消除噪声干扰,获得无噪电压数据;Intercept a section of the sampled voltage data to eliminate noise interference and obtain noise-free voltage data; S3: Sort the noise-free voltage data to obtain ordered noise-free voltage data; S4: Assign different weights to each voltage value in the ordered noise-free voltage data, and obtain the output voltage value through weighted filtering; S5: Repeat steps S1 - S4, compare the magnitudes of the output voltage value M1 and the output voltage value M2. If M2 > M1, calculate the gas concentration based on the voltage value M2; if M2 < M1 and M2 is less than Mn, calculate the gas concentration based on Mn; wherein, the voltage value M1 is the previous output voltage value, M2 is the subsequent output voltage value, and Mn is a protection threshold to prevent fluctuations; S6: Output the gas concentration calculated in step S5.
2. The gas detector output method according to claim 1, characterized in that: In step S2, median filtering is specifically used to eliminate noise interference.
3. The gas detector output method according to claim 1, characterized in that: Mn = 0.95 * M1.
4. The gas detector output method according to claim 1, characterized in that: The method of assigning weights is that the weights assigned from the middle value to both sides decrease successively.
5. The gas detector output method according to claim 4, characterized in that: The weights decreased each time are equal.
6. The gas detector output method according to any one of claims 1 to 5, characterized in that: Loop through steps S1 - S6 to maintain stable output of the gas detector.
7. A gas detector output device, characterized in that: It includes: A data acquisition unit for collecting the sensor signal voltage in the gas detector to obtain sampled voltage data; An interference elimination unit for intercepting a section of the sampled voltage data to eliminate noise interference and obtain noise-free voltage data; A voltage sorting unit for sorting the noise-free voltage data to obtain ordered noise-free voltage data; A weight calculation unit for assigning different weights to each voltage value in the ordered noise-free voltage data and obtaining the output voltage value through weighted filtering; A concentration calculation unit for comparing the magnitudes of the output voltage value M1 and the output voltage value M2. If M2 > M1, calculate the gas concentration based on the voltage value M2; if M2 < M1 and M2 is less than Mn, calculate the gas concentration based on Mn; wherein, the voltage value M1 is the previous output voltage value, M2 is the subsequent output voltage value, and Mn is a protection threshold to prevent fluctuations; A gas concentration output unit for outputting the gas concentration.
8. A computer device, characterized in that: The computer device includes a processor and a memory. A computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the gas detector output method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored in the storage medium, and the computer program is loaded and executed by the processor to implement the gas detector output method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Error data verification method and system for wind measurement data
CN111858127A
