Method and system for vehicle-mounted application platform-based CAN (Controller Area Network) signal difference adaptation
By sorting and mapping the CAN signal definitions of different models, a unified mapping relationship is generated, and the compatibility and maintainability of on-board applications between different models is achieved, the problems of cross-model adaptation difficulty and maintenance costs are solved, and the development efficiency is improved and maintainability.
Patent Information
- Application Number
- CN202411164776.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The difference in CAN signal definitions between different models makes it difficult to adapt across models for on-board applications, increasing development costs and maintenance difficulties.
Through data preparation, mapping generation, initialization and operation and maintenance steps, we collect and organize CAN signal definitions of different models, generate a unified CAN signal mapping relationship, dynamically load and execute corresponding CAN signal mapping logic, and ensure compatibility between different models. and maintainability.
It lowers the development threshold, improves development efficiency, enhances the maintainability of on-board applications, and reduces the adaptation difficulty caused by model updates and changes in CAN signal definitions.
Smart Images

Figure CN119182825A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle technology, and in particular to a method, tool, system, electronic device, storage medium and vehicle for adapting CAN signal differences in a vehicle-mounted application platform. Background Art
[0002] At present, with the rapid development of automobile technology, vehicle communication networks are becoming increasingly complex, especially the CAN (Controller Area Network) bus as the core technology for internal vehicle communication, its importance is self-evident. However, different car companies and models have differences in the definition and transmission of CAN signals, which brings huge challenges to the cross-model adaptation of in-vehicle applications.
[0003] Traditional in-vehicle application adaptation methods usually rely on manual analysis and writing specific CAN signal parsing code, which is not only labor-intensive and time-consuming, but also prone to errors. With the continuous updating and upgrading of vehicle models, each change requires re-adaptation, which greatly increases development costs and maintenance difficulties.
[0004] In addition, due to the differences in CAN signal definitions between different models, in-vehicle applications often need to adopt different logic and strategies when processing CAN signals of different models, which further increases code complexity and maintenance difficulty.
[0005] Therefore, the present application provides a method for adapting CAN signal differences in a vehicle-mounted application platform to solve the above technical problems. Summary of the invention
[0006] The purpose of the present invention is to provide a method, tool, system, electronic device, storage medium and vehicle for platform-based adaptation of CAN signal differences in vehicle-mounted applications, so as to solve the technical problem in the prior art that the CAN signals of different vehicle models have poor adaptability, which increases the difficulty of vehicle-mounted application maintenance and reduces development efficiency.
[0007] In order to solve the above technical problems, the present invention provides a method for adapting CAN signal differences in a vehicle-mounted application platform, comprising:
[0008] A data preparation step includes responding to and organizing the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping;
[0009] A mapping generation step, comprising generating a unified CAN signal mapping relationship based on a preset CAN signal mapping rule in response to the collected key information, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation;
[0010] An initialization step includes dynamically loading and executing corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup;
[0011] The operation and maintenance step includes responding to the application operation process, based on the CAN signal mapping logic, using the mapped CAN signal for data processing and communication, and updating when the vehicle model or the CAN signal definition changes.
[0012] In some specific embodiments, the data preparation step includes responding to and organizing the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping, and further includes:
[0013] Store the CAN signal definition files of different vehicle models in a designated directory;
[0014] Verifying the integrity, consistency and accuracy of the collected CAN signal definition files;
[0015] Classify, remove duplicates and sort the verified CAN signal definition files according to preset rules to form a unified signal list;
[0016] The signal list is saved in a format that is easy to search and process.
[0017] In some specific embodiments, the mapping generation step includes generating a unified CAN signal mapping relationship based on a preset CAN signal mapping rule in response to the collected key information, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation, and further includes:
[0018] Create a custom CAN signal class, which includes all CAN signals that need to be mapped as member variables and defines corresponding access and modification methods;
[0019] Analyze the CAN signal definitions of different vehicle models, and determine the corresponding relationship between the CAN signal and the user-defined CAN signal class member variables;
[0020] Based on the corresponding relationship, write mapping logic to map the CAN signal values of different vehicle models to the corresponding member variables of the custom CAN signal class;
[0021] Verify the correctness of the mapping logic so that CAN signals of different vehicle models can be correctly mapped.
[0022] In some specific embodiments, the initialization step includes dynamically loading and executing corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup, and further includes:
[0023] When the application is started, the vehicle identification information is read to determine the current vehicle model, wherein the vehicle identification information includes vehicle ECU information and vehicle VIN code;
[0024] According to the identified vehicle model, loading the CAN signal mapping logic of the corresponding vehicle model;
[0025] Execute the loaded CAN signal mapping logic, map the vehicle model-specific CAN signal value to the customized CAN signal class, and verify the mapping result.
[0026] In some specific embodiments, the operation and maintenance step includes, in response to the application running process, using the mapped CAN signal for data processing and communication based on the CAN signal mapping logic, and updating when the vehicle model or the CAN signal definition changes, further including:
[0027] During the running of the application, all logics involving CAN signal interaction are performed through the customized CAN signal class;
[0028] Monitor the real-time status of CAN signal interaction, and track the transmission status, abnormal status and change trend of CAN signals in real time;
[0029] When the vehicle model is changed or the CAN signal definition is changed, the data preparation and mapping generation steps are re-executed to update the CAN signal mapping relationship;
[0030] The updated CAN signal mapping relationship is tested and verified to ensure that new vehicle models or new CAN signal definitions can be correctly mapped and used.
[0031] Based on the same concept, the present invention also provides an automation tool, which applies the above-mentioned method of adapting CAN signal differences to the vehicle-mounted application platform. The automation tool can automatically execute the data preparation, mapping generation, initialization and operation and maintenance steps to improve development efficiency.
[0032] Based on the same concept, the present invention also provides a system for adapting CAN signal differences in a vehicle-mounted application platform, including:
[0033] A data preparation module is configured to respond to and organize the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping;
[0034] A mapping generation module, configured to generate a unified CAN signal mapping relationship in response to the collected key information based on a preset CAN signal mapping rule, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation;
[0035] an initialization module, configured to dynamically load and execute corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup;
[0036] The operation and maintenance module is configured to respond to the application operation process, based on the CAN signal mapping logic, use the mapped CAN signal for data processing and communication, and update when the vehicle model or the CAN signal definition changes.
[0037] Based on the same concept, the present invention also provides an electronic device, including: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of a method for adapting CAN signal differences to a vehicle-mounted application platform.
[0038] Based on the same concept, the present invention also provides a computer-readable storage medium, which stores a computer program executable by an electronic device. When the computer program runs on the electronic device, the electronic device executes the steps of the method for platform-based adaptation of CAN signals for vehicle-mounted applications.
[0039] Based on the same concept, the present invention also provides a vehicle, wherein the vehicle is provided with the system for adapting CAN signal differences through the vehicle-mounted application platform as described above.
[0040] Compared with the prior art, the beneficial effects are:
[0041] The present invention discloses a method, tool, system, electronic device, storage medium and vehicle for adapting CAN signal differences in a vehicle-mounted application platform, which can lower the development threshold, improve development efficiency and enhance maintainability. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flowchart of a method for adapting CAN signal differences in a vehicle-mounted application platform in some specific embodiments of the present invention;
[0043] Figure 2 It is a flow chart of the development stage of a method for adapting CAN signal differences in a vehicle-mounted application platform in some applications of the present invention;
[0044] Figure 3 It is a schematic diagram of the operation phase of a method for adapting CAN signal differences in a vehicle-mounted application platform in some applications of the present invention;
[0045] Figure 4 It is a flow chart of a vehicle model change maintenance phase in some applications of a vehicle application platform-based adaptation method for CAN signal differences of the present invention;
[0046] Figure 5 It is a flow chart of the maintenance phase of the CAN signal definition change of a vehicle model in some applications of a method for adapting CAN signal differences in a vehicle-mounted application platform of the present invention;
[0047] Figure 6 It is a structural schematic diagram of a system for adapting CAN signal differences in a vehicle-mounted application platform in some specific embodiments of the present invention;
[0048] Figure 7 It is a schematic diagram of the structure of an electronic device in some specific embodiments of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0050] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0051] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0052] It should be understood that although the terms first, second, third, etc. may be used to describe in the embodiments of the present application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, without departing from the scope of the embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0053] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0054] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.
[0055] It should be particularly noted that any symbols and / or numbers in the specification that are not marked in the accompanying drawings are not drawing marks.
[0056] Reference Figure 1 , a method for adapting CAN signal differences in a vehicle-mounted application platform, comprising:
[0057] S101, a data preparation step, including responding to and organizing the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping;
[0058] It is understandable that the range of vehicle models that need to be adapted should be clarified first, and the source of the CAN signal definitions of these vehicle models should be determined. The CAN signal definition files or data of each vehicle model are obtained and stored from the determined data source. A dedicated parsing program or script is written to read and parse the stored CAN signal definition files or data. The program can identify and extract key information in the file, such as signal name, ID, data type, length, range, sending node, receiving node, etc.
[0059] In some of the applications, the data preparation step includes responding to and organizing the collected CAN signal definitions of different vehicle models, including key information used for parsing and mapping, and centrally storing the CAN signal definition files of different vehicle models in a designated directory; verifying the integrity, consistency and accuracy of the collected CAN signal definition files; classifying, deduplicating and sorting the verified CAN signal definition files according to preset rules to form a unified signal list; and saving the signal list in a format that is easy to query and process.
[0060] It is understandable that a dedicated directory is first selected as a centralized storage point for CAN signal definition files. The directory should have good access control and backup mechanisms to ensure the security and reliability of the files. The CAN signal definition files of various models are collected through various channels (such as provided by the car company, downloaded from the network, internal sharing, etc.) and copied to the above selected directory. The file name contains information such as the model identification and version number for easy identification and management. Check whether each file is complete, including the file header, data segment, and file tail. Compare different versions of CAN signal definition files of the same model to ensure the consistency of signal definitions. At the same time, check whether the file format meets the preset specifications or standards. Verify whether the key information in the signal definition (such as signal name, ID, data type, range, etc.) is accurate. Classify the verified CAN signal definition files according to factors such as the function of the signal, the system or model to which it belongs. During the classification process, remove duplicate signal definitions.
[0061] In order to improve the readability and usability of the signal list, the classified signal definitions are sorted according to certain rules. The sorting rules can be formulated according to actual needs, such as the numerical value of the signal ID, the dictionary order of the signal name, or the priority of the system to which it belongs.
[0062] Select a format that is easy to query and process to save the unified signal list. For example, Excel spreadsheet, CSV file, database table or custom binary format. Convert the classified, deduplicated and sorted CAN signal definition data to the selected format. During the conversion process, ensure that the integrity and accuracy of the data are not affected. Save the converted signal list file in an easily accessible location and back it up regularly to prevent data loss. At the same time, record the time and content of each modification and update for subsequent tracking and auditing.
[0063] S102, a mapping generation step, comprising generating a unified CAN signal mapping relationship in response to the collected key information based on a preset CAN signal mapping rule, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation;
[0064] It is understandable that CAN signal mapping rules are formulated according to corresponding needs, and it is clearly specified how to map the specific CAN signal values of different vehicle models into standardized CAN signal representations, including the mapping of signal IDs, the unification of data types and lengths, the adjustment of signal ranges, and the standardization of signal units. For example, for the engine speed signal, it can be stipulated that all vehicle models are represented by unsigned 16-bit integers, with a unified range of 0-10000rpm and a unified unit of rpm. The formulated mapping rules are stored in the form of files, databases or program codes for reference in the mapping generation step. Based on the collected key information, the specific properties of the CAN signals of each vehicle model are parsed. Based on the preset CAN signal mapping rules, the specific CAN signal values of each vehicle model are mapped into the standardized CAN signal representation, including:
[0065] Signal ID mapping: If different vehicle models use different signal IDs to represent the same function, these different IDs are mapped to a unified ID according to the mapping rules.
[0066] Unification of data type and length: According to the mapping rules, the signal data type and length of the same function in different vehicle models are unified into a standardized format.
[0067] Signal range adjustment: If the representation range of the same signal in different vehicle models is different, it will be adjusted to a unified range according to the mapping rules.
[0068] Signal unit standardization: Ensure that signals of the same function in all vehicle models are expressed using uniform units.
[0069] Generate a mapping relationship table: Record the mapping relationship between the standardized representation and the original representation of each signal generated during the mapping process to form a mapping relationship table. The table contains key information such as the original signal ID, standardized signal ID, data type, length, range, unit, etc.
[0070] Verify mapping relationships: Verify the generated mapping relationship table to ensure that all mapping relationships are correct and there are no omissions or errors.
[0071] In some of the applications, the mapping generation step includes generating a unified CAN signal mapping relationship in response to the collected key information based on preset CAN signal mapping rules, the CAN signal mapping rules are used to map specific CAN signal values of different vehicle models to standardized CAN signal representations, creating a custom CAN signal class, the CAN signal class includes all CAN signals that need to be mapped as member variables, and defines corresponding access and modification methods; analyzing the CAN signal definitions of different vehicle models to determine the corresponding relationship between CAN signals and member variables of the custom CAN signal class; based on the corresponding relationship, writing mapping logic to map CAN signal values of different vehicle models to corresponding member variables of the custom CAN signal class; and verifying the correctness of the mapping logic so that CAN signals of different vehicle models can be correctly mapped.
[0072] It is understandable that, according to the corresponding requirements, a custom CAN signal class (for example, named CustomCanSignal) is defined. In this class, a member variable is defined for each CAN signal that needs to be mapped, and a data type and access modifier (such as public or private) are set for it.
[0073] Add access and modification methods: Write corresponding access (getter) and modification (setter) methods for each member variable. Allow external code to safely get and set the value of the CAN signal.
[0074] For example,
[0075] public class CustomCanSignal{
[0076] private int engineSpeed;
[0077] private boolean brakeStatus;
[0078] public int getEngineSpeed(){
[0079] return engineSpeed;
[0080] }
[0081] public void setEngineSpeed(int engineSpeed){
[0082] this.engineSpeed=engineSpeed;
[0083] }
[0084] public boolean getBrakeStatus(){
[0085] return brakeStatus;
[0086] }
[0087] public void setBrakeStatus(boolean brakeStatus){
[0088] this.brakeStatus=brakeStatus;
[0089] }
[0090] }
[0091] Collect detailed information about CAN signals from the technical manuals or CAN signal definition files of each vehicle model, including signal name, ID, data type, range, etc. Based on the collected information, analyze and determine the correspondence between the CAN signals of each vehicle model and the member variables of the custom CAN signal class. Based on the determined correspondence, design a mapping algorithm that can map the CAN signal values of different vehicle models to the corresponding member variables of the custom CAN signal class. Implement the mapping function in the custom CAN signal class or related tool class. This function receives the CAN signal values from different vehicle models as input and calls the setter method of the custom CAN signal class to set the values to the corresponding member variables.
[0092] For example,
[0093] public class CanSignalMapper{
[0094] public static void mapToCustomSignal(CustomCanSignalcustomSignal,Map<String,Object> rawSignals){
[0095] if(rawSignals.containsKey("EngineSpeed")){
[0096] customSignal.setEngineSpeed((Integer)
[0097] rawSignals.get("EngineSpeed"));
[0098] }
[0099] if(rawSignals.containsKey("BrakeStatus")){
[0100] customSignal.setBrakeStatus(Boolean.parseBoolean((String)
[0101] rawSignals.get("BrakeStatus")));
[0102] }
[0103] }
[0104] }
[0105] Write test cases for the mapping logic, covering the CAN signal definitions and possible edge cases for different vehicle models. The test cases ensure that all signals can be correctly mapped to the member variables of the custom CAN signal class. Run the test cases and check whether the test results are as expected. If errors or inconsistencies are found, go back to modify the mapping logic and re-execute the tests until all tests pass. Perform integration tests to verify the correctness and stability of the mapping logic in actual applications.
[0106] S103, an initialization step, including dynamically loading and executing corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup;
[0107] In some of the applications, the initialization step includes dynamically loading and executing the corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to the application startup. When the application starts, the vehicle identification information is read to determine the current vehicle model, and the vehicle identification information includes the vehicle ECU information and the vehicle VIN code; according to the identified vehicle model, the CAN signal mapping logic of the corresponding vehicle model is loaded; the loaded CAN signal mapping logic is executed to map the vehicle-specific CAN signal value to the custom CAN signal class, and the mapping result is verified.
[0108] It is understandable that the vehicle ECU information is read by communicating with the vehicle electronic control unit (ECU) through the vehicle network interface (such as the OBD-II interface). Including the version number of the ECU, the manufacturer's logo, etc., to preliminarily determine the vehicle type. At the same time, the vehicle identification code (VIN code) is read. The VIN code is the unique identifier of the vehicle, which contains detailed information such as the vehicle manufacturer, year, and model. Combined with the read vehicle ECU information and VIN code, the model of the current vehicle is determined through a preset algorithm or query database. Maintain a database containing CAN signal mapping relationships of different vehicle models. The mapping relationship of each vehicle model is uniquely identified and associated with the vehicle model. According to the determined vehicle model, the CAN signal mapping logic of the corresponding vehicle model is retrieved from the mapping relationship database.
[0109] Execute the loaded CAN signal mapping logic. First, instantiate a custom CAN signal class, which contains all the CAN signals that need to be mapped as member variables. Apply the loaded CAN signal mapping logic to the actual CAN signal value of the current vehicle model. Perform static verification of the mapping results through preset test cases or rules. This includes checking whether the mapped data is within a reasonable range and whether the data type is correct.
[0110] S104, operation and maintenance step, including responding to the application running process, based on the CAN signal mapping logic, using the mapped CAN signal for data processing and communication, and updating when the vehicle model or the CAN signal definition changes.
[0111] In some of these applications, the operation and maintenance steps include responding to the CAN signal mapping logic during application operation, using the mapped CAN signal for data processing and communication, and updating it when the vehicle model or CAN signal definition changes. During application operation, all logic involving CAN signal interaction is performed through a custom CAN signal class; monitoring the real-time situation of CAN signal interaction, and tracking the transmission situation, abnormal status and change trend of CAN signals in real time; when the vehicle model changes or the CAN signal definition changes, re-execute the data preparation and mapping generation steps, and update the CAN signal mapping relationship; test and verify the updated CAN signal mapping relationship to ensure that the new vehicle model or new CAN signal definition can be correctly mapped and used.
[0112] It is understandable that during the operation of the application, all logic involving CAN signal interaction is performed through the custom CAN signal class. Whether it is reading the vehicle status, sending control instructions or performing data analysis, the mapped CAN signal value is first accessed through this class. Real-time monitoring of the transmission status, abnormal status and change trend of CAN signals. Including monitoring key indicators such as signal transmission frequency, receiving delay, number of error frames, etc. When a CAN signal abnormality is detected (such as signal loss, too many error frames, etc.), the abnormal information is recorded and the corresponding processing mechanism is triggered, including retrying to send, recording logs, issuing warning notifications, etc. In order to facilitate user monitoring and diagnosis, a visual interface is provided to display the waveform of the CAN signal, status indicator light and other information in real time.
[0113] Updates and verifications in response to changes:
[0114] Changes in vehicle model or CAN signal definition: When the vehicle model or CAN signal definition changes (such as vehicle upgrades, configuration changes, etc.), re-prepare data and generate mapping relationships.
[0115] Re-execute data preparation and mapping generation: First, collect detailed information about the new model or new CAN signal definition, including signal name, ID, data type, range, etc. Then, re-execute the data preparation steps based on this information, including updating the database, generating mapping configuration files, etc. Then reload the CAN signal mapping logic with the new mapping relationship.
[0116] Test verification: The updated CAN signal mapping relationship needs to be tested and verified to ensure that the new vehicle model or new CAN signal definition can be correctly mapped and used. Test verification includes multiple levels such as unit testing, integration testing and system testing, covering scenarios such as normal operation and exception handling.
[0117] For example, taking the engine speed signal of a new car model as an example, first verify the correctness of the mapping logic through unit testing to ensure that the engine speed value can be correctly read and mapped. Then, verify whether the transmission and processing flow of the signal in the vehicle system is smooth through integration testing. Finally, perform system testing to simulate the signal interaction in actual driving scenarios to ensure stable operation of the system.
[0118] Combine the following Figures 2 to 5 The following are some examples of the method for adapting CAN signal differences to vehicle-mounted application platforms of the present invention in some applications:
[0119] In this embodiment, all CAN signal definition values of the system layer are mapped to the same set of CAN signal definition values of the application layer to ensure that a set of vehicle applications can run normally on different vehicle systems. Developers only need to maintain a set of codes and only regenerate the mapping relationship when the CAN signal definition is updated. The other functions are not affected, which reduces the development cost.
[0120] like Figure 2 As shown,
[0121] Development phase:
[0122] 1. Put the CAN signal definition classes of all vehicle models into the specified directory: As the data source of the signal, the directory stores the CAN signal definition classes of all vehicle models that need to be compatible.
[0123] 2. Develop a script to obtain the union of CAN signal constant definitions for all vehicle models: read all CAN signal definition classes in step 1 and summarize all CAN signals; any programming language can be used as long as the function can be completed.
[0124] 3. Develop scripts to generate CAN signal mapping conversion methods for each vehicle model: Generate custom classes and CAN signal mapping conversion for corresponding vehicle models;
[0125] For example, the CAN signal class is defined as follows. There is no restriction on the definition. You can change the reading logic according to different CAN signal definition methods.
[0126]
[0127] Generate styles like:
[0128] This is a custom signal class. Only CAN signal variables of this class are used in development.
[0129]
[0130]
[0131] This is the CAN signal conversion class for the corresponding vehicle model
[0132]
[0133] 4. Responsible for processing the service initialization phase of CAN signals, loading different CAN signal mapping logic according to different vehicle models; the method of distinguishing vehicle models is not within the scope of this patent, and can be done through EOL, part number, system properties, etc.
[0134] 5. All logics that use CAN signals use custom CAN signal classes to interact with CAN signals: All CAN signals in the project can use variables of custom signal classes.
[0135] like Figure 3 As shown,
[0136] Operation phase:
[0137] 1. Get the current model: Get the current model at runtime, which can be obtained through system properties, EOL, part number, etc.;
[0138] 2. Responsible for processing the service initialization of CAN signals and executing the CAN signal mapping conversion method of the corresponding vehicle model;
[0139] 3. When sending and receiving CAN signals, use the CAN signal definition value of the corresponding vehicle model to ensure correct data interaction with the vehicle system: After completing the above steps, the called CAN signal value is consistent with the CAN signal definition in the current vehicle system, ensuring the normal operation of the function.
[0140] like Figure 4 As shown,
[0141] Maintenance phase:
[0142] Model change: After completing step 1 of the development phase, run the script and then complete step 3;
[0143] like Figure 5 As shown,
[0144] Maintenance phase:
[0145] Change the CAN signal definition of the vehicle model: Run the script after completing step 1 of the development phase.
[0146] For the method steps disclosed in the above embodiments, the method steps are described as a series of action combinations for the purpose of simple description, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0147] The present invention also provides an automation tool, which applies the above-mentioned method of adapting CAN signal differences to the vehicle-mounted application platform. The automation tool can automatically execute the data preparation, mapping generation, initialization and operation and maintenance steps to improve development efficiency.
[0148] like Figure 6 As shown, the present invention also provides a system for adapting CAN signal differences in a vehicle-mounted application platform, comprising:
[0149] The data preparation module 201 is configured to respond to and organize the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping;
[0150] A mapping generation module 202 is configured to generate a unified CAN signal mapping relationship in response to the collected key information based on a preset CAN signal mapping rule, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation;
[0151] The initialization module 203 is configured to dynamically load and execute corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup;
[0152] The operation and maintenance module 204 is configured to respond to the application operation process, based on the CAN signal mapping logic, use the mapped CAN signal for data processing and communication, and update when the vehicle model or the CAN signal definition changes.
[0153] It is worth noting that although only some basic functional modules are disclosed in the embodiments of the present invention, it does not mean that the composition of the present system is limited to the above basic functional modules. On the contrary, what the present embodiment wants to express is that on the basis of the above basic functional modules, those skilled in the art can arbitrarily add one or more functional modules in combination with the prior art to form an infinite number of embodiments or technical solutions. In other words, the present system is open rather than closed. Just because the present embodiment only discloses individual basic functional modules, it cannot be considered that the protection scope of the claims of the present invention is limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above devices are described in terms of functions and are described separately in various units and modules. Of course, when implementing the present invention, the functions of each unit and module can be implemented in the same or one or more software and / or hardware.
[0154] like Figure 7 As shown, the present invention also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of a method for adapting CAN signal differences to a vehicle-mounted application platform.
[0155] Figure 7 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 7 The electronic device provided in the embodiment of the present invention includes: one or more processors 710 and a storage device 720; the processor 710 in the electronic device may be one or more, Figure 7 A processor 710 is taken as an example; the storage device 720 is used to store one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement the method for platform-based adaptation of CAN signal differences for in-vehicle applications as described in any of the embodiments of the present invention.
[0156] The electronic device may further include: an input device 730 and an output device 740 .
[0157] The processor 710, storage device 720, input device 730 and output device 740 in the electronic device can be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0158] The storage device 720 in the electronic device is a computer-readable storage medium that can be used to store one or more programs, which can be software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the method for adapting CAN signal differences to the vehicle-mounted application platform provided in the embodiment of the present invention. The processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the storage device 720, that is, the method for adapting CAN signal differences to the vehicle-mounted application platform in the above method embodiment is implemented.
[0159] The storage device 720 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the storage device 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 720 may further include a memory remotely arranged relative to the processor 710, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0160] The input device 730 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 740 may include a display device such as a display screen.
[0161] The present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device. When the computer program runs on the electronic device, the electronic device executes the steps of a method for platform-based adaptation of CAN signals to vehicle-mounted applications.
[0162] Specifically, the computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0163] The present invention also provides a vehicle, wherein the vehicle is provided with the system for adapting CAN signal differences through the vehicle-mounted application platform as described above.
[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for adapting CAN signal differences in a vehicle-mounted application platform, characterized in that: include: A data preparation step includes responding to and organizing the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping; A mapping generation step, comprising generating a unified CAN signal mapping relationship based on a preset CAN signal mapping rule in response to the collected key information, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation; An initialization step includes dynamically loading and executing corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup; The operation and maintenance step includes responding to the application operation process, based on the CAN signal mapping logic, using the mapped CAN signal for data processing and communication, and updating when the vehicle model or the CAN signal definition changes.
2. The method for adapting CAN signal differences based on vehicle-mounted application platform according to claim 1 is characterized in that: The data preparation step includes responding to and organizing the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping, and further includes: Store the CAN signal definition files of different vehicle models in a designated directory; Verifying the integrity, consistency and accuracy of the collected CAN signal definition files; Classify, remove duplicates and sort the verified CAN signal definition files according to preset rules to form a unified signal list; The signal list is saved in a format that is easy to search and process.
3. The method for adapting CAN signal differences based on vehicle-mounted application platform according to claim 1 is characterized in that: The mapping generation step includes generating a unified CAN signal mapping relationship based on a preset CAN signal mapping rule in response to the collected key information, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation, and further includes: Create a custom CAN signal class, which includes all CAN signals that need to be mapped as member variables and defines corresponding access and modification methods; Analyze the CAN signal definitions of different vehicle models, and determine the corresponding relationship between the CAN signal and the user-defined CAN signal class member variables; Based on the corresponding relationship, write mapping logic to map the CAN signal values of different vehicle models to the corresponding member variables of the custom CAN signal class; Verify the correctness of the mapping logic so that CAN signals of different vehicle models can be correctly mapped.
4. The method for adapting CAN signal differences based on vehicle-mounted application platform according to claim 3 is characterized in that: The initialization step includes dynamically loading and executing the corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to the application startup, and further includes: When the application is started, the vehicle identification information is read to determine the current vehicle model, wherein the vehicle identification information includes vehicle ECU information and vehicle VIN code; According to the identified vehicle model, loading the CAN signal mapping logic of the corresponding vehicle model; Execute the loaded CAN signal mapping logic, map the vehicle model-specific CAN signal value to the customized CAN signal class, and verify the mapping result.
5. The method for adapting CAN signal differences based on vehicle-mounted application platform according to claim 4 is characterized in that: The operation and maintenance step includes, in response to the application operation process, using the mapped CAN signal for data processing and communication based on the CAN signal mapping logic, and updating when the vehicle model or the CAN signal definition changes, further including: During the running of the application, all logics involving CAN signal interaction are performed through the customized CAN signal class; Monitor the real-time status of CAN signal interaction, and track the transmission status, abnormal status and change trend of CAN signals in real time; When the vehicle model is changed or the CAN signal definition is changed, the data preparation and mapping generation steps are re-executed to update the CAN signal mapping relationship; The updated CAN signal mapping relationship is tested and verified to ensure that new vehicle models or new CAN signal definitions can be correctly mapped and used.
6. An automated tool, characterized in that: The automation tool applies the method for adapting CAN signal differences to the vehicle-mounted application platform as described in claim 1, and the automation tool can automatically perform the data preparation, mapping generation, initialization and operation and maintenance steps to improve development efficiency.
7. A system for adapting CAN signal differences based on a vehicle-mounted application platform, characterized in that: include: A data preparation module is configured to respond to and organize the collected CAN signal definitions of different vehicle models, wherein the CAN signal definitions include key information for parsing and mapping; A mapping generation module, configured to generate a unified CAN signal mapping relationship in response to the collected key information based on a preset CAN signal mapping rule, wherein the CAN signal mapping rule is used to map CAN signal values specific to different vehicle models into a standardized CAN signal representation; an initialization module, configured to dynamically load and execute corresponding CAN signal mapping logic according to the current vehicle model based on the CAN signal mapping relationship in response to application startup; The operation and maintenance module is configured to respond to the application operation process, based on the CAN signal mapping logic, use the mapped CAN signal for data processing and communication, and update when the vehicle model or the CAN signal definition changes.
8. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the method described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: It stores a computer program executable by an electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the method described in any one of claims 1 to 5.
10. A vehicle, characterized in that: The vehicle is provided with a system for adapting CAN signal differences through a vehicle-mounted application platform as described in claim 7.
Citation Information
Patent Citations
ML-based voltage fingerprinting of controlled message error and reference truth for ECU mapping and messages for CAN bus
CN114200905A
CAN signal adaptation device, system, method and equipment and storage medium
CN114422291A
Vehicle communication method and device, terminal equipment and storage medium
CN115052038A
Vehicle data processing method and device, electronic equipment and medium
CN118337863A
Extensible mapping for vehicle system buses
US20200396101A1
