A method and system for generating battery test process files based on natural language
Through the natural language-based battery test process file generation method, the neural network model is used to automatically extract and convert test description text, solving the problems of errors and inefficiency in manual writing process files, and achieving high-quality and efficient process file generation.
Patent Information
- Application Number
- CN202411701442.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-04-04
AI Technical Summary
The existing battery test process files are written manually, and there are inevitable errors and inefficiencies, which affect the test quality.
Using a natural language-based battery test process file generation method, we automatically extract vocabulary from real-time test description text and convert it into battery test process steps by defining grammatical rules and creating neural network vocabulary extraction and arrangement model.
It realizes automatic generation of battery test process files to avoid manual errors, and significantly improves the quality and efficiency of test process files generation.
Smart Images

Figure CN119761354A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery testing, and in particular to a method and system for generating a battery testing process file based on natural language. Background Art
[0002] During the production and use of batteries, a series of tests are required. Battery testing is to charge and discharge the battery under different working conditions and collect relevant charge and discharge data during the charging and discharging process. According to different battery testing requirements, various test process files (test step files) must be organized and compiled to execute the test process. The test process file carries several test steps, each of which contains different parameters. It is a relatively clumsy file and the content and meaning of the test cannot be intuitively understood. Traditional test process files are manually written, which will inevitably produce errors and omissions, thereby affecting the quality of battery testing and inefficiency.
[0003] Therefore, how to provide a natural language-based battery test process document generation method and system to improve the quality and efficiency of battery test process document generation has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and system for generating battery test process documents based on natural language, so as to improve the quality and efficiency of generating battery test process documents.
[0005] In a first aspect, the present invention provides a method for generating a battery test process file based on natural language, comprising the following steps:
[0006] Step S1, defining a grammatical rule for generating a battery test step, creating a vocabulary extraction and arrangement model based on a neural network, and setting a loss function of the vocabulary extraction and arrangement model;
[0007] Step S2: obtaining a large number of natural language-based historical test description texts, and constructing a data set after preprocessing and annotating each of the historical test description texts;
[0008] Step S3, training the vocabulary extraction and arrangement model using the data set;
[0009] Step S4, obtaining an input real-time test description text, inputting the real-time test description text into a vocabulary extraction and arrangement model, and obtaining a vocabulary arrangement result;
[0010] Step S5: convert the word arrangement result according to the grammar rule to obtain the corresponding battery test steps, and compile each of the battery test steps to obtain a battery test process file.
[0011] Furthermore, in step S1, the grammar rules are used to convert each word in the word arrangement result into a corresponding step type, step parameter, step condition, condition parameter and parameter format in sequence, thereby generating a battery test step;
[0012] The vocabulary extraction and arrangement model is composed of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module;
[0013] The input module is used for inputting the test description text; the shallow feature extraction module is used for extracting shallow features from the test description text; the semantic feature extraction module is used for performing context learning on the test description text to extract deep features; the feature fusion module is used for fusing shallow features and deep features to obtain fused features; and the output module is used for outputting the fused features as a word compilation result.
[0014] Furthermore, the step S2 is specifically as follows:
[0015] A large number of natural language-based historical test description texts are obtained, and after preprocessing the data cleaning and format conversion of each of the historical test description texts, the vocabulary and arrangement relationship of each of the historical test description texts are annotated, and then a data set is constructed based on the annotated historical test description texts.
[0016] Furthermore, the step S3 is specifically as follows:
[0017] The data set is randomly divided into a training set and a validation set based on a preset segmentation ratio, and the vocabulary extraction and arrangement model is trained by the training set until the loss function is less than a preset loss threshold. The trained vocabulary extraction and arrangement model is then verified by the validation set to determine whether the accuracy of the extraction and arrangement is greater than the preset accuracy threshold. If so, the training is terminated; if not, the training set is expanded to continue the training.
[0018] Furthermore, the step S4 is specifically as follows:
[0019] A real-time test description text based on natural language input is obtained, and after preprocessing the real-time test description text, the real-time test description text is input into a vocabulary extraction and arrangement model to obtain a vocabulary arrangement result.
[0020] In a second aspect, the present invention provides a natural language-based battery test process file generation system, comprising the following modules:
[0021] An initialization module, used to define a grammatical rule for generating a battery test step, create a vocabulary extraction and arrangement model based on a neural network, and set a loss function of the vocabulary extraction and arrangement model;
[0022] A data set construction module is used to obtain a large amount of historical test description texts based on natural language, and to construct a data set after preprocessing and annotating each of the historical test description texts;
[0023] A vocabulary extraction and arrangement model training module, used for training the vocabulary extraction and arrangement model through the data set;
[0024] An extraction and arrangement module is used to obtain an input real-time test description text, input the real-time test description text into a vocabulary extraction and arrangement model, and obtain a vocabulary arrangement result;
[0025] The process file generation module is used to convert the word arrangement results according to the grammatical rules to obtain the corresponding battery test steps, and compile each of the battery test steps to obtain a battery test process file.
[0026] Furthermore, in the initialization module, the grammar rules are used to convert each word in the word arrangement result into the corresponding step type, step parameter, step condition, condition parameter and parameter format in sequence, thereby generating a battery test step;
[0027] The vocabulary extraction and arrangement model is composed of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module;
[0028] The input module is used for inputting the test description text; the shallow feature extraction module is used for extracting shallow features from the test description text; the semantic feature extraction module is used for performing context learning on the test description text to extract deep features; the feature fusion module is used for fusing shallow features and deep features to obtain fused features; and the output module is used for outputting the fused features as a word compilation result.
[0029] Furthermore, the data set construction module is specifically used for:
[0030] A large number of natural language-based historical test description texts are obtained, and after preprocessing the data cleaning and format conversion of each of the historical test description texts, the vocabulary and arrangement relationship of each of the historical test description texts are annotated, and then a data set is constructed based on the annotated historical test description texts.
[0031] Furthermore, the vocabulary extraction and arrangement model training module is specifically used for:
[0032] The data set is randomly divided into a training set and a validation set based on a preset segmentation ratio, and the vocabulary extraction and arrangement model is trained by the training set until the loss function is less than a preset loss threshold. The trained vocabulary extraction and arrangement model is then verified by the validation set to determine whether the accuracy of the extraction and arrangement is greater than the preset accuracy threshold. If so, the training is terminated; if not, the training set is expanded to continue the training.
[0033] Furthermore, the extraction and arrangement module is specifically used for:
[0034] A real-time test description text based on natural language input is obtained, and after preprocessing the real-time test description text, the real-time test description text is input into a vocabulary extraction and arrangement model to obtain a vocabulary arrangement result.
[0035] The advantages of the present invention are:
[0036] 1. By defining grammatical rules for generating battery test steps, a vocabulary extraction and arrangement model is created based on a neural network, and a loss function of the vocabulary extraction and arrangement model is set; then a large amount of historical test description texts based on natural language are obtained and preprocessed and annotated to construct a data set, and the vocabulary extraction and arrangement model is trained through the data set, and then the input real-time test description text is input into the vocabulary extraction and arrangement model to obtain the vocabulary arrangement result, and the vocabulary arrangement result is converted through grammatical rules to obtain the corresponding battery test steps, and finally each battery test step is compiled to obtain a battery test process file; that is, based on the pre-trained vocabulary extraction and arrangement model, the vocabulary arrangement result is automatically extracted from the real-time test description text based on natural language input, and then the vocabulary arrangement result is automatically converted into a battery test step through predefined grammatical rules, and finally the battery test step is compiled to obtain a battery test process file, and the whole process is automatically performed without manual operation, avoiding errors and omissions caused by manual operation, and ultimately greatly improving the quality and efficiency of battery test process file generation.
[0037] 2. By setting the vocabulary extraction and arrangement model to consist of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module; the input module is used for the input of the test description text; the shallow feature extraction module is used to extract shallow features from the test description text; the semantic feature extraction module is used to perform context learning on the test description text to extract deep features; the feature fusion module is used to fuse shallow features and deep features to obtain fused features; the output module is used to output the fused features as vocabulary arrangement results; that is, the vocabulary extraction and arrangement model can not only learn the surface meaning of the test description text, but also understand the deep meaning in combination with semantics and context, thereby greatly improving the reliability of the output of the vocabulary arrangement results, thereby greatly improving the quality of battery test process document generation.
[0038] 3. By preprocessing and annotating the historical test description texts for data cleaning and format conversion, the data set is constructed to effectively improve the quality of the data set, greatly improve the training effect of the vocabulary extraction and arrangement model, and thus greatly improve the quality of battery test process document generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0040] Figure 1 The invention discloses a flow chart of a method for generating a battery test process file based on natural language.
[0041] Figure 2 It is a structural schematic diagram of a natural language-based battery test process file generation system of the present invention. DETAILED DESCRIPTION
[0042] The technical solution in the embodiments of the present application has the following overall idea: based on a pre-trained vocabulary extraction and arrangement model, the vocabulary arrangement results are automatically extracted from the real-time test description text based on natural language input, and then the vocabulary arrangement results are automatically converted into battery test steps through predefined grammar rules. Finally, the battery test steps are compiled to obtain a battery test process file. The whole process is automatically performed without manual operation, avoiding errors and omissions caused by manual operation, so as to improve the quality and efficiency of battery test process file generation.
[0043] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a method for generating a battery test process file based on natural language of the present invention comprises the following steps:
[0044] Step S1, defining a grammatical rule for generating a battery test step, creating a vocabulary extraction and arrangement model based on a neural network, and setting a loss function of the vocabulary extraction and arrangement model;
[0045] Step S2: obtaining a large number of natural language-based historical test description texts, and constructing a data set after preprocessing and annotating each of the historical test description texts;
[0046] Step S3, training the vocabulary extraction and arrangement model using the data set;
[0047] Step S4, obtaining an input real-time test description text, inputting the real-time test description text into a vocabulary extraction and arrangement model, and obtaining a vocabulary arrangement result;
[0048] Step S5: convert the word arrangement result according to the grammar rule to obtain the corresponding battery test steps, and compile each of the battery test steps to obtain a battery test process file.
[0049] During specific implementation, a process file generation log is generated based on the real-time test description text, the vocabulary compilation result and the battery test process file, the process file generation log is encrypted, stored and backed up, and the vocabulary extraction and compilation model is continuously optimized based on the process file generation log.
[0050] In the step S1, the grammar rules are used to convert each word in the word arrangement result into a corresponding step type, step parameter, step condition, condition parameter and parameter format in sequence, thereby generating a battery test step;
[0051] The vocabulary extraction and arrangement model is composed of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module;
[0052] The input module is used for inputting the test description text; the shallow feature extraction module is used for extracting shallow features from the test description text; the semantic feature extraction module is used for performing context learning on the test description text to extract deep features; the feature fusion module is used for fusing shallow features and deep features to obtain fused features; and the output module is used for outputting the fused features as a word compilation result.
[0053] By setting the vocabulary extraction and arrangement model to consist of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module; the input module is used to input the test description text; the shallow feature extraction module is used to extract shallow features from the test description text; the semantic feature extraction module is used to perform context learning on the test description text to extract deep features; the feature fusion module is used to fuse shallow features and deep features to obtain fused features; the output module is used to output the fused features as a vocabulary arrangement result; that is, the vocabulary extraction and arrangement model can not only learn the surface meaning of the test description text, but also understand the deep meaning in combination with semantics and context, thereby greatly improving the reliability of the output of the vocabulary arrangement result, thereby greatly improving the quality of battery test process document generation.
[0054] The step S2 is specifically as follows:
[0055] A large number of natural language-based historical test description texts are obtained, and after preprocessing the data cleaning and format conversion of each of the historical test description texts, the vocabulary and arrangement relationship of each of the historical test description texts are annotated, and then a data set is constructed based on the annotated historical test description texts.
[0056] By preprocessing and annotating the historical test description texts for data cleaning and format conversion and then building a data set, the quality of the data set is effectively improved, the training effect of the vocabulary extraction and arrangement model is greatly improved, and the quality of battery test process document generation is greatly improved.
[0057] The step S3 is specifically as follows:
[0058] The data set is randomly divided into a training set and a validation set based on a preset segmentation ratio, and the vocabulary extraction and arrangement model is trained by the training set until the loss function is less than a preset loss threshold. The trained vocabulary extraction and arrangement model is then verified by the validation set to determine whether the accuracy of the extraction and arrangement is greater than the preset accuracy threshold. If so, the training is terminated; if not, the training set is expanded to continue the training.
[0059] The step S4 is specifically as follows:
[0060] A real-time test description text based on natural language input is obtained, and after preprocessing the real-time test description text, the real-time test description text is input into a vocabulary extraction and arrangement model in real time to obtain a vocabulary arrangement result.
[0061] A preferred embodiment of a natural language-based battery test process file generation system of the present invention includes the following modules:
[0062] An initialization module, used to define a grammatical rule for generating a battery test step, create a vocabulary extraction and arrangement model based on a neural network, and set a loss function of the vocabulary extraction and arrangement model;
[0063] A data set construction module is used to obtain a large amount of historical test description texts based on natural language, and to construct a data set after preprocessing and annotating each of the historical test description texts;
[0064] A vocabulary extraction and arrangement model training module, used for training the vocabulary extraction and arrangement model through the data set;
[0065] An extraction and arrangement module is used to obtain an input real-time test description text, input the real-time test description text into a vocabulary extraction and arrangement model, and obtain a vocabulary arrangement result;
[0066] The process file generation module is used to convert the word arrangement results according to the grammatical rules to obtain the corresponding battery test steps, and compile each of the battery test steps to obtain a battery test process file.
[0067] During specific implementation, a process file generation log is generated based on the real-time test description text, the vocabulary compilation result and the battery test process file, the process file generation log is encrypted, stored and backed up, and the vocabulary extraction and compilation model is continuously optimized based on the process file generation log.
[0068] In the initialization module, the grammar rules are used to convert each word in the word sorting result into the corresponding step type, step parameter, step condition, condition parameter and parameter format in sequence, thereby generating a battery test step;
[0069] The vocabulary extraction and arrangement model is composed of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module;
[0070] The input module is used for inputting the test description text; the shallow feature extraction module is used for extracting shallow features from the test description text; the semantic feature extraction module is used for performing context learning on the test description text to extract deep features; the feature fusion module is used for fusing shallow features and deep features to obtain fused features; and the output module is used for outputting the fused features as a word compilation result.
[0071] By setting the vocabulary extraction and arrangement model to consist of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module; the input module is used to input the test description text; the shallow feature extraction module is used to extract shallow features from the test description text; the semantic feature extraction module is used to perform context learning on the test description text to extract deep features; the feature fusion module is used to fuse shallow features and deep features to obtain fused features; the output module is used to output the fused features as a vocabulary arrangement result; that is, the vocabulary extraction and arrangement model can not only learn the surface meaning of the test description text, but also understand the deep meaning in combination with semantics and context, thereby greatly improving the reliability of the output of the vocabulary arrangement result, thereby greatly improving the quality of battery test process document generation.
[0072] The data set construction module is specifically used for:
[0073] A large number of natural language-based historical test description texts are obtained, and after preprocessing the data cleaning and format conversion of each of the historical test description texts, the vocabulary and arrangement relationship of each of the historical test description texts are annotated, and then a data set is constructed based on the annotated historical test description texts.
[0074] By preprocessing and annotating the historical test description texts for data cleaning and format conversion and then building a data set, the quality of the data set is effectively improved, the training effect of the vocabulary extraction and arrangement model is greatly improved, and the quality of battery test process document generation is greatly improved.
[0075] The vocabulary extraction and arrangement model training module is specifically used for:
[0076] The data set is randomly divided into a training set and a validation set based on a preset segmentation ratio, and the vocabulary extraction and arrangement model is trained by the training set until the loss function is less than a preset loss threshold. The trained vocabulary extraction and arrangement model is then verified by the validation set to determine whether the accuracy of the extraction and arrangement is greater than the preset accuracy threshold. If so, the training is terminated; if not, the training set is expanded to continue the training.
[0077] The extraction and arrangement module is specifically used for:
[0078] A real-time test description text based on natural language input is obtained, and after preprocessing the real-time test description text, the real-time test description text is input into a vocabulary extraction and arrangement model in real time to obtain a vocabulary arrangement result.
[0079] In summary, the advantages of the present invention are:
[0080] 1. By defining grammatical rules for generating battery test steps, a vocabulary extraction and arrangement model is created based on a neural network, and a loss function of the vocabulary extraction and arrangement model is set; then a large amount of historical test description texts based on natural language are obtained and preprocessed and annotated to construct a data set, and the vocabulary extraction and arrangement model is trained through the data set, and then the input real-time test description text is input into the vocabulary extraction and arrangement model to obtain the vocabulary arrangement result, and the vocabulary arrangement result is converted through grammatical rules to obtain the corresponding battery test steps, and finally each battery test step is compiled to obtain a battery test process file; that is, based on the pre-trained vocabulary extraction and arrangement model, the vocabulary arrangement result is automatically extracted from the real-time test description text based on natural language input, and then the vocabulary arrangement result is automatically converted into a battery test step through predefined grammatical rules, and finally the battery test step is compiled to obtain a battery test process file, and the whole process is automatically performed without manual operation, avoiding errors and omissions caused by manual operation, and ultimately greatly improving the quality and efficiency of battery test process file generation.
[0081] 2. By setting the vocabulary extraction and arrangement model to consist of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module; the input module is used for the input of the test description text; the shallow feature extraction module is used to extract shallow features from the test description text; the semantic feature extraction module is used to perform context learning on the test description text to extract deep features; the feature fusion module is used to fuse shallow features and deep features to obtain fused features; the output module is used to output the fused features as vocabulary arrangement results; that is, the vocabulary extraction and arrangement model can not only learn the surface meaning of the test description text, but also understand the deep meaning in combination with semantics and context, thereby greatly improving the reliability of the output of the vocabulary arrangement results, thereby greatly improving the quality of battery test process document generation.
[0082] 3. By preprocessing and annotating the historical test description texts for data cleaning and format conversion, the data set is constructed to effectively improve the quality of the data set, greatly improve the training effect of the vocabulary extraction and arrangement model, and thus greatly improve the quality of battery test process document generation.
[0083] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A method for generating a battery test process file based on natural language, characterized in that: The steps include: Step S1, defining a grammatical rule for generating a battery test step, creating a vocabulary extraction and arrangement model based on a neural network, and setting a loss function of the vocabulary extraction and arrangement model; Step S2: obtaining a large number of natural language-based historical test description texts, and constructing a data set after preprocessing and annotating each of the historical test description texts; Step S3, training the vocabulary extraction and arrangement model using the data set; Step S4, obtaining an input real-time test description text, inputting the real-time test description text into a vocabulary extraction and arrangement model, and obtaining a vocabulary arrangement result; Step S5: convert the word arrangement result according to the grammar rule to obtain the corresponding battery test steps, and compile each of the battery test steps to obtain a battery test process file.
2. The method for generating a battery test process file based on natural language according to claim 1, characterized in that: In the step S1, the grammar rules are used to convert each word in the word arrangement result into a corresponding step type, step parameter, step condition, condition parameter and parameter format in sequence, thereby generating a battery test step; The vocabulary extraction and arrangement model is composed of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module; The input module is used for inputting the test description text; the shallow feature extraction module is used for extracting shallow features from the test description text; the semantic feature extraction module is used for performing context learning on the test description text to extract deep features; the feature fusion module is used for fusing shallow features and deep features to obtain fused features; and the output module is used for outputting the fused features as a word compilation result.
3. The method for generating a battery test process file based on natural language according to claim 1, characterized in that: The step S2 is specifically as follows: A large number of natural language-based historical test description texts are obtained, and after preprocessing the data cleaning and format conversion of each of the historical test description texts, the vocabulary and arrangement relationship of each of the historical test description texts are annotated, and then a data set is constructed based on the annotated historical test description texts.
4. The method for generating a battery test process file based on natural language according to claim 1, characterized in that: The step S3 is specifically as follows: The data set is randomly divided into a training set and a validation set based on a preset segmentation ratio, and the vocabulary extraction and arrangement model is trained by the training set until the loss function is less than a preset loss threshold. The trained vocabulary extraction and arrangement model is then verified by the validation set to determine whether the accuracy of the extraction and arrangement is greater than the preset accuracy threshold. If so, the training is terminated; if not, the training set is expanded to continue the training.
5. The method for generating a battery test process file based on natural language according to claim 1, characterized in that: The step S4 is specifically as follows: A real-time test description text based on natural language input is obtained, and after preprocessing the real-time test description text, the real-time test description text is input into a vocabulary extraction and arrangement model to obtain a vocabulary arrangement result.
6. A battery test process document generation system based on natural language, characterized in that: Includes the following modules: An initialization module, used to define a grammatical rule for generating a battery test step, create a vocabulary extraction and arrangement model based on a neural network, and set a loss function of the vocabulary extraction and arrangement model; A data set construction module is used to obtain a large amount of historical test description texts based on natural language, and to construct a data set after preprocessing and annotating each of the historical test description texts; A vocabulary extraction and arrangement model training module, used for training the vocabulary extraction and arrangement model through the data set; An extraction and arrangement module is used to obtain an input real-time test description text, input the real-time test description text into a vocabulary extraction and arrangement model, and obtain a vocabulary arrangement result; The process file generation module is used to convert the word arrangement results according to the grammatical rules to obtain the corresponding battery test steps, and compile each of the battery test steps to obtain a battery test process file.
7. A natural language based battery test process document generation system as claimed in claim 6, characterized in that: In the initialization module, the grammar rules are used to convert each word in the word sorting result into the corresponding step type, step parameter, step condition, condition parameter and parameter format in sequence, thereby generating a battery test step; The vocabulary extraction and arrangement model is composed of an input module, a shallow feature extraction module, a semantic feature extraction module, a feature fusion module and an output module; The input module is used for inputting the test description text; the shallow feature extraction module is used for extracting shallow features from the test description text; the semantic feature extraction module is used for performing context learning on the test description text to extract deep features; the feature fusion module is used for fusing shallow features and deep features to obtain fused features; and the output module is used for outputting the fused features as a word compilation result.
8. The natural language-based battery test process document generation system according to claim 6, characterized in that: The data set construction module is specifically used for: A large number of natural language-based historical test description texts are obtained, and after preprocessing the data cleaning and format conversion of each of the historical test description texts, the vocabulary and arrangement relationship of each of the historical test description texts are annotated, and then a data set is constructed based on the annotated historical test description texts.
9. The natural language-based battery test process document generation system according to claim 6, characterized in that: The vocabulary extraction and arrangement model training module is specifically used for: The data set is randomly divided into a training set and a validation set based on a preset segmentation ratio, and the vocabulary extraction and arrangement model is trained by the training set until the loss function is less than a preset loss threshold. The trained vocabulary extraction and arrangement model is then verified by the validation set to determine whether the accuracy of the extraction and arrangement is greater than the preset accuracy threshold. If so, the training is terminated; if not, the training set is expanded to continue the training.
10. The natural language-based battery test process document generation system according to claim 6, characterized in that: The extraction and arrangement module is specifically used for: A real-time test description text based on natural language input is obtained, and after preprocessing the real-time test description text, the real-time test description text is input into a vocabulary extraction and arrangement model to obtain a vocabulary arrangement result.