Script modeling tool, interface model generation method and electronic device
By receiving and verifying the CAN communication mapping rule table through a script modeling tool, an interface model with hierarchical relationships is automatically generated, which solves the problem of errors introduced by manually creating signal interface models and improves the reliability of electronic control.
Patent Information
- Application Number
- CN202611365708.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-20
AI Technical Summary
In automotive electronic and electrical systems, human error is introduced when signal interface models are manually created, leading to low reliability of electronic control.
The script modeling tool receives the CAN communication mapping rule table generated based on preset mapping rules, performs verification and hierarchical data conversion, and automatically generates a target interface model with hierarchical relationships, replacing manual on-site configuration of signal conversion logic.
This reduces manual modifications to the model architecture and signal conversion logic, lowers human error, and improves the reliability of electronic control.
Smart Images

Figure CN123138218A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic control technology, and in particular to a script modeling tool, an interface model generation method, and an electronic device. Background Technology
[0002] In automotive electronic and electrical systems, Controller Area Network (CAN) bus communication is the core technology for enabling data interaction between various Electronic Control Units (ECUs).
[0003] In related technologies, manually creating signal interface models for signal conversion introduces human error, leading to low reliability of electronic control. Summary of the Invention
[0004] This application provides script modeling tools, interface model generation methods, and electronic devices to improve the reliability of electronic control.
[0005] In a first aspect, embodiments of this application provide a script modeling tool for creating a target interface model for signal conversion. The script modeling tool is configured to perform the following steps:
[0006] Receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and signal conversion logic corresponding to each CAN signal. The preset mapping rule includes multiple preset signal conversion logic.
[0007] The CAN communication mapping rule table is validated to obtain a validation result, which is either validation passed or validation failed.
[0008] When the verification result is successful, the CAN communication mapping rule table is transformed into hierarchical data to obtain structured data with hierarchical relationships.
[0009] Based on the hierarchical relationship, the structure data is modeled to obtain the target interface model.
[0010] Secondly, embodiments of this application provide a method for generating an interface model, comprising:
[0011] Receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and signal conversion logic corresponding to each CAN signal. The preset mapping rule includes multiple preset signal conversion logic.
[0012] The CAN communication mapping rule table is validated to obtain a validation result, which is either validation passed or validation failed.
[0013] When the verification result is successful, the CAN communication mapping rule table is transformed into hierarchical data to obtain structured data with hierarchical relationships.
[0014] Based on the hierarchical relationship, the structure data is modeled to obtain the target interface model.
[0015] Thirdly, embodiments of this application provide an interface model generation apparatus, comprising:
[0016] The receiving module is used to receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and the signal conversion logic corresponding to each CAN signal. The preset mapping rules include multiple preset signal conversion logics.
[0017] The verification module is used to verify the CAN communication mapping rule table and obtain the verification result, which is either verification passed or verification failed.
[0018] The conversion module is used to perform hierarchical data conversion on the CAN communication mapping rule table when the verification result is successful, so as to obtain structured data with hierarchical relationship.
[0019] The modeling module is used to model the structure data according to the hierarchical relationship to obtain the target interface model.
[0020] Fourthly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0021] The memory stores computer-executed instructions;
[0022] The processor executes computer execution instructions stored in the memory, causing the processor to perform the implementation method described in the first aspect above.
[0023] Fifthly, embodiments of this application provide a non-volatile computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the embodiments of the first aspect above.
[0024] Sixthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the implementation methods described in the first aspect above.
[0025] The script modeling tool, interface model generation method, and electronic device provided in this application receive a standardized CAN communication mapping rule table generated based on preset mapping rules as an input data source, replacing the manual on-site configuration of signal conversion logic. Based on the CAN communication mapping rule table, it automatically generates a target interface model with hierarchical relationships, which can reduce manual modification of the model architecture and signal conversion logic, reduce human subjective errors, and thus improve the reliability of electronic control. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0027] Figure 1 A schematic diagram illustrating an application scenario of an interface model generation method provided in this application embodiment;
[0028] Figure 2 A flowchart illustrating a method for generating an interface model provided in an embodiment of this application;
[0029] Figure 3 A flowchart illustrating another method for generating an interface model provided in an embodiment of this application;
[0030] Figure 4 A schematic diagram illustrating the generation of a CAN communication mapping rule table provided in an embodiment of this application;
[0031] Figure 5 This is a schematic diagram illustrating the generation of structure data provided in an embodiment of this application;
[0032] Figure 6 A schematic diagram of modeling provided for an embodiment of this application;
[0033] Figure 7 A schematic diagram showing the comparison before and after template instantiation provided in the embodiments of this application;
[0034] Figure 8 A schematic diagram of the structure of an interface model generation device provided in an embodiment of this application;
[0035] Figure 9 A schematic diagram of the structure of another interface model generation device provided in an embodiment of this application;
[0036] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0037] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0039] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0040] It should be noted that the phrase "at...time" in the embodiments of this application can refer to the instant at which a certain situation occurs, or to a period of time after the occurrence of a certain situation; the embodiments of this application do not specifically limit this. Furthermore, the display interface provided in the embodiments of this application is merely an example, and the display interface may include more or less content.
[0041] It should be noted that the script modeling tool, interface model generation method, and electronic device of this application can be used in the field of electronic control technology, or in any field other than electronic control. The application fields of the script modeling tool, interface model generation method, and electronic device of this application are not limited.
[0042] Figure 1This is a schematic diagram illustrating an application scenario of an interface model generation method provided in this application embodiment. An example is given based on the illustrated scenario: Electronic control units transmit messages to each other, converting the messages into CAN signals. The electronic control units then generate control logic based on the CAN signals to achieve vehicle operation control.
[0043] In practical applications, signal conversion is achieved through interface models. Therefore, the accuracy of the interface model determines the reliability of the electronic control system.
[0044] In related technologies, staff members create interface models on-site. This method is influenced by the staff's knowledge and experience, introducing human error and resulting in low reliability of the interface model, which in turn leads to low reliability of the electronic control system.
[0045] The method for generating the interface model provided in this application aims to solve the above-mentioned technical problems in related technologies.
[0046] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0047] Figure 2 A flowchart illustrating a method for generating an interface model provided in this application embodiment is shown. The method includes the following steps:
[0048] S201. Receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and the signal conversion logic corresponding to each CAN signal. The preset mapping rules include multiple preset signal conversion logics.
[0049] In this embodiment of the application, the execution subject can be a script modeling tool used to create a target interface model, which is used for signal conversion.
[0050] For example, the script modeling tool is a hardware processing device. The script modeling tool stores a pre-written automated processing program. The controller in the script modeling tool can execute the automated processing program to complete the reading, verification, data conversion and modeling operations of the CAN communication mapping rule table.
[0051] For example, a CAN communication mapping rule table is a tabular data file used to describe the transmission and conversion attributes of each CAN signal in the CAN communication matrix.
[0052] Optionally, the CAN communication matrix is a summary table of CAN information, which includes the message identifier, message period, message name, and information such as signal name, start bit, signal length, precision, offset, and physical value range for each message.
[0053] Based on the CAN communication matrix, staff can generate a CAN communication mapping rule table by adding a mapping type field according to preset mapping rules.
[0054] Among them, the signal conversion logic represents the conversion method between the original value of the CAN message and the physical quantity of the application layer.
[0055] For example, preset mapping rules are used to define the types and configuration methods of signal conversion logic, and preset mapping rules include multiple preset signal conversion logics.
[0056] Optionally, the preset signal conversion logic includes, but is not limited to, at least one of the following: linear conversion, invalid value assignment, default value assignment, table lookup processing, and array indexing.
[0057] With the scenario example as an illustration, in the actual implementation process, developers can fill in the mapping type field of each CAN signal row by row on the CAN communication matrix according to project requirements, forming a CAN communication mapping rule table. The CAN communication mapping rule table is stored in spreadsheet format, with each row corresponding to a CAN signal and each column corresponding to an attribute field.
[0058] S202. Verify the CAN communication mapping rule table to obtain the verification result, which is either verification passed or verification failed.
[0059] For example, the verification is used to check whether the configuration data in the CAN communication mapping rule table meets the preset rule requirements, so as to avoid defects in the generated interface model due to problems such as incomplete input information or signal interface names not meeting the requirements.
[0060] For example, the verification process traverses each field of the CAN communication mapping rule table in a line-by-line scanning manner, comparing the read configuration data item by item with the preset verification rules.
[0061] For example, the verification process includes multiple verification dimensions, each of which verifies the configuration data from a different perspective.
[0062] When all verification dimensions pass, the verification result is "verification passed," indicating that the CAN communication mapping rule table meets the modeling conditions; when any verification dimension fails, the verification result is "verification failed," indicating that there are incorrect configurations in the CAN communication mapping rule table that need to be corrected.
[0063] For example, the validation process can help identify errors made by developers when filling out the mapping rule table.
[0064] For example, errors may occur due to missing necessary parameter configurations for a CAN signal, an undefined value being entered in the mapping type field, an interface name not conforming to naming conventions, or precision or offset parameters exceeding a reasonable range.
[0065] When validation fails, the script modeling tool outputs a list of issues, which records the failed validation dimensions and the location and information of the abnormal fields. After the developers modify the mapping rule table according to the issue list, the script modeling tool reruns the validation until it passes.
[0066] S203. When the verification result is successful, the CAN communication mapping rule table is transformed into hierarchical data to obtain structured data with hierarchical relationships.
[0067] For example, hierarchical data transformation is the process of converting planar tabular data in a CAN communication mapping rule table into structured data with hierarchical nesting relationships.
[0068] Structured data is a nested composite data type that can organize data of different granularities according to hierarchical relationships.
[0069] The purpose of hierarchical data transformation is to organize the configuration data in the CAN communication mapping rule table into a data structure that is easy to traverse layer by layer, according to the access order of subsequent modeling operations, so that the modeling script tool can access the data layer by layer in the order from message period to message and then to signal.
[0070] For example, hierarchical data transformation categorizes and organizes configuration data according to multiple preset levels.
[0071] Optionally, multiple levels are included, including message period, message identifier, and interface identifier. The message period is the time interval at which CAN messages are periodically transmitted on the bus; the message identifier is the unique identifier of the CAN message; and the interface identifier is the name identifier of the CAN signal in the application layer interface.
[0072] During the transformation process, messages with the same period are grouped together at the outermost level; messages within each period are classified according to their identifier at the middle level; and signals under each message are classified according to their interface identifier at the innermost level. This results in a three-layer nested data structure, with each layer corresponding to a different data granularity.
[0073] For example, each node in the structure data stores attribute information for the corresponding level.
[0074] Optionally, the outermost node stores message period information, the middle layer nodes store message attributes such as message name and message identifier, and the innermost node stores signal attributes such as signal name, precision, offset, maximum value, minimum value, and mapping type.
[0075] For example, through a hierarchical data organization method, the modeling script tool can quickly locate the message and message period of each signal according to the hierarchical relationship during the modeling process, thereby achieving orderly automated modeling.
[0076] S204. Based on the hierarchical relationship, model the structure data to obtain the target interface model.
[0077] For example, the modeling process takes structure data as input and creates the model structure layer by layer according to the hierarchical relationship of the structure data. The model hierarchy in the target interface model corresponds one-to-one with the hierarchy of the structure data.
[0078] For example, the modeling script tool first traverses the outermost layer of the structure data and creates a top-level subsystem for each message cycle; then it traverses the middle layers and creates a message subsystem for each message within each top-level subsystem; finally, it traverses the innermost layer and creates a signal conversion logic model for each CAN signal within each message subsystem.
[0079] For example, in the target interface model, the name of the top-level subsystem corresponds to the message period.
[0080] For example, the top-level subsystem corresponding to a message with a period of 10ms is named 10ms; the name of the message subsystem corresponds to the message name, for example, the message subsystem corresponding to a message named BCM_Status is named BCM_Status.
[0081] This naming convention allows users of the model to directly understand the cycle and message information corresponding to a subsystem by its name, facilitating the configuration and scheduling of periodic tasks within the AUTOSAR architecture.
[0082] The interface model generation method provided in this application embodiment receives a CAN communication mapping rule table of a controller area network. The CAN communication mapping rule table is generated on a CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and signal conversion logic corresponding to each CAN signal. The preset mapping rules include multiple preset signal conversion logics. The CAN communication mapping rule table is verified to obtain a verification result, which is either verification passed or verification failed. When the verification result is verification passed, the CAN communication mapping rule table is transformed into hierarchical data to obtain hierarchical structure data. Based on the hierarchical relationship, the structure data is modeled to obtain the target interface model.
[0083] The above solution receives a standardized CAN communication mapping rule table generated based on preset mapping rules as the input data source, replacing the manual on-site configuration of signal conversion logic. Based on the CAN communication mapping rule table, it automatically generates a target interface model with hierarchical relationships, which can reduce manual modification of the model architecture and signal conversion logic, reduce human subjective error, and thus improve the reliability of electronic control.
[0084] Based on any of the above embodiments, the following, in conjunction with Figure 3 The detailed process of generating the interface model is explained.
[0085] Figure 3 This is a flowchart illustrating another method for generating an interface model provided in an embodiment of this application. For example... Figure 3 As shown, the method includes the following steps:
[0086] S301 Receive the CAN communication mapping rule table of the controller local area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and the signal conversion logic corresponding to each CAN signal. The preset mapping rules include multiple preset signal conversion logics.
[0087] Below, in conjunction with Figure 4 The method for generating the CAN communication mapping rule table is explained.
[0088] Figure 4 This is a schematic diagram illustrating the generation of a CAN communication mapping rule table provided in an embodiment of this application. For example... Figure 4 As shown, a mapping type field has been added to the traditional CAN protocol message table. The script uses this field to find the corresponding template model and automatically generate the interface model.
[0089] One feasible implementation method is to establish preset mapping rules by: determining the communication scenario and determining multiple preset signal conversion logics based on the communication scenario. The multiple preset signal conversion logics include at least one of the following: linear conversion, invalid value assignment, default value assignment, table lookup processing, and array indexing.
[0090] Based on multiple preset signal conversion logics, preset mapping rules are established.
[0091] Among them, linear conversion is used to perform proportional conversion according to precision and offset; invalid value assignment is used to output a preset invalid value when the signal is invalid; default value assignment is used to output a preset default value when the signal is missing; table lookup processing is used to complete the nonlinear mapping between the original value and the physical quantity through a lookup table; array indexing is used to retrieve the corresponding physical quantity from the array based on the original value as an index.
[0092] Each CAN signal corresponds to a signal conversion logic, and the CAN communication mapping rule table associates each CAN signal with its corresponding signal conversion logic.
[0093] For example, the communication scenario refers to the specific application scenario in which the CAN network operates, such as powertrain control, vehicle body control, and diagnostic communication. The data characteristics and conversion requirements of CAN signals differ across these different communication scenarios.
[0094] With scenario examples, in power control scenarios, motor speed signals can be converted from raw CAN values to physical speed quantities using linear conversion logic. In diagnostic communication scenarios, fault status signals can use invalid value assignment logic to output preset invalid values when anomalies are diagnosed. In battery management scenarios, battery temperature signals can use lookup table processing logic to perform nonlinear mapping using calibrated temperature characteristic curves. Developers select the appropriate conversion logic type from a variety of preset signal conversion logics based on the specific needs of the communication scenario, ensuring that the preset mapping rules cover all signal conversion requirements within that scenario.
[0095] The following table provides examples of several preset signal conversion logics:
[0096] Table 1
[0097]
[0098] Specifically, linear conversion refers to conversion according to the formula "physical value equals original value multiplied by precision plus offset"; invalid value assignment refers to setting the output value to a preset invalid value when the signal is invalid; default value assignment refers to setting the output value to a preset default value when the signal is missing; table lookup processing refers to mapping the original value to the physical value by looking up a table; array indexing refers to using the original value as an array index to obtain the corresponding physical value from a preset array.
[0099] For example, after determining multiple preset signal conversion logics, each preset signal conversion logic is treated as an option, and a preset mapping rule is established. The preset mapping rule defines the correspondence between each mapping type field and the signal conversion logic.
[0100] For example, when the value of the mapping type field is "0", it corresponds to linear conversion logic; when the value is "1", it corresponds to invalid value assignment logic; when the value is "2", it corresponds to default value assignment logic; when the value is "3", it corresponds to table lookup processing logic; and when the value is "4", it corresponds to array indexing logic.
[0101] Optionally, preset mapping rules are stored in the development terminal in the form of a configuration file. The script modeling tool calls the configuration file during the verification process to perform validity checks on the mapping type field in the mapping rule table.
[0102] Optionally, the process of establishing preset mapping rules can be completed in the initial stage of the project, and preset signal conversion logic can be continuously added as the project iterates. When adding preset signal conversion logic, it is only necessary to add a new mapping type field value and its corresponding signal conversion logic configuration to the preset mapping rule to expand the mapping rule table, without modifying the main code of the script modeling tool.
[0103] In this feasible implementation, by integrating multiple preset signal conversion logics into preset mapping rules, standardized field definitions and value specifications are provided for filling in the CAN communication mapping rule table. This allows different developers to fill in the mapping rule table according to unified rules, improving the standardization and maintainability of the rule table, thereby enhancing the reliability of electronic control.
[0104] One feasible implementation method involves determining multiple preset signal conversion logics using the following approach:
[0105] Identify multiple historical communication records corresponding to the communication scenario;
[0106] By decomposing signal data and clustering operational features from multiple historical communication records, the signal transmission patterns corresponding to the communication scenarios can be obtained.
[0107] Based on the signal transmission rules, determine the corresponding preset signal conversion logic.
[0108] For example, historical communication records refer to log data of signals transmitted by the CAN bus in a real operating environment. Multiple historical communication records can be obtained from bench tests, road tests, or calibration tests during the vehicle testing phase.
[0109] For example, each historical communication record contains the original message data, message timestamps, signal values, etc., transmitted on the CAN bus within a certain time period. When determining multiple historical communication records corresponding to a communication scenario, associated message records can be filtered according to the type of communication scenario. For example, for a power control scenario, message records related to engine control and motor control can be filtered; for a diagnostic communication scenario, message records related to diagnostic services can be filtered.
[0110] For example, the more historical communication records there are, and the wider the range of operating conditions covered, the more accurate the signal transmission patterns determined based on that data will be. In practical applications, historical communication records from multiple vehicles and multiple driving cycles can be collected to ensure the comprehensiveness and representativeness of the data.
[0111] For example, signal data decomposition involves splitting the messages in each historical communication record according to the signal dimension and extracting the original value sequence of each CAN signal.
[0112] For example, a CAN message contains 8 bytes, which can be broken down into the original value sequences of the speed signal, torque signal, and temperature signal according to the signal definition.
[0113] For example, operating condition feature clustering is the classification of a large amount of decomposed signal data based on operating condition features.
[0114] For example, data can be divided into multiple categories based on characteristics such as engine speed range, vehicle speed range, and temperature range. By performing statistical analysis on signal data within the same category, we can summarize the range of signal values, variation patterns, and data distribution characteristics under different operating conditions. These statistical patterns are the signal transmission patterns.
[0115] For example, signal transmission patterns may include the normal range of signal values, the gradient range of signal changes, the frequency and triggering conditions of invalid values, and whether there is a linkage between signals.
[0116] For example, after decomposing and clustering the historical communication records of battery temperature signals, it was found that the physical values of the temperature signals exhibit a specific nonlinear mapping relationship in different ambient temperature ranges. Therefore, it was determined that a lookup table processing logic was needed for signal conversion.
[0117] For example, the signal transmission rules reflect the signal conversion requirements in practical applications, and the preset signal conversion logic applicable to each signal can be determined based on these rules.
[0118] For example, when the signal transmission pattern shows that there is an approximately linear relationship between the physical value of the signal and the original value, linear conversion logic is used; when the signal transmission pattern shows that the signal will output a fixed value under specific abnormal conditions, invalid value assignment logic is used; when the signal transmission pattern shows that there is a non-linear correspondence between the physical value of the signal and the original value, table lookup processing logic is used; when the signal transmission pattern shows that the signal value can be directly mapped from a preset state table, array indexing logic is used.
[0119] For example, the preset signal conversion logic determined according to the signal transmission law can be one or more. The multiple preset signal conversion logics contained in the preset mapping rule cover different signal transmission law types, so that the generated mapping rule can flexibly adapt to various signal conversion requirements.
[0120] In this feasible implementation, by extracting signal transmission patterns from historical communication records and determining preset signal conversion logic based on these patterns, adaptive conversion logic selection based on actual data transmission characteristics is achieved, thereby improving the adaptability of mapping rules and thus enhancing the reliability of electronic control.
[0121] One feasible implementation method is to establish a pre-set template model library using the following methods:
[0122] Determine the mapping identifier corresponding to each preset signal conversion logic to obtain multiple mapping identifiers;
[0123] Establish a template model corresponding to each preset signal conversion logic to obtain multiple template models;
[0124] A preset template model library is established based on multiple mapping identifiers and multiple template models.
[0125] For example, the mapping identifier is a unique number for each preset signal conversion logic within a preset mapping rule. The mapping identifier can be a numeric number, a string encoding, or other unique identification form. The mapping identifier is determined when the preset mapping rule is established and is referenced in the mapping type field of the CAN communication mapping rule table.
[0126] For example, a template model is a pre-built model unit for each preset signal conversion logic. Each template model contains the complete implementation structure of that signal conversion logic, including input ports, output ports, calculation modules, parameter modules, and connection relationships.
[0127] For example, the template model corresponding to the linear conversion logic includes a gain module and an offset module. The gain module is used to multiply by the precision value, and the offset module is used to add the offset. The template model corresponding to the invalid value assignment logic includes a comparator and a constant module. The comparator is used to determine whether the signal is invalid, and the constant module is used to output a preset invalid value. The template model corresponding to the lookup table processing logic includes a one-dimensional lookup table module, which stores the calibrated mapping table data.
[0128] With the example of the scenario, it can be shown that by building a template model in advance, complex signal conversion logic can be completed during the construction process of the template model. The modeling script tool only needs to copy the template model and modify the key parameters, without the need for manual on-site module creation.
[0129] For example, multiple mapping identifiers and multiple template models are stored as key-value pairs, that is, each mapping identifier corresponds to one template model, forming a preset template model library. The preset template model library can be organized in the form of a file directory, with each template model saved as an independent model file, and the file name corresponding to the mapping identifier.
[0130] For example, when the script modeling tool performs a modeling operation, it reads the mapping type field in the structure data, finds the corresponding template model file from the preset template model library based on the mapping type field, and copies and loads the template model file into the target interface model.
[0131] In this feasible implementation, by determining the mapping identifier, establishing the template model, and constructing a preset template model library, the template model matching operation in the modeling process can be completed quickly, reducing human subjective error and thus improving the reliability of electronic control.
[0132] S302. Traverse each field of the CAN communication mapping rule table to obtain multiple configuration data.
[0133] For example, the CAN communication mapping rule table is stored in tabular format, with each row corresponding to a CAN signal and each column corresponding to an attribute field. Traversing each field means reading the contents of all cells in the table one by one, along the row and column dimensions.
[0134] For example, the configuration data includes the message identifier, message period, signal name, mapping type, precision, offset, maximum value, minimum value, and initial value for each CAN signal. During the traversal, the script modeling tool parses and stores the value of each field according to a preset data format, resulting in multiple configuration data sets.
[0135] For example, the traversal method can be row-by-row scanning, column-by-column scanning, or block indexing.
[0136] In some embodiments, a row-by-row scanning method is used. Starting from the first row of the table, the field values of all columns in that row are read sequentially. The read field values are combined to form the configuration data for the corresponding CAN signal in that row, and then the next row is read, until all rows have been traversed. After traversal, all the obtained configuration data is stored in memory in the form of an array or table for use in subsequent verification processes.
[0137] For example, the amount of configuration data is related to the number of signals in the CAN communication mapping rule table. When the CAN communication mapping rule table contains hundreds of CAN signals, the amount of configuration data is correspondingly large. Automatically obtaining configuration data through iteration avoids the tedious process of manually entering each signal.
[0138] S303. Perform multi-dimensional verification on multiple configuration data to obtain multiple sub-verification results. The multi-dimensional verification includes at least one of the following: field integrity verification, mapping type validity verification, interface name standardization verification, and parameter configuration correctness verification.
[0139] For example, the field integrity check is used to check whether all the required fields of each CAN signal have been filled. The required fields include message identifier, message period, signal name, mapping type, precision and offset, etc. If any required field is missing, the field integrity check will fail.
[0140] The mapping type validity check is used to check whether the value of the mapping type field is within the set of mapping identifiers defined by the preset mapping rules. For example, if the preset mapping rules define five mapping identifiers from Type1 to Type5, and the value of the mapping type field is Type6, then the mapping type validity check fails.
[0141] Interface name compliance check is used to check whether the signal interface name conforms to the preset naming conventions, such as whether the interface name starts with a letter, whether it contains illegal characters, whether it meets the length limit, and whether it conforms to the naming conventions defined by the project.
[0142] The parameter configuration correctness check is used to check whether the configuration of parameters such as precision, offset, maximum value, and minimum value are within a reasonable range. For example, whether the precision value is greater than zero, whether the maximum value is greater than the minimum value, and whether the offset is within the allowed value range.
[0143] Each verification dimension outputs a sub-verification result, which indicates whether the verification passed or failed.
[0144] For example, multi-dimensional validation can be performed simultaneously during a single iteration. That is, the validation of the above multiple dimensions is performed sequentially for each configuration data, resulting in multiple sub-validation results. For each configuration data, if all dimensions pass the validation, the sub-validation result of that configuration data is determined to be valid; if any dimension fails the validation, the sub-validation result of that configuration data is determined to be invalid.
[0145] Optionally, the sub-validation results can be stored as a list or array, recording the validation dimension and validation result for each field.
[0146] S304. When multiple sub-verification results are all verified as passed, the verification result is determined to be verified as passed.
[0147] For example, when all sub-verification results corresponding to the configuration data pass the verification, it means that all fields in the CAN communication mapping rule table meet the preset verification rules, and the entire verification result is determined to be successful. After successful verification, the script modeling tool continues to execute the subsequent hierarchical data transformation and modeling process.
[0148] For example, multiple sub-verification results passing means that all four dimensions—field integrity verification, mapping type validity verification, interface name standardization verification, and parameter configuration correctness verification—have passed, and each field of each CAN signal meets the requirements. This verification result indicates that the data quality of the CAN communication mapping rule table meets the modeling requirements and can proceed to the next step of processing.
[0149] S305. When at least one of the multiple sub-verification results is found to be a failed verification result, the verification result is determined to be a failed verification result.
[0150] For example, if at least one of the multiple sub-verification results is a verification failure, it indicates that there is an incorrect configuration in the CAN communication mapping rule table, and the verification result is determined to be a verification failure.
[0151] If the validation fails, the script modeling tool stops the subsequent hierarchical data transformation and modeling process and outputs a problem message indicating that the validation failed.
[0152] For example, upon determining that the verification result is a failure, the script modeling tool can generate a problem list. This list records the failed verification dimensions, the row and column numbers of the exception fields, the current value of the exception fields, and the expected value. Developers then modify the CAN communication mapping rule table based on this problem list.
[0153] Based on the above implementation method, by traversing each field of the CAN communication mapping rule table to obtain configuration data and verifying it in multiple dimensions, the integrity and correctness of the configuration data can be comprehensively detected. This effectively avoids defects in the generated model due to configuration errors, improves the reliability of the modeling process, and thus enhances the reliability of electronic control.
[0154] One feasible implementation method is to handle cases where validation fails, including:
[0155] When the validation result is that the validation failed, determine the validation dimension that failed and the abnormal field;
[0156] Based on the CAN communication mapping rule table, the failed verification dimensions, and the exception fields, a modification strategy is generated.
[0157] For example, when the verification result is that the verification failed, the script modeling tool filters out the sub-verification results that failed from multiple sub-verification results and determines the verification dimension corresponding to each sub-verification result that failed.
[0158] For example, if a field integrity check fails, the failed check dimension becomes the field integrity check dimension. Simultaneously, the script modeling tool uses the index information recorded in the sub-check results to locate the specific position of the abnormal field in the CAN communication mapping rule table, including the row and column numbers, thereby determining the field name and current value of the abnormal field.
[0159] For example, the abnormal field can be identified by recording the field index when the validation fails.
[0160] Specifically, when iterating through the configuration data for validation, for each failed validation item, information such as the field identifier, field name, current value, and validation rule is stored in the error log. Each record in the error log corresponds to an exception field.
[0161] For example, a modification strategy is an automated suggestion to guide developers in correcting abnormal fields. The script modeling tool generates specific modification suggestions based on the context information of the abnormal field in the CAN communication mapping rule table, combined with the failed validation dimensions and the current value of the abnormal field.
[0162] For example, when the field integrity check fails and the abnormal field is a missing precision field for a certain CAN signal, the modification strategy is to fill in the precision value of the signal in the precision field; when the mapping type validity check fails and the current value of the abnormal field is Type6, the modification strategy is to change the mapping type field to the mapping identifier defined in the preset mapping rules.
[0163] For example, the modification strategy is displayed in text form in the issue list, which lists the location of the abnormal fields, their current values, the failed validation dimensions, and modification suggestions in a table format.
[0164] Optionally, developers can correct the abnormal fields in the CAN communication mapping rule table item by item according to the modification strategy. After the correction is completed, the script modeling tool will be run again until the verification passes.
[0165] In this feasible implementation, by identifying the failed verification dimensions and abnormal fields and generating modification strategies, developers are provided with accurate error location information and correction suggestions. This allows developers to quickly find the locations that need correction without manually checking all configuration data, thereby improving the reliability of electronic control.
[0166] S306. When the verification result is successful, the CAN communication mapping rule table is transformed into hierarchical data to obtain structured data with hierarchical relationships.
[0167] One feasible implementation method involves hierarchical data transformation, specifically through the following steps:
[0168] Based on multiple preset levels, the configuration data in the CAN communication mapping rule table is categorized and organized to obtain multiple parameter sets corresponding to multiple levels, including message period, message identifier and interface identifier.
[0169] Create multi-level structures based on multiple levels;
[0170] Multiple parameter sets are filled into a multi-level structure according to their corresponding levels to obtain the structure data.
[0171] During the classification and organization process, all configuration data is traversed, the message period field value in each configuration data is extracted, and configuration data with the same message period value are grouped into the same message period parameter set.
[0172] Within each message period parameter set, configuration data with the same message identifier is further categorized based on the message identifier field value, grouping them into the same message identifier parameter set. Within each message identifier parameter set, configuration data with the same interface identifier is categorized a third time based on the interface identifier field value, grouping them into the same interface identifier parameter set.
[0173] The final parameter set has three levels of nested logic. The outermost parameter set contains multiple intermediate parameter sets, and each intermediate parameter set contains multiple innermost parameter sets.
[0174] For example, the purpose of categorizing and organizing is to pre-organize data according to the access order required during modeling, so that when creating a multi-level structure later, the data can be directly filled in according to the hierarchical order without having to search repeatedly during the modeling process.
[0175] For example, in an application scenario containing 100 CAN signals, the configuration data, after being categorized and organized, can be divided into three message period parameter sets according to periods of 10ms, 20ms, and 100ms. Each parameter set contains the corresponding message parameter set and signal parameter set.
[0176] For example, a multi-level structure is a nested structure data type. A multi-level structure consists of a top-level structure, intermediate-level structures, and an innermost structure. Each element of the top-level structure corresponds to a message period, each element of the intermediate-level structures corresponds to a message identifier, and each element of the innermost structure corresponds to an interface identifier.
[0177] For example, the field names in a multi-level structure correspond to the meaning of the level.
[0178] Specifically, the field name of the top-level structure is the period value; the field name of the middle-level structure is the message name; and the field name of the innermost structure is the interface name. This field naming convention establishes a correspondence between the access path of the structure data and the hierarchical structure of the target interface model, thereby directly locating the data of the corresponding signal.
[0179] For example, multiple parameter sets obtained from classification and organization are filled into a multi-level structure according to their respective hierarchical relationships.
[0180] Specifically, the message periodicity parameter set is filled into the corresponding fields of the top-level structure, the message identifier parameter set is filled into the corresponding fields of the intermediate-level structure, and the interface identifier parameter set is filled into the corresponding fields of the innermost-level structure. After filling, each node in the multi-level structure contains complete parameter information for its corresponding level.
[0181] For example, during the population process, the script modeling tool needs to maintain a consistent correspondence between the parameter set and the structure fields. For instance, when populating the message cycle parameter set, parameters with a cycle value of 10ms are populated into the Cycle_10ms field of the top-level structure, and parameters with a cycle value of 20ms are populated into the Cycle_20ms field. The resulting structure data after population serves as the input data for subsequent modeling operations.
[0182] Below, in conjunction with Figure 5 The generated structure data is explained.
[0183] Figure 5 This is a schematic diagram illustrating the generation of structure data provided in an embodiment of this application. For example... Figure 5 As shown, the original two-dimensional table data is reorganized into a structured data with three nested levels. The structured data is divided into message period level, message level and signal level from top to bottom. The message period level is grouped according to the message sending period. Each period group contains multiple messages. Each message carries a corresponding CAN signal. The signal level stores all configuration parameters such as mapping type field, precision, offset, and upper and lower limit of value.
[0184] Based on the above implementation method, the configuration data is categorized and organized according to three levels: message period, message identifier, and interface identifier. A multi-level structure is created to fill in the configuration data according to the level. This transforms the planar table data in the CAN communication mapping rule table into structure data with hierarchical relationships. The organization of the structure data corresponds to the model structure, which improves the readability of the modeling process and thus enhances the reliability of electronic control.
[0185] S307. Based on the hierarchical relationship, model the structure data to obtain the target interface model.
[0186] One feasible implementation approach can be modeled using the following methods:
[0187] Encapsulate messages with the same message period in the structure data into the corresponding top-level subsystem, and name the top-level subsystem according to the message period;
[0188] Each message in the top-level subsystem is encapsulated into a message subsystem, and the message subsystem is named according to the message name of each message.
[0189] Determine the CAN signal for each message from the configuration data;
[0190] The target interface model is obtained by modeling the CAN signal of each message.
[0191] Below, in conjunction with Figure 6 Explain the modeling process.
[0192] Figure 6 A schematic diagram illustrating the modeling provided in an embodiment of this application. For example... Figure 6 As shown, the automatically generated interface model adopts a hierarchical nested architecture. Each top-level subsystem corresponds to a message cycle level, encapsulating CAN messages with the same message cycle within that top-level subsystem. Each top-level subsystem contains one or more message subsystems, with a one-to-one correspondence between message subsystems and CAN messages. The modeling script tool reads the structure data, sequentially creates top-level subsystems corresponding to different message cycles, and generates a corresponding number of message subsystems within each top-level subsystem, completing the construction of the interface model framework. External input signals are input into the top-level subsystems and distributed to the internal message subsystems, processed by the model, and then output.
[0193] For example, a top-level subsystem is a subsystem module in the interface model used to aggregate messages with the same message cycle. During the modeling process, the script modeling tool traverses the outermost layer of the structure data to obtain all message cycle values. For each message cycle value, a top-level subsystem is created.
[0194] For example, if the structure data contains three message cycles of 10ms, 20ms, and 100ms, then three top-level subsystems are created, named 10ms, 20ms, and 100ms respectively.
[0195] For example, naming the top-level subsystems according to the message cycle allows model users to intuitively see the cycle scheduling requirements corresponding to each subsystem. In the AUTOSAR architecture, different cycle tasks need to be executed within different time windows. By encapsulating messages with the same cycle in the same top-level subsystem, the model units corresponding to cycle tasks can be centrally managed.
[0196] For example, a message subsystem is a subsystem module within a top-level subsystem, and each message subsystem corresponds to one CAN message frame. During the modeling process, the script modeling tool iterates through the message identifier parameter set corresponding to each top-level subsystem and creates a message subsystem for each message identifier. The name of the message subsystem corresponds to the message name of that message.
[0197] Each example message contains one or more CAN signals, whose names correspond to the signal names in the CAN communication mapping rule table. When determining the CAN signals, the script modeling tool reads the signal name and mapping type fields for each message from the innermost node of the structure data to obtain the list of CAN signals for that message.
[0198] For example, modeling based on CAN signals involves creating a corresponding signal conversion logic model for each CAN signal. During the modeling process, the script modeling tool selects the corresponding template model from a preset template model library for each CAN signal based on its mapping type, copies the template model to the message subsystem to which the CAN signal belongs, and modifies the key parameters in the template model according to the parameter information in the structure data. After modeling all CAN signals under all messages is completed, the target interface model is generated.
[0199] In this feasible implementation, by sequentially encapsulating the top-level subsystem and the message subsystem, the CAN signal of each message is determined and modeled based on the CAN signal, so that the hierarchical structure of the target interface model corresponds to the periodic attributes and message affiliation of the message, reducing human error and thus improving the reliability of electronic control.
[0200] One feasible implementation approach can be modeled using the following methods:
[0201] From the CAN signal of each message, determine the mapping identifier of each message and the structure information of each message;
[0202] Based on the mapping identifier of each message, match the template model of each message from the preset template model library;
[0203] Copy and load the template model of each message into the corresponding message subsystem;
[0204] Based on the structure information of each message, the key parameters of the corresponding template model are modified to obtain the target interface model.
[0205] For example, the mapping identifier is the signal conversion logic identifier corresponding to the CAN signal in the preset mapping rules, stored in the mapping type field of the CAN communication mapping rule table. The structure information is the set of parameters stored in the structure data for the CAN signal, including signal name, precision, offset, maximum value, minimum value, initial value, etc. When determining the mapping identifier and structure information, the script modeling tool reads the mapping type field value and parameter field value corresponding to each CAN signal from the innermost node of the structure data.
[0206] For example, the mapping type field of a CAN signal has a value of Type1, corresponding to linear conversion logic; the structure information records a precision of 0.01, an offset of 0, a maximum value of 300, and a minimum value of 0. The mapping identifier is used to match the template model, and the structure information is used to modify the parameter values in the template model.
[0207] For example, the preset template model library stores multiple template models, each corresponding to a preset signal conversion logic, and indexed by a mapping identifier. When matching template models, the script modeling tool compares the mapping identifier of the CAN signal with the mapping identifier in the preset template model library to find a template model that matches the mapping identifier.
[0208] For example, when the mapping identifier is Type1, it matches the template model corresponding to the linear conversion logic; when the mapping identifier is Type3, it matches the template model corresponding to the table lookup processing logic.
[0209] For example, the template models in the preset template model library are stored as files in a specified directory, with file names corresponding to mapping identifiers. The matching process finds the corresponding template model file through the file system.
[0210] For example, copy loading is the operation of copying the matched template model file into the target interface model.
[0211] Specifically, the script modeling tool calls the model copy interface to copy the modules and connections from the template model file to the current message's message subsystem. During the copying process, the module names in the template model remain unique to avoid name conflicts with other modules in the same message subsystem.
[0212] For example, the copy loading method can be to insert the template model as a whole into the message subsystem, or to disassemble the modules and connections inside the template model and insert them into the message subsystem.
[0213] For example, key parameters are those in the template model that need to be adjusted according to the actual signal configuration. For the template model corresponding to linear conversion logic, key parameters include precision value, offset, and signal upper and lower limits; for the template model corresponding to lookup table processing logic, key parameters include lookup table data sequence and input / output range; for the template model corresponding to array indexing logic, key parameters include array element values. The script modeling tool reads the parameter values from the structure information and writes them into the corresponding parameter configuration items in the template model, completing the personalized configuration of the model.
[0214] For example, if the precision recorded in the structure information is 0.01 and the offset is 0, the modeling script tool will set the gain module parameter in the linear conversion logic template model to 0.01 and the offset module parameter to 0.
[0215] After parameter modification, each signal conversion logic model in the target interface model is consistent with the configuration data in the CAN communication mapping rule table.
[0216] Below, in conjunction with Figure 7 This section provides an explanation of the comparison before and after template instantiation.
[0217] Figure 7 This is a schematic diagram comparing the template before and after instantiation provided in the embodiments of this application. For example... Figure 7 As shown, the top is a pre-configured general signal processing template with fixed signal processing logic. Input ports, output ports, and module parameters are all identified by placeholders. The bottom is the actual signal model obtained after automatic instantiation. The modeling script tool parses the signal configuration parameters in the structure and performs replacements at parameter modification points without altering the template's internal calculation logic: replacing template placeholder ports with real service signal names, replacing placeholder constants with actual service constants, and updating the module's scaling, offset, and output data type parameters. This allows the same general template to generate models adapted to different CAN signals.
[0218] Based on the above implementation methods, by determining the mapping identifier and structure information, matching the template model, copying and loading the template model, and modifying key parameters, automated modeling of CAN signals is achieved, reducing human error and thus improving the reliability of electronic control.
[0219] One feasible implementation involves multiple layers, from the outside in, including a message cycle layer, a message identifier layer, and an interface identifier layer.
[0220] The message cycle hierarchy stores the set of message cycle parameters.
[0221] The message identifier hierarchy stores the set of message identifier parameters;
[0222] The interface identifier hierarchy stores the interface identifier and the set of signal attribute parameters.
[0223] For example, the preset multiple layers include three layers: message period, message identifier, and interface identifier. The message period layer is the outermost layer, the message identifier layer is the middle layer, and the interface identifier layer is the innermost layer.
[0224] For example, the outermost layer is the message period level, which is specifically used to collect and store the message period parameter set corresponding to all messages. The message period is used as the first dimension to complete the preliminary classification of all message data, and realize the unified collection and management of messages in the same period.
[0225] The intermediate layer is the message identifier layer, which belongs to the corresponding message cycle layer. It is used to store the message identifier parameter set corresponding to each independent message, and further distinguishes different individual message data based on the cycle classification.
[0226] The innermost layer is the interface identifier layer, which is set inside the message identifier layer. It is used to centrally store the interface identifier of the corresponding message and the set of various signal attribute parameters, so as to accurately collect all signal detail data under a single message.
[0227] In this feasible implementation, based on the three-layer nested hierarchical structure, the original two-dimensional table-style CAN communication mapping rule table data is transformed into structured data with clear hierarchy and well-defined affiliation, providing a regular and orderly data foundation, thereby improving the reliability of electronic control.
[0228] As an example, the preset signal conversion logic in the preset mapping rules supports dynamic expansion during project iterations.
[0229] For example, when a new signal conversion requirement is added to a project, developers can add a new mapping type field to the preset mapping rules, develop the corresponding template model according to the construction process of the preset template model library, and add the new template model to the preset template model library.
[0230] When the script modeling tool reads the CAN communication mapping rule table, it matches the template model from the updated preset template model library according to the mapping type field, without needing to modify the main script code.
[0231] In this example, by dynamically expanding the preset mapping rules and preset template model library, the method for generating the interface model can continuously adapt to new signal conversion requirements.
[0232] As an example, the template model reuse mechanism also supports template model version management.
[0233] For example, each template model in the preset template model library can be associated with version number information. During the modeling process, the version of each template model used can be recorded. When the template model is updated, the latest version of the template model can be applied to the target interface model by rerunning the script modeling tool.
[0234] In this example, the traceability and consistency of the model can be guaranteed through a version management mechanism.
[0235] Figure 8 This is a schematic diagram of an interface model generation device provided in an embodiment of this application. Figure 8 As shown, the interface model generation device 80 may include: a receiving module 81, a verification module 82, a conversion module 83, and a modeling module 84.
[0236] The receiving module 81 is used to receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and the signal conversion logic corresponding to each CAN signal. The preset mapping rules include multiple preset signal conversion logics.
[0237] The verification module 82 is used to verify the CAN communication mapping rule table and obtain the verification result, which is either verification passed or verification failed.
[0238] The conversion module 83 is used to perform hierarchical data conversion on the CAN communication mapping rule table when the verification result is successful, so as to obtain structured data with hierarchical relationship.
[0239] Modeling module 84 is used to model the structure data according to the hierarchical relationship to obtain the target interface model.
[0240] Optionally, the receiving module 81 can perform... Figure 2 S201 in the embodiment.
[0241] Optionally, the verification module 82 can perform... Figure 2 S202 in the embodiment.
[0242] Optionally, conversion module 83 can perform... Figure 2 S203 in the embodiment.
[0243] Optionally, modeling module 84 can be executed. Figure 2 S204 in the embodiment.
[0244] In one possible implementation, the verification module 82 is specifically used for:
[0245] Iterate through each field of the CAN communication mapping rule table to obtain multiple configuration data;
[0246] Perform multi-dimensional validation on multiple configuration data to obtain multiple sub-validation results. The multi-dimensional validation includes at least one of the following: field integrity validation, mapping type validity validation, interface name standardization validation, and parameter configuration correctness validation.
[0247] If multiple sub-verification results all pass the verification, the verification result is determined to be a successful verification.
[0248] If at least one of the multiple sub-verification results is found to be a failed verification, the verification result is determined to be a failed verification.
[0249] In one possible implementation, the conversion module 83 is specifically used for:
[0250] Based on multiple preset levels, the configuration data in the CAN communication mapping rule table is categorized and organized to obtain multiple parameter sets corresponding to multiple levels, including message period, message identifier and interface identifier.
[0251] Create multi-level structures based on multiple levels;
[0252] Multiple parameter sets are filled into a multi-level structure according to their corresponding levels to obtain the structure data.
[0253] In one possible implementation, modeling module 84 is specifically used for:
[0254] Encapsulate messages with the same message period in the structure data into the corresponding top-level subsystem, and name the top-level subsystem according to the message period;
[0255] Each message in the top-level subsystem is encapsulated into a message subsystem, and the message subsystem is named according to the message name of each message.
[0256] The CAN signal for each message is determined from the configuration data; the target interface model is obtained by modeling based on the CAN signal of each message.
[0257] In one possible implementation, modeling module 84 is specifically used for:
[0258] From the CAN signal of each message, determine the mapping identifier of each message and the structure information of each message;
[0259] Based on the mapping identifier of each message, match the template model of each message from the preset template model library;
[0260] Copy and load the template model of each message into the corresponding message subsystem;
[0261] Based on the structure information of each message, the key parameters of the corresponding template model are modified to obtain the target interface model.
[0262] It should be noted that the interface model generation device shown in the embodiments of this application can execute the technical solution shown in the above method embodiments, and its implementation principle and beneficial effects are similar, so they will not be described again here.
[0263] Based on the above implementation method, a standardized CAN communication mapping rule table generated based on preset mapping rules is received as the input data source, replacing the manual on-site configuration of signal conversion logic. According to the CAN communication mapping rule table, a target interface model with hierarchical relationship is automatically generated, which can reduce manual modification of model architecture and signal conversion logic, reduce human subjective error, and thus improve the reliability of electronic control.
[0264] Figure 9 This is a schematic diagram of the structure of an interface model generation device provided in an embodiment of this application. Figure 8 Based on the illustrated embodiments, as Figure 9 As shown, the interface model generation device 80 further includes: a processing module 85, a configuration module 86, an analysis module 87, and a construction module 88.
[0265] Processing module 85 is used for:
[0266] When the validation result is that the validation failed, determine the validation dimension that failed and the abnormal field;
[0267] Based on the CAN communication mapping rule table, the failed verification dimensions, and the exception fields, a modification strategy is generated.
[0268] Configuration module 86 is used for:
[0269] Determine the communication scenario and, based on the communication scenario, determine multiple preset signal conversion logics. The multiple preset signal conversion logics include at least one of the following: linear conversion, invalid value assignment, default value assignment, table lookup processing, and array indexing.
[0270] Based on multiple preset signal conversion logics, preset mapping rules are established.
[0271] Analysis module 87 is used for:
[0272] Identify multiple historical communication records corresponding to the communication scenario;
[0273] By decomposing signal data and clustering operational features from multiple historical communication records, the signal transmission patterns corresponding to the communication scenarios can be obtained.
[0274] Based on the signal transmission rules, determine the corresponding preset signal conversion logic.
[0275] Module 88 is used for:
[0276] Determine the mapping identifier corresponding to each preset signal conversion logic to obtain multiple mapping identifiers;
[0277] Establish a template model corresponding to each preset signal conversion logic to obtain multiple template models;
[0278] A preset template model library is established based on multiple mapping identifiers and multiple template models.
[0279] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 10 As shown, the electronic device includes:
[0280] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, memory 292, and communication interface 293 can communicate with each other via the bus 294. The communication interface 293 can be used for information transmission. The processor 291 can invoke logical instructions stored in the memory 292 to execute the methods of the above embodiments.
[0281] Furthermore, the logic instructions in the aforementioned memory 292 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0282] The memory 292, as a non-volatile computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, that is, it implements the methods in the above-described method embodiments.
[0283] The memory 292 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 292 may include high-speed random access memory and may also include non-volatile memory.
[0284] Based on the above implementation method, a standardized CAN communication mapping rule table generated based on preset mapping rules is received as the input data source, replacing the manual on-site configuration of signal conversion logic. According to the CAN communication mapping rule table, a target interface model with hierarchical relationship is automatically generated, which can reduce manual modification of model architecture and signal conversion logic, reduce human subjective error, and thus improve the reliability of electronic control.
[0285] This application provides a non-volatile computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in the foregoing embodiments.
[0286] Based on the above implementation method, a standardized CAN communication mapping rule table generated based on preset mapping rules is received as the input data source, replacing the manual on-site configuration of signal conversion logic. According to the CAN communication mapping rule table, a target interface model with hierarchical relationship is automatically generated, which can reduce manual modification of model architecture and signal conversion logic, reduce human subjective error, and thus improve the reliability of electronic control.
[0287] This application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in the foregoing embodiments.
[0288] Based on the above implementation method, a standardized CAN communication mapping rule table generated based on preset mapping rules is received as the input data source, replacing the manual on-site configuration of signal conversion logic. According to the CAN communication mapping rule table, a target interface model with hierarchical relationship is automatically generated, which can reduce manual modification of model architecture and signal conversion logic, reduce human subjective error, and thus improve the reliability of electronic control.
[0289] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0290] It should be further noted that although the steps in the flowchart are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated in this document, there is no strict order requirement for the execution of these steps, and they can be executed in other orders.
[0291] Furthermore, at least some 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 may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0292] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0293] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0294] When an integrated unit / module is implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. The processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC.
[0295] The storage unit can be any suitable magnetic 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).
[0296] If an integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device.
[0297] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0298] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0299] Any of the components, modules, units, parts, methods, and operations described in this application can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be performed at least in part by one or more hardware logic components.
[0300] The terms “system,” “computing device,” or “apparatus” used in this document encompass a variety of apparatuses, devices, and machines for processing data, including, for example, one or more programmable processors, computers, systems-on-a-chip, or combinations thereof.
[0301] The device may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, protocol stack, database management system, operating system, cross-platform runtime environment, virtual machine, or a combination thereof. The aforementioned computer program (also referred to as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for the computing environment.
[0302] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software 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 beyond the scope of this application.
[0303] In the description of the embodiments of this application, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, an indirect connection through an intermediate medium, or the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application according to the specific circumstances.
[0304] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0305] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only.
[0306] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A script modeling tool, characterized in that, The script modeling tool is used to create a target interface model for signal conversion, and the script modeling tool is configured to perform the following steps: Receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and signal conversion logic corresponding to each CAN signal. The preset mapping rule includes multiple preset signal conversion logic. The CAN communication mapping rule table is validated to obtain a validation result, which is either validation passed or validation failed. When the verification result is successful, the CAN communication mapping rule table is transformed into hierarchical data to obtain structured data with hierarchical relationships. Based on the hierarchical relationship, the structure data is modeled to obtain the target interface model.
2. The script modeling tool according to claim 1, characterized in that, The step of verifying the CAN communication mapping rule table to obtain the verification result specifically includes: By iterating through each field of the CAN communication mapping rule table, multiple configuration data are obtained; The multiple configuration data are validated in multiple dimensions to obtain multiple sub-validation results. The multiple dimensions validation includes at least one of the following: field integrity validation, mapping type validity validation, interface name standardization validation, and parameter configuration correctness validation. When all of the sub-verification results pass the verification, the verification result is determined to be a successful verification. If at least one of the multiple sub-verification results is a verification failure, the verification result is determined to be a verification failure.
3. The script modeling tool according to claim 1, characterized in that, The step of performing hierarchical data transformation on the CAN communication mapping rule table to obtain hierarchical structured data specifically includes: Based on multiple preset levels, the configuration data in the CAN communication mapping rule table is categorized and organized to obtain multiple parameter sets corresponding to the multiple levels, including message period, message identifier and interface identifier; Create a multi-level structure based on the multiple levels; The multiple parameter sets are filled into the multi-level structure according to their corresponding levels to obtain the structure data.
4. The script modeling tool according to claim 3, characterized in that, The step of modeling the structure data according to the hierarchical relationship to obtain the target interface model specifically includes: In the structure data, messages with the same message period are encapsulated into the corresponding top-level subsystem, and the top-level subsystem is named according to the message period; Each message in the top-level subsystem is encapsulated into a message subsystem, and the message subsystem is named according to the message name of each message. The CAN signal for each message is determined from the configuration data; The target interface model is obtained by modeling the CAN signal of each message.
5. The script modeling tool according to claim 4, characterized in that, The step of modeling based on the CAN signal of each message to obtain the target interface model specifically includes: From the CAN signal of each message, determine the mapping identifier of each message and the structure information of each message; Based on the mapping identifier of each message, match the template model of each message from the preset template model library; The template model of each message is copied and loaded into the corresponding message subsystem; Based on the structure information of each message, the key parameters of the corresponding template model are modified to obtain the target interface model.
6. The script modeling tool according to claim 3, characterized in that, The multiple layers, from the outside in, include the message cycle layer, the message identifier layer, and the interface identifier layer; among them... The message period hierarchy stores a set of message period parameters; The message identifier hierarchy stores a set of message identifier parameters; The interface identifier hierarchy stores the interface identifier and a set of signal attribute parameters.
7. The script modeling tool according to claim 1, characterized in that, The script modeling tool is also configured to perform the following steps: When the verification result is that the verification failed, the verification dimension that failed and the abnormal field are determined. A modification strategy is generated based on the CAN communication mapping rule table, the failed verification dimensions, and the exception fields.
8. The script modeling tool according to any one of claims 1-7, characterized in that, The process of establishing the preset mapping rules includes: A communication scenario is determined, and multiple preset signal conversion logics are determined based on the communication scenario. The multiple preset signal conversion logics include at least one of the following: linear conversion, invalid value assignment, default value assignment, table lookup processing, and array indexing. Based on the multiple preset signal conversion logics, the preset mapping rules are established.
9. The script modeling tool according to claim 8, characterized in that, The step of determining multiple preset signal conversion logic steps based on the communication scenario specifically includes: Identify multiple historical communication records corresponding to the aforementioned communication scenario; By performing signal data decomposition and condition feature clustering on the multiple historical communication records, the signal transmission patterns corresponding to the communication scenario are obtained. Based on the signal transmission rules, determine the corresponding multiple preset signal conversion logics.
10. The script modeling tool according to claim 8, characterized in that, After establishing the preset mapping rules, the method further includes: Determine the mapping identifier corresponding to each preset signal conversion logic to obtain multiple mapping identifiers; Establish a template model corresponding to each preset signal conversion logic to obtain multiple template models; A preset template model library is established based on the multiple mapping identifiers and the multiple template models.
11. A method for generating an interface model, characterized in that, include: Receive the CAN communication mapping rule table of the controller area network. The CAN communication mapping rule table is generated on the CAN communication matrix based on preset mapping rules. The CAN communication mapping rule table includes multiple CAN signals and signal conversion logic corresponding to each CAN signal. The preset mapping rule includes multiple preset signal conversion logic. The CAN communication mapping rule table is validated to obtain a validation result, which is either validation passed or validation failed. When the verification result is successful, the CAN communication mapping rule table is transformed into hierarchical data to obtain structured data with hierarchical relationships. Based on the hierarchical relationship, the structure data is modeled to obtain the target interface model.
12. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method of claim 11.
