Construction method and device of control model, electronic equipment and storage medium

Through segmented analysis and model training of historical data of fuel cell stacks, SVR, CatBoost and XGBoost models are used to predict stack impedance, which solves the problem of insufficient reliability of shutdown purging tasks in the existing technology and achieves more accurate control and higher system reliability.

CN118588982APending Publication Date: 2024-09-03DONGFENG MOTOR GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410736232.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The shutdown purge tasks of existing fuel cell stacks are insufficiently reliable, difficult to accurately describe complexity and nonlinear characteristics, difficult to estimate and calibrate parameters, and lack flexibility, leading to accuracy and reliability problems.

Method used

By obtaining the historical data of the fuel cell stack, it is divided into multiple mission stages, and the impedance prediction model is trained to accurately predict the stack impedance. The prediction results are configured as input parameters of the control model, and SVR, CatBoost and XGBoost models are used to improve predictions. Accuracy.

Benefits of technology

It improves the reliability of fuel cell stack shutdown purging tasks, ensures the accuracy of stack impedance prediction, enhances the accuracy and flexibility of the control model, extends the service life of the stack, and improves energy utilization efficiency and system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118588982A
    Figure CN118588982A
Patent Text Reader

Abstract

The invention discloses a construction method and device of a control model, electronic equipment and a storage medium, and relates to the technical field of construction of control models. The construction method comprises the following steps: acquiring a historical data set of a shutdown purging task executed by a fuel cell stack, dividing the historical data set into a plurality of data subsets according to a plurality of task stages of the shutdown purging task, training an impedance prediction model of the corresponding task stage according to each data subset, and predicting the impedance of the shutdown purging task according to the impedance prediction model. The control module is used for controlling the model to execute a shutdown purging task, so that the predicted impedance output by the impedance prediction model reaches a preset target, when the predicted impedance reaches the preset target, it is indicated that the impedance prediction model can accurately predict the pile impedance, and the predicted impedance output by the impedance prediction model is configured as an input parameter for controlling the model to execute the shutdown purging task. According to the construction method, the control model can implement accurate stack impedance prediction in different task stages of the shutdown purging task, and the reliability of executing the shutdown purging task by the fuel cell stack is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of control model construction, and in particular to a control model construction method, device, electronic equipment and storage medium. Background Art

[0002] As the core component of the fuel cell system, the fuel cell stack plays an important role in the development of fuel cell technology. With the increasing attention paid to clean energy and sustainable development around the world, the development prospects of hydrogen fuel cells are very broad. However, the development of fuel cell stacks still faces some challenges. For example, technical bottlenecks, cost issues, infrastructure construction, etc. need to be further resolved.

[0003] The modeling and optimization of fuel cell stack shutdown purge are of great significance for improving the success rate of fuel cell stack startup, extending service life, improving energy efficiency, enhancing system reliability, and supporting intelligent management. The main disadvantages of existing shutdown purge methods include the difficulty in accurately describing the complexity and nonlinear characteristics of purge, the difficulty in parameter estimation and calibration, the lack of flexibility, and the possible accuracy problems, which lead to insufficient reliability of shutdown purge task execution.

[0004] Therefore, how to improve the reliability of the fuel cell stack in performing shutdown purge tasks is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The present invention provides a control model construction method, device, electronic device and storage medium, which can improve the reliability of a fuel cell stack in performing shutdown purge tasks.

[0006] The embodiment of the present invention provides the following solution:

[0007] In a first aspect, an embodiment of the present invention provides a method for constructing a control model, the method comprising:

[0008] Acquire a historical data set of a fuel cell stack executing a shutdown purge task, wherein the historical data set includes at least a plurality of groups of purge times, a purge flow rate corresponding to each group of the purge times, and a stack impedance;

[0009] According to multiple task stages of the shutdown purge task, the historical data set is divided into multiple data subsets, wherein each data subset includes the purge time, purge flow rate and stack impedance of the corresponding task stage;

[0010] The impedance prediction model of the corresponding task stage is trained according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target;

[0011] When the predicted impedance reaches a preset target, the predicted impedance output by the impedance prediction model is configured as an input parameter for the control model to perform a shutdown purge task.

[0012] In an optional embodiment, obtaining a historical data set of a fuel cell stack executing a shutdown purge task includes:

[0013] Collecting task data of shutdown purge task when the fuel cell stack is subjected to preset experiments, wherein the preset experiments at least include endurance drum test and low temperature cold start test;

[0014] Establish a storage directory based on the collected information of the task data, and store the task data in a preset target format according to the storage directory;

[0015] Configure a first characteristic tag of the purge time, a second characteristic tag of the purge flow rate, and a third characteristic tag of the stack impedance according to the target format;

[0016] Extracting the purge time, the purge flow rate and the stack impedance respectively in the storage directory according to the first feature tag, the second feature tag and the third feature tag;

[0017] The data extraction results of the purge time, purge flow rate and stack impedance are determined as a historical data set.

[0018] In an optional embodiment, before dividing the historical data set into multiple data subsets according to multiple task stages of the shutdown purge task, the method further includes:

[0019] Extracting the purge time and stack impedance of multiple shutdown purge tasks from the historical data set;

[0020] Determine the stage threshold of each task stage according to the purge time and stack impedance of multiple shutdown purge tasks;

[0021] The shutdown purge task is divided into multiple task stages according to stage thresholds.

[0022] In an optional embodiment, the stage threshold of each task stage is determined according to the purge time and stack impedance of multiple shutdown purge tasks, including:

[0023] Input the purge time and stack impedance of each shutdown purge task into the N-order difference calculation model to obtain the second-order derivative of the stack impedance with respect to the purge time in each shutdown purge task;

[0024] The purge time corresponding to the second-order derivative of each shutdown purge task is determined as the stage threshold of each task stage.

[0025] In an optional embodiment, the impedance prediction model of the corresponding task stage is trained according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target, and the method further includes:

[0026] All models in the prediction model library are trained based on the data subset of each task stage;

[0027] According to the actual impedance of the shutdown purge task and the predicted impedance output by each model after completing the training, the determination coefficient representing the prediction accuracy of each model is obtained;

[0028] The model corresponding to the maximum determination coefficient of each task stage is determined as the impedance prediction model of the task stage.

[0029] In an optional embodiment, the impedance prediction model includes an SVR model, a CatBoost model, and an XGBoost model; training the impedance prediction model of the corresponding task stage according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target, including:

[0030] Configuring a first parameter group of the SVR model, wherein the first parameter group includes a kernel function, a regularization parameter, a gamma value, and an epsilon value of the SVR model;

[0031] Training the SVR model according to the data subset of the flow channel purge stage, and adjusting the first parameter group until a first deviation of the predicted impedance output by the SVR model is less than a first preset target;

[0032] The second parameter group of the CatBoost model is configured, wherein the second parameter group includes the number of iterations, tree depth, learning rate, and loss function of the CatBoost model;

[0033] Training the CatBoost model according to the data subset of the gas diffusion layer purge phase, and adjusting the second parameter group until a second deviation of the predicted impedance output by the CatBoost model is less than a second preset target;

[0034] Configure the third parameter group of the XGBoost model, wherein the third parameter group includes the tree depth, learning rate, gamma value, and regression square error of the XGBoost model;

[0035] The XGBoost model is trained based on the data subset of the proton exchange membrane purge phase, and the third parameter group is adjusted until a third deviation of the predicted impedance output by the XGBoost model is less than a third preset target.

[0036] In an optional embodiment, the impedance prediction model includes an SVR model, a CatBoost model, and an XGBoost model; configuring the predicted impedance output by the impedance prediction model as an input parameter for the control model to perform the shutdown purge task includes:

[0037] The first predicted impedance output by the SVR model is configured as an input parameter of the control model in the flow channel purge stage;

[0038] The second predicted impedance output by the CatBoost model is configured as an input parameter of the control model in the gas diffusion layer purge stage;

[0039] The third predicted impedance output by the XGBoost model is configured as an input parameter of the control model in the proton exchange membrane purge stage.

[0040] In a second aspect, an embodiment of the present invention further provides a control model construction device, the device comprising:

[0041] An acquisition module, used to acquire a historical data set of a fuel cell stack executing a shutdown purge task, wherein the historical data set includes at least a plurality of groups of purge times, a purge flow rate corresponding to each group of the purge times, and a stack impedance;

[0042] A partitioning module is used to partition the historical data set into multiple data subsets according to multiple task stages of the shutdown purge task, wherein each data subset includes the purge time, purge flow rate and stack impedance of the corresponding task stage;

[0043] The first training module is used to train the impedance prediction model of the corresponding task stage according to each data subset, so that the predicted impedance output by the impedance prediction model reaches a preset target;

[0044] The configuration module is used to configure the predicted impedance output by the impedance prediction model as an input parameter for the control model to perform the shutdown purge task when the predicted impedance reaches a preset target.

[0045] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory is coupled to the processor and stores instructions, and when the instructions are executed by the processor, the electronic device executes the steps of any one of the methods in the first aspect.

[0046] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods in the first aspect.

[0047] Compared with the prior art, the control model construction method, device, electronic device and storage medium of the present invention have the following advantages:

[0048] The construction method, device, electronic device and storage medium of the control model of the present invention obtains the historical data set of the fuel cell stack performing the shutdown purge task, and divides the historical data set into multiple data subsets according to the multiple task stages of the shutdown purge task. Since the historical data set includes at least multiple groups of purge time, the purge flow rate and stack impedance corresponding to each group of the purge time, the impedance prediction model of the corresponding task stage can be trained according to each data subset, so that the predicted impedance output by the impedance prediction model reaches the preset target. When the predicted impedance reaches the preset target, it means that the impedance prediction model can accurately predict the stack impedance, and the predicted impedance output by the impedance prediction model is configured as the input parameter of the control model performing the shutdown purge task. The construction method enables the control model to implement accurate stack impedance prediction in different task stages of the shutdown purge task, so that the control model can accurately fit the corresponding relationship between the purge time, the purge flow rate and the stack impedance, so that the control of various parameters when the fuel cell stack performs the shutdown purge task is more accurate, thereby improving the reliability of the fuel cell stack performing the shutdown purge task. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A flow chart of a method for constructing a control model provided by an embodiment of the present invention;

[0051] Figure 2 A schematic diagram of a storage directory provided by an embodiment of the present invention;

[0052] Figure 3 A flowchart of performing nonlinear fitting on data provided by an embodiment of the present invention;

[0053] Figure 4 A schematic diagram of scatter points and fitting curves provided by an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of an impedance variation curve provided by an embodiment of the present invention;

[0055] Figure 6 A curve showing a derivative change of stack impedance with purge time provided by an embodiment of the present invention;

[0056] Figure 7 A schematic diagram of a split impedance variation curve provided by an embodiment of the present invention;

[0057] Figure 8-1 A prediction curve diagram of the SVR model provided in an embodiment of the present invention performing multiple purge tasks;

[0058] Figure 8-2 A prediction curve diagram of the SVR model provided in an embodiment of the present invention performing a single purge task;

[0059] Figure 9-1 A prediction curve diagram of the CatBoost model provided in an embodiment of the present invention for multiple purge tasks;

[0060] Figure 9-2 A prediction curve diagram of a single purge task using the CatBoost model provided in an embodiment of the present invention;

[0061] Figure 10-1 A prediction curve graph of the XGBoost model provided in an embodiment of the present invention for multiple purge tasks;

[0062] Figure 10-2 A prediction curve graph of a single purge task using the XGBoost model provided in an embodiment of the present invention;

[0063] Fig.11 A schematic diagram of the structure of a control model construction device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention belong to the scope of protection of the embodiments of the present invention.

[0065] At present, a large amount of data is collected in the research and application of hydrogen energy vehicles, fuel cell systems and fuel cell stacks, whether in bench tests or vehicle tests. With the vigorous development of artificial intelligence, data-driven shutdown purge modeling is gradually implemented and applied. Executing the shutdown purge task of the fuel cell stack through the control model is of great significance for improving the success rate of stack startup, extending service life, improving energy utilization efficiency, enhancing system reliability and supporting intelligent management. It is mainly reflected as follows:

[0066] 1. Improve the success rate of stack startup: By modeling and optimizing the stack shutdown purge process, the purge time and purge flow rate can be more accurately controlled to ensure that the residual gas or impurities inside the stack are effectively removed. This helps reduce the failure rate during stack startup, improve the startup success rate, and ensure the stable operation of the stack.

[0067] 2. Extend the service life of the fuel cell stack: Insufficient or excessive purge during the shutdown purge of the fuel cell stack may damage the materials and structures inside the fuel cell stack. Through modeling and optimization, the optimal purge parameters can be found to reduce unnecessary wear and corrosion, thereby extending the service life of the fuel cell stack.

[0068] 3. Improve energy efficiency: Optimizing the purge process can reduce unnecessary energy consumption. For example, by reducing the purge time or reducing the purge flow rate, the energy consumption during the shutdown purge process can be reduced, and the overall energy efficiency can be improved.

[0069] 4. Enhance system reliability: Through modeling and optimization, we can better understand the dynamic characteristics of the shutdown purge process, predict possible problems, and take corresponding measures in advance to prevent them. This helps to enhance the reliability of the entire system and reduce downtime caused by stack startup failure.

[0070] 5. Support intelligent management: Modeling and optimization provide the basis for intelligent management of the fuel cell stack. By real-time monitoring of key parameters such as fuel cell stack impedance and combining with the optimized purge model, the fuel cell stack can be automatically controlled and optimized to improve management efficiency and operation level.

[0071] Therefore, it is of great significance to construct a control model to implement the shutdown purge of the fuel cell stack. The existing construction methods mostly simulate the entire shutdown purge process as a process and establish a big data prediction model similar to the fitting formula. However, due to factors such as changes in experimental conditions and measurement errors, the accuracy of the control model construction is insufficient. This is because shutdown purge is a complex control process, which involves multiple stages of purge and the influence of multiple factors, as shown below:

[0072] 1. Complexity and nonlinear characteristics: Overall modeling often attempts to incorporate all stages and influencing factors of stack shutdown purge into a unified model. However, the different stages of the stack purge process (flow channel purge, gas diffusion layer purge, proton exchange membrane purge) have their own unique physical and chemical characteristics, which are difficult to accurately capture and express in the overall model. In addition, the change in stack impedance during the purge process is nonlinear, which increases the difficulty of overall modeling.

[0073] 2. Difficulty in parameter estimation and calibration: Overall modeling usually involves a large number of parameters that need to be estimated and calibrated based on mission data. However, due to the complexity of the shutdown purge process, it is difficult to accurately obtain all necessary data and perform parameter estimation. In addition, the parameter calibration process is also affected by many factors, such as changes in experimental conditions, measurement errors, etc., which leads to inaccuracies in model construction.

[0074] 3. Lack of flexibility: Overall modeling usually attempts to build a universal model to adapt to different purge conditions and fuel cell stack configurations. However, due to the high complexity of the shutdown purge process, overall modeling often has difficulty meeting control accuracy requirements. Different fuel cell stack designs and operating conditions may lead to significant differences in purge effects, and overall modeling cannot fully reflect these differences. Therefore, for specific application scenarios, overall modeling lacks the necessary flexibility.

[0075] 4. Accuracy and reliability issues: Due to the above reasons, the overall modeling has accuracy and reliability issues when describing the shutdown purge process. The control model cannot accurately predict the impedance changes during the purge process, or may produce misleading results in some cases, resulting in the inability to effectively guide the purge operation and maintenance of the fuel cell stack in actual applications.

[0076] In contrast, the segmented construction of the control model can better solve the above problems. It decomposes the overall process into several task stages according to the different stages and characteristics of the shutdown purge process. This can more accurately describe the physical and chemical properties of each stage, reduce the complexity of the control model, and improve the accuracy and reliability of the control model. At the same time, segmented modeling is also easier to estimate and calibrate parameters, as well as to make adaptive adjustments to specific application scenarios. In summary, the shortcomings of the overall modeling of shutdown purge mainly include the difficulty in accurately describing complexity and nonlinear characteristics, difficulty in parameter estimation and calibration, lack of flexibility, and possible accuracy and reliability problems. Therefore, in practical applications, segmented construction of the control model is a more appropriate choice. The following embodiments of the present invention will specifically explain how to implement the segmented construction of the control model to solve the above technical problems.

[0077] See also Figure 1 , Figure 1 A flowchart of a control model construction method provided in an embodiment of the present invention, the construction method can be implemented based on a construction terminal of the control model, the construction terminal can be a computer device or a server device, and it only needs to be able to run the construction method, and no specific limitation is made here. The construction method includes:

[0078] S11. Obtain a historical data set of a fuel cell stack executing a shutdown purge task, wherein the historical data set includes at least a plurality of groups of purge times, a purge flow rate corresponding to each group of the purge times, and a stack impedance.

[0079] Specifically, there is a correlation between the purge time, the purge flow rate and the stack impedance. Taking the shutdown purge task performed at a constant purge flow rate as an example, as the purge time increases, the stack impedance increases accordingly. A historical data set can be constructed based on the purge time, purge flow rate and stack impedance obtained from the fuel cell stack in multiple historical purge tasks. It should be noted that when constructing a historical data set, the purge time, purge flow rate and stack impedance in the same shutdown purge task can be classified into the same data group to facilitate the subsequent implementation of data subset division.

[0080] Since the data in the historical data set is the data collected when the shutdown purge task is performed, if the shutdown purge experiment is performed alone to collect data, the distribution characteristics of the collected data are limited. Based on this, in a specific implementation, the historical data set of the fuel cell stack performing the shutdown purge task is obtained, including:

[0081] S11-1. Collect task data of shutdown purge task when the fuel cell stack is subjected to preset experiment, wherein the preset experiment includes at least endurance drum test and low temperature cold start test. The preset experiment is an experimental item implemented to test the fuel cell stack. After completing the experiment, the shutdown purge task can be performed on the fuel cell stack, and task data can be collected during the execution of the task. It can be understood that the collection cycle, characteristic quantity and overall test cycle can be formulated after comprehensive consideration, taking the maximum scope covered by each experiment. For example, the collection cycle is set to 0.272 seconds, or even shorter; the characteristic quantity is set to be no less than 200, and the overall test cycle is greater than 6 months, so as to obtain a large amount of task data.

[0082] S11-2. A storage directory is established based on the collected information of the task data, and the task data is stored in a preset target format based on the storage directory. The collected information can be the task sequence number of the shutdown purge task or the collection time of the task data. Figure 2 , Figure 2 This is a schematic diagram of the storage directory. When creating a storage directory based on the acquisition time, you can create a storage target in units of "days", and the experimental data collected on the same day will be stored in the same folder. The target format can be selected based on actual needs. To facilitate subsequent data extraction, the target format can be set to csv (comma-separated values).

[0083] S11-3, configure the first characteristic tag of the purge time, the second characteristic tag of the purge flow rate, and the third characteristic tag of the stack impedance according to the target format. The first characteristic tag, the second characteristic tag, and the third characteristic tag are respectively tags set for extracting the corresponding data. Storing the purge time, purge flow rate, and stack impedance based on the target format will mark each data, and the characteristic tag is used to identify the corresponding tag.

[0084] S11-4. Extract the purge time, purge flow rate and stack impedance in the storage directory according to the first feature tag, the second feature tag and the third feature tag. The built-in csv module of python can be used to read different csv files in different subfolders under the general folder, use the open function to open the csv file in read mode ('r'), create a csv.reader object, read the csv file stream line by line, disassemble and analyze the file stream one by one, and extract the purge time, purge flow rate and stack impedance.

[0085] S11-5. Determine the data extraction results of purge time, purge flow and stack impedance as a historical data set. Extracting data through python includes vertical extraction of shutdown purge status and horizontal screening of key feature quantities. Vertical extraction includes assigning csv data to python's dataframe, and screening out shutdown purge stage data (FCState_st=33) from the experimental data through the stack operation status. Horizontal screening includes defining key feature fields related to shutdown purge, that is, feature labels of different data, for example: defining purge time as Time, defining air inlet flow as Air_fStkIn, inlet cooling temperature as Coolt_tStkIn, outlet cooling temperature as Coolt_tStkOut, stack impedance as R, etc. In order to reduce the interference of irrelevant feature quantity data, irrelevant feature quantity data are eliminated in the data extraction stage.

[0086] Core code snippet:

[0087] vali_vars=['Time','Air_fStkIn','Coolt_tStkIn','Coolt_tStkOut','R']

[0088] df_vali=tmp_df[vali_vars]

[0089] tmp_df is the intermediate dataframe result passed from the previous link; df_vali is the dataframe result of further extracting the required key feature quantities based on tmp_df.

[0090] After extracting data, you can add a new column of file name and save the extracted data to the dataframe. Get the shutdown purge status, fixed time interval, and specified key feature field information, assign them to the new df_vali variable dataframe, and add a new column name "mfile" to assign the csv file name to the column of data extracted from the csv file. The purpose is to convert the three-segment data set of multiple csv files into data conditions for filtering the same file in the same dataframe. The core code is: Tmp_df['mfile'] = fname.

[0091] It should be noted that the data obtained by a single shutdown purge task contains a csv file with m records; n shutdown purge tasks have a total of N csv files, and the historical data set contains N csv files with m*N records of data. A csv file is arranged in sequence according to the collection time sequence in the historical data set.

[0092] After extracting the data, you can also perform nonlinear fitting on the data. Figure 3 , Figure 3 This is a flow chart of non-linear fitting of data, which specifically includes steps S301-S306.

[0093] S301, importing the stack shutdown purge data that needs to be fitted, namely, the purge time, purge flow rate and stack impedance extracted in the above steps.

[0094] S302, define the exponential function of R(t,f). According to prior knowledge, there is an exponential function relationship between the purge time (t), the purge flow rate (f) and the stack impedance (R). Therefore, according to the imported stack shutdown purge data that needs to be fitted, find the specific exponential function relationship, that is, find the parameters that express the specific exponential function relationship. Core code:

[0095] def func(t,f,a,b,c):

[0096] return a*np.exp(b*t*f / 1000)+c / / Example function, a, b, c are all preset coefficients, and the specific values ​​can be set according to actual needs.

[0097] S303, define and initialize the fitting parameter list, core code: fit_params = [].

[0098] S304, perform nonlinear fitting on each data set, core code:

[0099] popt,_=curve_fit(func,t_data,R_data)

[0100] fit_params.append(popt)

[0101] S305: Draw a scatter plot of the original data and a fitted curve. The drawn scatter plots and the fitted curve can be represented on the same graph, such as Figure 4 As shown, the green data in the figure are scattered data, and the red curve is a fitting curve. The historical data set can be represented by data or data charts, and no specific limitation is made here. After obtaining the historical data set, step S12 is entered.

[0102] S12. Divide the historical data set into multiple data subsets according to multiple task stages of the shutdown purge task, wherein each data subset includes the purge time, purge flow rate and stack impedance of the corresponding task stage.

[0103] Specifically, different periods of the shutdown purge task have different purge characteristics, so the shutdown purge task can be set as multiple task stages based on actual needs, and the historical data set can be divided into multiple corresponding data subsets based on the stack impedance or purge time of each task stage. Figure 5 , Figure 5 It is a curve diagram of the stack impedance, which characterizes the relationship between the stack impedance and the purge time. It can be seen from the figure that the slope of the curve gradually increases, so the shutdown purge task can be divided into three task stages based on the change characteristics of the slope. The first task stage is the flow channel purge stage. In this stage, the stack impedance changes slightly with the increase of the purge process and the purge time; the second task stage is the gas diffusion layer purge stage. With the increase of the purge process and the purge time, the stack impedance changes gradually increase; the third task stage is the proton exchange membrane purge stage. With the increase of the purge process and the purge time, the stack impedance changes significantly. Therefore, based on the above-mentioned task stage characteristics, the historical data set can be divided into three data subsets.

[0104] Since the division of task phases determines the purge quality of the fuel cell stack, if the division is implemented based on practical experience, the accuracy of the division will be insufficient. Based on this, in a specific implementation, before dividing the historical data set into multiple data subsets according to multiple task phases of the shutdown purge task, the method also includes:

[0105] S11-6. Extract the purge time and stack impedance of multiple shutdown purge tasks from the historical data set. The data can be extracted based on the labels corresponding to the purge time and stack impedance. The extracted purge time and stack impedance are stored correspondingly based on each shutdown purge task to facilitate subsequent analysis.

[0106] S11-7. Determine the stage threshold of each task stage according to the purge time and stack impedance of multiple shutdown purge tasks. The stage threshold is a threshold for dividing the shutdown purge task into multiple purge stages, which can be a time threshold or an impedance threshold. The purge time and stack impedance can be input into a preset threshold calculation model, and the threshold calculation model can derive the stage threshold of each task stage based on the change characteristics of the stack impedance. For example, a central difference calculation is performed on all stack impedances of each shutdown purge task to obtain the impedance threshold of each shutdown purge task, and then the impedance threshold of the same task stage is averaged to obtain the stage threshold of each task stage.

[0107] Exemplarily, according to the purge time and stack impedance of multiple shutdown purge tasks, the stage threshold of each task stage is determined, including:

[0108] S11-7-1. Input the purge time and stack impedance of each shutdown purge task into the calculation model of N-order difference to obtain the second-order derivative of the stack impedance with respect to the purge time in each shutdown purge task. It can be understood that the calculation result of N-order difference reflects a change between discrete quantities and is a tool for studying discrete mathematics. Differential operation, corresponding to differential operation, is an important concept in calculus. Differential is divided into three types: forward difference, backward difference and central difference. This embodiment adopts central difference calculation.

[0109] The value of the Nth order difference can be determined based on the specific application scenario. The Nth order difference is used to describe the higher-order change trends such as the rate and acceleration of the variable changing over time in a discrete time series. The principles for determining the Nth order difference are usually based on the following points:

[0110] Core code:

[0111] dRdt_central1=np.gradient(R,t,edge_order=2,method='central')

[0112] d2Rdt2_central=np.gradient(dRdt_central1,t,edge_order=2)

[0113] dRdt_central1 represents the first-order derivative of the central difference of the stack impedance R with respect to the purge time t, and d2Rdt2_central represents the second-order derivative of the central difference of the stack impedance R with respect to the purge time t.

[0114] S11-7-2. Determine the purge time corresponding to the second-order derivative of each shutdown purge task as the stage threshold of each task stage.

[0115] In the first-order derivative, the edge_order parameter is used to specify the difference order of the edge points. For central differences, edge_order is usually set to 2 because central differences are not available at the boundary points and need to be approximated by lower-order differences.

[0116] The above code will output the differential approximation of the stack impedance R with respect to the purge time t. These values ​​can be regarded as the approximation of the derivative of the stack impedance R with respect to the purge time t at discrete points.

[0117] In the second-order derivative, the calculation may encounter problems at the boundary because two consecutive data points are required to calculate the central difference. In the numpy.gradient function, by setting the edge_order parameter, the difference order of the edge points can be controlled to handle boundary conditions. Here, edge_order is set to 2, indicating that the second-order difference will be used to approximate the derivative at the boundary.

[0118] The principle of determining the N-order difference: the difference value is stable, and there is no obvious upward or downward trend, that is, the difference value fluctuates around the 0 point of the X-axis. If there is an obvious upward or downward trend, continue to differentiate and determine its value according to the number of differences N. Please refer to Figure 6 , Figure 6 The curve of the derivative change of stack impedance with purge time, curve a is the curve of the first-order derivative, and curve b is the curve of the second-order derivative. The differential value after the second-order difference is basically distributed around 0, rather than an upward or downward trend. Therefore, the stage thresholds of the three mission stages can be obtained through the second-order difference.

[0119] Therefore, it can be concluded that: thsd_d2Rt2_1=0.05, thsd_d2Rt2_2=0.5, thsd_d2Rt2_1 is the stage threshold of the first task stage and the second task stage, and thsd_d2Rt2_2 is the stage threshold of the second task stage and the third task stage.

[0120] S11-8, dividing the shutdown purge task into multiple task stages according to the stage threshold. Taking the stage threshold obtained in the above manner as an example to implement the division of task stages:

[0121] The first task stage: [0,thsd_d2Rt2_1)=[0,0.05)

[0122] Second task stage: [thsd_d2Rt2_1,thsd_d2Rt2_2)=[0.05,0.5)

[0123] The third task stage: [thsd_d2Rt2_2,30) = [0.5,30)

[0124] The interval value [0,0.05) of the first task stage shows that the stack impedance R does not change much with the purge time t and is relatively stable, which is completely consistent with the characteristic that in the flow channel purge stage, the stack impedance generally changes little with the increase of the purge process and purge time.

[0125] The interval value [0.05, 0.5) of the second task stage shows that the stack impedance R gradually increases with the purge time t, which is completely consistent with the characteristic that when the gas diffusion layer is purged, the stack impedance gradually increases with the increase of the purge process and the purge time.

[0126] The interval value [0.5,30) of the third task stage shows that the stack impedance R changes significantly with the purge time t, which is completely consistent with the characteristic that during the proton exchange membrane purge stage, the stack impedance changes significantly with the increase of the purge process and purge time.

[0127] Therefore, based on the above analysis, it can be determined that the stage thresholds corresponding to the three task stages are reasonable. The following will specifically explain the division process of multiple data subsets. The obtained stage thresholds thsd_d2Rt2_1 and thsd_d2Rt2_2 can divide the dataframe (df) of the historical data set into three layers (df1, df2, df3); the segmentation process is as follows:

[0128] Create a historical data set Dataframe (df): define Python's Dataframe class df, assign the entire data to df; create an array strata of the same length as the historical data set, strata = np.zeros (len (df), dtype = int), first create an integer array of the same length as df, and initialize all elements to 0; segment the overall data points:

[0129] strata[:np.where(df['R']==thsd_d2Rt2_1)[0][0]]=1

[0130] strata[np.where(df['R']==thsd_d2Rt2_1)[0][0]:np.where(df['R']==thsd_d2Rt2_2)[0][0]]=2

[0131] strata[np.where(df['R']==thsd_d2Rt2_2)[0][0]:]=3

[0132] Among them: np is the imported numpy (import numpy as np);

[0133] np.where(df['R']==thsd_d2Rt2_1)[0][0], np.where(df['R']==thsd_d2Rt2_2)[0][0] represent the index values ​​of the first appearance of thsd_d2Rt2_1 and thsd_d2Rt2_2 in the entire data set respectively; np.where(df['R']==thsd_d2Rt2_1) is a tuple; this represents the first index value of the appearance of thsd_d2Rt2_1) and thsd_d2Rt2_2); "1" represents the first task stage of flow channel purge, "2" represents the second task stage of gas diffusion layer purge, and "3" represents the third task stage of proton exchange membrane purge; the historical data set is divided into three data subsets df1, df2, and df3 according to the segmentation labels.

[0134] Core code:

[0135] strata_series=pd.Series(strata,index=df.index)

[0136] grouped=df.groupby(strata_series)

[0137] df1 = grouped.get_group(1)

[0138] df2 = grouped.get_group(2)

[0139] df3 = grouped.get_group(3)

[0140] strata_series means converting a strata array to a pandas Series for use with df;

[0141] grouped means using groupby to divide df into three groups according to the value of strata;

[0142] df1, df2, and df3 represent the DataFrames of each group extracted respectively, that is, three data subsets.

[0143] At this point, according to the stage thresholds thsd_d2Rt2_1 and thsd_d2Rt2_2, the historical data set is divided into three data subsets that effectively retain the overall data characteristics. Subsequently, the characteristics of each data subset need to be modeled with relevant artificial intelligence algorithms. The model of each task stage is used to predict the impedance of the battery stack during shutdown purging in this stage. The data distribution characteristics represented by each data subset can be modeled to accurately implement the prediction of the battery stack impedance. After completing the modeling of each purge stage and dividing the historical data set into multiple data subsets, step S13 is entered.

[0144] S13. Training the impedance prediction model of the corresponding task stage according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target.

[0145] Specifically, since each data subset has corresponding data distribution characteristics, in order to accurately predict the impedance of the battery stack in each purge stage, training can be performed separately, that is, the data subset of each purge stage is used to train the impedance prediction model of that stage. Each data subset can be divided into a training set and a test set, and the impedance prediction model is trained based on the training set. After the training is completed, the prediction accuracy of the impedance prediction model is verified by the test set. When the prediction accuracy reaches the preset accuracy threshold, it means that the impedance prediction model can implement accurate prediction in the purge stage, and it is determined that the predicted impedance reaches the preset target.

[0146] Still taking the three purge stages as an example, when implementing model training, the three data subsets can be saved as three csv files, df1 is saved as "flow channel.csv", df2 is saved as "gas diffusion layer.csv", and df3 is saved as "proton exchange membrane.csv". Figure 7 , Figure 7 The results of the three purge stages are characterized. From the stage threshold determined by the N-order difference, it can be concluded that the stack impedance R in the three purge stages shows obvious differences with the purge time t, that is, the stack impedance R changes faster and faster, increasing exponentially. The impedance prediction model applicable to each stage can be configured based on the characteristics of different data subsets.

[0147] All models in the prediction model library are trained based on the data subset of each mission stage. According to prior knowledge, there is an exponential function relationship between purge time, purge flow and stack impedance. Based on the prediction requirements of this functional relationship, multiple models can be selected to build a prediction model library, including linear regression model (or LinearRegression), LightGBM model, CatBoost model, XGBoost model, random forest model (or RandomForestRegressor), polynomial regression model (PolyRegression), support vector regression model (or SVR model), multi-layer perceptron regression model (or MLPRegressor) and more than ten other models.

[0148] According to the actual impedance of the shutdown purge task and the predicted impedance output by each model after training, the determination coefficient characterizing the prediction accuracy of each model is obtained. The determination coefficient is a coefficient that characterizes the prediction accuracy. The closer the determination coefficient is to 1, the higher the prediction accuracy; conversely, the farther the determination coefficient is from 1, the lower the prediction accuracy. After implementing the prediction of different numbers of shutdown purge tasks, the corresponding determination coefficient can be determined. If the deviation between the two is less than the deviation threshold, it means that the determination coefficient is correctly determined. For example, after each model implements the stack impedance prediction of 100 shutdown purge tasks, the corresponding first determination coefficient is determined; after implementing the stack impedance prediction of a single shutdown purge task, the corresponding second determination coefficient is determined. When the deviation between the two determination coefficients is small, the first determination coefficient is determined as the determination coefficient of the model.

[0149] The model corresponding to the maximum determination coefficient of each task stage is determined as the impedance prediction model of the task stage. The model corresponding to the maximum determination coefficient is the most accurate model for implementing impedance prediction in the task stage, and is determined as the impedance prediction model of the task stage.

[0150] When configuring the impedance prediction model for the three purge stages, the SVR model was used in the first purge stage, the CatBoost model was used in the second purge stage, and the XGBoost model was used in the third purge stage according to the modeling and model evaluation results to establish the prediction model of R(t,f).

[0151] The specific steps for implementing impedance prediction model training in each purge stage will be described below.

[0152] For the SVR model, the first parameter group of the SVR model needs to be configured, wherein the first parameter group includes the kernel function, regularization parameter, gamma value and epsilon value of the SVR model. The SVR model is trained according to the data subset of the flow channel purge stage, and the first parameter group is adjusted until the first deviation of the predicted impedance output by the SVR model is less than the first preset target. The core code for modeling the SVR model: svr_rbf = SVR (kernel = 'rbf', C = 100, gamma = 0.1, epsilon = .1)

[0153] kernel='rbf', the kernel parameter determines the type of kernel function used by SVR. The embodiment of the present invention uses the 'rbf' (radial basis function) kernel, also known as the Gaussian kernel. The RBF kernel is a nonlinear kernel that can map data to a higher-dimensional space, allowing the model to handle nonlinear relationships.

[0154] C = 100, C is a regularization parameter used to control the tolerance of the SVR model to errors. The larger the C value, the more complex the model is, and the more it tends to fit the noise in the training data, which may lead to overfitting; the smaller the C value, the simpler the model is, which may lead to underfitting. Configuring C to 100, which is a relatively large value, means that the SVR model will tend to reduce training errors, but may also be more susceptible to noise.

[0155] Gamma = 0.1, gamma is a parameter of the RBF kernel, which controls the shape of the decision boundary. The larger the gamma value, the more the decision boundary tends to surround the local area of ​​the training data points; the smaller the gamma value, the smoother the decision boundary is, and some details of the training data may be ignored.

[0156] Epsilon = 0.1, epsilon is an important parameter in the SVR model, which defines the size of the insensitive region in the regression estimate. Only observations that deviate from the predicted impedance by more than epsilon contribute to the loss function. This parameter helps control the complexity and smoothness of the model. The larger the epsilon value, the higher the tolerance of the model to errors, and the model may be simpler; the smaller the epsilon value, the lower the tolerance of the model to errors, and the model may be more complex.

[0157] Based on the data subset of the flow channel purge stage, the ratio of the training set and test set of the SVR model can be constructed to be 8:2; the SVR model is trained and tested based on the training set and test set. Figure 8-1 and 8-2 , Figure 8-1 The green columnar image in the middle represents multiple data points, and the red ones are multiple fitted curves; Figure 8-2The data points in the figure are the actual impedance, and the curve represents the predicted impedance. The determination coefficient r2 of the SVR model in the test data of 100 purge processes is 0.9422902163184068; the determination coefficient r2 in a single purge process is 0.9418036151685724, which shows that the SVR model has completed training. Figure 8-2 The horizontal axis is the purge time, and the vertical axis is the predicted impedance.

[0158] Similarly, the CatBoost model also needs to be trained and verified. The second parameter group of the CatBoost model needs to be configured, wherein the second parameter group includes the number of iterations, tree depth, learning rate, and loss function of the CatBoost model. The CatBoost model is trained based on a data subset of the gas diffusion layer purge phase, and the second parameter group is adjusted until the second deviation of the predicted impedance output by the CatBoost model is less than the second preset target.

[0159] During the gas diffusion layer purge phase, the stack impedance R gradually increases with the purge time t. The CatBoost algorithm can be used for modeling. It is a machine learning algorithm based on the Gradient Boosting Decision Tree (GBDT), which is mainly used to process categorical features. The CatBoost model introduces a novel processing method that can automatically process categorical features without explicitly converting them. Its core innovation is the use of a sorting-based method to sort the histogram of categorical features and input the sorted results into the decision tree as feature values. Its advantage is that it embeds an innovative algorithm that automatically processes categorical features into numerical features. This processing method makes the CatBoost model more efficient and accurate in processing categorical features, without the need to convert categorical features into numerical types like the traditional GBDT algorithm.

[0160] The data subsets of the gas diffusion layer purge phase are configured as training sets and test sets in a ratio of 8:2. The second parameter group is adjusted during training and testing. The parameter adjustment results of the CatBoost model are as follows:

[0161] Iterations: iterations = 200

[0162] Tree depth: depth=10;

[0163] Learning rate: learning_rate=0.02;

[0164] Loss function: loss_function = 'RMSE';

[0165] See also Figure 9-1 and 9-2 , the determination coefficient r2 of the CatBoost model in the test data of 100 purge processes is 0.9387676470713161; the determination coefficient r2 in a single purge process is 0.94519302982132058, which shows that the CatBoost model has completed training. Among them, Figure 9-2 The horizontal axis is the purge time, and the vertical axis is the predicted impedance. Figure 8-1 , 8-2 same.

[0166] The following method is used for training and verification of the XGBoost model: the third parameter group of the XGBoost model is configured, wherein the third parameter group includes the tree depth, learning rate, gamma value, and regression square error of the XGBoost model. The XGBoost model is trained according to the data subset of the proton exchange membrane purge stage, and the third parameter group is adjusted until the third deviation of the predicted impedance output by the XGBoost model is less than the third preset target.

[0167] During the proton exchange membrane purge phase, the stack impedance R changes significantly with the purge time t, and the XGBoost algorithm is used for modeling. The XGBoost model is an optimized distributed gradient boosting library that implements efficient, flexible and portable machine learning algorithms. It is based on the Gradient Boosting framework. Through multiple rounds of iterations, each round of iteration generates a weak classifier and trains it based on the residual of the previous round of classifiers. Each weak classifier is weighted and summed during the training process to form the final strong classifier. The XGBoost model introduces regularization technology to control the complexity of the model and reduce the risk of overfitting; it can also evaluate the importance of features and select features based on the contribution of features; XGBoost supports parallel computing and can effectively use multiple CPU cores to accelerate the training process. It can also automatically handle missing values ​​without preprocessing the missing values.

[0168] The data subsets of the proton exchange membrane purge phase are configured as training sets and test sets in a ratio of 8:2. The third parameter group is adjusted during training and testing. The final parameter adjustment results are as follows:

[0169] 'objective' = 'reg:squarederror' / / Regression problem uses squared error

[0170] 'max_depth' = 3 / / maximum depth of the tree

[0171] 'eta' = 0.1 / / learning rate

[0172] 'gamma' = 0 / / parameter to control model complexity

[0173] 'subsample' = 0.8 / / subsample ratio

[0174] 'colsample_bytree' = 0.8 / / column sampling ratio

[0175] 'min_child_weight' = 1 / / minimum sample weight on a leaf node

[0176] 'eval_metric = 'rmse' / / Evaluation indicator is root mean square error

[0177] See also Figure 10-1 and 10-2 , the determination coefficient r2 of the XGBoost model in the test data of 100 purge processes is 0.9609394229892439; the determination coefficient r2 in a single purge process is 0.9692783828611458, which shows that the XGBoost model has completed training. Among them, Figure 10-2 The horizontal axis is the purge time, and the vertical axis is the predicted impedance. The expression characteristics in the figure are also the same as Figure 8-1 , 8-2 After the stack impedance predicted by the impedance prediction model in each task stage reaches the preset target, the process proceeds to step S14.

[0178] S14. When the predicted impedance reaches a preset target, the predicted impedance output by the impedance prediction model is configured as an input parameter for the control model to perform the shutdown purge task.

[0179] Specifically, the control model is a model for controlling the shutdown purge task of the fuel cell stack, and it is necessary to implement the control of the purge flow and purge time to purge the fuel cell stack to the corresponding stack impedance in each purge stage. The impedance prediction model of each purge stage can be embedded in the control model, or it can be configured in parallel. Since the impedance prediction model of each purge stage can accurately predict the stack impedance based on the purge flow and purge time, it can be configured to the corresponding purge stage to implement the prediction of the stack impedance. It can be understood that when implementing the application of each model, the purge time and purge flow of different purge stages can be set based on actual control requirements. For example, when the purge efficiency needs to be used as the control target, the set purge time is as small as possible; when the purge power consumption is used as the control target, the purge time and purge flow need to be balanced to minimize the purge power consumption generated in the purge stage.

[0180] Still taking the configuration of three purge stages as an example, when implementing the impedance prediction model configuration of each purge stage, the first predicted impedance output by the SVR model is configured as the input parameter of the control model in the flow channel purge stage; the second predicted impedance output by the CatBoost model is configured as the input parameter of the control model in the gas diffusion layer purge stage; the third predicted impedance output by the XGBoost model is configured as the input parameter of the control model in the proton exchange membrane purge stage. This enables the fuel cell stack to accurately fit the relationship between the purge flow, purge time and stack impedance during the three-stage purge, providing accurate purge time and purge flow for the stack shutdown purge, improving the performance and life of the stack product, saving energy consumption, and improving efficiency.

[0181] It needs to be further explained that, under different external ambient temperatures, on the premise of ensuring that the fuel cell stack can successfully start at low temperature cold, this method can provide accurate air compressor purge flow; on the premise of ensuring the success of low temperature cold start and accurate low air compressor purge flow, the purge time for successful low temperature cold start of the stack can be shortened. By comparison, under the conditions of ensuring successful cold start at different ambient temperatures, the shutdown purge time of the stack is shortened; it is also possible to determine the dynamic balance point of the purge time t and the purge flow f, and reduce the power consumption of the shutdown purge; at the same time, low-power purge of the air compressor is realized to achieve noise reduction.

[0182] Based on the same technical concept as the construction method, the embodiment of the present invention also provides a construction device for a control model, see Fig.11 , Fig.11 The schematic diagram of the structure of the construction device. The construction device includes:

[0183] An acquisition module 101 is used to acquire a historical data set of a fuel cell stack executing a shutdown purge task, wherein the historical data set includes at least a plurality of groups of purge times, a purge flow rate corresponding to each group of the purge times, and a stack impedance;

[0184] A division module 102 is used to divide the historical data set into multiple data subsets according to multiple task stages of the shutdown purge task, wherein each data subset includes the purge time, purge flow rate and stack impedance of the corresponding task stage;

[0185] The first training module 103 is used to train the impedance prediction model of the corresponding task stage according to each data subset, so that the predicted impedance output by the impedance prediction model reaches a preset target;

[0186] The configuration module 104 is used to configure the predicted impedance output by the impedance prediction model as an input parameter for the control model to perform the shutdown purge task when the predicted impedance reaches a preset target.

[0187] In an optional embodiment, the acquisition module includes:

[0188] A collection submodule, used to collect task data of shutdown purge tasks when the fuel cell stack is subjected to preset experiments, wherein the preset experiments at least include a durability drum test and a low-temperature cold start test;

[0189] The storage submodule is used to establish a storage directory according to the collected information of the task data, and store the task data in a preset target format according to the storage directory;

[0190] A configuration submodule, configured to configure a first characteristic tag of the purge time, a second characteristic tag of the purge flow rate, and a third characteristic tag of the stack impedance according to a target format;

[0191] An extraction submodule, used to extract the purge time, the purge flow rate and the stack impedance in the storage directory according to the first feature tag, the second feature tag and the third feature tag;

[0192] The first determination submodule is used to determine the data extraction results of the purge time, the purge flow rate and the stack impedance as a historical data set.

[0193] In an optional embodiment, the construction device further comprises:

[0194] An extraction module, used for extracting the purge time and stack impedance of multiple shutdown purge tasks from the historical data set;

[0195] A first determination module is used to determine the stage threshold of each task stage according to the purge time and stack impedance of multiple shutdown purge tasks;

[0196] The processing module is used to divide the shutdown purge task into multiple task stages according to the stage threshold.

[0197] In an optional embodiment, the first determining module includes:

[0198] An acquisition submodule is used to input the purge time and the stack impedance of each shutdown purge task into an N-order differential calculation model to obtain the second-order derivative of the stack impedance with respect to the purge time in each shutdown purge task;

[0199] The second determination submodule is used to determine the purge time corresponding to the second-order derivative of each shutdown purge task as the stage threshold of each task stage.

[0200] In an optional embodiment, the construction device further comprises:

[0201] The second training module is used to train all models in the prediction model library according to the data subset of each task stage;

[0202] An acquisition module is used to obtain a determination coefficient representing the prediction accuracy of each model based on the actual impedance of the shutdown purge task and the predicted impedance output by each model after completing the training;

[0203] The second determination module is used to determine the model corresponding to the maximum determination coefficient of each task stage as the impedance prediction model of the task stage.

[0204] In an optional embodiment, the impedance prediction model includes an SVR model, a CatBoost model, and an XGBoost model; the first training module includes:

[0205] A first configuration submodule, used to configure a first parameter group of the SVR model, wherein the first parameter group includes a kernel function, a regularization parameter, a gamma value, and an epsilon value of the SVR model;

[0206] A first training submodule, configured to train the SVR model according to the data subset of the flow channel purge stage, and adjust the first parameter group until a first deviation of the predicted impedance output by the SVR model is less than a first preset target;

[0207] A second configuration submodule is used to configure a second parameter group of the CatBoost model, wherein the second parameter group includes the number of iterations, tree depth, learning rate, and loss function of the CatBoost model;

[0208] A second training submodule is used to train the CatBoost model according to the data subset of the gas diffusion layer purge phase, and adjust the second parameter group until a second deviation of the predicted impedance output by the CatBoost model is less than a second preset target;

[0209] The third configuration submodule is used to configure the third parameter group of the XGBoost model, wherein the third parameter group includes the tree depth, learning rate, gamma value, and regression square error of the XGBoost model;

[0210] The third training submodule is used to train the XGBoost model according to the data subset of the proton exchange membrane purge phase and adjust the third parameter group until the third deviation of the predicted impedance output by the XGBoost model is less than a third preset target.

[0211] In an optional embodiment, the impedance prediction model includes an SVR model, a CatBoost model, and an XGBoost model; and the configuration module includes:

[0212] A first configuration submodule, configured to configure the first predicted impedance output by the SVR model as an input parameter of the control model in the flow channel purge stage;

[0213] A second configuration submodule is used to configure the second predicted impedance output by the CatBoost model as an input parameter of the control model in the gas diffusion layer purge stage;

[0214] The third configuration submodule is used to configure the third predicted impedance output by the XGBoost model as an input parameter of the control model in the proton exchange membrane purge stage.

[0215] Based on the same technical concept as the construction method, an embodiment of the present invention also provides an electronic device, including a processor and a memory, wherein the memory is coupled to the processor, and the memory stores instructions, which, when executed by the processor, enable the electronic device to execute the steps of any one of the methods in the construction method.

[0216] Based on the same technical concept as the construction method, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any method in the construction method are implemented.

[0217] The technical solution provided in the embodiments of the present invention has at least the following technical effects or advantages:

[0218] The construction method obtains a historical data set of the fuel cell stack performing the shutdown purge task, and divides the historical data set into multiple data subsets according to multiple task stages of the shutdown purge task. Since the historical data set includes at least multiple groups of purge time, the purge flow rate and stack impedance corresponding to each group of the purge time, the impedance prediction model of the corresponding task stage can be trained according to each data subset, so that the predicted impedance output by the impedance prediction model reaches the preset target. When the predicted impedance reaches the preset target, it means that the impedance prediction model can accurately predict the stack impedance, and the predicted impedance output by the impedance prediction model is configured as the input parameter of the control model to perform the shutdown purge task. The construction method enables the control model to implement accurate stack impedance prediction in different task stages of the shutdown purge task, so that the control model can accurately fit the corresponding relationship between the purge time, the purge flow rate and the stack impedance, so that the control of various parameters is more accurate when the fuel cell stack performs the shutdown purge task, thereby improving the reliability of the fuel cell stack in performing the shutdown purge task.

[0219] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0220] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (modules, systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0221] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0222] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0223] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0224] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for constructing a control model, characterized in that: The method comprises: Acquire a historical data set of the fuel cell stack performing a shutdown purge task, wherein the historical data set includes at least a plurality of groups of purge times, a purge flow rate corresponding to each group of the purge times, and a stack impedance; According to the multiple task stages of the shutdown purge task, the historical data set is divided into multiple data subsets, wherein each of the data subsets includes the purge time, purge flow rate and stack impedance of the corresponding task stage; Training an impedance prediction model for a corresponding task stage according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target; When the predicted impedance reaches the preset target, the predicted impedance output by the impedance prediction model is configured as an input parameter for the control model to perform the shutdown purge task.

2. The control model construction method according to claim 1, characterized in that: The acquiring of a historical data set of the fuel cell stack executing a shutdown purge task includes: Collecting task data of a shutdown purge task when the fuel cell stack is subjected to a preset experiment, wherein the preset experiment at least includes a durability drum test and a low-temperature cold start test; Establishing a storage directory according to the collected information of the task data, and storing the task data in a preset target format according to the storage directory; Configure the first characteristic tag of the purge time, the second characteristic tag of the purge flow rate, and the third characteristic tag of the stack impedance according to the target format; According to the first feature tag, the second feature tag and the third feature tag, respectively extract the purge time, the purge flow rate and the stack impedance in the storage directory; The data extraction results of the purge time, the purge flow rate and the stack impedance are determined as the historical data set.

3. The method for constructing a control model according to claim 1, characterized in that: Before dividing the historical data set into a plurality of data subsets according to the plurality of task stages of the shutdown purge task, the method further comprises: Extracting the purge time and stack impedance of multiple shutdown purge tasks from the historical data set; Determining a stage threshold of each task stage according to the purge time and stack impedance of the plurality of shutdown purge tasks; The shutdown purge task is divided into the multiple task stages according to the stage threshold.

4. The method for constructing a control model according to claim 3, characterized in that: Determining the stage threshold of each task stage according to the purge time and stack impedance of the plurality of shutdown purge tasks includes: Inputting the purge time and stack impedance of each shutdown purge task into an N-order difference calculation model to obtain the second-order derivative of the stack impedance with respect to the purge time in each shutdown purge task; The purge time corresponding to the second-order derivative of each shutdown purge task is determined as the stage threshold of each task stage.

5. The method for constructing a control model according to claim 1, characterized in that: Before the impedance prediction model of the corresponding task stage is trained according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target, the method further includes: All models in the prediction model library are trained based on the data subset of each task stage; According to the actual impedance of the shutdown purge task and the predicted impedance output by each model after completing the training, the determination coefficient representing the prediction accuracy of each model is obtained; The model corresponding to the maximum determination coefficient of each task stage is determined as the impedance prediction model of the task stage.

6. The method for constructing a control model according to claim 1, characterized in that: The impedance prediction model includes an SVR model, a CatBoost model and an XGBoost model; the impedance prediction model of the corresponding task stage is trained according to each data subset so that the predicted impedance output by the impedance prediction model reaches a preset target, including: Configuring a first parameter group of the SVR model, wherein the first parameter group includes a kernel function, a regularization parameter, a gamma value, and an epsilon value of the SVR model; Training the SVR model according to the data subset of the flow channel purge phase, and adjusting the first parameter group until a first deviation of the predicted impedance output by the SVR model is less than a first preset target; Configuring a second parameter group of the CatBoost model, wherein the second parameter group includes the number of iterations, tree depth, learning rate, and loss function of the CatBoost model; Training the CatBoost model according to the data subset of the gas diffusion layer purge phase, and adjusting the second parameter group until a second deviation of the predicted impedance output by the CatBoost model is less than a second preset target; Configuring a third parameter group of the XGBoost model, wherein the third parameter group includes a tree depth, a learning rate, a gamma value, and a regression square error of the XGBoost model; The XGBoost model is trained according to the data subset of the proton exchange membrane purge phase, and the third parameter group is adjusted until a third deviation of the predicted impedance output by the XGBoost model is less than a third preset target.

7. The method for constructing a control model according to claim 1, characterized in that: The impedance prediction model includes an SVR model, a CatBoost model and an XGBoost model; configuring the predicted impedance output by the impedance prediction model as an input parameter for the control model to perform the shutdown purge task includes: configuring the first predicted impedance output by the SVR model as an input parameter of the control model in the flow channel purge stage; configuring the second predicted impedance output by the CatBoost model as an input parameter of the control model in the gas diffusion layer purge stage; The third predicted impedance output by the XGBoost model is configured as an input parameter of the control model in the proton exchange membrane purge stage.

8. A control model construction device, characterized in that: The device comprises: An acquisition module, used to acquire a historical data set of the fuel cell stack performing a shutdown purge task, wherein the historical data set at least includes multiple groups of purge times, a purge flow rate corresponding to each group of the purge times, and a stack impedance; A division module, used to divide the historical data set into multiple data subsets according to multiple task stages of the shutdown purge task, wherein each of the data subsets includes the purge time, purge flow rate and stack impedance of the corresponding task stage; A first training module is used to train the impedance prediction model of the corresponding task stage according to each data subset, so that the predicted impedance output by the impedance prediction model reaches a preset target; A configuration module is used to configure the predicted impedance output by the impedance prediction model as an input parameter for the control model to perform the shutdown purge task when the predicted impedance reaches the preset target.

9. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is coupled to the processor and stores instructions, and when the instructions are executed by the processor, the electronic device executes the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.