Model construction method and device of vehicle electronic system and electronic equipment
By automatically identifying and replacing duplicate identifiers in vehicle electronic system configuration files, the problem of low vehicle electronic system model construction efficiency is solved, achieving efficient simulation model construction and configuration file accuracy.
Patent Information
- Application Number
- CN202410732436.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-15
AI Technical Summary
The model construction efficiency of vehicle electronic systems is low, mainly due to the problem of duplicate identifiers in configuration files, which results in low efficiency of manual troubleshooting and repair.
During the model building process of the vehicle electronic system, the simulation model of the vehicle electronic system is built by responding to abnormal model building instructions, automatically obtaining elements and identifiers in the configuration file, identifying and replacing duplicate identifiers, and generating an updated configuration file. .
Automated processing of identifier duplication issues improves the efficiency of vehicle electronic system model construction, ensures the accuracy and reliability of configuration files, reduces manual intervention, and improves the accuracy of simulation models.
Smart Images

Figure CN118779979A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle electronic system simulation modeling, and in particular to a vehicle electronic system model building method, device and electronic equipment. Background Art
[0002] The vehicle's electronic system is modeled and simulated using software tools such as MATLAB. The resulting simulation model can analyze and evaluate the system's performance, functionality, and stability. Simulation modeling of the vehicle's electronic system can help engineers quickly verify and optimize when designing and developing the vehicle's electronic system, thereby improving the reliability and efficiency of the vehicle's electronic system.
[0003] When simulating and modeling a vehicle electronic system, modeling anomalies may occur. Currently, relevant technicians are usually required to manually check the various configuration files of the vehicle electronic system to ensure the correctness of the configuration files. However, manual checking of configuration files is inefficient and it is difficult to repair the configuration files in a timely manner, resulting in low efficiency in model building of the vehicle electronic system.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device and electronic device for building a model of a vehicle electronic system, so as to at least solve the technical problem of low efficiency in building a model of a vehicle electronic system in the related art.
[0006] According to one aspect of an embodiment of the present invention, a method for building a model of a vehicle electronic system is provided, comprising: in a process of building a simulation model of the vehicle electronic system, in response to a model building exception instruction for the vehicle electronic system, obtaining multiple elements and identifiers of the multiple elements in a configuration file of the vehicle electronic system, wherein the model building exception instruction is an instruction generated when a simulation modeling exception occurs during the building process; determining a target element having a repeated identifier among the multiple elements based on the identifiers of the multiple elements; replacing the current identifier of the target element in the configuration file with the target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that is not repeated with the identifiers of the multiple elements; and building a simulation model of the vehicle electronic system based on the updated configuration file.
[0007] Optionally, the current identifier of the target element in the configuration file is replaced with the target identifier to obtain an updated configuration file, including: replacing the current identifier of the target element with the target identifier and generating a replacement record, wherein the replacement record is used to record the correspondence between the target element and the target identifier; and generating an updated configuration file based on the configuration file and the replacement record.
[0008] Optionally, generating an updated configuration file based on the configuration file and the replacement record includes: obtaining a current tree structure composed of multiple elements in the configuration file; updating the current tree structure based on the replacement record to obtain an updated tree structure; and updating the configuration file based on the updated tree structure to obtain an updated configuration file.
[0009] Optionally, the model building method of the vehicle electronic system also includes: building an identifier dictionary based on identifiers of multiple elements, wherein the identifier dictionary is used to store the identifiers of multiple elements and the number of occurrences of the identifiers of multiple elements; generating an identifier that does not appear in the identifier dictionary based on the identifier dictionary to obtain a target identifier.
[0010] Optionally, obtaining multiple elements and identifiers of multiple elements in a configuration file of a vehicle electronic system includes: obtaining a file path of the configuration file based on an exception type corresponding to an exception instruction constructed based on a model; calling the configuration file based on the file path, and determining multiple elements and identifiers of multiple elements in the configuration file.
[0011] Optionally, determining multiple elements and identifiers of multiple elements in the configuration file includes: calling a preset parsing function corresponding to the first file type according to the first file type of the configuration file; parsing the configuration file based on the preset parsing function to obtain a current tree structure composed of multiple elements in the configuration file and a root element of the current tree structure; and traversing the current tree structure based on the root element to obtain multiple elements and identifiers of the multiple elements.
[0012] Optionally, the vehicle electronic system is simulated and modeled based on the updated configuration file to obtain a simulation model of the vehicle electronic system, including: calling a preset modeling tool corresponding to the second file type based on the second file type of the updated configuration file, wherein the preset modeling tool is used to represent a pre-set software tool for simulation modeling of the configuration file; and using the preset modeling tool to simulate and model the vehicle electronic system based on the updated configuration file to obtain a simulation model.
[0013] According to another aspect of an embodiment of the present invention, a model building device for a vehicle electronic system is also provided, including: an acquisition module, used to acquire multiple elements and identifiers of multiple elements in a configuration file of the vehicle electronic system in response to receiving a model building exception instruction of the vehicle electronic system during the process of building a simulation model of the vehicle electronic system, wherein the model building exception instruction is an instruction generated when a simulation model modeling exception occurs during the construction process; a determination module, used to determine a target element with a repeated identifier among multiple elements based on the identifiers of the multiple elements; a replacement module, used to replace the current identifier of the target element in the configuration file with a target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that does not overlap with the identifiers of the multiple elements; and a construction module, used to build a simulation model of the vehicle electronic system based on the updated configuration file.
[0014] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.
[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0016] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0017] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0018] According to another aspect of the embodiments of the present invention, a computer program is further provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.
[0019] In an embodiment of the present invention, a method for building a model of a vehicle electronic system is provided, comprising: in a process of building a simulation model of the vehicle electronic system, in response to a model building exception instruction for the vehicle electronic system, obtaining multiple elements and identifiers of multiple elements in a configuration file of the vehicle electronic system, wherein the model building exception instruction is an instruction generated when a simulation model building exception occurs during the building process; determining a target element with a repeated identifier among multiple elements based on the identifiers of the multiple elements; replacing a current identifier of the target element in the configuration file with a target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that does not repeat with the identifiers of multiple elements; building a simulation model of the vehicle electronic system based on the updated configuration file. It is easy to notice that, considering that the cause of the simulation modeling exception of the vehicle electronic system is usually the presence of elements with repeated identifiers in the configuration file of the vehicle electronic system, the present application proposes a method for building a simulation model of the vehicle electronic system in response to receiving a model building exception instruction. After the model building exception instruction of the vehicle electronic system is received, multiple elements and identifiers of multiple elements in the configuration file of the vehicle electronic system are automatically obtained, which is convenient for subsequent checking of multiple elements and identifiers of multiple elements in the configuration file, realizing automatic response to the model building exception instruction, and checking whether there are repeated identifiers. If there are repeated identifiers, the elements corresponding to these repeated identifiers can be recorded or marked as target elements, and the current identifiers of the repeated identifier elements in the configuration file can be replaced with new identifiers. The present application can automatically determine the target elements with repeated identifiers in the configuration file and assign new identifiers to the target elements. During the implementation process, a programming language can be used to write a program, and the relevant file operations and string processing functions can be combined to realize the replacement of identifiers, so that a simulation model of the vehicle electronic system can be constructed based on the updated configuration file, thereby solving the technical problem of low efficiency in model building of the vehicle electronic system in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 is a flow chart of a method for building a model of a vehicle electronic system according to an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of a model building device for a vehicle electronic system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] Example 1
[0026] According to an embodiment of the present invention, an embodiment of a model building method for a vehicle electronic system is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] Figure 1 is a flow chart of a method for building a model of a vehicle electronic system according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0028] Step S102 : in the process of building a simulation model for the vehicle electronic system, in response to an abnormal model building instruction for the vehicle electronic system, obtaining a plurality of elements and identifiers of the plurality of elements in a configuration file of the vehicle electronic system.
[0029] Among them, the model building exception instruction is an instruction generated when an abnormal situation occurs in the simulation model building process.
[0030] The above-mentioned vehicle electronic system may refer to various electronic devices and systems on the vehicle, electronic systems used to control and monitor various functions and states of the vehicle and interact with users. The vehicle electronic system may include but is not limited to driving assistance systems, anti-lock braking systems, in-vehicle entertainment systems, air conditioning control systems, lighting control systems, etc. The vehicle electronic system is not limited here.
[0031] The above-mentioned model building abnormality instructions may refer to instructions generated or issued by the modeling tool or modeling software of the vehicle electronic system simulation model, or may be instructions manually edited by relevant technicians after discovering modeling abnormalities in the simulation model. The model building abnormality instructions are not limited here.
[0032] The above-mentioned configuration file may refer to a file used to describe the hardware and software configuration information of the vehicle electronic system. The configuration file may include parameter settings, communication protocols, signal definitions, diagnostic information, etc. of the electronic control unit. The configuration file may include ARXML files, etc. There is no specific limitation on the configuration file here. ARXML files can be used to describe software components, communication interfaces, parameters and signal definitions, etc. in the automotive electronic system. ARXML files can be used in the development and integration process of the vehicle electronic system to help developers model, configure and integrate the system.
[0033] The above-mentioned multiple elements may refer to various parameters, options, settings and rules in the configuration file, which can be used to define and configure various functions and behaviors of the vehicle electronic system. These elements may include basic information of the vehicle, configuration of sensors and controllers, settings of communication protocols, fault diagnosis and processing rules, system working modes and strategies, etc.
[0034] The above-mentioned identifier may refer to a name or symbol used to uniquely identify an element in a configuration file. The identifier may refer to a Universally Unique Identifier (UUID), etc. The identifier is not specifically limited here. In the configuration file of the vehicle electronic system, the identifier may be used to represent different components, parameters, functions, etc., so that the system can correctly identify and use these elements. The identifier may be composed of letters, numbers and underscores, and has certain naming rules and conventions to ensure the correctness and readability of the configuration file. Through the identifier, the system can accurately locate and identify each element in the configuration file, thereby realizing effective configuration and management of the vehicle electronic system.
[0035] In an optional embodiment, the vehicle electronic system can be simulated and analyzed using computer software and mathematical models. By establishing a simulation model of the system and using simulation software for calculation and simulation, the performance, behavior and response of the system can be predicted, helping engineers optimize designs, verify functions, identify problems, reduce costs and shorten development cycles. Simulation modeling of the vehicle electronic system can be used to conduct comprehensive testing and evaluation of the vehicle electronic system before the actual manufacture of the vehicle, so as to improve the quality and reliability of the vehicle electronic system. Considering that the cause of abnormal simulation modeling of the vehicle electronic system is usually an error in the configuration file of the vehicle electronic system, the present application proposes that in response to receiving a model building exception instruction of the vehicle electronic system, multiple elements and identifiers of the multiple elements in the configuration file of the vehicle electronic system are automatically obtained, so as to facilitate subsequent inspection of the multiple elements and identifiers of the multiple elements in the configuration file, and realize automatic response to the model building exception instruction.
[0036] Step S104: determining a target element having a repeated identifier among the multiple elements based on the identifiers of the multiple elements.
[0037] In an optional embodiment, in the configuration file, each element has a unique identifier, and the identifier can be used to distinguish different elements. In actual applications, two or more elements may have the same identifier in the configuration file. This may be due to data errors or other reasons. In this case, all elements in the configuration file can be traversed, and the identifiers of each element can be extracted. These identifiers are stored in a set, and then the identifiers in the set are traversed to check whether there are duplicate identifiers. If duplicate identifiers appear, the elements corresponding to these duplicate identifiers can be recorded or marked as target elements for subsequent processing and repair; for target elements with duplicate identifiers, further analysis and processing can be performed to find out the cause of the duplicate identifiers and perform repair operations.
[0038] Step S106: Replace the current identifier of the target element in the configuration file with the target identifier to obtain an updated configuration file.
[0039] The target identifier is used to indicate an identifier that does not overlap with identifiers of multiple elements.
[0040] In an optional embodiment, in the configuration file, the same identifier may be used multiple times. In order to avoid confusion and conflict, these repeated identifiers need to be replaced with new unique identifiers. The current identifier of the repeated identifier element in the configuration file can be replaced with the new identifier to obtain an updated configuration file. Specifically, for each repeated identifier, a new unique identifier is generated. For example, this can be achieved by adding a specific suffix or prefix to the original identifier to ensure that the new identifier does not conflict with the existing identifier. The current identifier of each repeated identifier element in the configuration file needs to be replaced with a new identifier to ensure that each identifier is unique in the updated configuration file. After completing the replacement operation, the updated configuration file can be saved and ensure that the updated file is used in subsequent processing. Through the above steps, the problem of repeated identifiers in the configuration file can be effectively solved to ensure the accuracy and reliability of the configuration file.
[0041] Traditional methods usually require relevant technical personnel to manually check for duplicate identifier elements and manually assign new identifiers to the duplicate identifier elements. The present application can automatically assign new identifiers to duplicate identifier elements. Specifically, a preset configuration file parsing function can be called to read the configuration file, and parse the duplicate identifier elements therein, and define a new identifier replacement rule, such as replacing specific characters in the current identifier with a new identifier. All duplicate identifier elements in the configuration file can be traversed, and the current identifier can be replaced with a new identifier according to the defined replacement rules. Finally, the updated configuration file can be automatically written to the new configuration file to complete the identifier replacement process. During the implementation process, programming languages such as Python, Java, etc. can be used to write programs, and related file operations and string processing functions can be combined to implement identifier replacement. At the same time, unit testing and data verification can be performed to ensure the accuracy and completeness of the replacement process.
[0042] Step S108 , constructing a simulation model of the vehicle electronic system based on the updated configuration file.
[0043] In an optional embodiment, the configuration information in the updated configuration file can be used to construct a simulation model of the vehicle electronic system through simulation software or tools. Specifically, based on the updated configuration file, simulation software or tools, such as MATLAB / Simulink, CANoe, etc., which are not limited here, can be used to construct a simulation model of the vehicle electronic system. This simulation model may include communication, signal processing, control algorithms, etc. between vehicle electronic systems, as well as simulation of the vehicle's overall system. By constructing a simulation model, the behavior of the vehicle electronic system can be simulated to verify the correctness and performance of the system design. At the same time, system function testing, communication protocol testing, network topology testing, etc. can also be performed to ensure the stability and reliability of the system in actual applications. The resulting simulation model can help developers verify the correctness of the system design and configuration, and provide reference and guidance for subsequent development work.
[0044] In an embodiment of the present invention, a method for building a model of a vehicle electronic system is provided, comprising: in a process of building a simulation model of the vehicle electronic system, in response to a model building exception instruction for the vehicle electronic system, obtaining multiple elements and identifiers of multiple elements in a configuration file of the vehicle electronic system, wherein the model building exception instruction is an instruction generated when a simulation model building exception occurs during the building process; determining a target element with a repeated identifier among multiple elements based on the identifiers of the multiple elements; replacing a current identifier of the target element in the configuration file with a target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that does not repeat with the identifiers of multiple elements; building a simulation model of the vehicle electronic system based on the updated configuration file. It is easy to notice that, considering that the cause of the simulation modeling exception of the vehicle electronic system is usually the presence of elements with repeated identifiers in the configuration file of the vehicle electronic system, the present application proposes a method for building a simulation model of the vehicle electronic system in response to receiving a model building exception instruction. After the model building exception instruction of the vehicle electronic system is received, multiple elements and identifiers of multiple elements in the configuration file of the vehicle electronic system are automatically obtained, which is convenient for subsequent checking of multiple elements and identifiers of multiple elements in the configuration file, realizing automatic response to the model building exception instruction, and checking whether there are repeated identifiers. If there are repeated identifiers, the elements corresponding to these repeated identifiers can be recorded or marked as target elements, and the current identifiers of the repeated identifier elements in the configuration file can be replaced with new identifiers. The present application can automatically determine the target elements with repeated identifiers in the configuration file and assign new identifiers to the target elements. During the implementation process, a programming language can be used to write a program, and the relevant file operations and string processing functions can be combined to realize the replacement of identifiers, so that a simulation model of the vehicle electronic system can be constructed based on the updated configuration file, thereby solving the technical problem of low efficiency in model building of the vehicle electronic system in the related technology.
[0045] Optionally, the current identifier of the target element in the configuration file is replaced with the target identifier to obtain an updated configuration file, including: replacing the current identifier of the target element with the target identifier and generating a replacement record, wherein the replacement record is used to record the correspondence between the target element and the target identifier; and generating an updated configuration file based on the configuration file and the replacement record.
[0046] In an optional embodiment, during the identifier replacement process, the correspondence between the target element and the new identifier can be recorded as a replacement record. The replacement record can be stored in the form of a key-value pair and can be represented by a dictionary, JSON or other data structure, which is not limited here. Then, based on the configuration file and the replacement record, an updated configuration file is generated. Specifically, the original configuration file content can be compared with the replacement record, and the repeated identifier can be replaced with a new identifier according to the correspondence, and then the updated content can be written into the new configuration file. The replacement record can be used to record the correspondence between the repeated elements of the identifier and the new identifier, so that the repeated identifier can be accurately replaced when the updated configuration file is generated. The replacement record can ensure the accuracy of the identifier replacement and avoid errors in the configuration file caused by human errors. The replacement record can record the replacement process of the identifier to facilitate tracing and troubleshooting. A corresponding program can be written to automate the processing to ensure the accuracy and efficiency of the replacement. The above process can be used to deal with the problem of repeated identifiers in the configuration file in software development or system management to ensure the correctness and reliability of the configuration file.
[0047] Optionally, generating an updated configuration file based on the configuration file and the replacement record includes: obtaining a current tree structure composed of multiple elements in the configuration file; updating the current tree structure based on the replacement record to obtain an updated tree structure; and updating the configuration file based on the updated tree structure to obtain an updated configuration file.
[0048] In an optional embodiment, each element in the configuration file can be read, and these elements may include different configuration items, parameters, or other related information, and each element is organized into a tree structure according to the hierarchical relationship of the elements in the configuration file, that is, the nodes of the tree represent the elements in the configuration file, and the relationship between the nodes represents the organizational structure of the elements in the configuration file; according to the information in the replacement record, the current tree structure is updated, such as updating the value or attribute of the existing node, and finally an updated tree structure is obtained. By automatically updating the current tree structure, the present application can simplify the update process of the configuration file, reduce manual intervention, and improve efficiency and accuracy; according to the updated tree structure, the elements in the configuration file are reorganized into a new structure, and the updated elements are written into the configuration file, thereby obtaining an updated configuration file; the above steps can convert the updated tree structure into a text form of the configuration file according to a certain format or rule, and then write it into the configuration file, so that the content in the configuration file is consistent with the updated tree structure.
[0049] Optionally, the model building method of the vehicle electronic system also includes: building an identifier dictionary based on identifiers of multiple elements, wherein the identifier dictionary is used to store the identifiers of multiple elements and the number of occurrences of the identifiers of multiple elements; generating an identifier that does not appear in the identifier dictionary based on the identifier dictionary to obtain a target identifier.
[0050] The identifier dictionary mentioned above may refer to a list or database that records identifiers and the number of times the identifiers appear in a configuration file.
[0051] In an optional embodiment, the identifier of each element in the configuration file can be stored in an identifier dictionary, and the number of occurrences of the identifier of each element can be recorded; the identifier of each element can be added to the dictionary by traversing each element in the configuration file, and the number of occurrences of the identifier of each element can be updated; new identifiers can be generated based on identifiers that do not appear in the identifier dictionary. This process can be achieved through some algorithms or rules. For example, numbers or characters can be added after the current identifier to construct a new identifier, which ensures that the new identifier will not be repeated with an existing identifier, while also maintaining the uniqueness of the identifier.
[0052] The present application uses an identifier dictionary to conveniently store and count the identifiers of each element in the configuration file and the number of occurrences of the identifiers of each element. By constructing an identifier dictionary, the elements in the configuration file can be managed and analyzed more efficiently. The identifier dictionary can provide fast search and statistics functions, making the processing of element identifiers more convenient and effective. The identifier dictionary can be used to quickly find the identifiers of elements in the configuration file without traversing the entire configuration file every time a target identifier is generated; new identifiers can be generated through identifiers that do not appear in the identifier dictionary. The use of an identifier dictionary can improve the efficiency and flexibility of configuration file processing, making the management and analysis of element identifiers more convenient and efficient.
[0053] Optionally, obtaining multiple elements and identifiers of multiple elements in a configuration file of a vehicle electronic system includes: obtaining a file path of the configuration file based on an exception type corresponding to an exception instruction constructed based on a model; calling the configuration file based on the file path, and determining multiple elements and identifiers of multiple elements in the configuration file.
[0054] In an optional embodiment, the file path of the corresponding configuration file can be obtained based on the exception type of the exception instruction that appears in the model building process, and the relationship between the exception type and the configuration file can be determined; the path of the configuration file can be pre-set, for example, the storage path of the configuration file is specified in the program, or the path of the configuration file is set in the system environment variable, etc. Based on the above information, the file path of the configuration file corresponding to the exception type can be determined; calling the configuration file based on the file path can be implemented using file operation-related functions in the programming language. It is necessary to open the configuration file and then read the content in the file. According to the format of the configuration file, the corresponding method can be used to parse the configuration file to obtain each element and the identifier corresponding to each element.
[0055] Optionally, determining multiple elements and identifiers of multiple elements in the configuration file includes: calling a preset parsing function corresponding to the first file type according to the first file type of the configuration file; parsing the configuration file based on the preset parsing function to obtain a current tree structure composed of multiple elements in the configuration file and a root element of the current tree structure; and traversing the current tree structure based on the root element to obtain multiple elements and identifiers of the multiple elements.
[0056] In an optional embodiment, when processing a configuration file, a preset parsing function corresponding to the file type can be called according to the file type of the configuration file to parse the content of the configuration file into an operable data structure. The preset parsing function can be determined according to the file type of the configuration file. For example, a given ARXML file can be parsed by the ET.parse(arxml_file) function, so that the configuration file can be parsed to obtain the current tree structure composed of the elements in the configuration file and the root element of the current tree structure; the current tree structure can be traversed based on the root element. For example, the root.iter() function can be used to traverse the elements in the current tree structure to obtain the elements and the identifiers of the elements. The traversal operation can be performed in depth. Algorithms such as depth-first search or breadth-first search are used to ensure that all elements can be accessed and their identifiers or other related information can be obtained. Determining the root element and traversing the current tree structure based on the root element can ensure that the entire tree structure can be completely traversed and each element and the identifier of each element in the configuration file can be obtained. The root element is the starting point of the entire tree structure. By traversing the root element, each child element can be traversed step by step to ensure that no element in the configuration file is missed. This ensures that the parsing of the configuration file is complete and accurate. Through the above steps, the information in the configuration file can be converted into a hierarchical data representation, which makes it easier to perform subsequent operations, such as verifying the validity of the configuration, reading specific configuration items, and modifying configuration information.
[0057] Optionally, the vehicle electronic system is simulated and modeled based on the updated configuration file to obtain a simulation model of the vehicle electronic system, including: calling a preset modeling tool corresponding to the second file type based on the second file type of the updated configuration file, wherein the preset modeling tool is used to represent a pre-set software tool for simulation modeling of the configuration file; and using the preset modeling tool to simulate and model the vehicle electronic system based on the updated configuration file to obtain a simulation model.
[0058] In an optional embodiment, considering that the file type of the updated configuration file may change, the preset modeling tool can be called by selecting an appropriate file type according to the format and type of the updated configuration file. Different configuration files may require different preset modeling tools for simulation modeling, which needs to be selected according to the specific situation; the preset modeling tool can be a software tool specifically used to represent the preset simulation modeling of the configuration file, which can help users to perform simulation modeling work quickly and efficiently; the preset modeling tool is used to simulate and model the vehicle electronic system based on the updated configuration file, and the input conditions and constraints of the simulation model can be set according to the parameters and specification information in the configuration file to ensure accurate simulation results; the updated configuration file is simulated and modeled by the preset modeling tool to obtain a simulation model of the vehicle electronic system, and the simulation model can be used for further analysis, optimization and verification work to help engineers and designers better understand and improve the performance and reliability of the vehicle electronic system.
[0059] Example 2
[0060] According to another aspect of an embodiment of the present invention, a model building device for a vehicle electronic system is also provided. The device can execute the model building method for a vehicle electronic system of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.
[0061] Figure 2 is a schematic diagram of a model building device for a vehicle electronic system according to an embodiment of the present application, such as Figure 2 As shown, the device includes the following: an acquisition module 202 , a determination module 204 , a replacement module 206 , and a construction module 208 .
[0062] Among them, the acquisition module 202 is used to obtain multiple elements and identifiers of multiple elements in the configuration file of the vehicle electronic system in response to receiving a model construction exception instruction of the vehicle electronic system during the construction process of the simulation model of the vehicle electronic system, wherein the model construction exception instruction is an instruction generated when a simulation model modeling exception occurs during the construction process; the determination module 204 is used to determine the target element with a repeated identifier among the multiple elements based on the identifiers of the multiple elements; the replacement module 206 is used to replace the current identifier of the target element in the configuration file with the target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that does not duplicate the identifiers of the multiple elements; the construction module 208 is used to build the simulation model of the vehicle electronic system based on the updated configuration file.
[0063] The replacement module is further used to replace the current identifier of the target element with the target identifier, generate a replacement record, wherein the replacement record is used to record the correspondence between the target element and the target identifier; and generate an updated configuration file based on the configuration file and the replacement record.
[0064] The replacement module is further used to obtain a current tree structure composed of multiple elements in the configuration file; update the current tree structure based on the replacement record to obtain an updated tree structure; and update the configuration file based on the updated tree structure to obtain an updated configuration file.
[0065] Among them, the construction module is also used to build an identifier dictionary based on the identifiers of multiple elements, wherein the identifier dictionary is used to store the identifiers of multiple elements and the number of occurrences of the identifiers of multiple elements; based on the identifier dictionary, an identifier that does not appear in the identifier dictionary is generated to obtain a target identifier.
[0066] Among them, the acquisition module is also used to obtain the file path of the configuration file based on the exception type corresponding to the model-built exception instruction; call the configuration file based on the file path, and determine multiple elements and identifiers of multiple elements in the configuration file.
[0067] Among them, the determination module is also used to call a preset parsing function corresponding to the first file type according to the first file type of the configuration file; parse the configuration file based on the preset parsing function to obtain a current tree structure composed of multiple elements in the configuration file and a root element of the current tree structure; traverse the current tree structure based on the root element to obtain multiple elements and identifiers of multiple elements.
[0068] Among them, the construction module is also used to call a preset modeling tool corresponding to the second file type based on the second file type of the updated configuration file, wherein the preset modeling tool is used to represent a pre-set software tool for simulating and modeling the configuration file; and use the preset modeling tool to simulate and model the vehicle electronic system based on the updated configuration file to obtain a simulation model.
[0069] Example 3
[0070] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0071] The above-mentioned memory may refer to a device inside a computer for storing data and programs, and may include memory, hard disk, etc., wherein the memory may be used to temporarily store running programs and data, the hard disk may be used to store programs and data for a long time, and the memory may be used to enable the computer to read and write data, and execute programs; the above-mentioned processor may be responsible for executing instructions in computer programs and performing data processing, and may be responsible for controlling and executing various operations, including arithmetic operations, logical operations, data transmission, etc.
[0072] Example 4
[0073] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0074] The above-mentioned computer storage medium may refer to a medium in a computer memory used to store certain discontinuous physical quantities. Computer storage media mainly include semiconductors, magnetic cores, magnetic drums, magnetic tapes, laser disks, etc.; the stored program included in the computer-readable storage medium may be a set of instructions that can be recognized and executed by a computer, running on an electronic computer, and is an information tool that meets certain needs of people.
[0075] Example 5
[0076] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0077] The above-mentioned computer program product may refer to a software program that has been written, tested and released and can be run on a computer or other device. The computer program product may include an application, an operating system, tool software, etc., which is used to implement specific functions or solve specific problems.
[0078] Example 6
[0079] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0080] The above-mentioned non-volatile computer-readable storage medium may refer to a medium for storing data. The non-volatile computer-readable storage medium can keep the data from being lost when the power is off, and can be used to store long-term data, such as operating systems, applications, and user files. The non-volatile storage medium may include hard disk drives, solid-state drives, optical disks, and flash memory storage devices, etc.
[0081] Example 7
[0082] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0083] The above-mentioned computer program may refer to a collection of instructions used to tell a computer to perform a specific task or operation. A computer program may be written by a programmer using a specific programming language and may include algorithms, data structures, logic, and control flows. A computer program may be used for a variety of purposes, including application software, operating systems, and the like.
[0084] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0085] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0086] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0087] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0089] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for constructing a model of a vehicle electronic system, characterized in that: include: In the process of constructing a simulation model of the vehicle electronic system, in response to a model construction exception instruction for the vehicle electronic system, a plurality of elements in a configuration file of the vehicle electronic system and identifiers of the plurality of elements are obtained, wherein the model construction exception instruction is an instruction generated when a simulation model modeling exception occurs during the construction process; Determine, based on the identifiers of the multiple elements, a target element in which the identifier is repeated among the multiple elements; Replacing the current identifier of the target element in the configuration file with the target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that is not repeated with the identifiers of the multiple elements; The simulation model of the vehicle electronic system is constructed based on the updated configuration file.
2. The vehicle electronic system model building method according to claim 1, characterized in that: Replacing the current identifier of the target element in the configuration file with the target identifier to obtain an updated configuration file, including: Replacing the current identifier of the target element with the target identifier to generate a replacement record, wherein the replacement record is used to record the corresponding relationship between the target element and the target identifier; The updated configuration file is generated based on the configuration file and the replacement record.
3. The vehicle electronic system model building method according to claim 2, characterized in that: Generating the updated configuration file based on the configuration file and the replacement record includes: Obtaining a current tree structure composed of the multiple elements in the configuration file; Updating the current tree structure based on the replacement record to obtain an updated tree structure; The configuration file is updated based on the updated tree structure to obtain the updated configuration file.
4. The vehicle electronic system model building method according to claim 1, characterized in that: The method further comprises: Building an identifier dictionary based on the identifiers of the multiple elements, wherein the identifier dictionary is used to store the identifiers of the multiple elements and the number of occurrences of the identifiers of the multiple elements; An identifier that does not appear in the identifier dictionary is generated based on the identifier dictionary to obtain the target identifier.
5. The vehicle electronic system model building method according to claim 1, characterized in that: Acquiring a plurality of elements and identifiers of the plurality of elements in a configuration file of the vehicle electronic system includes: Acquire the file path of the configuration file based on the exception type corresponding to the exception instruction constructed by the model; The configuration file is called based on the file path, and the plurality of elements and identifiers of the plurality of elements in the configuration file are determined.
6. The vehicle electronic system model building method according to claim 5, characterized in that: Determining the plurality of elements and identifiers of the plurality of elements in the configuration file includes: Calling a preset parsing function corresponding to a first file type according to the first file type of the configuration file; Parsing the configuration file based on the preset parsing function to obtain a current tree structure composed of the multiple elements in the configuration file and a root element of the current tree structure; The current tree structure is traversed based on the root element to obtain the multiple elements and identifiers of the multiple elements.
7. The vehicle electronic system model building method according to claim 1, characterized in that: Performing simulation modeling on the vehicle electronic system based on the updated configuration file to obtain a simulation model of the vehicle electronic system includes: Based on the second file type of the updated configuration file, calling a preset modeling tool corresponding to the second file type, wherein the preset modeling tool is used to represent a preset software tool for performing simulation modeling on the configuration file; The preset modeling tool is used to perform simulation modeling on the vehicle electronic system based on the updated configuration file to obtain the simulation model.
8. A model building device for a vehicle electronic system, characterized in that: include: an acquisition module, configured to acquire, in response to receiving a model building exception instruction of the vehicle electronic system during the construction of a simulation model of the vehicle electronic system, a plurality of elements in a configuration file of the vehicle electronic system and identifiers of the plurality of elements, wherein the model building exception instruction is an instruction generated when a simulation model modeling exception occurs during the construction process; A determination module, configured to determine, based on the identifiers of the multiple elements, a target element in which a duplicate identifier appears among the multiple elements; a replacement module, configured to replace a current identifier of the target element in the configuration file with a target identifier to obtain an updated configuration file, wherein the target identifier is used to indicate an identifier that is not repeated with the identifiers of the multiple elements; A construction module is used to construct the simulation model of the vehicle electronic system based on the updated configuration file.
9. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the vehicle electronic system model building method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the vehicle electronic system model building method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the model building method of the vehicle electronic system according to any one of claims 1 to 7.
