Signal line batch labeling method, model training method and device

By acquiring and analyzing the name and attribute information of the signal line, and using the annotation rule recommendation model to automatically determine the annotation rules and perform batch marking, the problem of low signal line labeling efficiency and accuracy in the prior art is solved, and the stability and interpretability of the model are improved.

CN120217857APending Publication Date: 2025-06-27SINO TRUK JINAN POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510292115.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, the signal line labeling efficiency and accuracy are low, which leads to difficult to effectively position during model design and simulation testing.

Method used

By obtaining the name and attribute information of multiple signal lines, using the pre-stored annotation rule recommendation model, the annotation rules of the signal lines are automatically determined and batch annotation is performed.

Benefits of technology

Improve the efficiency and accuracy of signal line labeling, ensure the stability and performance of the model at different development stages, while enhancing the interpretability and transparency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120217857A_ABST
    Figure CN120217857A_ABST
Patent Text Reader

Abstract

The invention provides a signal line batch labeling method and device and a model training method and device, and relates to the field of computer aided design software. The signal line batch labeling method comprises the following steps: acquiring a first type file comprising respective first names and first attribute information of a plurality of first signal lines, and respective second names and second attribute information of a plurality of second signal lines; determining a plurality of third signal lines commonly included by the plurality of first signal lines and the plurality of second signal lines according to the first type file and second names and second attribute information of the plurality of second signal lines, and obtaining first names and first attribute information of the plurality of third signal lines; inputting the first names and the first attribute information of the plurality of third signal lines into a pre-stored labeling rule recommendation model to obtain a recommended labeling rule corresponding to each third signal line; and marking the corresponding third signal line according to the recommended marking rule. Through the method, the labeling efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer-aided design software, and particularly to a method for batch labeling signal lines, a method for model training, and an apparatus therefor. Background Art

[0002] With the rapid evolution of the automotive industry towards intelligence, the functions of vehicles are becoming increasingly complex. Especially in the field of high-level intelligent driving, to achieve core functions such as environmental perception, the system needs to introduce a large number of algorithms and strategies. Against this background, the development method based on the Simulink model has become the mainstream practice in the industry. When using the Simulink model to build an intelligent driving algorithm model, its Simulink file structure is designed as a tree, including a top-level model, subsystems, and atomic modules to support complex system modeling and simulation. With the improvement of design requirements, the complexity of the Simulink model increases, and the number of signal lines also increases. These complex software functions need to be ensured for safety and reliability through simulation and testing. Therefore, signal line labeling in Simulink is an important part of problem positioning and analysis in the model design and simulation testing process.

[0003] In the prior art, the manual labeling method is adopted, that is, each signal line is labeled separately through manual operation, but the efficiency and accuracy of manual labeling are low. Summary of the Invention

[0004] This application provides a method for batch labeling signal lines, a method for model training, and an apparatus therefor, which are used to solve the problem of low labeling efficiency and accuracy caused by the existing signal line labeling method.

[0005] In a first aspect, this application provides a method for batch labeling signal lines, including:

[0006] Obtaining a first type of file including the first names and first attribute information of multiple first signal lines, and the second names and second attribute information of multiple second signal lines; wherein, each of the second signal lines is obtained based on several of the first signal lines;

[0007] According to the first type of file, and the second names and second attribute information of multiple second signal lines, determining multiple third signal lines jointly included by the multiple first signal lines and the multiple second signal lines from the multiple second signal lines, and obtaining the first names and first attribute information of the multiple third signal lines;

[0008] Inputting the first names and first attribute information of the multiple third signal lines into a pre-stored annotation rule recommendation model, and obtaining the recommended annotation rules corresponding to each of the third signal lines output by the annotation rule recommendation model;

[0009] Label the corresponding third signal lines according to the recommended labeling rules corresponding to each of the third signal lines.

[0010] In a possible design, the obtaining the first type of file including the first names and first attribute information of the respective multiple first signal lines includes:

[0011] Name the multiple first signal lines respectively according to a preset naming rule to obtain the first names of the respective multiple first signal lines;

[0012] Extract the first attribute information of the respective multiple first signal lines from the multiple first signal lines;

[0013] Obtain the first type of file according to the first names and first attribute information of the respective multiple first signal lines.

[0014] In a possible design, the obtaining the first type of file according to the first names and first attribute information of the respective multiple first signal lines includes:

[0015] Obtain a second type of file according to the first names and first attribute information of the respective multiple first signal lines; wherein, the format of the second type of file is a table;

[0016] Obtain the first type of file according to the second type of file; wherein, the format of the first type of file is a data dictionary.

[0017] In a possible design, the obtaining the first type of file according to the second type of file includes:

[0018] Modify the worksheet name of the second type of file;

[0019] Write the second type of file with the modified name into a script file to obtain the first type of file.

[0020] In a possible design, the naming the multiple first signal lines respectively according to a preset naming rule to obtain the first names of the respective multiple first signal lines includes:

[0021] Define variables sequentially indicating each of the first signal lines;

[0022] When the variable indicates a target signal line, name the target signal line according to the preset naming rule to obtain the first name of the target signal line; wherein, the target signal line is any one of the multiple first signal lines.

[0023] In a possible design, a labeling rule library is pre-stored, and at least one labeling rule template is pre-stored in the labeling rule library;

[0024] Labeling the corresponding third signal line according to the recommended labeling rule corresponding to each of the third signal lines includes:

[0025] Inputting each of the recommended labeling rules into the labeling rule library to obtain the labeling rule template corresponding to each of the recommended labeling rules output by the labeling rule library;

[0026] Labeling the corresponding third signal line according to each of the labeling rule templates.

[0027] In a possible design, after determining, according to the first type of file, and the second names and second attribute information of the multiple second signal lines, the multiple third signal lines jointly included by the multiple first signal lines and the multiple second signal lines, and obtaining the first names and first attribute information of the multiple third signal lines, the method further includes:

[0028] Obtaining the second names and second attribute information of the multiple third signal lines according to the second names and second attribute information of the multiple second signal lines;

[0029] Judging whether the corresponding third signal line is modified according to the first name, first attribute information, second name, and second attribute information of each of the third signal lines.

[0030] In a second aspect, the present application provides a model training method, including:

[0031] Training a labeling rule recommendation model according to the third names and third attribute information of the pre-stored multiple historical signal lines, and the recommended labeling rule corresponding to each of the historical signal lines; wherein the labeling rule recommendation model is used for the signal line batch labeling method provided in the first aspect of the present application.

[0032] In a third aspect, the present application provides a signal line batch labeling device, including:

[0033] A first information acquisition module, configured to acquire a first type of file including the first names and first attribute information of the multiple first signal lines, and the second names and second attribute information of the multiple second signal lines; wherein each of the second signal lines is obtained based on several of the first signal lines;

[0034] A second information acquisition module, configured to determine, from multiple second signal lines, multiple third signal lines jointly included by the multiple first signal lines and the multiple second signal lines according to the first type of file, as well as the second names and second attribute information of the multiple second signal lines respectively, and obtain the first names and first attribute information of the multiple third signal lines respectively;

[0035] A recommended annotation rule acquisition module, configured to input the first names and first attribute information of the multiple third signal lines respectively into a pre-stored annotation rule recommendation model, and obtain the recommended annotation rules corresponding to each third signal line output by the annotation rule recommendation model;

[0036] An annotation module, configured to annotate the corresponding third signal lines according to the recommended annotation rules corresponding to each third signal line.

[0037] In a fourth aspect, the present application provides a model training device, including:

[0038] An input module, configured to train an annotation rule recommendation model according to the third names and third attribute information of multiple pre-stored historical signal lines respectively, and the recommended annotation rules corresponding to each historical signal line; wherein the annotation rule recommendation model is used for the signal line batch annotation device provided in the third aspect of the present application.

[0039] In a fifth aspect, the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0040] The memory stores computer execution instructions;

[0041] The processor executes the computer execution instructions stored in the memory to implement the signal line batch annotation method provided in the first aspect of the present application or the model training method provided in the second aspect of the present application.

[0042] In a sixth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the signal line batch annotation method provided in the first aspect of the present application or the model training method provided in the second aspect of the present application.

[0043] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the signal line batch annotation method provided in the first aspect of the present application or the model training method provided in the second aspect of the present application.

[0044] The present application provides a method and apparatus for batch annotation of signal lines and a model training method. The method for batch annotation of signal lines includes: obtaining a first type of file including the first names and first attribute information of multiple first signal lines, and the second names and second attribute information of multiple second signal lines; determining, according to the first type of file, and the second names and second attribute information of the multiple second signal lines, multiple third signal lines jointly included by the multiple first signal lines and the multiple second signal lines from the multiple second signal lines, and obtaining the first names and first attribute information of the multiple third signal lines; inputting the first names and first attribute information of the multiple third signal lines into a pre-stored annotation rule recommendation model to obtain recommended annotation rules output by the annotation rule recommendation model corresponding to each third signal line; and annotating the corresponding third signal line according to the recommended annotation rule corresponding to each third signal line. Based on the above method, the following technical effects are achieved: at each stage of model development, monitoring and analyzing the changes in signal line information and taking corresponding measures can ensure the stability and performance of the model in different development stages. At the same time, it also helps to enhance the interpretability of the model, improve the transparency and credibility of the model; by using the trained annotation rule recommendation model to obtain the recommended annotation rules corresponding to each signal line and annotating the corresponding signal line through the recommended annotation rules, the efficiency and accuracy of annotation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0046] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application and used together with the specification to explain the principles of the present application.

[0047] Figure 1 Flow diagram of the method for batch annotation of signal lines provided by the embodiment of the present application Figure 1 ;

[0048] Figure 2 Flow diagram of the method for batch annotation of signal lines provided by the embodiment of the present application Figure 2 ;

[0049] Figure 3 Flow diagram of the method for batch annotation of signal lines provided by the embodiment of the present application Figure 3 ;

[0050] Figure 4Flow schematic of the signal line batch annotation method provided by the embodiment of the present application Figure 4 ;

[0051] Figure 5 Structural schematic diagram of the signal line batch annotation device provided by the embodiment of the present application;

[0052] Figure 6 Structural schematic diagram of the electronic device provided by the embodiment of the present application.

[0053] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed implementation manners

[0054] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0055] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit to be different. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific manner. In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more.

[0056] It should be noted that "when... " in the embodiments of the present application can be at the instant when a certain situation occurs, or within a period of time after a certain situation occurs. The embodiments of the present application do not make specific limitations on this. In addition, a signal line batch annotation method or a model training method provided by the embodiments of the present application is only used as an example, and the signal line batch annotation method or the model training method may also include more or less content.

[0057] It should be noted that the user information (including but not limited to user device information and user personal information) and data (including but not limited to data for analysis, stored data, and displayed data) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or reject.

[0058] To facilitate a clear description of the technical solutions of the embodiments of this application, the following briefly introduces some of the terms and technologies involved in the embodiments of this application:

[0059] Simulink model: A Simulink model is a graphical simulation and modeling environment integrated with MATLAB, specifically used for the modeling, simulation, and analysis of dynamic systems. Through its intuitive graphical interface, users can build and simulate complex multi-domain system models by dragging and dropping modules and connecting these modules.

[0060] Signal line: In a Simulink model, a signal line is an element used to connect the data flow between different modules or subsystems. The main function of a signal line is to transmit data. It connects different modules or subsystems in a Simulink model, transferring the output signal of one module to the input terminal of another module. The signals transmitted by the signal line can be different types of data, such as digital signals, analog signals, and Boolean values, etc.

[0061] To clearly understand the technical solutions of this application, the solutions of the prior art will be introduced in detail first.

[0062] Currently, the annotation of signal lines is carried out by manual annotation, that is, each signal line is individually annotated through manual operations, but the efficiency and accuracy of manual annotation are relatively low.

[0063] Therefore, in view of the problem of low annotation efficiency and accuracy caused by the existing signal line annotation method, it is found in the research that to solve this problem, ① obtain a file storing the standard names and standard attribute information of signal lines; ② input the standard names and standard attribute information of signal lines into a pre-stored annotation rule recommendation model to obtain the recommended annotation rules corresponding to each signal line; ③ annotate the corresponding signal lines according to each recommended annotation rule.

[0064] Based on the above creative discovery, the technical solutions of this application are proposed.

[0065] The application scenarios of the signal line batch annotation method provided by the embodiments of the present application are introduced below. The following application scenarios are only examples, aiming to help those skilled in the art understand the technical content of the present application, but it does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.

[0066] 1) Models such as automotive control systems that contain hundreds of signal lines: Through the signal line batch annotation method provided by the present application, signal lines can be quickly annotated and are not prone to errors.

[0067] 2) Multi-model collaborative design: In complex projects, multiple models need to work together. Different models are designed by different teams. When transmitting signals between models, the functions and properties of the signals need to be clearly identified. By annotating the signal lines through the signal line batch annotation method provided by the present application, the consistency of signals between multiple models can be ensured, facilitating collaborative design and integration.

[0068] 3) Automatically generating reports and documents: When documents need to be updated frequently, batch annotating signal lines can assist in automatically generating model documents and reports. By annotating the signal lines through the signal line batch annotation method provided by the present application, basic information such as signal types, sizes, and units can be provided for generating reports, thereby automatically generating detailed model documents.

[0069] The embodiments of the present application are introduced below in conjunction with the accompanying drawings of the specification.

[0070] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems are described in detail below with specific embodiments. These several specific embodiments below can be combined with each other. For the same or similar concepts or processes, they may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0071] Figure 1 Schematic flow of the signal line batch annotation method provided by the embodiments of the present application Figure 1 Then, the signal line batch annotation method provided by this embodiment includes the following steps:

[0072] S101. Obtain a first type of file including the first names and first attribute information of multiple first signal lines, and the second names and second attribute information of multiple second signal lines.

[0073] In this embodiment, each second signal line is obtained based on several first signal lines.

[0074] Specifically, the multiple first signal lines refer to the signal lines created during the initial design stage of the Simulink model, and their core function is to transmit data for modules with input / output ports. During the development process of the model, the Simulink model will undergo multiple modifications until the final Simulink model is formed. The multiple second signal lines refer to the signal lines created in the final Simulink model, and their core function is also to transmit data for modules with input / output ports. Compared with all the first signal lines, any one second signal line may belong to the signal lines that have changed, that is, the name or attribute information of the corresponding signal line has changed, or it may be a newly added signal line; it may also belong to the signal lines that have not changed, that is, the name and attribute information of the corresponding signal line have not changed. Monitoring and analyzing the changes in signal line information and taking corresponding measures at each stage of model development can ensure the stability and performance of the model in different development stages. At the same time, it also helps to enhance the interpretability of the model and improve the transparency and credibility of the model.

[0075] The first name refers to the name corresponding to each first signal line, and the first attribute information refers to the information corresponding to each first signal line, including data type, source module, target module, unit, and data range. The second name refers to the name corresponding to each second signal line, and the second attribute information refers to the information corresponding to each second signal line, including data type, source module, target module, unit, and data range. The information included in the attribute information is determined according to actual needs and is not specifically limited here.

[0076] In this embodiment, for obtaining the first name and first attribute information of each of the multiple first signal lines, first, obtain the handles of each of the multiple first signal lines, use the find_system function in combination with regular expressions to traverse the handles of all the first signal lines in the Simulink model, and then use the get_param function to extract the first name and first attribute information corresponding to each first signal line respectively. After obtaining the first name and first attribute information of each of the multiple first signal lines, save them in a first-type file, and the first-type file refers to a file in the.sldd format that can be imported into the Simulink model. The obtaining of the second name and second attribute information of each of the multiple second signal lines is similar to the above method and will not be elaborated here. The signal line names and attribute information in the.sldd format file can be read using readtable or readmatrix. By calling the simulink.BlockDiagram and find_system functions, it is possible to traverse the final Simulink model and collect the second name and second attribute information of all the second signal lines respectively.

[0077] S102. Determine multiple third signal lines that are commonly included in the multiple first signal lines and the multiple second signal lines from the multiple second signal lines according to the first type of file, as well as the second names and second attribute information of the respective multiple second signal lines, and obtain the first names and first attribute information of the respective multiple third signal lines.

[0078] In this embodiment, the multiple third signal lines refer to the signal lines that are commonly included in the multiple first signal lines and the multiple second signal lines. Through the relevant information stored in the first type of file, the first names and first attribute information of the respective multiple third signal lines can be obtained.

[0079] S103. Input the first names and first attribute information of the respective multiple third signal lines into a pre-stored annotation rule recommendation model, and obtain the recommended annotation rules corresponding to each third signal line output by the annotation rule recommendation model.

[0080] In this embodiment, a trained annotation rule recommendation model is pre-stored. The function of this annotation rule recommendation model is to obtain the recommended annotation rules corresponding to the signal line according to the input name and attribute information corresponding to the signal line.

[0081] For the pre-stored annotation rule recommendation model, a deep learning model is used to train the annotation rule recommendation model. First, a classification model is used to classify the signal lines, and then a regression model is used to implement the annotation rule recommendation task. For training data annotation, historical data is used as the training set, and the annotation data includes signal line features (input) and recommended annotation rules (output).

[0082] The following gives a piece of code for training the annotation rule recommendation model:

[0083] from sklearn.ensemble import RandomForestClassifier

[0084] # Train the model

[0085] model = RandomForestClassifier()

[0086] model.fit(X, y)

[0087] # Predict the annotation rules for new signals

[0088] new_signal = [{

[0089] "signal_name": "wheel_speed",

[0090] "data_type": "double",

[0091] "source_module": "wheelModule",

[0092] "target_module": "controlModule",

[0093] "unit": "rpm",

[0094] "range": "0 - 2000"

[0095] }]

[0096] X_new = vectorizer.transform(new_signal)

[0097] predicted_label = model.predict(X_new)

[0098] print("Recommended annotation rule:", predicted_label[0])

[0099] S104. Annotate the corresponding third signal line according to the recommended annotation rule corresponding to each third signal line.

[0100] In this embodiment, among the recommended annotation rules corresponding to the signal lines output by the annotation rule recommendation model, annotation information such as recommended name, naming specification, data type, and unit is included. Through the annotation information, the corresponding signal lines can be annotated. The information included in the recommended annotation rule is determined according to actual requirements and is not specifically limited here. Through the trained annotation rule recommendation model, the signal features are automatically recognized, and the recommended annotation rule corresponding to each signal line is obtained. And through this recommended annotation rule, the corresponding signal line is annotated, which can improve the efficiency and accuracy of annotation.

[0101] The present application provides a method for batch labeling of signal lines. The method for batch labeling of signal lines includes: obtaining a first type of file including the first names and first attribute information of multiple first signal lines, and the second names and second attribute information of multiple second signal lines; according to the first type of file, and the second names and second attribute information of multiple second signal lines, determining multiple third signal lines commonly included in the multiple first signal lines and the multiple second signal lines from the multiple second signal lines, and obtaining the first names and first attribute information of the multiple third signal lines; inputting the first names and first attribute information of the multiple third signal lines into a pre-stored labeling rule recommendation model, and obtaining recommended labeling rules corresponding to each third signal line output by the labeling rule recommendation model; and labeling the corresponding third signal lines according to the recommended labeling rules corresponding to each third signal line. Based on the above method, the following technical effects are achieved: at each stage of model development, monitoring and analyzing changes in signal line information and taking corresponding measures can ensure the stability and performance of the model in different development stages. At the same time, it also helps to enhance the interpretability of the model, improve the transparency and credibility of the model; by using the trained labeling rule recommendation model, obtaining recommended labeling rules corresponding to each signal line, and labeling the corresponding signal lines through the recommended labeling rules, the efficiency and accuracy of labeling can be improved.

[0102] Figure 2 Schematic flow of the method for batch labeling of signal lines provided by the embodiment of the present application Figure 2 This embodiment further explains the method for batch labeling of signal lines on the basis of the embodiment provided in Figure 1 . As shown in Figure 2 , S101 includes:

[0103] S201. Name the multiple first signal lines respectively according to the preset naming rule to obtain the first names of the multiple first signal lines.

[0104] Labeling signal lines in the Simulink model is an important part of locating problems in the model design and simulation test process. There are mainly 5 requirements for labeling signal lines: signal parsing, data recording, observation points, visualization, and viewers.

[0105] Specifically, if the labeling of the signal line is for setting observation points, the preset naming rule is the naming rule of the observation points in the modeling specification; if the labeling of the signal line is for signal parsing, the preset naming rule is the naming rule of the parsed data; if the labeling of the signal line is for data recording, the preset naming rule is the naming rule of the recorded data; if the labeling of the signal line is for visualization, the preset naming rule is the naming rule of the visualization data; if the labeling of the signal line is for the viewer, the preset naming rule is the naming rule of the viewed data. According to different requirements, different naming rules are set, and the signal lines are named according to the corresponding naming rules, so that the names have clear meanings and consistency. At the same time, identifying the signal usage through the names of the signal lines can reduce the complexity of model interpretation.

[0106] In this embodiment, first, the handles of multiple first signal lines are obtained respectively. The find_system function is used in combination with regular expressions to traverse the handles of all the first signal lines in the Simulink model. Then, according to the preset naming rule, the set_param function is used to set the corresponding first name for each first signal line respectively.

[0107] S202. Extract the first attribute information of each of the multiple first signal lines from the multiple first signal lines.

[0108] In this embodiment, the method for extracting the first attribute information of each of the multiple first signal lines has been mentioned in S101 and will not be elaborated here.

[0109] S203. Obtain a first type of file according to the first names and the first attribute information of each of the multiple first signal lines.

[0110] In this embodiment, the first names and the first attribute information of each of the obtained multiple first signal lines are saved in the first type of file.

[0111] In a possible design, S203 includes:

[0112] S301. Obtain a second type of file according to the first names and the first attribute information of each of the multiple first signal lines.

[0113] In this embodiment, the format of the second type of file is a table.

[0114] Specifically, the first names and the first attribute information of each of the multiple first signal lines are created into a second type of file, that is, an excel file. Before generating the.sldd format file that can be imported into the Simulink model, creating an excel file with the first names and the first attribute information can facilitate the collation and viewing of data information.

[0115] S302. Obtain the first type of file according to the second type of file.

[0116] In this embodiment, the format of the first type of file is a data dictionary.

[0117] Specifically, an excel file is created and a file in.sldd format that can be imported into the Simulink model is generated.

[0118] In a possible design, S302 includes:

[0119] S401. Modify the worksheet name of the second type of file.

[0120] Specifically, the first names and first attribute information of multiple first signal lines are created into an excel file, and the sheet name of the excel file is named Signal.

[0121] S402. Write the second type of file with the modified name into a script file to obtain the first type of file.

[0122] Specifically, the content of the excel file with the modified name is written into a new m file through the Matlab scripting language, and a file in.sldd format that can be imported into the Simulink model is automatically generated. Before generating the file in.sldd format that can be imported into the Simulink model, the content of the excel file with the modified name is written into a new m file through the Matlab scripting language. The scripting process reduces human intervention and potential errors, and can greatly improve the work efficiency and accuracy.

[0123] Figure 3 This is the process schematic of the signal line batch annotation method provided by the embodiment of the present application. Figure 3 . On the basis of the above embodiment, this embodiment further explains the signal line batch annotation method. As Figure 3 shown, S201 includes:

[0124] S501. Define variables that sequentially indicate each first signal line.

[0125] Specifically, the variable i traverses multiple first signal lines through a for loop, starting from index 0, and continues to loop as long as i is less than the number of first signal lines. Each time the loop is executed, i is incremented by 1.

[0126] S502. When the variable indicates the target signal line, name the target signal line according to the preset naming rule to obtain the first name of the target signal line.

[0127] In this embodiment, the target signal line is any one of the multiple first signal lines.

[0128] In each loop where the variable i indicates the target signal line, the target signal line is named according to a preset naming rule. When the entire for loop ends, it means that all the first signal lines have been traversed and each first signal line has been named. Using a for loop to traverse all the first signal lines and name each first signal line is concise and efficient, reducing manual intervention and errors, and is easier to maintain and expand.

[0129] Figure 4 Flow schematic of the signal line batch annotation method provided by the embodiment of the present application Figure 4 Based on the above embodiment, this embodiment further explains the signal line batch annotation method. As Figure 4 shown, a annotation rule library is pre-stored, and at least one annotation rule template is pre-stored in the annotation rule library. Then S104 includes:

[0130] S601. Input each recommended annotation rule into the annotation rule library, and obtain the annotation rule template corresponding to each recommended annotation rule output by the annotation rule library.

[0131] In this embodiment, an annotation rule library is pre-stored. Each recommended annotation rule input into this annotation rule library is matched with the annotation rule templates in this annotation rule library. If this annotation rule library pre-stores an annotation rule template corresponding to the recommended annotation rule, then the annotation rule template corresponding to the recommended annotation rule is output.

[0132] S602. Annotate the corresponding third signal line according to each annotation rule template.

[0133] In this embodiment, the annotation rule template includes annotation information such as a recommended name, naming specification, data type, and unit. Through the annotation information, the corresponding signal line can be annotated. The information included in the annotation rule template is determined according to actual needs and is not specifically limited here. By using the annotation rule template obtained by matching in the annotation rule library to annotate the signal line, the efficiency and accuracy of annotation can be improved.

[0134] The following gives a piece of code for obtaining an annotation rule template by matching with an annotation rule library:

[0135] rules={

[0136] "obs_engineSpeed": {

[0137] "prefix": "obs_",

[0138] "naming_convention": "camelCase",

[0139] "data_type": "double",

[0140] "unit": "rpm"

[0141] },

[0142] "obs_brakePressure": {

[0143] "prefix": "obs_",

[0144] "naming_convention":"camelCase",

[0145] "data_type": "single",

[0146] "unit": "Pa"

[0147] },

[0148] "obs_temperature": {

[0149] "prefix": "obs_",

[0150] "naming_convention": "camelCase",

[0151] "data_type": "double",

[0152] "unit": "degC"

[0153] }

[0154] }

[0155] def recommend_rule(predicted_label, signal_name):

[0156] rule = rules.get(predicted_label, {})

[0157] if rule:

[0158] # Generate the recommended rule

[0159] recommended_name = rule["prefix"] + signal_name

[0160] return {

[0161] "recommended_name": recommended_name,

[0162] "naming_convention": rule["naming_convention"],

[0163] "data_type": rule["data_type"],

[0164] "unit": rule["unit"]

[0165] }

[0166] return None

[0167] # Example signal

[0168] signal_name = "wheel_speed"

[0169] recommendation = recommend_rule(predicted_label[0], signal_name)

[0170] print("Recommended result:", recommendation)

[0171] Recommended result: {

[0172] 'recommended_name': 'obs_wheel_speed',

[0173] 'naming_convention': 'camelCase',

[0174] 'data_type': 'double',

[0175] 'unit': 'rpm'

[0176] }

[0177] In a possible design, after S102, the method further includes:

[0178] S701. Obtain the second names and second attribute information of the multiple third signal lines according to the second names and second attribute information of the multiple second signal lines respectively.

[0179] In this embodiment, the multiple third signal lines refer to the signal lines jointly included by the multiple first signal lines and the multiple second signal lines. Through the second names and second attribute information of the multiple second signal lines respectively, the second names and second attribute information of the multiple third signal lines can be obtained.

[0180] S702. Determine whether the corresponding third signal line is modified according to the first name, first attribute information, second name, and second attribute information of each third signal line.

[0181] In this embodiment, if the first name of the third signal line is different from the second name, or the first attribute information and the second attribute information of the third signal line are different, then the third signal line has been modified. In this case, using the set_param function, set the 'SignalName' attribute, and apply the first name of the third signal line to the corresponding signal line, or apply the first attribute information of the third signal line to the corresponding signal line. There are strict requirements for the name of the signal line during this process, and the case and abbreviations included in the name need to be kept consistent. When the name or attribute information of the signal line changes, by using the standardized information included in the first type of file to correct the changed data, the performance of the model can be improved, and a multi-dimensional balance of security, efficiency, and credibility can be achieved in complex applications.

[0182] The embodiment of this application can perform visual display. It is an interaction interface between different functions and is developed based on the App designer tool of MATLAB. It includes a start button, obtaining the first name and first attribute information, obtaining the first name and first attribute information of each of the multiple third signal lines, obtaining recommended annotation rules, obtaining annotation rule templates, prompting execution result information, and displaying the execution progress. It can manually select the required process, display the execution progress and information prompt, provide an intuitive operation interface, start each process and view the results, and provide a friendly human-computer interaction interface.

[0183] The embodiment of this application provides a model training method, including:

[0184] Train a recommended annotation rule model according to the third names and third attribute information of the multiple pre-stored historical signal lines respectively, and the recommended annotation rules corresponding to each historical signal line.

[0185] The recommended annotation rule model provided by this embodiment is used for the signal line batch annotation method provided by the above embodiment.

[0186] Figure 5 It is a schematic structural diagram of the signal line batch annotation device provided by the embodiment of this application. As Figure 5As shown in the figure, in this embodiment, the signal line batch annotation device may be located in an electronic device. The signal line batch annotation device includes:

[0187] A first information acquisition module 501, configured to acquire a first type of file including the first names and first attribute information of a plurality of first signal lines respectively, and the second names and second attribute information of a plurality of second signal lines respectively; wherein, each second signal line is obtained based on a plurality of first signal lines;

[0188] A second information acquisition module 502, configured to determine, from the plurality of second signal lines, a plurality of third signal lines jointly included by the plurality of first signal lines and the plurality of second signal lines according to the first type of file, and the second names and second attribute information of the plurality of second signal lines respectively, and obtain the first names and first attribute information of the plurality of third signal lines respectively;

[0189] A recommended annotation rule acquisition module 503, configured to input the first names and first attribute information of the plurality of third signal lines respectively into a pre-stored annotation rule recommendation model, and obtain the recommended annotation rules corresponding to each third signal line output by the annotation rule recommendation model;

[0190] An annotation module 504, configured to perform annotation on the corresponding third signal line according to the recommended annotation rule corresponding to each third signal line.

[0191] The signal line batch annotation device provided in this embodiment may execute Figure 1 the technical solution of the signal line batch annotation method embodiment shown in the figure, and its implementation principle and technical effect are similar to those of Figure 1 the signal line batch annotation method embodiment shown in the figure, and will not be elaborated here one by one.

[0192] Meanwhile, the signal line batch annotation device provided by the present invention further refines the signal line batch annotation device on the basis of the signal line batch annotation device provided in the previous embodiment.

[0193] Optionally, in this embodiment, when the first information acquisition module 501 acquires the first type of file including the first names and first attribute information of a plurality of first signal lines respectively, it names the plurality of first signal lines respectively according to a preset naming rule to obtain the first names of the plurality of first signal lines respectively;

[0194] Extract the first attribute information of the plurality of first signal lines respectively from the plurality of first signal lines;

[0195] Obtain the first type of file according to the first names and first attribute information of the plurality of first signal lines respectively.

[0196] Optionally, in this embodiment, when the first information acquisition module 501 obtains the first type of file according to the first names and first attribute information of the multiple first signal lines, it obtains a second type of file according to the first names and first attribute information of the multiple first signal lines; wherein, the format of the second type of file is a table.

[0197] Obtain the first type of file according to the second type of file; wherein, the format of the first type of file is a data dictionary.

[0198] Optionally, in this embodiment, when the first information acquisition module 501 obtains the first type of file according to the second type of file, it modifies the worksheet name of the second type of file.

[0199] Write the second type of file with the modified name into a script file to obtain the first type of file.

[0200] Optionally, in this embodiment, when the first information acquisition module 501 names the multiple first signal lines respectively according to a preset naming rule to obtain the first names of the multiple first signal lines, it defines variables that sequentially indicate each first signal line.

[0201] When a variable indicates a target signal line, name the target signal line according to a preset naming rule to obtain the first name of the target signal line; wherein, the target signal line is any one of the multiple first signal lines.

[0202] Optionally, in this embodiment, when the annotation module 504 annotates the corresponding third signal line according to the recommended annotation rule corresponding to each third signal line, it pre-stores an annotation rule library, and at least one annotation rule template is pre-stored in the annotation rule library.

[0203] Input each recommended annotation rule into the annotation rule library to obtain the annotation rule template corresponding to each recommended annotation rule output by the annotation rule library.

[0204] Annotate the corresponding third signal line according to each annotation rule template.

[0205] Optionally, in this embodiment, after the second information acquisition module 502 determines, from the multiple second signal lines, the multiple third signal lines jointly included in the multiple first signal lines and the multiple second signal lines, and obtains the first names and first attribute information of the multiple third signal lines according to the first type of file, and the second names and second attribute information of the multiple second signal lines, the method further includes:

[0206] Obtain the second names and second attribute information of the multiple third signal lines according to the second names and second attribute information of the multiple second signal lines.

[0207] Based on the first name, first attribute information, second name, and second attribute information of each third signal line, determine whether the corresponding third signal line is modified.

[0208] The signal line batch annotation device provided in this embodiment can execute the technical solutions of the above-mentioned signal line batch annotation method embodiment. Its implementation principle and technical effects are similar to those of the above-mentioned signal line batch annotation method embodiment, and will not be elaborated here one by one.

[0209] An embodiment of the present application provides a structural schematic diagram of a model training device. In this embodiment, the model training device can be located in an electronic device. The model training device includes:

[0210] According to the third names and third attribute information of multiple pre-stored historical signal lines respectively, and the recommended annotation rules corresponding to each historical signal line, a recommended annotation rule model is trained.

[0211] The recommended annotation rule model provided in the embodiment of the present application is used for the signal line batch annotation device provided in the above embodiment.

[0212] Figure 6 It is a structural schematic diagram of the electronic device provided in the embodiment of the present application. The electronic device is intended for various electronic devices that can execute the signal line batch annotation method or the model training method, such as, a microcomputer, a single-chip microcomputer, and other suitable computers. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0213] As Figure 6 shown, the electronic device includes: at least one processor 601 and a memory 602. The electronic device also includes a communication component 603. Among them, the processor 601, the memory 602, and the communication component 603 are connected through a bus 604.

[0214] In the specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the signal line batch annotation method or the model training method executed on the electronic device side as described above.

[0215] The specific implementation process of the processor 601 can refer to the above-mentioned signal line batch annotation method or model training method embodiment. Its implementation principle and technical effects are similar, and will not be elaborated here in this embodiment.

[0216] In the above embodiments, it should be understood that the processor 601 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor 601 may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being executed and completed by a hardware processor, or can be executed and completed by a combination of hardware and software modules in the processor.

[0217] The memory 602 may include high-speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.

[0218] The bus 604 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus 604 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the bus 604 in the drawings of the present application is not limited to only one bus or one type of bus.

[0219] The functions implemented for the electronic device and the main control device are described above for the solution provided by the embodiments of the present application. It can be understood that in order for the electronic device or the main control device to implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Combining the units and algorithm steps of each example described in the embodiments disclosed in the embodiments of the present application, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the manner of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiments of the present application.

[0220] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the above signal line batch annotation method or model training method is implemented.

[0221] The computer-readable storage medium described above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.

[0222] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. The readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). The processor and the readable storage medium can also exist as discrete components in an electronic device or a master device.

[0223] The memory 602 is the non-transitory computer-readable storage medium provided by the present invention. The non-transitory computer-readable storage medium of the present invention stores computer instructions for causing a computer to execute the signal line batch annotation method or the model training method provided by the present invention.

[0224] As a non-transitory computer-readable storage medium, the memory 602 can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions / modules corresponding to the signal line batch annotation method or the model training method in the embodiments of the present application. By running the non-transitory software programs, instructions, and modules stored in the memory 602, the processor 601 executes various functional applications and data processing, thereby implementing the signal line batch annotation method or the model training method in the above method embodiments.

[0225] Meanwhile, the present embodiment also provides a computer program product, including a computer program, which is used to implement the signal line batch annotation method or the model training method in the above embodiments when executed by a processor.

[0226] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0227] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential either, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0228] It should be understood that the above device embodiments are illustrative only, and the devices of the present application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0229] In addition, without special instructions, in each embodiment of the present application, each functional unit / module can be integrated in one unit / module, or each unit / module can exist physically alone, or two or more units / modules can be integrated together. The above integrated unit / module can be implemented in the form of hardware or in the form of a software program module.

[0230] When the integrated unit / module is implemented in the form of hardware, the hardware can be a digital circuit and an analog circuit. The physical implementation of the hardware structure includes but is not limited to transistors and memristors. Without special instructions, the processor can be any suitable hardware processor, such as CPU, GPU, FPGA, DSP and ASIC. Without special instructions, the storage unit can be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM) and hybrid memory cube (HMC).

[0231] When the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), external hard drives, magnetic disks, or optical discs.

[0232] In the above embodiments, the descriptions of the various embodiments each have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as falling within the scope described in this specification.

[0233] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include the common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.

[0234] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A signal line batch labeling method, characterized in that: include: Acquire a first type file including first names and first attribute information of each of a plurality of first signal lines, and second names and second attribute information of each of a plurality of second signal lines; wherein each of the second signal lines is obtained based on a plurality of the first signal lines; According to the first type file, and the second names and second attribute information of the plurality of second signal lines, determine a plurality of third signal lines commonly included by the plurality of first signal lines and the plurality of second signal lines from the plurality of second signal lines, and obtain the first names and first attribute information of the plurality of third signal lines; Inputting the first name and the first attribute information of each of the plurality of third signal lines into a pre-stored labeling rule recommendation model to obtain a recommended labeling rule corresponding to each of the third signal lines output by the labeling rule recommendation model; According to the recommended labeling rule corresponding to each of the third signal lines, the corresponding third signal line is labeled.

2. The signal line batch marking method according to claim 1, characterized in that: The obtaining of a first type file including first names and first attribute information of respective first signal lines includes: Naming the plurality of first signal lines respectively according to a preset naming rule to obtain respective first names of the plurality of first signal lines; Extracting first attribute information of each of the plurality of first signal lines from the plurality of first signal lines; The first type file is obtained according to the first names and first attribute information of each of the plurality of first signal lines.

3. The signal line batch marking method according to claim 2, characterized in that: The obtaining the first type file according to the first names and the first attribute information of the plurality of first signal lines comprises: According to the first names and the first attribute information of the plurality of first signal lines, a second type of file is obtained; wherein the format of the second type of file is a table; The first type of file is obtained according to the second type of file; wherein the format of the first type of file is a data dictionary.

4. The signal line batch marking method according to claim 3, characterized in that: The obtaining the first type of file according to the second type of file includes: Modify the worksheet name of the second type file; The second type of file with the modified name is written into the script file to obtain the first type of file.

5. The signal line batch marking method according to claim 2, characterized in that: The step of naming the plurality of first signal lines respectively according to a preset naming rule to obtain respective first names of the plurality of first signal lines includes: defining a variable indicating each of the first signal lines in turn; When the variable indicates a target signal line, the target signal line is named according to the preset naming rule to obtain a first name of the target signal line; wherein the target signal line is any one of the multiple first signal lines.

6. The signal line batch marking method according to claim 1, characterized in that: A labeling rule library is pre-stored, wherein at least one labeling rule template is pre-stored in the labeling rule library; The step of labeling the corresponding third signal line according to the recommended labeling rule corresponding to each of the third signal lines includes: Input each of the recommended annotation rules into the annotation rule library, and obtain an annotation rule template output by the annotation rule library corresponding to each of the recommended annotation rules; According to each of the marking rule templates, a corresponding third signal line is marked.

7. The signal line batch marking method according to claim 1, characterized in that: After determining, from the plurality of second signal lines, a plurality of third signal lines commonly included by the plurality of first signal lines and the plurality of second signal lines according to the first type file and the second names and second attribute information of the plurality of second signal lines, and obtaining the first names and first attribute information of the plurality of third signal lines, the method further comprises: According to the second names and second attribute information of the plurality of second signal lines, obtain the second names and second attribute information of the plurality of third signal lines; According to the first name, the first attribute information, the second name, and the second attribute information of each of the third signal lines, it is determined whether the corresponding third signal line is modified.

8. A model training method, characterized in that: include: According to the third names and third attribute information of each of the plurality of pre-stored historical signal lines, and the recommended labeling rules corresponding to each of the historical signal lines, a labeling rule recommendation model is trained; wherein the labeling rule recommendation model is used in the signal line batch labeling method according to any one of claims 1 to 7.

9. A signal line batch marking device, characterized in that: include: A first information acquisition module, used to acquire a first type of file including first names and first attribute information of each of a plurality of first signal lines, and second names and second attribute information of each of a plurality of second signal lines; wherein each of the second signal lines is obtained based on a plurality of the first signal lines; a second information acquisition module, configured to determine, from the plurality of second signal lines, a plurality of third signal lines commonly included by the plurality of first signal lines and the plurality of second signal lines according to the first type file and the second names and second attribute information of the plurality of second signal lines, and obtain the first names and first attribute information of the plurality of third signal lines; A recommended labeling rule acquisition module, used for inputting the first name and the first attribute information of each of the plurality of third signal lines into a pre-stored labeling rule recommendation model, and obtaining a recommended labeling rule corresponding to each of the third signal lines output by the labeling rule recommendation model; The labeling module is used to label the corresponding third signal line according to the recommended labeling rule corresponding to each of the third signal lines.

10. A model training device, characterized in that: include: An input module is used to train a labeling rule recommendation model based on the third name and third attribute information of each of the multiple pre-stored historical signal lines, and the recommended labeling rules corresponding to each of the historical signal lines; wherein the labeling rule recommendation model is used in the signal line batch labeling device described in claim 9.