Model training method, hydrogen sensor correction method, device, equipment and medium

By training a neural network model to predict the reference resistance of the hydrogen sensor and automatically correct the hydrogen sensor, the problem that the accuracy of the hydrogen sensor is affected by environmental factors is solved, and the calibration efficiency and measurement accuracy are improved.

CN119691453AActive Publication Date: 2025-03-25SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411869142.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-25
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

In the prior art, the accuracy of the hydrogen sensor is affected by environmental factors such as temperature and humidity, resulting in low calibration efficiency, and it is impossible to effectively solve the safety and reliability problems caused by hydrogen accumulation in lithium battery energy storage systems.

Method used

By obtaining multiple training samples, including ambient temperature, humidity and resistance data of hydrogen sensors under different environmental conditions, a clustering algorithm is used to identify abnormal and normal samples, construct training samples, train a fully connected multi-layer feedforward neural network model, predict the reference resistance of the hydrogen sensor, and thus automatically correct the hydrogen sensor.

Benefits of technology

It improves the calibration efficiency of hydrogen sensors, reduces manual intervention, enhances the measurement accuracy and reliability of hydrogen sensors, and can effectively deal with the influence of environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691453A_ABST
    Figure CN119691453A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, a hydrogen sensor correction method and device, equipment and a medium. The method comprises the steps that a plurality of first training samples are obtained, and each first training sample comprises a first environment temperature, a first environment humidity and first resistance measured by a first hydrogen sensor at the first environment temperature and the first environment humidity, and a reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity; the multiple first training samples are adopted to train a basic model to obtain a target model, the target model is used for predicting the reference resistance of the hydrogen sensor to be corrected, the target model is obtained through training of the basic model, the hydrogen sensor is corrected through the target model, manual correction is not needed, and the correction efficiency is improved. And the correction efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of sensor technology, and in particular relates to a model training method, a hydrogen sensor calibration method, a device, equipment and a medium. Background Art

[0002] In lithium battery energy storage systems, electrolyte decomposition failure will produce hydrogen. The accumulation of hydrogen inside the battery will cause the internal pressure to increase, leading to battery expansion, thermal runaway and other problems, seriously affecting the safety and reliability of the battery. Therefore, a hydrogen sensor is installed in the lithium battery energy storage system to monitor the hydrogen concentration of the lithium battery energy storage system.

[0003] Due to environmental factors such as temperature and humidity, the accuracy of hydrogen sensors will decrease. The calibration of hydrogen sensors is an important maintenance task. Currently, hydrogen sensors are usually calibrated manually using calibration equipment in a specific calibration environment, and the manual calibration method is inefficient. Summary of the invention

[0004] The embodiments of the present application provide a model training method, a hydrogen sensor calibration method, an apparatus, a device and a medium, which are intended to improve the calibration efficiency of hydrogen sensors.

[0005] In a first aspect, an embodiment of the present application provides a model training method, the method comprising:

[0006] Acquire a plurality of first training samples, each of the first training samples comprising 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;

[0007] A plurality of the first training samples are used to train a basic model to obtain a target model, and the target model is used to predict a reference resistance of a hydrogen sensor to be calibrated.

[0008] In one example, before acquiring a plurality of first training samples, the method further includes:

[0009] Sampling the resistance of a plurality of first hydrogen sensors at different ambient temperatures and different ambient humidity to obtain a plurality of historical samples corresponding to each of the first hydrogen sensors, wherein each historical sample corresponding to the first hydrogen sensor includes an ambient temperature, an ambient humidity, and a resistance measured by the first hydrogen sensor at the ambient temperature and the ambient humidity;

[0010] For each of the multiple historical samples corresponding to the first hydrogen sensor, the following processing is performed:

[0011] Performing anomaly identification 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 multiple abnormal samples and the multiple normal samples.

[0013] In one example, constructing the first training sample according to the multiple abnormal samples and the multiple normal samples includes:

[0014] For each abnormal sample, the following processing is performed:

[0015] Acquire the ambient temperature and ambient humidity of the abnormal sample;

[0016] 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, 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.

[0017] In one example, performing abnormality identification on the plurality of historical samples to obtain a plurality of abnormal samples and a plurality of normal samples includes:

[0018] Configuring the number of clusters of the clustering algorithm according to a preset number, and setting an initial center point for each cluster;

[0019] Taking the initial center point of each cluster as the target center point of each cluster;

[0020] For each of the historical samples, respectively calculating a first distance between the historical sample and a target center point of each of the clusters;

[0021] Determine the cluster to which the historical sample belongs according to the plurality of first distances;

[0022] Calculate the first center point of each cluster according to the mean of the historical samples contained in each cluster;

[0023] Taking each of the first center points as the target center point of the corresponding cluster, and executing the step of respectively calculating the first distance between the historical sample and the target center point of each cluster for each of the historical samples, until an iteration stop condition is met;

[0024] The historical samples in the first cluster are taken as the abnormal samples, and the historical samples in the second cluster are taken as the normal samples. The first cluster is the cluster including the least number of historical samples among all clusters, and the second cluster is the cluster among all clusters except the first cluster.

[0025] In one example, after the base model is trained using the plurality of the first training samples to obtain the target model, the method further includes:

[0026] Acquire a second ambient temperature, a second ambient humidity, and a second resistance measured by the first hydrogen sensor at 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 resistor;

[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 the preset accuracy value, it is determined that the target model meets the prediction requirements.

[0031] In one example, estimating a first hydrogen concentration of the first hydrogen sensor according to the first reference resistor includes:

[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 base resistance to obtain a first value;

[0034] Calculating the first value to the nth power to obtain a second value, where n is the second preset calibration constant;

[0035] The second value is multiplied by a first preset calibration constant to obtain an estimated first hydrogen concentration.

[0036] In a second aspect, an embodiment of the present application provides a hydrogen sensor calibration method, the method comprising:

[0037] Acquire the current ambient temperature, the current ambient humidity, and the measured resistance of the hydrogen sensor to be calibrated measured at the current ambient temperature and the current ambient humidity;

[0038] Inputting the current ambient temperature, the current ambient humidity and the measured resistance into a target model to obtain a 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] In a third aspect, an embodiment of the present application provides a model training device, the device comprising:

[0041] A first acquisition module is used to acquire a plurality of first training samples, each of which 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 basic model using the plurality of the first training samples to obtain a target model, wherein the target model is used to predict the reference resistance of the hydrogen sensor to be calibrated.

[0043] In a fourth aspect, an embodiment of the present application provides a hydrogen sensor calibration device, the device comprising:

[0044] A 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] A prediction module, used for inputting the current ambient temperature, the current ambient humidity and the resistance into a target model to obtain a target resistance, wherein the target model is obtained by the model training method described in the first aspect;

[0046] The calibration module is used to calibrate the resistance of the hydrogen sensor to be calibrated by using the target resistance.

[0047] In a fifth aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;

[0048] When the processor executes the 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, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the model training method described in the first aspect or the hydrogen sensor calibration method described in the second aspect is implemented.

[0050] In the seventh aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the model training method described in the first aspect or the hydrogen sensor calibration method described in the second aspect.

[0051] The model training method, hydrogen sensor calibration method, device, equipment and medium of the embodiments of the present application obtain multiple first training samples, use the first training samples to train the basic model, and 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. No manual calibration is required, which can effectively improve the calibration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0053] Figure 1 It is a flowchart of the model training method provided in the embodiment of the present application;

[0054] Figure 2 It is a flow chart of a hydrogen sensor calibration method provided in an embodiment of the present application;

[0055] Figure 3 It is a schematic diagram of the detection system architecture provided in an embodiment of the present application;

[0056] Figure 4 is another flow chart of the model training method provided in the embodiment of the present application;

[0057] Figure 5 is a schematic diagram comparing the accuracy of the hydrogen sensor provided in the embodiment of the present application before and after calibration;

[0058] Figure 6 It is a structural schematic diagram of a model training device provided in an embodiment of the present application;

[0059] Figure 7 It is a structural schematic diagram of a hydrogen sensor calibration device provided in an embodiment of the present application;

[0060] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0062] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0063] In order to solve the technical problems in the related art, the embodiments of the present application provide a model training method, a hydrogen sensor calibration method, a device, a equipment and a medium. The model training method provided by the embodiments of the present application is first introduced below.

[0064] Figure 1 is a flow chart of the model training method provided in the embodiment of the present application. The model training method of the present application can be applied to electronic devices. Figure 1 As shown, the model training method provided in the embodiment of the present application includes the following steps 101 to 102, wherein:

[0065] Step 101, obtaining a plurality of first training samples, each of which 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, by sampling the resistance of multiple sensors at different ambient temperatures and different ambient humidity, multiple historical samples are obtained, a first training sample is constructed according to the historical samples, and multiple first training samples are obtained, wherein each training sample includes the first ambient temperature, the first ambient humidity, the first resistance measured by the first hydrogen sensor at the first ambient temperature and the first ambient humidity, and the reference resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity.

[0067] Step 102 : using a plurality of first training samples to train a basic model to obtain a target model, wherein the target model is used to predict a reference resistance of a hydrogen sensor to be calibrated.

[0068] In this embodiment, the first training sample is used to train the basic model, wherein the basic model can be obtained by training the basic model to obtain a target model, wherein the basic model can adopt a fully connected multi-layer feedforward neural network model, which is composed 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, ambient humidity and resistance measured at the ambient temperature and ambient humidity of the hydrogen sensor to be calibrated are input into the target network to obtain a resistance, and the resistance is sampled to calibrate the hydrogen sensor to be calibrated.

[0069] In this embodiment, multiple first training samples are obtained, and the first training samples are used 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. No manual calibration is required, which can effectively improve the calibration efficiency.

[0070] In one example, before step 101, the method further includes:

[0071] Sampling the resistance of a plurality of first hydrogen sensors at different ambient temperatures and different ambient humidity to obtain a plurality of historical samples corresponding to each first hydrogen sensor, wherein each historical sample corresponding to the first hydrogen sensor includes the ambient temperature, the ambient humidity, and the resistance measured by the first hydrogen sensor at the ambient temperature and the ambient humidity;

[0072] For each of the multiple historical samples corresponding to the first hydrogen sensor, the following processing is performed:

[0073] Perform anomaly identification on multiple historical samples to obtain multiple abnormal samples and multiple normal samples;

[0074] A first training sample is constructed according to a plurality of abnormal samples and a plurality of normal samples.

[0075] Connect multiple first hydrogen sensors to multiple batteries for sampling. Specifically, select sampling positions, open sampling holes at the sampling positions of each battery, and the depth of the sampling holes is 1-2 mm. Install gas sampling pipes on the sampling holes, fill the gaps between the sampling pipes and the sampling holes with sealing materials, and connect the sampling pipes to the first hydrogen sensors.

[0076] The resistances of the plurality of first hydrogen sensors at different ambient temperatures and different ambient humidity are sampled to obtain a plurality of historical samples corresponding to each first hydrogen sensor, wherein each historical sample corresponding to the first hydrogen sensor includes the ambient temperature, the ambient humidity, and the resistance of the hydrogen sensor measured at the ambient temperature and the ambient humidity, wherein the resistance is obtained by measuring the voltage. Specifically, the supply voltage of the first hydrogen sensor, the output voltage of the first hydrogen sensor, and the load resistance are substituted into formula (1) to obtain the resistance of the hydrogen sensor, which is as follows:

[0077]

[0078] Among them, V cc is the supply voltage of the first hydrogen sensor, V RL is the output voltage of the first hydrogen sensor, R L is the load resistance.

[0079] For each of the multiple historical samples corresponding to the first hydrogen sensor, the following processing is performed: abnormality identification is performed on the multiple historical samples to obtain multiple abnormal samples and multiple normal samples. Further, a first training sample is constructed based on the multiple abnormal samples and multiple normal samples.

[0080] It should be noted that the multiple first hydrogen sensors can be sensors of the same model, and the target model is suitable for calibrating the above-mentioned model of hydrogen sensors; if it is necessary to obtain a target model suitable for multiple different types, then when sampling, multiple historical samples of hydrogen sensors with multiple different signals are collected, and when training the target model, the model information of the sensor is carried in the historical samples so that the target model outputs the reference resistance corresponding to the model.

[0081] By identifying abnormal samples and normal samples, multiple training samples are constructed. The number of samples has a significant impact on the performance of the neural network. Abundant samples usually mean stronger generalization ability and faster convergence speed, which can improve the accuracy and robustness of the model.

[0082] In one example, constructing a first training sample according to a plurality of abnormal samples and a plurality of normal samples includes:

[0083] For each abnormal sample, perform the following processing:

[0084] Obtain the ambient temperature and ambient humidity of abnormal samples;

[0085] 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, 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 ambient humidity in the abnormal sample are obtained. Whether the target sample can be obtained from multiple normal samples, the ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample, and the ambient temperature in the target sample is the same as the ambient temperature in the abnormal sample. If the target sample is obtained from multiple normal samples, a first training sample is constructed: the ambient temperature in the abnormal sample is used as the first ambient temperature in the first training sample, the ambient humidity in the abnormal sample is used as the first ambient humidity in 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.

[0087] By constructing training samples from collected real data, neural networks can be better trained.

[0088] In one example, anomaly identification is performed on multiple historical samples to obtain multiple abnormal samples and multiple normal samples, including:

[0089] The number of clusters of the clustering algorithm is configured according to a preset number, and an initial center point is set 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, the first distance between the historical sample and the target center point of each cluster is calculated respectively;

[0092] Determine the cluster to which the historical sample belongs according to the multiple first distances;

[0093] According to the mean of the historical samples contained in each cluster, the first center point of the corresponding cluster is calculated;

[0094] Taking each first center point as the target center point of the corresponding cluster, and executing the step of respectively calculating the first distance between the historical sample and the target center point of each cluster for each historical sample, until the iteration stop condition is met;

[0095] The historical samples in the first cluster are taken as abnormal samples, and the historical samples in the second cluster are taken as normal samples. The first cluster is the cluster including the least number of historical samples among all clusters, and the second cluster is the cluster except the first cluster among all clusters.

[0096] In this embodiment, the clustering algorithm is configured. Specifically, the number of clustering clusters of the clustering algorithm is configured according to a preset number. For example, the clustering cluster is set to 3, and an initial center point is set for each clustering cluster. The center point can be a pre-set reference resistor, or randomly selected from the first resistors in multiple historical samples. The initial center point of each clustering cluster is used as the target center point of each clustering cluster. For each historical sample, the first distance between the historical sample and the target center of each clustering cluster is calculated respectively. What is calculated is the first distance between the first resistor in the historical sample and the target center point of each clustering cluster. The clustering cluster to which the historical sample belongs is determined based on the multiple first distances. The clustering cluster to which the historical sample belongs is the clustering cluster closest to itself.

[0097] According to the mean of the historical samples contained in each clustering cluster, that is, the mean of the first resistance of the historical samples, the first center point of the corresponding clustering cluster is calculated, and each first center point is used as the target center point of the corresponding clustering cluster. The step of calculating the first distance between the historical sample and the target center point of each clustering cluster is performed for each historical sample until the iteration stop condition is met, wherein the iteration stop condition can be the number of iterations, such as pre-setting the number of iterations, and reaching the preset number of iterations, then the iteration stop condition is met, or the iteration condition can be that the historical samples in each clustering cluster no longer change, that is, the multiple historical samples contained in each clustering cluster obtained by two adjacent clusterings are the same, and the two adjacent clustering results are the same, then the iteration stop condition is met.

[0098] After the generation stop condition is met, the historical samples in the first cluster are taken as abnormal samples. The first cluster is the cluster with the least number of historical samples among all clusters. The historical samples in the second cluster are taken as normal samples. The second cluster is the remaining cluster among all clusters except the first cluster.

[0099] Abnormal samples and normal samples are identified from multiple historical samples through clustering algorithms for training purposes.

[0100] In one example, after a base model is trained using a plurality of first training samples to obtain a target model, the method further includes:

[0101] Acquire a second ambient temperature, a second ambient humidity, and a second resistance measured by the first hydrogen sensor at the second ambient temperature and the second ambient humidity;

[0102] Inputting the second ambient temperature, the second ambient humidity and the second resistance into the target model to obtain a first reference resistance;

[0103] estimating a first hydrogen concentration of a first hydrogen sensor according to a first reference resistor;

[0104] Determining an accuracy value of the first hydrogen sensor according to the first hydrogen concentration and the reference hydrogen concentration;

[0105] 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.

[0106] In this embodiment, the second ambient temperature, the second ambient humidity, and the second resistance measured by the first hydrogen sensor at the second ambient temperature and the second ambient humidity are obtained, wherein the resistance is obtained using formula (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, the accuracy value of the first hydrogen sensor is calculated based on the first hydrogen concentration and the reference hydrogen concentration, and whether the target model meets the prediction requirements is determined based on the accuracy value. 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 prediction effect of the model can be accurately verified so that it can be subsequently applied in actual correction work.

[0108] In one example, estimating a first hydrogen concentration of a first hydrogen sensor according to a first reference resistor includes:

[0109] Obtaining a first preset calibration constant, a second preset calibration constant, and a preset reference resistance;

[0110] Calculating a ratio of a first reference resistor to a preset base resistor to obtain a first value;

[0111] Calculating the first value to the nth power to obtain a second value, where n is a second preset calibration constant;

[0112] The second value is multiplied by a first preset calibration constant to obtain an 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, a ratio of the first reference resistor to the preset reference resistor is calculated to obtain a first value, the first value is calculated to the nth power, where n is the second preset calibration constant, to obtain a second value, and the second value is multiplied by the first preset calibration constant to obtain an estimated first hydrogen concentration. The first hydrogen concentration is calculated using formula (2):

[0114]

[0115] Among them, C H2 is the first hydrogen concentration, A is the first preset calibration constant, B is the second preset calibration constant, Rs is the first reference resistor, and R0 is the preset reference resistor.

[0116] In one example, determining the accuracy value of the first hydrogen sensor according to the first hydrogen concentration and a preset reference hydrogen concentration includes:

[0117] Calculating an absolute value of a difference between the first hydrogen concentration and a preset reference hydrogen concentration to obtain a third value;

[0118] Dividing the third value by a preset reference hydrogen concentration to obtain a fourth value;

[0119] The fourth value is subtracted 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 a third value, the third value is divided by the preset reference hydrogen concentration to obtain a fourth value, and 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 formula (3):

[0121]

[0122] Wherein, 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 is a flow chart of a hydrogen sensor calibration method provided in an embodiment of the present application. The hydrogen sensor calibration method of the present application can be applied to electronic equipment. Figure 2 As shown, the hydrogen sensor calibration method provided in the embodiment of the present application includes the following steps 201 to 203, wherein:

[0125] Step 201 , obtaining the current ambient temperature, the current ambient humidity, and the measured resistance of the hydrogen sensor to be calibrated measured under the current ambient temperature and the current ambient humidity.

[0126] In this embodiment, the current ambient temperature, the current ambient temperature, and the measured resistance of the hydrogen sensor to be calibrated measured under the current ambient temperature and the current ambient humidity are obtained, and the resistance is calculated using formula (1). The hydrogen sensor to be calibrated is the first hydrogen sensor mentioned above.

[0127] Step 202, input the current ambient temperature, the current ambient humidity and the measured resistance into a target model to obtain a target resistance, and the target model is obtained based on the above-mentioned model training method.

[0128] In this embodiment, the current ambient temperature, the current ambient humidity, and the measured resistance of the hydrogen sensor to be calibrated measured at the current ambient temperature and the current ambient humidity are input into the target model, and the reference resistance of the hydrogen sensor is predicted using the target model to obtain the target resistance.

[0129] Step 203: calibrate the resistance of the hydrogen sensor to be calibrated using the target resistance.

[0130] In this embodiment, the resistance of the hydrogen sensor to be calibrated is calibrated by using the target resistance, and the load resistance is used for calibration. By using the target resistance to calibrate the resistance of the sensor, the measurement accuracy of the hydrogen sensor can be improved, the environmental influence can be eliminated, and the hydrogen sensor measurement can be more accurate and reliable.

[0131] The following is an example of the generator training method provided in the embodiment of the present application.

[0132] like Figure 3 As shown, Figure 3 It is a schematic diagram of the detection system architecture provided in the embodiment of the present application. The detection system includes a data collection module, an unsupervised learning module, a sample processing module, and a result analysis and verification module. Among them, the data collection module is composed of a temperature and humidity sensor and a hydrogen sensor. The temperature and humidity sensor is used to measure the ambient temperature and ambient humidity, and the hydrogen sensor is used to measure the hydrogen concentration. The hydrogen sensor is connected to the battery, a sampling position is selected, and a sampling hole is opened at the sampling position of each battery. The sampling hole depth is 1-2 mm. A gas sampling pipeline is installed on the sampling hole, and a sealing material is used to fill the gap between the sampling pipeline and the sampling hole. The sampling tube is connected to the hydrogen sensor, and the hydrogen sensor is integrated with the gas collection channel of the battery.

[0133] Among them, the unsupervised learning module is composed of a K-means clustering model, which is used to identify abnormal samples and normal samples.

[0134] Among them, the sample processing module is composed of a fully connected multi-layer feedforward neural network model, and the fully connected multi-layer feedforward neural network model is trained using abnormal samples and normal samples.

[0135] Among them, the result analysis module and the verification module are used to verify the accuracy of the hydrogen sensor with resistance compensated by the neural network model (ie, the calibrated hydrogen sensor mentioned above) and the hydrogen sensor with uncompensated resistance (ie, the uncalibrated hydrogen sensor mentioned above).

[0136] The hydrogen sensor is a semiconductor gas sensor used to detect hydrogen. Its core is a heater and a metal oxide semiconductor (SnO2). When hydrogen is present, it reacts with the adsorbed oxygen on the sensor surface, changing the conductivity of the sensor, which causes the resistance of the sensor to change. The temperature and humidity sensor is arranged on the battery surface to collect temperature and humidity in real time, providing data support for the accuracy compensation of the sensor that detects the decomposition of the battery electrolyte.

[0137] As the temperature rises, the carrier concentration increases, and the concentration of carriers (electrons and holes) in the semiconductor material increases, resulting in increased conductivity. The increase in temperature causes the gas molecules to move more violently, which speeds up the reaction rate of hydrogen with the oxide on the sensor surface, thereby changing the conductivity. When the humidity increases, the water molecules in the air will compete with the hydrogen molecules for the adsorption sites on the sensor surface. This may reduce the adsorption of hydrogen molecules and reduce the reaction efficiency. The increase in humidity may cause a layer of water film to form on the sensor surface, which will increase the resistance and reduce the conductivity. The change in conductivity will directly affect the accuracy of the hydrogen sensor, and the hydrogen sensor needs to be calibrated.

[0138] Figure 4 is another flow chart of the model training method provided in the embodiment of the present application. The model training method of the present application can be applied to electronic devices. Figure 4 As shown, the model training method provided in the embodiment of the present application includes the following steps 401 to 408, wherein:

[0139] Step 401, collecting sensor data.

[0140] In this embodiment, data from the temperature and humidity sensor and the hydrogen sensor are collected.

[0141] Step 402, screening the collected sensor data to obtain data that meets standard experimental conditions.

[0142] In this embodiment, the collected data of the temperature and humidity sensor and the hydrogen sensor are screened to obtain data that meets the standard experimental conditions, that is, a plurality of first training sample data are obtained, each first training sample including a first ambient temperature, a first ambient humidity, and a first resistance measured by the 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.

[0143] Step 403, expand the dimension of the data.

[0144] In this embodiment, the first resistor is dimensionally expanded to obtain a matrix corresponding to the first resistor, and the one-dimensional data is dimensionally expanded to two-dimensional data, and the matrix is ​​used for clustering. Expanding the original three-dimensional data of the sensor can better capture the characteristics of the data for clustering and improve the recognition performance of abnormal data points of the sensor.

[0145] Step 404: Use the K-means clustering model to identify abnormal samples and normal samples.

[0146] In this embodiment, the number of clusters of the K-means clustering algorithm is configured, such as K=3, and an initial center point is set for each cluster cluster. The center point can be a matrix corresponding to a pre-set reference resistor, or randomly selected from a matrix corresponding to the first resistor in multiple historical samples; the initial center point of each cluster cluster is used as the target center point of each cluster cluster, and for each historical sample, the first distance between the historical sample and the target center of each cluster cluster is calculated respectively. The first distance calculated is the first distance between the matrix corresponding to the first resistor in the historical sample and the target center point of each cluster cluster. The cluster cluster to which the historical sample belongs is determined based on the multiple first distances, and the cluster cluster to which the historical sample belongs is the cluster cluster closest to itself.

[0147] According to the mean of the historical samples contained in each clustering cluster, that is, the mean of the matrix corresponding to the first resistance of the historical samples, the first center point of the corresponding clustering cluster is calculated, and each first center point is used as the target center point of the corresponding clustering cluster. The step of calculating the first distance between the historical sample and the target center point of each clustering cluster is performed for each historical sample until the iteration stop condition is met, wherein the iteration stop condition can be the number of iterations. For example, if the number of iterations is set in advance and the preset number of iterations is reached, the iteration stop condition is met, or the iteration condition can be that the historical samples in each clustering cluster no longer change, that is, the multiple historical samples contained in each clustering cluster obtained by two adjacent clusterings are the same, and the two adjacent clustering results are the same, then the iteration stop condition is met.

[0148] After the generation stop condition is met, the historical samples in the first cluster are taken as abnormal samples. The first cluster is the cluster with the least number of historical samples among all clusters. The historical samples in the second cluster are taken as normal samples. The second cluster is the remaining cluster among all clusters except the first cluster.

[0149] Step 405: Use abnormal samples and normal samples to train a fully connected multi-layer feedforward neural network model.

[0150] In this embodiment, the first training sample is constructed using abnormal samples and normal samples (i.e., the first training sample is constructed in the above text), and the fully connected multilayer feedforward neural network model (i.e., the basic model in the above text) is trained using multiple first training samples to obtain a target model. The neural network can learn the relationship between the first resistance measured by the first hydrogen sensor at the first ambient temperature and the first ambient humidity, the reference resistance and the base resistance of the first hydrogen sensor at the first ambient temperature and the first ambient humidity, such as learning the relationship between the ratio of the reference resistance and the base resistance, which is expressed as:

[0151]

[0152] Among them, y is the resistance ratio, Rs is the reference resistance, and Rso is the base resistance, where the base resistance value is the resistance measured by the hydrogen sensor under standard temperature and standard humidity, and the first reference resistance is the high-precision resistance maintained by the hydrogen sensor through the target model.

[0153] Step 406 , calculating the hydrogen concentration of the calibrated hydrogen sensor, and calculating 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] Calculating the hydrogen concentration of the uncalibrated hydrogen sensor: obtaining a first preset calibration constant, a second preset calibration constant and a preset reference resistor, obtaining a resistance corresponding to the first reference resistor, that is, a resistance before calibration, calculating the ratio of the resistance to the preset reference resistor to obtain a resistance ratio, calculating the resistance ratio to the nth power, where n is the second preset calibration constant, obtaining a first result, multiplying the first result by the first preset calibration constant, and obtaining the hydrogen concentration of the uncalibrated hydrogen sensor. The calculation method is similar to formula (2), and the first reference resistor in formula (2) is replaced by a resistance corresponding to the first reference resistor.

[0156] Step 407 , calculating 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 obtained result is divided by the preset reference hydrogen concentration to obtain a second result, and 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, in the same standard experimental environment, place the 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 the accuracy of the uncalibrated hydrogen sensor. The standard experimental environment is temperature: 20℃±2℃, humidity: 55%RH±5%RH, closed environment, actual hydrogen concentration is 1000ppm, and the reference resistance can be selected as 2.5 kiloohms, the reference temperature is 22℃, and the reference humidity is 57%RH.

[0159] See also Figure 5 , Figure 5 is a schematic diagram comparing the accuracy of the hydrogen sensor provided in the embodiment of the present application before and after calibration, Figure 5 The accuracy of the calibrated hydrogen sensor is compared with that of the uncalibrated hydrogen sensor. The accuracy of the uncalibrated hydrogen sensor fluctuates dramatically in different samples, ranging from 91% to 97%, indicating that its measurement results are greatly affected by environmental factors and lack stability. The accuracy of the calibrated hydrogen sensor remains at a stable level of about 97% without obvious fluctuations, indicating that the environmental impact has been successfully eliminated, making the hydrogen sensor measurement more accurate and reliable.

[0160] The model training method provided in the embodiment of the present application can be executed by a model training device. In the embodiment of the present application, the model training device executing the model training method is taken as an example to illustrate the model training device provided in the embodiment of the present application.

[0161] Figure 6 Schematic diagram of the structure of the model training device provided in the embodiment of the present application. Figure 6 As shown, the model training device of the present application includes:

[0162] The first acquisition module 601 is used to acquire multiple first training samples, each of which includes a first ambient temperature, a first ambient humidity, a first resistance measured by the 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 basic model using a plurality of first training samples to obtain a target model, and the target model is used to predict the reference resistance of the hydrogen sensor to be calibrated.

[0164] In one example, the model training device also includes: a sample processing module.

[0165] Among them, the sample processing module 603 is used to sample the resistance of multiple first hydrogen sensors at different ambient temperatures and different ambient humidity to obtain multiple historical samples corresponding to each first hydrogen sensor, and each historical sample corresponding to the first hydrogen sensor includes the ambient temperature, the ambient humidity, and the resistance measured by the first hydrogen sensor under the ambient temperature and the ambient humidity; for the multiple historical samples corresponding to each first hydrogen sensor, the following processing is performed: abnormality identification is performed on the multiple historical samples to obtain multiple abnormal samples and multiple normal samples; and a first training sample is constructed according to the multiple abnormal samples and the multiple normal samples.

[0166] In one example, the sample processing module 603 is further configured to perform the following processing on each abnormal sample:

[0167] Obtain the ambient temperature and ambient humidity of abnormal samples;

[0168] 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, 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 also used to configure the number of clustering clusters of the clustering algorithm according to a preset number, and set an initial center point for each clustering cluster; use the initial center point of each clustering cluster as the target center point of each clustering cluster; for each historical sample, calculate the first distance between the historical sample and the target center point of each clustering cluster; determine the clustering cluster to which the historical sample belongs according to multiple first distances; calculate the first center point of the corresponding clustering cluster according to the mean of the historical samples contained in each clustering cluster; use each first center point as the target center point of the corresponding clustering cluster, and execute the step of calculating the first distance between the historical sample and the target center point of each clustering cluster for each historical sample, until the iteration stop condition is met; use the historical samples in the first clustering cluster as abnormal samples, and use the historical samples in the second clustering cluster as normal samples, the first clustering cluster is the clustering cluster including the least number of historical samples among all clustering clusters, and the second clustering cluster is the clustering cluster among all clustering clusters except the first clustering cluster.

[0170] In one example, the model training device further includes: a verification module 604.

[0171] The first acquisition module 601 is also used to obtain the second ambient temperature, the second ambient humidity, and the second resistance measured by the first hydrogen sensor under the second ambient temperature and the second ambient humidity. The verification module 604 is used to input the second ambient temperature, the second ambient humidity, and the second resistance into the target model to obtain the first reference resistance; estimate the first hydrogen concentration of the first hydrogen sensor according to the first reference resistance; determine the accuracy value of the first hydrogen sensor according to the first hydrogen concentration and the reference hydrogen concentration; 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.

[0172] In one example, the model training device further includes: a computing 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 resistance; calculate the ratio of the first reference resistance to the preset reference resistance to obtain a first value; calculate the nth power of the first value 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 an estimated first hydrogen concentration.

[0174] The model training device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0175] The hydrogen sensor calibration method provided in the embodiment of the present application can be executed by a hydrogen sensor calibration device. In the embodiment of the present application, the hydrogen sensor calibration method is executed by a hydrogen sensor calibration device as an example to illustrate the hydrogen sensor calibration method provided in the embodiment of the present application.

[0176] Figure 7 Schematic diagram of the structure of the hydrogen sensor calibration device provided in the embodiment of the present application. Figure 7 As shown, the hydrogen sensor calibration device of the present application includes:

[0177] The second acquisition module 701 is used to acquire the current ambient temperature, the current ambient humidity, and the resistance of the hydrogen sensor to be calibrated measured under the current ambient temperature and the current ambient humidity.

[0178] The prediction module 702 is used to input the current ambient temperature, the current ambient humidity and the resistance into a target model to obtain a target resistance, and the target model is obtained based on the above-mentioned model training method.

[0179] The calibration module 703 is configured to calibrate the resistance of the hydrogen sensor to be calibrated by using the target resistance.

[0180] The hydrogen sensor calibration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0181] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0182] The 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), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0184] The memory 802 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 802 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 802 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 802 is a non-volatile solid-state memory.

[0185] In some embodiments, the memory 802 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) 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 an aspect of the present disclosure.

[0186] The processor 801 implements any one of the methods xx in the above embodiments by reading and executing computer program instructions stored in the memory 802.

[0187] In one example, the electronic device may further include a communication interface 808 and a bus 810. Figure 8 As shown, the processor 801, the memory 802, and the communication interface 808 are connected via a bus 810 and communicate with each other.

[0188] The communication interface 808 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0189] Bus 810 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 810 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0190] The electronic device can execute the model training method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 5 Described model training method and device.

[0191] The electronic device can execute the hydrogen sensor calibration method in the embodiment of the present application, thereby realizing the combination Figure 2 and Figure 6 A hydrogen sensor calibration method and device are described.

[0192] In addition, in combination with the model training method or hydrogen sensor calibration method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the model training method or hydrogen sensor calibration method in the above embodiment is implemented.

[0193] In combination with the model training method or hydrogen sensor calibration method in the above embodiments, an embodiment of the present application may provide a computer program product. When the instructions in the computer program product are executed by a 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 clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0195] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in 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, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0196] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. 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 embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0197] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram 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 device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. 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 can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0198] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.

Claims

1. A model training method, characterized in that: include: Acquire a plurality of first training samples, each of the first training samples comprising 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; A plurality of the first training samples are used to train a basic model to obtain a target model, and the target model is used to predict a reference resistance of a hydrogen sensor to be calibrated.

2. The method according to claim 1, characterized in that: Before acquiring a plurality of first training samples, the method further includes: Sampling the resistance of a plurality of first hydrogen sensors at different ambient temperatures and different ambient humidity to obtain a plurality of historical samples corresponding to each of the first hydrogen sensors, wherein each historical sample corresponding to the first hydrogen sensor includes an ambient temperature, an ambient humidity, and a resistance measured by the first hydrogen sensor at the ambient temperature and the ambient humidity; For each of the multiple historical samples corresponding to the first hydrogen sensor, the following processing is performed: Performing anomaly identification on the plurality of historical samples to obtain a plurality of abnormal samples and a plurality of normal samples; The first training sample is constructed according to the multiple abnormal samples and the multiple normal samples.

3. The method according to claim 2, characterized in that The step of constructing the first training sample according to the plurality of abnormal samples and the plurality of normal samples comprises: For each abnormal sample, the following processing is performed: Acquire the ambient temperature and ambient 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, 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.

4. The method according to claim 2, characterized in that: The performing abnormality identification on the plurality of historical samples to obtain a plurality of abnormal samples and a plurality of normal samples includes: Configuring the number of clusters of the clustering algorithm according to a preset number, and setting an initial center point for each cluster; Taking the initial center point of each cluster as the target center point of each cluster; For each of the historical samples, respectively calculating a first distance between the historical sample and a target center point of each of the clusters; Determine the cluster to which the historical sample belongs according to the plurality of first distances; Calculate the first center point of each cluster according to the mean of the historical samples contained in each cluster; Taking each of the first center points as the target center point of the corresponding cluster, and executing the step of respectively calculating the first distance between the historical sample and the target center point of each cluster for each of the historical samples, until an iteration stop condition is met; The historical samples in the first cluster are taken as the abnormal samples, and the historical samples in the second cluster are taken as the normal samples. The first cluster is the cluster including the least number of historical samples among all clusters, and the second cluster is the cluster among all clusters except the first cluster.

5. The method according to any one of claims 1 to 4, characterized in that After the base model is trained using the plurality of the first training samples to obtain a target model, the method further includes: Acquire a second ambient temperature, a second ambient humidity, and a second resistance measured by the first hydrogen sensor at the second ambient temperature and the second ambient humidity; Inputting the second ambient temperature, the second ambient humidity and the second resistance into the target model to obtain a first reference resistance; estimating a first hydrogen concentration of the first hydrogen sensor according to the first reference resistor; determining an accuracy value of the first hydrogen sensor according to the first hydrogen concentration and a reference hydrogen concentration; 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.

6. The method according to claim 5, characterized in that The estimating a first hydrogen concentration of the first hydrogen sensor according to the first reference resistor includes: Obtaining a first preset calibration constant, a second preset calibration constant, and a preset reference resistance; Calculating a ratio of the first reference resistance to the preset base resistance to obtain a first value; Calculating the first value to the nth power to obtain a second value, where n is the second preset calibration constant; The second value is multiplied by a first preset calibration constant to obtain an estimated first hydrogen concentration.

7. A hydrogen sensor calibration method, characterized in that: include: Acquire the current ambient temperature, the current ambient humidity, and the measured resistance of the hydrogen sensor to be calibrated measured at the current ambient temperature and the current ambient humidity; Inputting the current ambient temperature, the current ambient humidity and the measured resistance into a target model to obtain a target resistance, wherein the target model is obtained based on the model training method described in any one of claims 1 to 6; The resistance of the hydrogen sensor to be calibrated is calibrated using the target resistance.

8. A model training device, characterized in that: The device comprises: A first acquisition module is used to acquire a plurality of first training samples, each of which 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 basic model using the plurality of the first training samples to obtain a target model, wherein the target model is used to predict the reference resistance of the hydrogen sensor to be calibrated.

9. A hydrogen sensor calibration device, characterized in that: The device comprises: A 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; A prediction module, used for inputting the current ambient temperature, the current ambient humidity and the resistance into a target model to obtain a target resistance, wherein the target model is obtained based on the model training method described in any one of claims 1 to 6; The calibration module is used to calibrate the resistance of the hydrogen sensor to be calibrated by using the target resistance.

10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method according to any one of claims 1 to 7 is implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

12. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Temperature and humidity compensation method and device for gas sensor

    CN114461621A

  • Random forest-based gas type and concentration prediction method, system and device

    CN116759014A

  • Intelligent test method and system for insulation performance of motor

    CN118112415A

  • Method and sensor for detecting gas concentration based on data physical double-drive model

    CN118655187A

  • Gas sensor drift real-time correction method for time window following compensation

    CN118883655A