A humidity detection method and device, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG TCL INTELLIGENT HEATING & VENTILATING EQUIP CO LTD
- Filing Date
- 2021-11-25
- Publication Date
- 2026-06-16
AI Technical Summary
Existing humidity-sensitive resistors suffer from slow sensing speed and poor stability when detecting humidity, especially since they require a stabilization time after the input waveform flips before an accurate voltage value can be obtained.
By setting up a humidity detection device, combined with a humidity detection module and a temperature detection module, the temperature partial pressure value and humidity partial pressure value are obtained. Based on a preset humidity reference table, the relative humidity data of the space to be tested can be directly obtained, shortening the data processing time.
It improves the speed of humidity detection and relative humidity analysis, ensuring rapid acquisition and stability of humidity data.
Smart Images

Figure CN114091273B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electrical technology, specifically to a humidity detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] The quality of humidity-sensitive resistors on the market varies greatly. Some humidity-sensitive resistors distort the sampled voltage after the input waveform is flipped, and it takes a certain amount of time for them to stabilize before an accurate voltage value can be obtained and returned to the data processor for calculation. Using this single-wire output voltage sensor module to detect humidity cannot quickly analyze the relative humidity in the space, and there are problems with slow humidity sensing speed and poor stability. Summary of the Invention
[0003] This application provides a humidity detection method, apparatus, electronic device, and storage medium that can shorten the processing time of the data processor for temperature detection data after acquiring temperature detection data from a humidity-sensitive resistor, thereby improving the humidity detection speed and the relative humidity analysis speed in the space to be measured.
[0004] On one hand, this application provides a humidity detection method, which detects humidity using a humidity detection device installed in the space to be measured. The humidity detection device includes a humidity detection module and a temperature detection module. The humidity detection method includes:
[0005] Obtain the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module;
[0006] The current temperature data within the space to be measured is determined based on the temperature partial pressure value.
[0007] Based on a preset humidity lookup table, the current temperature data and the humidity partial pressure value are used as inputs to look up the table and obtain the current relative humidity data in the space to be measured.
[0008] In one possible implementation of this application, before obtaining the temperature partial pressure value of the temperature detection module and the humidity partial pressure value of the humidity detection module, the method includes:
[0009] Acquire multiple temperature sample data, multiple temperature sample partial pressure data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data corresponding to the multiple humidity sample data of the space to be tested;
[0010] The humidity comparison table is obtained by integrating the multiple temperature sample data, the multiple temperature sample pressure data, the multiple humidity sample data, and the multiple humidity sample pressure data.
[0011] In one possible implementation of this application, before integrating the plurality of temperature sample data, the plurality of temperature sample partial pressure data, the plurality of humidity sample data, and the plurality of humidity sample partial pressure data to obtain the humidity comparison table, the method includes:
[0012] Based on the relationship between the multiple temperature sample data and the multiple temperature sample partial pressure data, points are plotted on a two-dimensional temperature coordinate to obtain a two-dimensional temperature curve;
[0013] Based on the relationship between the multiple humidity sample data and the multiple humidity sample partial pressure data, points are plotted on the two-dimensional humidity coordinate to obtain a two-dimensional humidity curve;
[0014] By integrating the two-dimensional temperature curve and the two-dimensional humidity curve, a three-dimensional surface is obtained.
[0015] In one possible implementation of this application, the step of integrating the plurality of temperature sample data, the plurality of temperature sample partial pressure data, the plurality of humidity sample data, and the plurality of humidity sample partial pressure data to obtain the humidity comparison table includes:
[0016] The three-dimensional surface is converted into a two-dimensional array, which includes multiple array elements composed of basic arrays;
[0017] The two-dimensional array is used as the humidity reference table.
[0018] In one possible implementation of this application, the step of converting the three-dimensional surface into a two-dimensional array, the two-dimensional array comprising multiple array elements composed of basic arrays, includes:
[0019] Based on the temperature sample data, determine the first-level index value of the basic array;
[0020] Based on the humidity sample data, determine the secondary index value of the basic array;
[0021] The array values of the basic array are determined based on the humidity sample pressure data.
[0022] A two-dimensional array composed of multiple basic arrays is used as the humidity reference table.
[0023] In one possible implementation of this application, determining the first-level index value of the basic array based on the temperature sample data includes:
[0024] The multiple temperature sample data are divided into N temperature data intervals with adjacent numerical values, resulting in multiple temperature data intervals, where N is a natural number less than 4.
[0025] The multiple temperature data intervals are sequentially labeled to obtain multiple temperature data intervals with numerical labels;
[0026] The numerical label is determined to be the first-level index value of the basic array.
[0027] In one possible implementation of this application, determining the secondary index value of the basic array based on the humidity sample data includes:
[0028] Based on the temperature data range, determine N humidity sample data corresponding to N temperature sample data in the temperature data range;
[0029] The average value of the N humidity sample data is calculated to obtain the average humidity sample data.
[0030] The average data of the humidity sample is determined as the secondary index value of the basic array.
[0031] In one possible implementation of this application, based on a preset humidity lookup table, the current temperature data and the humidity partial pressure value are used as inputs to look up the table to obtain the current relative humidity data in the space to be measured, including:
[0032] Based on the current temperature data, determine the temperature data range corresponding to the current temperature data in the humidity lookup table;
[0033] Based on the temperature data range, determine the current first-level index value corresponding to the temperature data range;
[0034] The current secondary index value is determined based on the humidity partial pressure value and the current primary index value;
[0035] The current secondary index value is used as the current relative humidity data within the space to be measured.
[0036] In one possible implementation of this application, obtaining the temperature partial pressure value of the temperature detection module and the humidity partial pressure value of the humidity detection module includes...
[0037] Within a preset time period, receive and acquire trigger signals;
[0038] Based on the trigger signal, the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module are acquired once.
[0039] On the other hand, this application provides a humidity detection device, which includes a humidity detection module and a temperature detection module;
[0040] The acquisition module is used to acquire the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module;
[0041] The conversion module is used to determine the current temperature data in the space to be measured based on the temperature partial pressure value;
[0042] The determination module is used to look up the current relative humidity data in the space to be measured by taking the current temperature data and the humidity partial pressure value as inputs based on a preset humidity lookup table.
[0043] The humidity detection device further includes a data integration module, which specifically comprises:
[0044] Used to acquire multiple temperature sample data, multiple temperature sample pressure data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample pressure data corresponding to the multiple humidity sample data of the space under test;
[0045] This is used to integrate the multiple temperature sample data, the multiple temperature sample pressure data, the multiple humidity sample data, and the multiple humidity sample pressure data to obtain the humidity comparison table.
[0046] The data integration module further includes:
[0047] This is used to plot points on a two-dimensional temperature coordinate system based on the relationship between the multiple temperature sample data and the multiple temperature sample partial pressure data, thereby obtaining a two-dimensional temperature curve.
[0048] This is used to plot points on a two-dimensional humidity coordinate system based on the relationship between the multiple humidity sample data and the multiple humidity sample partial pressure data, thereby obtaining a two-dimensional humidity curve.
[0049] This is used to integrate the two-dimensional temperature curve and the two-dimensional humidity curve to obtain a three-dimensional surface.
[0050] The data integration module further includes:
[0051] Used to convert the three-dimensional surface into a two-dimensional array, the two-dimensional array comprising multiple array elements composed of basic arrays;
[0052] The two-dimensional array is used as the humidity reference table.
[0053] The data integration module further includes:
[0054] Used to determine the first-level index value of the basic array based on the temperature sample data;
[0055] Used to determine the secondary index value of the basic array based on the humidity sample data;
[0056] Used to determine the array value of the base array based on the humidity sample pressure data.
[0057] This is used to construct a two-dimensional array from multiple basic arrays as the humidity reference table.
[0058] The data integration module further includes:
[0059] This is used to divide N temperature sample data that are adjacent in value into a temperature data interval, resulting in multiple temperature data intervals, where N is a natural number less than 4.
[0060] This is used to sequentially label multiple temperature data intervals to obtain multiple temperature data intervals with numerical labels;
[0061] Used to determine that the numerical label is the first-level index value of the basic array.
[0062] The data integration module further includes:
[0063] Used to determine N humidity sample data corresponding to N temperature sample data in the temperature data range;
[0064] This is used to calculate the average value of N humidity sample data to obtain the average humidity sample data;
[0065] This is used to determine the average data of the humidity sample as the secondary index value of the base array.
[0066] The determining module specifically includes:
[0067] Used to determine the temperature data range in the humidity lookup table corresponding to the current temperature data based on the current temperature data;
[0068] Used to determine the current first-level index value corresponding to the temperature data range based on the temperature data range;
[0069] Used to determine the current secondary index value based on the humidity partial pressure value and the current primary index value;
[0070] This is used to use the current secondary index value as the current relative humidity data within the space to be measured.
[0071] The acquisition module is specifically:
[0072] Used to receive and acquire trigger signals within a preset time period;
[0073] This is used to acquire the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module once, based on the acquisition trigger signal.
[0074] On the other hand, this application also provides an electronic device, characterized in that the electronic device comprises:
[0075] One or more processors;
[0076] Memory; and
[0077] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the humidity detection method.
[0078] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the humidity detection method.
[0079] This application obtains the current temperature data and humidity partial pressure value, and then looks up the table based on the current temperature data and humidity partial pressure value to directly obtain the current temperature data of the space to be measured. Compared with the traditional technology that detects the voltage value of a single line by a sensor module and then needs to calculate the voltage value through a data processor to obtain the humidity, this application can quickly and directly look up the current relative humidity data when the corresponding humidity partial pressure value is collected, shortening the processing time of temperature detection data and improving the humidity detection speed and the relative humidity analysis speed of the space to be measured. Attached Figure Description
[0080] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0081] Figure 1 This is a schematic diagram of an embodiment of the humidity detection module provided in this application.
[0082] Figure 2 This is a schematic diagram of an embodiment of the temperature detection module provided in this application;
[0083] Figure 3 This is a schematic flowchart of an embodiment of the humidity detection method provided in this application.
[0084] Figure 4 This is a schematic flowchart of an embodiment of the humidity detection method provided in this application.
[0085] Figure 5 This is a schematic diagram of a three-dimensional curved surface provided in the embodiments of this application;
[0086] Figure 6 This is a schematic flowchart of an embodiment of the humidity detection method provided in this application.
[0087] Figure 7 This is a schematic diagram of the humidity comparison table provided in the embodiments of this application;
[0088] Figure 8 This is a schematic flowchart of an embodiment of the humidity detection method provided in this application.
[0089] Figure 9 This is a schematic flowchart of an embodiment of the humidity detection method provided in this application.
[0090] Figure 10 This is a schematic diagram of one embodiment of the humidity detection device provided in this application.
[0091] Figure 11 This is a schematic diagram of an embodiment of the electronic device provided in this application. Detailed Implementation
[0092] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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.
[0093] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0094] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0095] This application provides a humidity detection method, apparatus, electronic device, and storage medium, which will be described in detail below.
[0096] In this embodiment, humidity is detected by a humidity detection device installed in the space to be measured, thus realizing a humidity detection method, such as... Figure 1 and Figure 2 As shown, the humidity detection device includes a humidity detection module and a temperature detection module, and also includes a data processor.
[0097] like Figure 1 As shown, the humidity detection module includes a humidity sensor RH and a first voltage divider resistor RS. One end of the humidity sensor RH is electrically connected to port IO1 of the data processor, forming connection point V1. The other end of the humidity sensor RH is electrically connected to the first voltage divider resistor RS, and the other end of the first voltage divider resistor RS is electrically connected to port IO2 of the data processor, forming connection point V3. The AD port of the data processor is electrically connected to the connection point between the humidity sensor RH and the first voltage divider resistor RS, forming connection point V2 at the AD port of the data processor. During detection, the two ports of the data processor send a 1kHz square wave. The connection points V1 and V3 have opposite 5V pulse levels, or other voltage values. The humidity sensor RH changes its resistance under different humidity conditions, simultaneously forming a voltage divider with the first voltage divider resistor RS. The sampled humidity voltage value is returned to the AD port of the processor.
[0098] like Figure 2As shown, the temperature detection module includes a temperature sensor TP and a second voltage divider resistor RS. The temperature sensor TP and the second voltage divider resistor RS are connected in parallel. One of the electrical connection points of the temperature sensor TP and the second voltage divider resistor RS forms connection point V4. The AD port of the data processor is electrically connected to connection point V4. During application, after the external power supply VCC supplies power to the temperature sensor TP, the temperature field in the space is monitored in real time through the temperature sensor TP. When the temperature field in the space changes, its resistance value changes, causing the voltage value of the second voltage divider resistor RS to change synchronously. The voltage value of the second voltage divider resistor RS is collected and the collected temperature voltage value data is transmitted to the AD port of the data processor.
[0099] like Figure 3 The diagram shown is a flowchart of an embodiment of the humidity detection method in this application. The humidity detection method includes the following steps 101-103:
[0100] 101. Obtain the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module.
[0101] A humidity detection device installed in the environment to be tested is used to detect the ambient temperature and humidity in real time. The temperature pressure value detected by the temperature detection module is transmitted to the AD port of the data processor to obtain the temperature pressure value. The humidity pressure value detected by the humidity detection module is transmitted to the AD port of the data processor to obtain the humidity pressure value.
[0102] 102. Determine the current temperature data in the space to be measured based on the temperature partial pressure value.
[0103] The data processor receives the temperature pressure values and converts them into the current temperature data corresponding to the temperature pressure values.
[0104] 103. Based on the preset humidity reference table, the current temperature data and humidity partial pressure value are used as input to look up the table and obtain the current relative humidity data in the space to be measured.
[0105] The obtained humidity partial pressure value and temperature partial pressure value are used as input, and a table lookup is performed based on the humidity lookup table. The corresponding current relative humidity data is directly retrieved according to the data correspondence in the humidity lookup table.
[0106] This application obtains the current temperature data and humidity partial pressure value, and then looks up the table based on the current temperature data and humidity partial pressure value to directly obtain the current temperature data of the space to be measured. Compared with the traditional technology that detects the voltage value of a single line by a sensor module and then needs to calculate the voltage value through a data processor to obtain the humidity, this application can quickly and directly look up the current relative humidity data when the corresponding humidity partial pressure value is collected, shortening the processing time of temperature detection data and improving the humidity detection speed and the relative humidity analysis speed of the space to be measured.
[0107] In some embodiments of this application, before measuring humidity, it is necessary to establish an accurate humidity comparison table based on the actual conditions of the space to be measured, so as to facilitate data retrieval.
[0108] Before obtaining the temperature partial pressure value from the temperature detection module and the humidity partial pressure value from the humidity detection module, the method includes:
[0109] Acquire multiple temperature sample data, multiple temperature sample partial pressure data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data corresponding to the multiple humidity sample data of the space to be tested.
[0110] The humidity detection device collects real-time data on temperature, humidity, and voltage changes corresponding to humidity in the space under test. This includes multiple temperature sample data at different temperatures, multiple temperature sample voltage data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample voltage data corresponding to the multiple humidity sample data. These multiple sets of experimental data are used as data samples.
[0111] By integrating multiple temperature sample data, multiple temperature sample partial pressure data, multiple humidity sample data, and multiple humidity sample partial pressure data, a humidity comparison table is obtained.
[0112] In some embodiments of this application, such as Figure 4 As shown, before integrating multiple temperature sample data, multiple temperature sample partial pressure data, multiple humidity sample data, and multiple humidity sample partial pressure data to obtain a humidity comparison table, the method includes the following steps 201-203:
[0113] 201. Based on the relationship between multiple temperature sample data and multiple temperature sample partial pressure data, plot points on a two-dimensional temperature coordinate to obtain a two-dimensional temperature curve.
[0114] First, a two-dimensional temperature coordinate system is established. In actual conditions, when the temperature field of the space to be measured changes, the partial pressure data of the temperature sample collected by the data processor also changes synchronously. After the data processor processes the collected partial pressure data of the temperature sample and converts it into temperature sample data, points are plotted on the two-dimensional temperature coordinate system according to the one-to-one correspondence between the partial pressure data of the temperature sample and the converted temperature sample data to obtain a two-dimensional temperature curve.
[0115] 202. Based on the relationship between multiple humidity sample data and multiple humidity sample partial pressure data, plot points on a two-dimensional humidity coordinate to obtain a two-dimensional humidity curve.
[0116] A two-dimensional humidity coordinate system is established. In actual conditions, when the temperature field of the space under test changes, the humidity in the space under test will also change accordingly. Therefore, the humidity sample partial pressure data collected by the data processor will also change synchronously. After the data processor processes the collected humidity sample partial pressure data and converts it into humidity sample data, points are plotted on the two-dimensional humidity coordinate system according to the one-to-one correspondence between the humidity sample partial pressure data and the converted humidity sample data to obtain a two-dimensional humidity curve.
[0117] 203. Integrate the two-dimensional temperature curve and the two-dimensional humidity curve to obtain a three-dimensional surface.
[0118] A three-dimensional humidity coordinate system is established. Based on the two-dimensional temperature and humidity curves, and the correspondence between temperature and humidity sample data, points are plotted on the three-dimensional humidity coordinate system. The data for the three-dimensional surface includes multiple corresponding temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data, forming a three-dimensional surface. The three-dimensional surface is as follows: Figure 5 As shown, the three-dimensional curved surface covers all humidity points that the humidity detection module can detect at a specified temperature.
[0119] In some embodiments of this application, multiple temperature sample data, multiple temperature sample partial pressure data, multiple humidity sample data, and multiple humidity sample partial pressure data are integrated to obtain a humidity comparison table, including the following:
[0120] The three-dimensional surface is converted into a two-dimensional array, which consists of multiple array elements composed of basic arrays. The two-dimensional array is used as a humidity reference table.
[0121] Table 1. Two-dimensional array (temperature-humidity-voltage values)
[0122]
[0123] To simplify the relationships between data, a data processor programmatically processes the three-dimensional surface, converting it into a two-dimensional array containing multiple corresponding temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data. For example, the two-dimensional array obtained from the three-dimensional surface can be shown in Table 1. The two-dimensional array includes primary index values, secondary index values, and array values. For example, in this embodiment, as shown in Table 1, the temperature in the table represents the temperature sample data, which can be used as the primary index value; the relative humidity in the table represents the humidity sample data, which can be used as the secondary index value; and the voltage values in the table represent the humidity sample partial pressure data, which can be used as the array value of the two-dimensional array. The table content is also adjusted according to the actual detected data, and no specific limitations are made here. By using any two of the primary index values, secondary index values, and array values, the other value can be obtained, thereby achieving rapid data retrieval.
[0124] In some embodiments of this application, such as Figure 6 As shown, the three-dimensional surface is converted into a two-dimensional array, which includes multiple array elements composed of basic arrays, including the following steps 301 to 303:
[0125] 301. Determine the first-level index value of the basic array based on the temperature sample data.
[0126] The primary index value of the basic array can be any one of the temperature sample data, humidity sample data, or humidity sample partial pressure data. In this embodiment, the primary index value of the basic array is determined based on the temperature sample data.
[0127] Because the detected temperature partial pressure value changes continuously with the temperature of the space under test during the application process, the data processor needs to frequently query the current humidity data during the table lookup process, resulting in continuous fluctuations in the current relative humidity data of the space under test. Therefore, several temperature sample data with adjacent values can be considered as an interval. When the temperature change of the space under test is detected to be within a certain interval, the current relative humidity data output by the data processor will not jump, making the current relative humidity data more stable.
[0128] Therefore, in this embodiment, determining the first-level index value of the basic array based on temperature sample data includes:
[0129] Divide N temperature sample data points that are adjacent in value into a temperature data interval, resulting in multiple temperature data intervals, where N is a natural number less than 4.
[0130] In this embodiment, N is set to 3, that is, three temperature sample data with adjacent values in the multiple temperature sample data are divided into a temperature data interval. For example, as shown in Table 1, the three data with temperature sample data of 5, 6 and 7 are used as a temperature data interval. By analogy, multiple temperature data intervals covering more temperature sample data are obtained. Since the change in humidity voltage relationship between each adjacent temperature sample data of multiple temperature sample data is small, the error can still be ≤1% without losing accuracy.
[0131] Multiple temperature data intervals are sequentially labeled to obtain multiple temperature data intervals with numerical labels, and the numerical labels are determined as the first-level index values of the basic array.
[0132] To facilitate table lookup by the data processor, the corresponding temperature data ranges can be labeled. This allows the data processor to determine the corresponding temperature data range based on the measured current temperature data, obtain the numerical label corresponding to the temperature data range, and thus determine the primary index value.
[0133] 302. Determine the secondary index value of the basic array based on the humidity sample data.
[0134] The secondary index value of the basic array can be any one of the temperature sample data, humidity sample data, or humidity sample partial pressure data. In this embodiment, the secondary index value of the basic array is determined based on the humidity sample data.
[0135] Specifically, since the primary index value corresponds to the temperature data range, based on the correspondence between humidity sample data and temperature sample data in the three-dimensional surface, the temperature data range is composed of three adjacent temperature sample data. This temperature data range corresponds to three humidity sample data with the same or different values in the three-dimensional surface. In order to facilitate the use of the basic array, in this embodiment, the average value of the three humidity sample data corresponding to the temperature data range is calculated, and the average value of the three humidity sample data is used as the secondary index value of the basic array.
[0136] Therefore, based on the humidity sample data, the secondary index values of the basic array are determined, including:
[0137] Based on the temperature data range, determine the N humidity samples corresponding to the N temperature samples within the temperature data range.
[0138] In this embodiment, the temperature data range consists of 3 temperature sample data points, which corresponds to 3 humidity sample data points. For example, if the temperature data range is 5–7°C, and the measured humidity sample partial pressure data is 3.51V within that range, then the corresponding 3 humidity sample data points are 87%RH, 86%RH, and 85%RH.
[0139] The average value of N humidity samples is calculated to obtain the average humidity sample data, and the average humidity sample data is used to determine the secondary index value of the base array.
[0140] In this embodiment, if the temperature data range is 5–7°C, and the corresponding three humidity sample data are 87%RH, 86%RH, and 85%RH, the average of these three humidity sample data is calculated. The resulting average humidity sample data is 86%RH. This average humidity sample data with a value of 86%RH is then used as the secondary index value of the base array. Therefore, during application, when the detected current temperature data falls within a certain temperature range, the average humidity sample data can be obtained directly by looking up the table, thus deriving the current relative humidity data corresponding to the current temperature data. This prevents frequent switching of ranges and table lookups due to temperature changes, ensuring a more stable current relative humidity data.
[0141] 303. Based on the partial pressure data of the humidity samples, determine the array values of the basic array, and use the two-dimensional array composed of multiple basic arrays as a humidity reference table.
[0142] The array value of the basic array can be any one of the temperature sample data, humidity sample data, or humidity sample partial pressure data. In this embodiment, the array value of the basic array is determined based on the humidity sample partial pressure data.
[0143] Table 2 Humidity Comparison Table (Temperature-Humidity-Voltage Values)
[0144]
[0145] After using the numerical labels corresponding to the temperature data range as the first-level index values of the basic array, and the average humidity sample data corresponding to the temperature data range as the second-level index values of the basic array, the humidity sample partial pressure data that commonly corresponds to the temperature data range and the average humidity sample data is determined. This humidity sample partial pressure data is then used as the array value of the basic array. Finally, the resulting two-dimensional array composed of multiple basic arrays serves as the humidity lookup table. For example, the humidity lookup table can be as shown in Table 2, or obtained as follows: Figure 7 The comparison charts and table content shown are adjusted based on the actual test data, and no specific limitations are made here.
[0146] In some embodiments of this application, such as Figure 8As shown, based on a preset humidity lookup table, the current temperature data and humidity partial pressure value are used as input to look up the table and obtain the current relative humidity data of the space to be measured, including the following steps 401 to 403:
[0147] 401. Based on the current temperature data, determine the temperature data range in the humidity reference table that corresponds to the current temperature data.
[0148] After acquiring the current temperature data, the data processor determines the temperature data range based on the current temperature data. For example, if the acquired current temperature data is 5°C, then the temperature data range is determined to be 5–7°C.
[0149] 402. Based on the temperature data range, determine the current first-level index value corresponding to the temperature data range.
[0150] The corresponding numerical label is determined based on the temperature data range, which determines the current first-level index value to be used as the query condition.
[0151] 403. Based on the humidity partial pressure value and the current primary index value, determine the current secondary index value, and use the current secondary index value as the current relative humidity data in the space to be measured.
[0152] This means that the resistance value of the humidity sensor RH changes under different ambient temperatures, causing the voltage value across the first voltage divider resistor RS to change synchronously, i.e., the humidity voltage value also changes synchronously. Under the current temperature data environment, the humidity voltage value obtained by the data processor is the array value used as the query condition. By looking up the table based on the determined primary index value and the determined array value, the current secondary index value under the current temperature data environment can be determined, i.e., the current relative humidity data in the space to be measured can be determined.
[0153] In some embodiments of this application, such as Figure 9 As shown, obtaining the temperature partial pressure value of the temperature detection module and the humidity partial pressure value of the humidity detection module includes the following steps 501-502:
[0154] 501. Receive and acquire trigger signals within the preset time period.
[0155] Within a preset time period, the data processor generates a trigger signal once. The time period can be set by the user, for example, it can be set to generate a trigger signal once every 60 milliseconds.
[0156] 502. Based on the trigger signal, obtain the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module.
[0157] After receiving the trigger signal, the temperature detection module and the humidity detection module detect the voltage value at the AD port of the data processor, thereby obtaining the temperature voltage division value of the temperature detection module and the humidity voltage division value of the humidity detection module, realizing the automatic acquisition of the temperature voltage division value and the humidity voltage division value by the data processor.
[0158] In some embodiments of this application, to better implement the humidity detection method in the embodiments of this application, a humidity detection device is also provided based on the humidity detection method, such as... Figure 10 As shown, the humidity detection device 600 includes:
[0159] The humidity detection device includes a humidity detection module 601 and a temperature detection module 602, and also includes a data processor 603, wherein the data processor 603 specifically includes:
[0160] The acquisition module 604 is used to acquire the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module;
[0161] The conversion module 605 is used to determine the current temperature data in the space to be measured based on the temperature partial pressure value;
[0162] The determination module 606 is used to look up the current relative humidity data in the space to be measured by taking the current temperature data and humidity partial pressure value as input based on a preset humidity lookup table.
[0163] The humidity detection device also includes a data integration module, which specifically comprises:
[0164] Used to acquire multiple temperature sample data, multiple temperature sample partial pressure data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data corresponding to the multiple humidity sample data of the space under test;
[0165] This is used to integrate multiple temperature sample data, multiple temperature sample partial pressure data, multiple humidity sample data, and multiple humidity sample partial pressure data to obtain a humidity comparison table.
[0166] The data integration module also specifically includes:
[0167] It is used to plot points on a two-dimensional temperature coordinate system based on the relationship between multiple temperature sample data and multiple temperature sample partial pressure data, and obtain a two-dimensional temperature curve.
[0168] This is used to plot points on a two-dimensional humidity coordinate system based on the relationship between multiple humidity sample data and multiple humidity sample partial pressure data, thus obtaining a two-dimensional humidity curve.
[0169] It is used to integrate two-dimensional temperature curves and two-dimensional humidity curves to obtain a three-dimensional surface.
[0170] The data integration module also specifically includes:
[0171] Used to convert a three-dimensional surface into a two-dimensional array, which consists of multiple array elements composed of basic arrays;
[0172] Used to display a two-dimensional array as a humidity reference table.
[0173] The data integration module also specifically includes:
[0174] Used to determine the first-level index value of the basic array based on temperature sample data;
[0175] Used to determine the secondary index value of the base array based on humidity sample data;
[0176] Used to determine the array values of the base array based on the partial pressure data of the humidity sample.
[0177] Used to create a two-dimensional array of multiple basic arrays as a humidity reference table.
[0178] The data integration module also specifically includes:
[0179] This is used to divide N temperature sample data with adjacent values into a temperature data interval, resulting in multiple temperature data intervals, where N is a natural number less than 4.
[0180] This is used to sequentially label multiple temperature data ranges to obtain multiple temperature data ranges with numerical labels.
[0181] Used to determine the first-level index value of the numerical label in the base array.
[0182] The data integration module also specifically includes:
[0183] Used to determine N humidity samples corresponding to N temperature samples within a temperature data range;
[0184] This is used to calculate the average value of N humidity samples to obtain the average humidity sample data.
[0185] Used to determine the secondary index value of the base array for the average data of humidity samples.
[0186] Module 606 is specifically defined as follows:
[0187] Used to determine the temperature data range in the humidity table that corresponds to the current temperature data, based on the current temperature data;
[0188] Used to determine the current first-level index value corresponding to the temperature data range based on the temperature data range;
[0189] Used to determine the current secondary index value based on the humidity partial pressure value and the current primary index value;
[0190] Used to take the current secondary index value as the current relative humidity data in the space to be measured.
[0191] The specific details of module 604 are as follows:
[0192] Used to receive and acquire trigger signals within a preset time period;
[0193] This is used to obtain the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module based on the trigger signal.
[0194] In another embodiment of this application, such as Figure 11 As shown, this application also provides an electronic device 700, which illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application. Specifically:
[0195] The electronic device may include components such as a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will understand that... Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0196] The processor 701 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 702, and by calling data stored in the memory 702, thereby providing overall monitoring of the electronic device. Optionally, the processor 701 may include one or more processing cores; the processor 701 may be a Central Processing Unit (CPU), or 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. The general-purpose processor may be a microprocessor or any conventional processor. Preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may not be integrated into the processor 701.
[0197] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the electronic device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
[0198] The electronic device also includes a power supply 703 that supplies power to the various components. Preferably, the power supply 703 is logically connected to the processor 701 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0199] The electronic device may also include an input unit 704, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0200] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 701 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 702 according to the following instructions, and the processor 701 runs the applications stored in the memory 702 to realize various functions, as follows:
[0201] Obtain the temperature partial pressure value from the temperature detection module and the humidity partial pressure value from the humidity detection module;
[0202] Determine the current temperature data within the space to be measured based on the temperature partial pressure value;
[0203] Based on a preset humidity lookup table, the current temperature data and humidity partial pressure value are used as inputs to look up the table and obtain the current relative humidity data of the space to be measured.
[0204] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0205] In some embodiments of this application, a computer-readable storage medium is also provided. This storage medium may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the humidity detection method provided in the embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:
[0206] Obtain the temperature partial pressure value from the temperature detection module and the humidity partial pressure value from the humidity detection module;
[0207] Determine the current temperature data within the space to be measured based on the temperature partial pressure value;
[0208] Based on a preset humidity lookup table, the current temperature data and humidity partial pressure value are used as inputs to look up the table and obtain the current relative humidity data of the space to be measured.
[0209] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0210] The above provides a detailed description of a humidity detection method, apparatus, electronic device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A humidity detection method, characterized in that, Humidity is detected by a humidity detection device installed in the space to be tested, the humidity detection device including a humidity detection module and a temperature detection module, and the humidity detection method includes: Obtain the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module; The current temperature data within the space to be measured is determined based on the temperature partial pressure value. Based on a preset humidity lookup table, the current temperature data and the humidity partial pressure value are used as inputs to look up the table and obtain the current relative humidity data in the space to be measured. Before obtaining the temperature partial pressure value of the temperature detection module and the humidity partial pressure value of the humidity detection module, the method includes: Acquire multiple temperature sample data, multiple temperature sample partial pressure data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data corresponding to the multiple humidity sample data of the space to be tested; Based on the relationship between the multiple temperature sample data and the multiple temperature sample partial pressure data, points are plotted on a two-dimensional temperature coordinate to obtain a two-dimensional temperature curve; Based on the relationship between the multiple humidity sample data and the multiple humidity sample partial pressure data, points are plotted on the two-dimensional humidity coordinate to obtain a two-dimensional humidity curve; The two-dimensional temperature curve and the two-dimensional humidity curve are integrated to obtain a three-dimensional surface; wherein, the three-dimensional surface covers all humidity points that the humidity detection module can detect at a specified temperature; the data of the three-dimensional surface includes multiple corresponding temperature sample data, multiple humidity sample data, and multiple humidity sample pressure data. The three-dimensional surface is converted into a two-dimensional array, which includes multiple array elements composed of basic arrays; The two-dimensional array is used as the humidity reference table.
2. The humidity detection method as described in claim 1, characterized in that, The process of converting the three-dimensional surface into a two-dimensional array, wherein the two-dimensional array comprises multiple array elements composed of basic arrays, including: Based on the temperature sample data, determine the first-level index value of the basic array; Based on the humidity sample data, determine the secondary index value of the basic array; Based on the humidity sample partial pressure data, determine the array values of the basic array; A two-dimensional array composed of multiple basic arrays is used as the humidity reference table.
3. The humidity detection method as described in claim 2, characterized in that, Determining the first-level index value of the basic array based on the temperature sample data includes: The multiple temperature sample data are divided into N temperature data intervals with adjacent numerical values, resulting in multiple temperature data intervals, where N is a natural number less than 4. The multiple temperature data intervals are sequentially labeled to obtain multiple temperature data intervals with numerical labels; The numerical label is determined to be the first-level index value of the basic array.
4. The humidity detection method as described in claim 3, characterized in that, Determining the secondary index value of the basic array based on the humidity sample data includes: Based on the temperature data range, determine N humidity sample data corresponding to N temperature sample data in the temperature data range; The average value of the N humidity sample data is calculated to obtain the average humidity sample data. The average data of the humidity sample is determined as the secondary index value of the basic array.
5. The humidity detection method as described in claim 2, characterized in that, Based on a preset humidity lookup table, the current temperature data and the humidity partial pressure value are used as inputs to look up the table and obtain the current relative humidity data in the space to be measured, including: Based on the current temperature data, determine the temperature data range corresponding to the current temperature data in the humidity lookup table; Based on the temperature data range, determine the current first-level index value corresponding to the temperature data range; The current secondary index value is determined based on the humidity partial pressure value and the current primary index value; The current secondary index value is used as the current relative humidity data within the space to be measured.
6. The humidity detection method as described in claim 1, characterized in that, The process of obtaining the temperature partial pressure value of the temperature detection module and the humidity partial pressure value of the humidity detection module includes... Within a preset time period, receive and acquire trigger signals; Based on the trigger signal, the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module are acquired once.
7. A humidity detection device, characterized in that, The humidity detection device includes a humidity detection module and a temperature detection module; The acquisition module is used to acquire the temperature pressure value of the temperature detection module and the humidity pressure value of the humidity detection module; The conversion module is used to determine the current temperature data in the space to be measured based on the temperature partial pressure value; The determination module is used to look up the current relative humidity data in the space to be measured by taking the current temperature data and the humidity partial pressure value as inputs based on a preset humidity lookup table. The humidity detection device also includes a data integration module, which is used for: Acquire multiple temperature sample data, multiple temperature sample partial pressure data corresponding to the temperature sample data, multiple humidity sample data, and multiple humidity sample partial pressure data corresponding to the multiple humidity sample data of the space to be tested; Based on the relationship between multiple temperature sample data and multiple temperature sample partial pressure data, points are plotted on a two-dimensional temperature coordinate to obtain a two-dimensional temperature curve. Based on the relationship between multiple humidity sample data and multiple humidity sample partial pressure data, points are plotted on a two-dimensional humidity coordinate system to obtain a two-dimensional humidity curve. The two-dimensional temperature curve and the two-dimensional humidity curve are integrated to obtain a three-dimensional surface; wherein, the three-dimensional surface covers all humidity points that the humidity detection module can detect at a specified temperature; the data of the three-dimensional surface includes multiple corresponding temperature sample data, multiple humidity sample data, and multiple humidity sample pressure data. The three-dimensional surface is converted into a two-dimensional array, which includes multiple array elements composed of basic arrays; The two-dimensional array is used as the humidity reference table.
8. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the humidity detection method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps of the humidity detection method according to any one of claims 1 to 6.