Model training method, hydrogen sensor correction method, device, equipment and medium
By automatically calibrating the hydrogen sensor using training samples and a neural network model, the problem of low calibration efficiency of the hydrogen sensor is solved, and efficient and accurate hydrogen sensor calibration is achieved.
Patent Information
- Application Number
- CN202411869142.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing hydrogen sensors have low calibration efficiency, are greatly affected by environmental factors, and manual calibration is inefficient.
By acquiring multiple training samples, clustering algorithms are used to identify abnormal and normal samples, training samples are constructed, and a fully connected multilayer feedforward neural network model is used to train the target model to predict the reference resistance of the hydrogen sensor and automatically calibrate the hydrogen sensor.
It improves the calibration efficiency of hydrogen sensors, reduces manual intervention, enhances the accuracy and reliability of calibration, and eliminates the influence of environmental factors.
Smart Images

Figure CN119691453B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of sensors, and particularly relates to a model training method, a hydrogen sensor correction method, a device, equipment and a medium. BACKGROUND
[0002] In a lithium battery energy storage system, hydrogen gas is generated due to electrolyte decomposition failure. Accumulation of hydrogen gas in the battery interior can cause internal pressure to rise, triggering problems such as battery swelling and thermal runaway, which seriously affect the safety and reliability of the battery. Therefore, a hydrogen sensor is arranged in the lithium battery energy storage system to monitor the hydrogen concentration of the lithium battery energy storage system.
[0003] Due to the influence of environmental factors such as temperature and humidity, the accuracy of the hydrogen sensor will decrease. Calibration of the hydrogen sensor is an important maintenance work. Currently, the hydrogen sensor is calibrated in a specific calibration environment by using a calibration device and manual calibration. The manual calibration method has low efficiency. SUMMARY
[0004] The embodiments of the application provide a model training method, a hydrogen sensor correction method, a device, equipment and a medium, aiming to improve the calibration efficiency of the hydrogen sensor.
[0005] In a first aspect, the embodiments of the application provide a model training method, which comprises the following steps.
[0006] Obtaining a plurality of first training samples, each of the first training samples comprising a first environmental temperature, a first environmental humidity, a first resistance measured by a first hydrogen sensor under the first environmental temperature and the first environmental humidity, and a reference resistance of the first hydrogen sensor under the first environmental temperature and the first environmental humidity;
[0007] Training a basic model by using the plurality of first training samples to obtain a target model, the target model being used for predicting the reference resistance of a hydrogen sensor to be corrected.
[0008] In one example, before the step of obtaining the plurality of first training samples, the method further comprises the following steps.
[0009] Sampling the resistance of a plurality of first hydrogen sensors under different environmental temperatures and different environmental humidities to obtain a plurality of historical samples corresponding to each of the first hydrogen sensors, each of the historical samples corresponding to the first hydrogen sensor comprising an environmental temperature, an environmental humidity, and a resistance measured by the first hydrogen sensor under the environmental temperature and the environmental humidity;
[0010] For each of the plurality of historical samples corresponding to the first hydrogen sensor, the following processing is performed.
[0011] abnormality identification is performed on the plurality of historical samples to obtain a plurality of abnormal samples and a plurality of normal samples;
[0012] The first training sample is constructed according to the plurality of abnormal samples and the plurality of normal samples.
[0013] In one example, the first training sample is constructed according to the plurality of abnormal samples and the plurality of normal samples, comprising:
[0014] For each of the abnormal samples, the following processing is performed:
[0015] The ambient temperature and the ambient humidity of the abnormal sample are obtained;
[0016] If a target sample is obtained from the plurality of normal samples, the ambient temperature of the abnormal sample is taken as a first ambient temperature of the first training sample, the ambient humidity of the abnormal sample is taken as a first ambient humidity of the first training sample, the resistance in the abnormal sample is taken as a first resistance of the first training sample measured under the first ambient temperature and the first ambient humidity, and the resistance in the target sample is taken as a reference resistance of the first training sample, wherein the ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample, and the ambient humidity in the target sample is the same as the ambient humidity in the abnormal sample.
[0017] In one example, the abnormality identification is performed on the plurality of historical samples to obtain a plurality of abnormal samples and a plurality of normal samples, comprising:
[0018] The number of clustering clusters of a clustering algorithm is configured according to a preset number, and an initial center point is set for each of the clustering clusters;
[0019] The initial center point of each of the clustering clusters is taken as a target center point of each of the clustering clusters;
[0020] For each of the historical samples, a first distance between the historical sample and each of the target center points of the clustering clusters is calculated respectively;
[0021] The clustering cluster to which the historical sample belongs is determined according to a plurality of the first distances;
[0022] A first center point of each of the clustering clusters is calculated according to the mean value of the historical samples contained in each of the clustering clusters;
[0023] Each of the first center points is taken as a target center point of the corresponding clustering cluster, and the step of calculating the first distance between the historical sample and each of the target center points of the clustering clusters for each of the historical samples is performed until an iteration stop condition is met;
[0024] The historical samples in a first cluster are taken as the abnormal samples, and the historical samples in a second cluster are taken as the normal samples, the first cluster being a cluster with the least number of historical samples included in all the clusters, and the second cluster being a cluster other than the first cluster among all the clusters.
[0025] In one example, after the base model is trained to obtain the target model by using the plurality of first training samples, the method further comprises:
[0026] obtaining a second ambient temperature, a second ambient humidity, and a second resistance measured by the first hydrogen sensor under the second ambient temperature and the second ambient humidity;
[0027] inputting the second ambient temperature, the second ambient humidity, and the second resistance into the target model to obtain a first reference resistance;
[0028] estimating a first hydrogen concentration of the first hydrogen sensor according to the first reference resistance;
[0029] determining an accuracy value of the first hydrogen sensor according to the first hydrogen concentration and a reference hydrogen concentration;
[0030] if the accuracy value is greater than or equal to a preset accuracy value, determining that the target model meets a prediction requirement.
[0031] In one example, the estimating the first hydrogen concentration of the first hydrogen sensor according to the first reference resistance comprises:
[0032] obtaining a first preset calibration constant, a second preset calibration constant, and a preset reference resistance;
[0033] calculating a ratio of the first reference resistance to the preset reference resistance to obtain a first value;
[0034] calculating an n-th power of the first value to obtain a second value, n being the second preset calibration constant;
[0035] multiplying the second value by the first preset calibration constant to obtain the estimated first hydrogen concentration.
[0036] In a second aspect, an embodiment of the present application provides a hydrogen sensor correction method, which comprises:
[0037] obtaining a current ambient temperature, a current ambient humidity, and a measured resistance measured by a hydrogen sensor to be corrected under the current ambient temperature and the current ambient humidity;
[0038] The current ambient temperature, current ambient humidity, and the measured resistance are input into the target model to obtain the target resistance, wherein the target model is obtained by the model training method described in the first aspect;
[0039] The resistance of the hydrogen sensor to be calibrated is calibrated using the target resistance.
[0040] Thirdly, embodiments of this application provide a model training apparatus, the apparatus comprising:
[0041] The first acquisition module is used to acquire multiple first training samples. Each first training sample includes a first ambient temperature, a first ambient humidity, a first resistance measured by a first hydrogen sensor at the first ambient temperature and the first ambient humidity, and a reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity.
[0042] The training module is used to train the base model using multiple first training samples to obtain a target model, which is used to predict the reference resistance of the hydrogen sensor to be calibrated.
[0043] Fourthly, embodiments of this application provide a hydrogen sensor calibration device, the device comprising:
[0044] The second acquisition module is used to acquire the current ambient temperature, the current ambient humidity, and the resistance measured by the hydrogen sensor to be calibrated under the current ambient temperature and the current ambient humidity.
[0045] The prediction module is used to input the current ambient temperature, current ambient humidity and the resistance into the target model to obtain the target resistance, wherein the target model is obtained by the model training method described in the first aspect;
[0046] A calibration module is used to calibrate the resistance of the hydrogen sensor to be calibrated using the target resistance.
[0047] Fifthly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions;
[0048] When the processor executes computer program instructions, it implements the model training method as described in the first aspect or the hydrogen sensor calibration method as described in the second aspect.
[0049] In a sixth aspect, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the model training method as described in the first aspect or the hydrogen sensor calibration method as described in the second aspect.
[0050] In a seventh aspect, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the model training method as described in the first aspect or the hydrogen sensor calibration method as described in the second aspect.
[0051] The model training method, hydrogen sensor calibration method, apparatus, device, and medium of this application embodiment acquire multiple first training samples, use the first training samples to train the basic model to obtain a target model, the target model is used to predict the reference resistance of the hydrogen sensor to be calibrated, the target model is obtained by training the basic model, and the hydrogen sensor is calibrated using the target model, which eliminates the need for manual calibration and can effectively improve calibration efficiency. Attached Figure Description
[0052] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a flowchart illustrating the model training method provided in the embodiments of this application;
[0054] Figure 2 This is a schematic flowchart of the hydrogen sensor calibration method provided in the embodiments of this application;
[0055] Figure 3 This is a schematic diagram of the detection system architecture provided in the embodiments of this application;
[0056] Figure 4 This is another schematic diagram of the model training method provided in the embodiments of this application;
[0057] Figure 5 This is a schematic diagram comparing the accuracy of the hydrogen sensor provided in this application before and after calibration;
[0058] Figure 6 This is a schematic diagram of the structure of the model training device provided in the embodiments of this application;
[0059] Figure 7 This is a schematic diagram of the structure of the hydrogen sensor calibration device provided in the embodiments of this application;
[0060] Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0061] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0062] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0063] To address the technical problems in related technologies, embodiments of this application provide a model training method, a hydrogen sensor calibration method, an apparatus, a device, and a medium. The model training method provided in this application embodiment will be described first below.
[0064] Figure 1 This is a schematic flowchart illustrating the model training method provided in an embodiment of this application. The model training method of this application can be applied to electronic devices. For example... Figure 1 As shown, the model training method provided in this application embodiment includes the following steps 101 to 102, wherein:
[0065] Step 101: Obtain multiple first training samples. Each first training sample includes a first ambient temperature, a first ambient humidity, a first resistance measured by a first hydrogen sensor at the first ambient temperature and the first ambient humidity, and a reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity.
[0066] In this embodiment, multiple historical samples are obtained by sampling the resistance of multiple sensors under different ambient temperatures and humidity levels. Based on the historical samples, a first training sample is constructed, and multiple first training samples are obtained. Each training sample includes a first ambient temperature, a first ambient humidity, a first resistance measured by a first hydrogen sensor under the first ambient temperature and humidity, and a reference resistance of the first hydrogen sensor under the first ambient temperature and humidity.
[0067] Step 102: The basic model is trained using multiple first training samples to obtain the target model. The target model is used to predict the reference resistance of the hydrogen sensor to be calibrated.
[0068] In this embodiment, a base model is trained using a first training sample. The base model can be used to train a target model, which can be a fully connected multilayer feedforward neural network model consisting of multiple neuron layers, including an input layer, one or more hidden layers, and an output layer. The target model is used to predict the reference resistance of the hydrogen sensor to be calibrated. Specifically, the ambient temperature, humidity, and resistance measured at these conditions are input into the target network to obtain a resistance value. This resistance is then sampled to calibrate the hydrogen sensor.
[0069] In this embodiment, multiple first training samples are obtained, and the base model is trained using the first training samples to obtain the target model. The target model is used to predict the reference resistance of the hydrogen sensor to be calibrated. By training the base model, the target model is obtained, and the hydrogen sensor is calibrated using the target model. Manual calibration is not required, which can effectively improve the calibration efficiency.
[0070] In one example, prior to step 101, the method also includes:
[0071] The resistance of multiple first hydrogen sensors is sampled under different ambient temperatures and humidity levels to obtain multiple historical samples corresponding to each first hydrogen sensor. Each historical sample corresponding to the first hydrogen sensor includes ambient temperature, ambient humidity, and the resistance measured by the first hydrogen sensor under the ambient temperature and humidity.
[0072] For each first hydrogen sensor corresponding to multiple historical samples, the following processing is performed:
[0073] Anomaly identification was performed on multiple historical samples, resulting in multiple anomalous samples and multiple normal samples.
[0074] The first training sample is constructed based on multiple abnormal samples and multiple normal samples.
[0075] Multiple first hydrogen sensors are connected to multiple batteries for sampling. Specifically, sampling locations are selected, and sampling holes are made at the sampling locations of each battery. The sampling hole depth is 1-2 mm. Gas sampling pipes are installed on the sampling holes, and the gaps between the sampling pipes and the sampling holes are filled with sealing material. The sampling pipes are then connected to the first hydrogen sensors.
[0076] The resistance of multiple first hydrogen sensors is sampled under different ambient temperatures and humidity levels to obtain multiple historical samples corresponding to each first hydrogen sensor. Each historical sample corresponding to the first hydrogen sensor includes ambient temperature, ambient humidity, and the resistance of the hydrogen sensor measured under the ambient temperature and humidity. The resistance is obtained by measuring the voltage. Specifically, the resistance of the hydrogen sensor is obtained by substituting the power supply voltage, output voltage, and load resistance of the first hydrogen sensor into equation (1), as follows:
[0077]
[0078] Among them, V cc V is the power supply voltage for the first hydrogen sensor. RL R is the output voltage of the first hydrogen sensor. L This is the load resistance.
[0079] For each first hydrogen sensor, the following processing is performed on multiple historical samples: anomaly identification is performed on the multiple historical samples to obtain multiple anomalous samples and multiple normal samples. Further, the first training sample is constructed based on the multiple anomalous samples and multiple normal samples.
[0080] It should be noted that multiple first hydrogen sensors can be sensors of the same model, and the target model is suitable for calibrating hydrogen sensors of the above model. If it is necessary to obtain a target model applicable to multiple different types, multiple historical samples of hydrogen sensors with different signals are collected during sampling. When training the target model, the sensor model information is carried in the historical samples so that the target model can output the reference resistor corresponding to the model.
[0081] By identifying abnormal and normal samples, multiple training samples are constructed. The number of samples has a significant impact on the performance of neural networks. More samples usually mean stronger generalization ability and faster convergence speed, which can improve the accuracy and robustness of the model.
[0082] In one example, the first training sample is constructed based on multiple abnormal samples and multiple normal samples, including:
[0083] For each anomalous sample, perform the following processing:
[0084] Obtain the ambient temperature and humidity of the abnormal samples;
[0085] If the target sample is obtained from multiple normal samples, the ambient temperature of the abnormal sample is used as the first ambient temperature of the first training sample, the ambient humidity of the abnormal sample is used as the first ambient humidity of the first training sample, the resistance in the abnormal sample is used as the first resistance of the first training sample measured under the first ambient temperature and the first ambient humidity, and the resistance in the target sample is used as the reference resistance of the first training sample. The ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample, and the ambient humidity in the target sample is the same as the ambient humidity in the abnormal sample.
[0086] In this embodiment, for each abnormal sample, the following processing is performed: The ambient temperature and humidity of the abnormal sample are obtained. It is determined whether a target sample can be obtained from multiple normal samples, where the ambient temperature of the target sample is the same as that of the abnormal sample. If a target sample is obtained from multiple normal samples, a first training sample is constructed: the ambient temperature of the abnormal sample is used as the first ambient temperature of the first training sample; the ambient humidity of the abnormal sample is used as the first ambient humidity of the first training sample; the resistance of the abnormal sample is used as the first resistance of the first training sample measured under the first ambient temperature and first ambient humidity; and the resistance of the target sample is used as the reference resistance of the first training sample.
[0087] By constructing training samples using collected real data, neural networks can be trained more effectively.
[0088] In one example, anomaly identification is performed on multiple historical samples, resulting in multiple anomalous samples and multiple normal samples, including:
[0089] Configure the number of clusters for the clustering algorithm according to a preset number, and set an initial centroid for each cluster.
[0090] The initial center point of each cluster is used as the target center point of each cluster;
[0091] For each historical sample, calculate the first distance between the historical sample and the target center point of each cluster.
[0092] The cluster to which the historical sample belongs is determined based on multiple first distances;
[0093] The first centroid of the corresponding cluster is calculated based on the mean of the historical samples contained in each cluster.
[0094] Each first center point is used as the target center point of the corresponding cluster. The first distance between the historical sample and the target center point of each cluster is calculated for each historical sample until the iteration stop condition is met.
[0095] Historical samples in the first cluster are considered outliers, and historical samples in the second cluster are considered normal samples. The first cluster is the cluster with the fewest historical samples among all clusters, and the second cluster is the cluster other than the first cluster.
[0096] In this embodiment, the clustering algorithm is configured. Specifically, the number of clusters in the clustering algorithm is configured according to a preset number, such as setting the number of clusters to 3, and setting an initial center point for each cluster. The center point can be a pre-set reference resistor, or it can be randomly selected from the first resistors in multiple historical samples. The initial center point of each cluster is used as the target center point of each cluster. For each historical sample, the first distance between the historical sample and the target center of each cluster is calculated. The first distance between the first resistor in the historical sample and the target center point of each cluster is calculated. The cluster to which the historical sample belongs is determined based on multiple first distances. The cluster to which the historical sample belongs is the cluster closest to itself.
[0097] Based on the mean of the historical samples contained in each cluster, i.e. the mean of the first resistance of the historical samples, the first centroid of the corresponding cluster is calculated. Each first centroid is used as the target centroid of the corresponding cluster. The step of calculating the first distance between the historical sample and the target centroid of each cluster is performed for each historical sample until the iteration stopping condition is met. The iteration stopping condition can be the number of iterations, such as a preset number of iterations. The iteration stopping condition is met when the preset number of iterations is reached. Alternatively, the iteration condition can be that the historical samples in each cluster no longer change, that is, the multiple historical samples contained in each cluster obtained by two adjacent clustering are the same, and the iteration stopping condition is met when the results of two adjacent clustering are the same.
[0098] After the generation stopping condition is met, the historical samples in the first cluster are regarded as abnormal samples. The first cluster is the cluster with the fewest historical samples among all clusters. The historical samples in the second cluster are regarded as normal samples. The second cluster is the cluster other than the first cluster among all clusters.
[0099] Abnormal and normal samples are identified from multiple historical samples using clustering algorithms for training purposes.
[0100] In one example, after training the base model using multiple first training samples to obtain the target model, the method further includes:
[0101] The second ambient temperature and the second ambient humidity are obtained, as well as the second resistance measured by the first hydrogen sensor under the second ambient temperature and the second ambient humidity.
[0102] The second ambient temperature, the second ambient humidity, and the second resistance are input into the target model to obtain the first reference resistance;
[0103] The first hydrogen concentration of the first hydrogen sensor is estimated based on the first reference resistor;
[0104] The accuracy value of the first hydrogen sensor is determined based on the first hydrogen concentration and the reference hydrogen concentration.
[0105] If the accuracy value is greater than or equal to the preset accuracy value, then the target model is determined to meet the prediction requirements.
[0106] In this embodiment, a second ambient temperature, a second ambient humidity, and a second resistance measured by a first hydrogen sensor under the second ambient temperature and second ambient humidity are obtained, wherein the resistance is obtained using equation (1). The second ambient temperature, the second ambient humidity, and the second resistance are input into the target model to obtain a first reference resistance. Further, the first hydrogen concentration of the first hydrogen sensor is estimated based on the first reference resistance, and the accuracy value of the first hydrogen sensor is calculated based on the first hydrogen concentration and the reference hydrogen concentration. Based on the accuracy value, it is determined whether the target model meets the prediction requirements. If the accuracy value is greater than or equal to the preset accuracy value, it is determined that the target model meets the prediction requirements.
[0107] By calculating the accuracy value, the predictive performance of the model can be accurately verified, so that it can be applied to actual correction work in the future.
[0108] In one example, estimating the first hydrogen concentration of the first hydrogen sensor based on the first reference resistor includes:
[0109] Obtain the first preset calibration constant, the second preset calibration constant, and the preset reference resistor;
[0110] Calculate the ratio of the first reference resistor to the preset reference resistor to obtain the first value;
[0111] Calculate the first value to the power of n to obtain the second value, where n is the second preset calibration constant;
[0112] Multiplying the second value by the first preset calibration constant yields the estimated first hydrogen concentration.
[0113] In this embodiment, a first preset calibration constant, a second preset calibration constant, and a preset reference resistor are obtained. The ratio of the first reference resistor to the preset reference resistor is calculated to obtain a first value. The first value is then raised to the power of n, where n is the second preset calibration constant, to obtain a second value. The second value is multiplied by the first preset calibration constant to obtain the estimated first hydrogen concentration. The first hydrogen concentration is calculated using equation (2):
[0114]
[0115] Among them, C H2 A is the first hydrogen concentration, B is the first preset calibration constant, Rs is the second preset calibration constant, R0 is the first reference resistor, and R0 is the preset reference resistor.
[0116] In one example, the accuracy value of the first hydrogen sensor is determined based on a first hydrogen concentration and a preset reference hydrogen concentration, including:
[0117] Calculate the absolute value of the difference between the first hydrogen concentration and the preset reference hydrogen concentration to obtain the third value;
[0118] Divide the third value by the preset baseline hydrogen concentration to obtain the fourth value;
[0119] Subtract the fourth value from 1 to obtain the accuracy value of the first hydrogen sensor.
[0120] In this embodiment, the absolute value of the difference between the first hydrogen concentration and the preset reference hydrogen concentration is calculated to obtain the third value. The third value is divided by the preset reference hydrogen concentration to obtain the fourth value. The fourth value is subtracted from 1 to obtain the accuracy value of the first hydrogen sensor. The accuracy value of the first hydrogen sensor is expressed by equation (3):
[0121]
[0122] Where A1 is the accuracy value of the first hydrogen sensor, M is the first hydrogen concentration, and T is the preset reference hydrogen concentration.
[0123] By calculating the accuracy value, the accuracy of the hydrogen sensor can be accurately evaluated.
[0124] Figure 2 This is a schematic flowchart of a hydrogen sensor calibration method provided in an embodiment of this application. The hydrogen sensor calibration method of this application can be applied to electronic devices. Figure 2 As shown, the hydrogen sensor calibration method provided in this application embodiment includes the following steps 201 to 203, wherein:
[0125] Step 201: Obtain the current ambient temperature, current ambient humidity, and the measurement resistance obtained by the hydrogen sensor to be calibrated under the current ambient temperature and current ambient humidity.
[0126] In this embodiment, the current ambient temperature, the current ambient temperature, and the measurement resistance obtained by the hydrogen sensor to be calibrated under the current ambient temperature and current ambient humidity are obtained. The resistance is calculated using equation (1). The hydrogen sensor to be calibrated is the first hydrogen sensor mentioned above.
[0127] Step 202: Input the current ambient temperature, current ambient humidity and measured resistance into the target model to obtain the target resistance. The target model is obtained based on the model training method described above.
[0128] In this embodiment, the current ambient temperature, current ambient humidity, and the measured resistance obtained by the hydrogen sensor to be calibrated under the current ambient temperature and current ambient humidity are input into the target model. The target model is used to predict the reference resistance of the hydrogen sensor to obtain the target resistance.
[0129] Step 203: Use the target resistor to calibrate the resistance of the hydrogen sensor to be calibrated.
[0130] In this embodiment, a target resistor is used to calibrate the resistance of the hydrogen sensor to be calibrated, and the calibration is performed through a load resistor. By using a target resistor to calibrate the sensor's resistance, the measurement accuracy of the hydrogen sensor can be improved, environmental influences can be eliminated, and the hydrogen sensor measurement becomes more accurate and reliable.
[0131] The generator training method provided in the embodiments of this application will be illustrated below.
[0132] like Figure 3 As shown, Figure 3 This is a schematic diagram of the detection system architecture provided in this application embodiment. The detection system includes a data collection module, an unsupervised learning module, a sample processing module, and a result analysis and verification module. The data collection module consists of a temperature and humidity sensor and a hydrogen sensor. The temperature and humidity sensor measures ambient temperature and humidity, while the hydrogen sensor measures hydrogen concentration. The hydrogen sensor is connected to a battery. Sampling locations are selected, and sampling holes with a depth of 1-2 mm are opened at each battery sampling location. A gas sampling pipe is installed on the sampling hole, and the gap between the sampling pipe and the sampling hole is filled with sealing material. The sampling pipe is then connected to the hydrogen sensor, integrating the gas collection channel of the hydrogen sensor and the battery.
[0133] The unsupervised learning module consists of a K-means clustering model, which identifies abnormal and normal samples.
[0134] The sample processing module consists of a fully connected multilayer feedforward neural network model, which is trained using both abnormal and normal samples.
[0135] The result analysis module and the verification module are used to verify the accuracy of the hydrogen sensor with compensated resistance (i.e., the corrected hydrogen sensor mentioned above) and the hydrogen sensor with uncompensated resistance (i.e., the uncorrected hydrogen sensor mentioned above).
[0136] A hydrogen sensor is a semiconductor gas sensor used to detect hydrogen. Its core components are a heater and a metal oxide semiconductor (SnO2). When hydrogen is present, it reacts with adsorbed oxygen on the sensor surface, changing the sensor's conductivity and thus its resistance. Temperature and humidity sensors are placed on the battery surface to collect temperature and humidity data in real time, providing data support for accuracy compensation of sensors detecting electrolyte decomposition.
[0137] As temperature increases, the concentration of charge carriers (electrons and holes) within the semiconductor material increases, leading to improved conductivity. Increased temperature also intensifies the movement of gas molecules, accelerating the reaction rate between hydrogen and the oxides on the sensor surface, thus altering conductivity. Increased humidity causes water molecules in the air to compete with hydrogen molecules for adsorption sites on the sensor surface. This may reduce hydrogen adsorption and decrease reaction efficiency. Increased humidity can also cause a water film to form on the sensor surface, increasing resistance and reducing conductivity. Changes in conductivity directly affect the accuracy of the hydrogen sensor, necessitating its calibration.
[0138] Figure 4 This is another schematic flowchart of the model training method provided in this application. The model training method of this application can be applied to electronic devices. Figure 4 As shown, the model training method provided in this application embodiment includes the following steps 401 to 408, wherein:
[0139] Step 401: Collect sensor data.
[0140] In this embodiment, data are collected from a temperature and humidity sensor and a hydrogen sensor.
[0141] Step 402: Filter the collected sensor data to obtain data that meets the standard experimental conditions.
[0142] In this embodiment, the collected data from the temperature and humidity sensor and the hydrogen sensor are filtered to obtain data that meets the standard experimental conditions, that is, multiple first training sample data are obtained. Each first training sample includes a first ambient temperature, a first ambient humidity, a first resistance measured by the first hydrogen sensor under the first ambient temperature and the first ambient humidity, and a reference resistance of the first hydrogen sensor under the first ambient temperature and the first ambient humidity.
[0143] Step 403: Expand the dimensions of the data.
[0144] In this embodiment, the first resistor is expanded to obtain a matrix corresponding to the first resistor, thus expanding the one-dimensional data to two-dimensional data. The matrix is then used for clustering. Expanding the original three-dimensional data of the sensor allows for better capture of data features, improving the ability to identify abnormal data points in the sensor and facilitating clustering.
[0145] Step 404: Use the K-means clustering model to identify abnormal and normal samples.
[0146] In this embodiment, the number of clusters in the K-means clustering algorithm is configured, such as K=3. An initial centroid is set for each cluster. The centroid can be a matrix corresponding to a pre-defined reference resistor, or it can be randomly selected from the matrices corresponding to the first resistors in multiple historical samples. The initial centroid of each cluster is used as the target centroid of each cluster. For each historical sample, the first distance between the historical sample and the target centroid of each cluster is calculated. The first distance is calculated between the matrix corresponding to the first resistor in the historical sample and the target centroid of each cluster. The cluster to which the historical sample belongs is determined based on multiple first distances. The cluster to which the historical sample belongs is the cluster closest to itself.
[0147] Based on the mean of the historical samples contained in each cluster, that is, the mean of the matrix corresponding to the first resistance of the historical samples, the first centroid of the corresponding cluster is calculated. Each first centroid is used as the target centroid of the corresponding cluster. The step of calculating the first distance between the historical sample and the target centroid of each cluster is performed for each historical sample until the iteration stopping condition is met. The iteration stopping condition can be the number of iterations, such as a preset number of iterations. When the preset number of iterations is reached, the iteration stopping condition is met. Alternatively, the iteration condition can be that the historical samples in each cluster no longer change, that is, the multiple historical samples contained in each cluster obtained by two adjacent clusterings are the same, and the results of two adjacent clusterings are the same, then the iteration stopping condition is met.
[0148] After the generation stopping condition is met, the historical samples in the first cluster are regarded as abnormal samples. The first cluster is the cluster with the fewest historical samples among all clusters. The historical samples in the second cluster are regarded as normal samples. The second cluster is the cluster other than the first cluster among all clusters.
[0149] Step 405: Train the fully connected multilayer feedforward neural network model using abnormal and normal samples.
[0150] In this embodiment, abnormal samples and normal samples are used to construct the first training samples (i.e., constructing the first training samples as mentioned above). Multiple first training samples are used to train the fully connected multilayer feedforward neural network model (i.e., the base model as mentioned above) to obtain the target model. The neural network can learn the relationship between the first resistance measured by the first hydrogen sensor under the first ambient temperature and the first ambient humidity, and the reference resistance and reference resistance of the first hydrogen sensor under the first ambient temperature and the first ambient humidity. For example, learning the relationship between the ratio of the reference resistance and the reference resistance can be expressed as:
[0151]
[0152] Where y is the resistance ratio, Rs is the reference resistance, and Rso is the reference resistance. The reference resistance value is the resistance measured by the hydrogen sensor under standard temperature and humidity. The first reference resistance, obtained through the target model, is the high-precision resistance maintained by the hydrogen sensor.
[0153] Step 406: Calculate the hydrogen concentration of the calibrated hydrogen sensor and the hydrogen concentration of the uncalibrated hydrogen sensor.
[0154] In this embodiment, the hydrogen concentration of the calibrated hydrogen sensor is calculated using equation (2).
[0155] Calculate the hydrogen concentration of the uncalibrated hydrogen sensor: Obtain the first preset calibration constant, the second preset calibration constant, and the preset reference resistor. Obtain the resistance corresponding to the first reference resistor, i.e., the resistance before calibration. Calculate the resistance ratio by the ratio of the first reference resistor to the preset reference resistor. Calculate the resistance ratio to the power of n, where n is the second preset calibration constant. Obtain the first result. Multiply the first result by the first preset calibration constant to obtain the hydrogen concentration of the uncalibrated hydrogen sensor. The calculation method is similar to that of equation (2), except that the first reference resistor in equation (2) is replaced with the resistor corresponding to the first reference resistor.
[0156] Step 407: Calculate the accuracy value of the calibrated hydrogen sensor and the accuracy value of the uncalibrated hydrogen sensor.
[0157] In this embodiment, the absolute value of the difference between the hydrogen concentration of the calibrated hydrogen sensor and the preset reference hydrogen concentration is calculated. The result is divided by the preset reference hydrogen concentration to obtain a second result. The second result is subtracted from 1 to obtain the accuracy value of the calibrated hydrogen sensor. The accuracy of the uncalibrated hydrogen sensor is calculated in the same way.
[0158] Alternatively, under the same standard experimental conditions, place an uncalibrated hydrogen sensor in the standard experimental environment, measure the hydrogen concentration, calibrate the uncalibrated hydrogen sensor, place the calibrated hydrogen sensor in the standard experimental environment, measure the hydrogen concentration, and compare the accuracy of the calibrated hydrogen sensor with that of the uncalibrated hydrogen sensor. The standard experimental environment is a closed environment with a temperature of 20℃±2℃ and a humidity of 55%RH±5%RH, and an actual hydrogen concentration of 1000ppm. A reference resistance of 2.5 kΩ, a reference temperature of 22℃, and a reference humidity of 57%RH can be selected.
[0159] See Figure 5 , Figure 5 This is a schematic diagram comparing the accuracy of the hydrogen sensor provided in this application before and after calibration. Figure 5 The comparison between the accuracy of a calibrated hydrogen sensor and an uncalibrated hydrogen sensor demonstrates that the accuracy of the uncalibrated hydrogen sensor fluctuated drastically across different samples, ranging from 91% to 97%, indicating that its measurement results are greatly affected by environmental factors and lack stability. In contrast, the accuracy of the calibrated hydrogen sensor remained at a stable level of approximately 97%, without significant fluctuations, indicating that environmental influences were successfully eliminated, resulting in more accurate and reliable hydrogen sensor measurements.
[0160] The model training method provided in this application can be executed by a model training device. This application uses an example of a model training device executing the model training method to illustrate the model training device provided in this application.
[0161] Figure 6 This is a schematic diagram of the structure of the model training device provided in the embodiments of this application. Figure 6 As shown, the model training device of this application includes:
[0162] The first acquisition module 601 is used to acquire multiple first training samples. Each first training sample includes a first ambient temperature, a first ambient humidity, a first resistance measured by a first hydrogen sensor at the first ambient temperature and the first ambient humidity, and a reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity.
[0163] The training module 602 is used to train the base model using multiple first training samples to obtain the target model, which is used to predict the reference resistance of the hydrogen sensor to be calibrated.
[0164] In one example, the model training apparatus also includes a sample processing module.
[0165] The sample processing module 603 is used to sample the resistance of multiple first hydrogen sensors under different ambient temperatures and humidity levels to obtain multiple historical samples corresponding to each first hydrogen sensor. Each historical sample corresponding to a first hydrogen sensor includes ambient temperature, ambient humidity, and the resistance measured by the first hydrogen sensor under the ambient temperature and humidity. For the multiple historical samples corresponding to each first hydrogen sensor, the following processing is performed: anomaly identification is performed on the multiple historical samples to obtain multiple abnormal samples and multiple normal samples; and a first training sample is constructed based on the multiple abnormal samples and multiple normal samples.
[0166] In one example, the sample processing module 603 is also configured to perform the following processing for each anomalous sample:
[0167] Obtain the ambient temperature and humidity of the abnormal samples;
[0168] If the target sample is obtained from multiple normal samples, the ambient temperature of the abnormal sample is used as the first ambient temperature of the first training sample, the ambient humidity of the abnormal sample is used as the first ambient humidity of the first training sample, the resistance in the abnormal sample is used as the first resistance of the first training sample measured under the first ambient temperature and the first ambient humidity, and the resistance in the target sample is used as the reference resistance of the first training sample. The ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample, and the ambient humidity in the target sample is the same as the ambient humidity in the abnormal sample.
[0169] In one example, the sample processing module 603 is further configured to configure the number of clusters in the clustering algorithm according to a preset number, and set an initial centroid for each cluster; use the initial centroid of each cluster as the target centroid of each cluster; calculate the first distance between the historical sample and the target centroid of each cluster for each historical sample; determine the cluster to which the historical sample belongs based on multiple first distances; calculate the first centroid of the corresponding cluster based on the mean of the historical samples contained in each cluster; use each first centroid as the target centroid of the corresponding cluster, and execute the step of calculating the first distance between the historical sample and the target centroid of each cluster for each historical sample until the iteration stopping condition is met; treat the historical samples in the first cluster as abnormal samples, and the historical samples in the second cluster as normal samples, wherein the first cluster is the cluster with the fewest historical samples among all clusters, and the second cluster is the cluster other than the first cluster among all clusters.
[0170] In one example, the model training apparatus also includes a verification module 604.
[0171] The first acquisition module 601 is further configured to acquire a second ambient temperature, a second ambient humidity, and a second resistance measured by the first hydrogen sensor under the second ambient temperature and second ambient humidity. The verification module 604 is configured to input the second ambient temperature, second ambient humidity, and second resistance into the target model to obtain a first reference resistance; estimate the first hydrogen concentration of the first hydrogen sensor based on the first reference resistance; determine the accuracy value of the first hydrogen sensor based on the first hydrogen concentration and the reference hydrogen concentration; and determine that the target model meets the prediction requirements if the accuracy value is greater than or equal to a preset accuracy value.
[0172] In one example, the model training apparatus also includes a computation module 605.
[0173] The calculation module 605 is used to obtain a first preset calibration constant, a second preset calibration constant, and a preset reference resistor; calculate the ratio of the first reference resistor to the preset reference resistor to obtain a first value; calculate the first value raised to the power of n to obtain a second value, where n is the second preset calibration constant; and multiply the second value by the first preset calibration constant to obtain the estimated first hydrogen concentration.
[0174] The model training device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0175] The hydrogen sensor calibration method provided in this application can be executed by a hydrogen sensor calibration device. This application uses an example of a hydrogen sensor calibration device executing the hydrogen sensor calibration method to illustrate the hydrogen sensor calibration device provided in this application.
[0176] Figure 7 This is a schematic diagram of the hydrogen sensor calibration device provided in an embodiment of this application. Figure 7 As shown, the hydrogen sensor calibration device of this application includes:
[0177] The second acquisition module 701 is used to acquire the current ambient temperature, the current ambient humidity, and the resistance measured by the hydrogen sensor to be calibrated under the current ambient temperature and the current ambient humidity.
[0178] The prediction module 702 is used to input the current ambient temperature, current ambient humidity and the resistance into the target model to obtain the target resistance. The target model is obtained based on the above model training method.
[0179] The calibration module 703 is used to calibrate the resistance of the hydrogen sensor to be calibrated using the target resistance.
[0180] The hydrogen sensor calibration device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0181] Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.
[0182] An electronic device may include a processor 801 and a memory 802 storing computer program instructions.
[0183] Specifically, the processor 801 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0184] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.
[0185] In some embodiments, memory 802 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.
[0186] The processor 801 implements any of the methods described in the above embodiments by reading and executing computer program instructions stored in the memory 802.
[0187] In one example, the electronic device may also include a communication interface 808 and a bus 810. Wherein, such as Figure 8 As shown, the processor 801, memory 802, and communication interface 808 are connected through bus 810 and complete communication with each other.
[0188] The communication interface 808 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0189] Bus 810 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0190] The electronic device can execute the model training method in the embodiments of this application, thereby achieving the combination Figure 1 and Figure 5 The model training method and apparatus described.
[0191] This electronic device can perform the hydrogen sensor calibration method described in the embodiments of this application, thereby achieving the combination Figure 2 and Figure 6 The hydrogen sensor calibration method and apparatus are described.
[0192] In addition, in conjunction with the model training method or hydrogen sensor calibration method in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement the model training method or hydrogen sensor calibration method in the above embodiments.
[0193] In conjunction with the model training method or hydrogen sensor calibration method in the above embodiments, this application embodiment can provide a computer program product. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device implements the model training method or hydrogen sensor calibration method in the above embodiments.
[0194] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0195] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0196] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0197] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0198] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A model training method, characterized in that, include: Multiple first training samples are obtained, each first training sample including a first ambient temperature, a first ambient humidity, a first resistance measured by a first hydrogen sensor at the first ambient temperature and the first ambient humidity, and a reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity. The base model is trained using multiple first training samples to obtain a target model, which is used to predict the reference resistance of the hydrogen sensor to be calibrated. The method further includes, prior to acquiring multiple first training samples: The resistance of multiple first hydrogen sensors is sampled under different ambient temperatures and humidity levels to obtain multiple historical samples corresponding to each first hydrogen sensor. Each historical sample corresponding to the first hydrogen sensor includes ambient temperature, ambient humidity, and the resistance measured by the first hydrogen sensor under the ambient temperature and ambient humidity. For each of the multiple historical samples corresponding to the first hydrogen sensor, the following processing is performed: Anomaly identification is performed on multiple historical samples to obtain multiple abnormal samples and multiple normal samples; The first training sample is constructed based on the plurality of abnormal samples and the plurality of normal samples; The step of constructing the first training sample based on the plurality of abnormal samples and the plurality of normal samples includes: For each of the aforementioned abnormal samples, the following processing is performed: Obtain the ambient temperature and humidity of the abnormal sample; If a target sample is obtained from multiple normal samples, the ambient temperature of the abnormal sample is used as the first ambient temperature of the first training sample, the ambient humidity of the abnormal sample is used as the first ambient humidity of the first training sample, the resistance in the abnormal sample is used as the first resistance of the first training sample measured under the first ambient temperature and the first ambient humidity, and the resistance in the target sample is used as the reference resistance of the first training sample. The ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample, and the ambient humidity in the target sample is the same as the ambient humidity in the abnormal sample.
2. The method according to claim 1, characterized in that, The process of identifying anomalies in multiple historical samples to obtain multiple anomalous samples and multiple normal samples includes: The number of clusters in the clustering algorithm is configured according to a preset number, and an initial center point is set for each cluster. The initial center point of each cluster is used as the target center point of each cluster. For each historical sample, calculate the first distance between the historical sample and the target center point of each cluster. The cluster to which the historical sample belongs is determined based on multiple first distances; The first centroid of the corresponding cluster is calculated based on the mean of the historical samples contained in each cluster. Each of the first center points is used as the target center point of the corresponding cluster. For each historical sample, the first distance between the historical sample and the target center point of each cluster is calculated until the iteration stop condition is met. Historical samples in the first cluster are considered as abnormal samples, and historical samples in the second cluster are considered as normal samples. The first cluster is the cluster with the fewest historical samples among all clusters, and the second cluster is the cluster other than the first cluster among all clusters.
3. The method according to any one of claims 1 or 2, characterized in that, After training the base model using multiple of the first training samples to obtain the target model, the method further includes: Acquire a second ambient temperature, a second ambient humidity, and a second resistance measured by a first hydrogen sensor at the second ambient temperature and the second ambient humidity; The second ambient temperature, the second ambient humidity, and the second resistance are input into the target model to obtain the first reference resistance; The first hydrogen concentration of the first hydrogen sensor is estimated based on the first reference resistor; The accuracy value of the first hydrogen sensor is determined based on the first hydrogen concentration and the reference hydrogen concentration. If the accuracy value is greater than or equal to the preset accuracy value, then the target model is determined to meet the prediction requirements.
4. The method according to claim 3, characterized in that, The step of estimating the first hydrogen concentration of the first hydrogen sensor based on the first reference resistor includes: Obtain the first preset calibration constant, the second preset calibration constant, and the preset reference resistor; Calculate the ratio of the first reference resistor to the preset reference resistor to obtain a first value; Calculate the first value to the power of n to obtain the second value, where n is the second preset calibration constant; Multiply the second value by the first preset calibration constant to obtain the estimated first hydrogen concentration.
5. A method for calibrating a hydrogen sensor, characterized in that, include: The current ambient temperature, current ambient humidity, and the measurement resistance measured by the hydrogen sensor to be calibrated at the current ambient temperature and current ambient humidity are obtained. The current ambient temperature, current ambient humidity, and the measured resistance are input into the target model to obtain the target resistance. The target model is obtained based on the model training method described in any one of claims 1 to 4. The resistance of the hydrogen sensor to be calibrated is calibrated using the target resistance.
6. A model training device, characterized in that, The device includes: The first acquisition module is used to acquire multiple first training samples. Each first training sample includes a first ambient temperature, a first ambient humidity, a first resistance measured by a first hydrogen sensor at the first ambient temperature and the first ambient humidity, and a reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity. The training module is used to train the base model using multiple first training samples to obtain a target model, which is used to predict the reference resistance of the hydrogen sensor to be calibrated. The sample processing module is used to sample the resistance of multiple first hydrogen sensors under different ambient temperatures and humidity levels to obtain multiple historical samples corresponding to each first hydrogen sensor. Each historical sample corresponding to a first hydrogen sensor includes ambient temperature, ambient humidity, and the resistance measured by the first hydrogen sensor under the ambient temperature and humidity. For the multiple historical samples corresponding to each first hydrogen sensor, the following processing is performed: anomaly identification is performed on the multiple historical samples to obtain multiple abnormal samples and multiple normal samples; the first training sample is constructed based on the multiple abnormal samples and the multiple normal samples. The sample processing module is also configured to perform the following processing for each of the abnormal samples: Obtain the ambient temperature and humidity of the abnormal sample; If a target sample is obtained from multiple normal samples, the ambient temperature of the abnormal sample is used as the first ambient temperature of the first training sample, the ambient humidity of the abnormal sample is used as the first ambient humidity of the first training sample, the resistance in the abnormal sample is used as the first resistance of the first training sample measured under the first ambient temperature and the first ambient humidity, and the resistance in the target sample is used as the reference resistance of the first training sample. The ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample, and the ambient humidity in the target sample is the same as the ambient humidity in the abnormal sample.
7. A hydrogen sensor calibration device, characterized in that, The device includes: The second acquisition module is used to acquire the current ambient temperature, the current ambient humidity, and the resistance measured by the hydrogen sensor to be calibrated under the current ambient temperature and the current ambient humidity. The prediction module is used to input the current ambient temperature, current ambient humidity and the resistance into the target model to obtain the target resistance, wherein the target model is obtained based on the model training method described in any one of claims 1 to 4; A calibration module is used to calibrate the resistance of the hydrogen sensor to be calibrated using the target resistance.
8. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the method as described in any one of claims 1-5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the method as described in any one of claims 1-5.
10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Temperature and humidity compensation method and device for gas sensor
CN114461621A