PDU module configuration code generation method, system and device based on AUTOSAR architecture and storage medium
By parsing ARXML files and generating PduR configuration files, the problem of incompatibility with the AUTOSAR standard in the existing technology is solved, and automated configuration generation is realized, which improves development efficiency and compatibility.
Patent Information
- Application Number
- CN202411958008.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-30
AI Technical Summary
The existing PDU module configuration method based on AUTOSAR architecture is not compatible with the AUTOSAR standard and cannot directly parse the communication matrix file in ARXML format, resulting in errors in message forwarding settings.
Generate intermediate files by parsing ARXML files, edit these files to configure PDU routing information, and import these configurations into the compilation tool to generate PduR configuration files, which are finally compiled with the AUTOSAR standard operating system.
Implement automation tools to generate configuration files from ARXML files, reduce the workload of manual encoding and the possibility of errors, improve development efficiency and system adaptability, and ensure compatibility with other AUTOSAR components.
Smart Images

Figure CN120066515A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automotive architectures, and particularly to a method, system, device, and storage medium for generating PDU module configuration code based on the AUTOSAR architecture. Background Art
[0002] Autosar (AUTomotive Open System ARchitecture) is a global network of development partners aiming to create and establish an open and standardized software architecture for automotive electronic control units (ECUs).
[0003] Under the Autosar architecture, PduR (PDU Router) is an important software module that acts as a router and forwarder for data packets (PDUs, Protocol Data Units) between different automotive communication stack layers. As part of the Autosar architecture, PduR implements a standardized interface and protocol for data transmission; PduR is located in the service layer of the Autosar software architecture and provides an abstraction layer between upper-layer applications (such as diagnostics, network management, etc.) and lower-layer communication interfaces (such as CAN, LIN, FlexRay, etc.). Application-layer software can be developed independently of the underlying physical transmission medium, improving software portability and reusability; the main responsibility of PDUR is to route PDUs generated by upper-layer applications to the correct lower-layer communication interface according to the configuration (such as the configuration in the PduR_Lcfg.c file) and forward the PDUs received from the physical layer to the corresponding upper-layer applications. It supports functions such as PDU multicast and gateway functions; the configuration of PDUR is usually completed during the system generation stage, allowing the routing path of PDUs to be defined through configuration, and its flexibility makes it possible to reuse software components between different projects and different ECUs; due to the existence of multiple communication protocols and networks in automotive systems, PduR needs to support multiple communication interfaces and protocols including CAN, LIN, FlexRay, Ethernet, etc. to ensure effective data transmission between different networks.
[0004] In summary, PduR provides a key middleware service under the Autosar architecture. Through a standardized data routing and forwarding mechanism, it supports the construction of an efficient and flexible automotive communication network. The currently published patent (Publication No.: CN117270500A) discloses an automatic configuration method for centralized diagnosis based on AUTOSAR, which forwards in-vehicle communication messages to the diagnosis module for processing by parsing a CSV file. PduR needs to support multiple communication interfaces and protocols including CAN, LIN, FlexRay, Ethernet, etc., to ensure the effective transmission of data between different networks. First, this technology only supports the automatic configuration of forwarding to the diagnosis module. Second, it uses a CSV format file for the automatic generation of the configuration file, which is not compatible with the autosar standard. Moreover, this technology does not directly parse the communication matrix file in the arxml format of the autosar standard to obtain messages, and this method is prone to setting errors in message forwarding. Summary of the Invention
[0005] To solve the above technical problems, the present invention provides a method, system, device, and storage medium for generating PDU module configuration code based on the AUTOSAR architecture.
[0006] The present invention is achieved through the following technical solutions.
[0007] The method for generating PDU module configuration code based on the AUTOSAR architecture provided by the present invention includes: parsing an ARXML file to generate a first intermediate file, configuring the first intermediate file to generate a second intermediate file, importing the second intermediate file into a compilation tool to generate a third intermediate file, and compiling the third intermediate file together with the AUTOSAR standard operating system.
[0008] Further, parsing the ARXML file includes using the AUTOSAR toolchain to parse the PDU information in the ARXML file and exporting the first intermediate file in the xlxs format.
[0009] Further, configuring the first intermediate file to generate a second intermediate file includes the following method:
[0010] Editing the information in the first intermediate file, where the information includes source pdu, source module, destination pdu, transmission path, and destination module, and generating a second intermediate file after editing.
[0011] Further, importing the second intermediate file into a compilation tool to generate a third intermediate file includes the following method:
[0012] Importing the second intermediate file into the compilation tool Clarence Studio, and generating the PduR configuration file PduR_Lcfg.c according to the code template in the compilation tool.
[0013] Furthermore, the AUTOSAR standard operating system is an embedded operating system.
[0014] The present invention also provides a PDU module configuration code generation system based on the AUTOSAR architecture, including an ARXML parsing module and a configuration code generation module. The ARXML parsing module includes a detection module and a parsing module. The detection module receives the imported communication matrix in ARXML format and sends the judgment result to the parsing module. The parsing module sends the parsed PDU information to the configuration code generation module. The configuration code generation module receives the PDU information in xlxs format, judges the legality of the PDU information file, and generates configuration code according to the PUD information.
[0015] The present invention also provides a PDU module configuration code generation device based on the AUTOSAR architecture, including a module for executing any one of the above methods, including a processor and an interface circuit. The interface circuit is used to receive signals from other devices outside the device that executes the kernel state command and transmit them to the processor or send signals from the processor to other devices outside the device that executes the kernel state command. The processor uses logic circuits or executes code instructions to implement any one of the above methods.
[0016] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements any one of the above methods.
[0017] The beneficial effects of the present invention are as follows: By generating a configuration file from the Arxml file through an automated tool, the workload of manual coding and the possibility of errors are reduced, the development efficiency is improved, and it can also be flexibly customized according to project requirements, improving the adaptability of the system; By following the AUTOSAR standard, the compatibility with other AUTOSAR components is ensured, which is beneficial to modular design and system integration.
[0018] By automatically generating code through a tool, human coding errors are reduced, the accuracy and reliability of the code are improved. At the same time, the automatically generated configuration file can be directly used for compilation and burning, which is convenient for quick test verification and speeds up the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a schematic flow chart of the method of the present invention;
[0020] Figure 2 is a schematic diagram of the connection relationship of the system modules of the present invention;
[0021] Figure 3 is a schematic diagram of the parameters of the second intermediate file of the present invention;
[0022] Figure 4 It is a screenshot of the experimental result interface of the present invention. Specific embodiments
[0023] The technical solution of the present invention will be further described below, but the scope of protection is not limited thereto.
[0024] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Embodiment
[0026] The operating system generated by the generation module in this embodiment is the embedded operating system RT-Thread real-time embedded operating system, and the chip is the Infineon TC399 chip. All PDU information in the communication matrix of this embodiment is recorded in the ARXML file. By reading the ARXML file through an XML parser, all PDU information in the communication matrix can be obtained, specifically including:
[0027] 1.1. PDU identifier (PDUId): Each PDU (protocol data unit) has a unique identifier for identifying different PDUs inside the PduR module. These identifiers are usually defined during the configuration phase of the entire system;
[0028] 1.2. PDU type and attributes: The type of each Pdu (such as CAN, LIN, FlexRay, etc.) and its attributes (such as length, whether it is a dynamic length, etc.), so that PDUR can correctly process each PDU;
[0029] In addition to the above PDU information, the following configuration information required for the PDU module described by xlsx is included in this embodiment:
[0030] 2.1. Source module and destination module: PduR needs to know the source module (sender) and destination module (receiver) of each PDU. This includes which upper-layer application the PDU is sent from, and to which lower-layer communication interface or another upper-layer application it should be routed;
[0031] 2.2. Transmission path: For PDUs that need to be routed through PduR, their routing paths need to be defined. This includes the sending and receiving relationships of PDUs, and how to forward between different software modules and communication interfaces.
[0032] 2.3. Forwarding strategy: For some PDUs, specific forwarding strategies may need to be defined, such as direct forwarding, store-and-forward, or multicast, etc.;
[0033] Parse the AUTOSAR configuration file, i.e., the ARXML file, which contains the network communication configuration of the ECU (Electronic Control Unit).
[0034] The result of parsing is to generate a first intermediate file. The format of the first intermediate file is an Excel file, and the first intermediate file contains information such as the above source module, destination module, routing path, and forwarding policy;
[0035] Edit the first intermediate file, configure the source module, destination module, routing path, and forwarding policy according to the specific requirements of this embodiment. The configured file is the second intermediate file. The specific information in the second intermediate file can be viewed Figure 3 , and it can be seen from the figure the corresponding configuration information and functions of the source pdu (SourcePdu), source module (SrcModule), destination pdu (DestPdu), transmission path (TransmitPath), and destination module (DestModule). By setting the routing policy of the PDU as above, it is ensured that data can be forwarded along the expected path and in the expected manner. The format of the second intermediate file is still an Excel file;
[0036] Import the second intermediate file into the compiler tool Clarence Studio to generate a third intermediate file according to the code template, that is, the PduR configuration file PduR_Lcfg.c:
[0037] Compile the generated PduR_Lcfg.c together with other AUTOSAR standard operating system (OS) files. The operating system file selected in this embodiment is the RT-Thread embedded operating system file to generate a binary file that can run on the target hardware;
[0038] Download and burn the compiled binary file onto the target ECU hardware. Specific hardware interfaces and burning tools are used during the burning process.
[0039] After the burning is completed, conduct actual tests to verify whether the forwarding of the PDU meets the expectations; the tests may include unit tests, integration tests, and system tests to ensure that data can be correctly routed and forwarded between different modules.
[0040] As Figure 4 shown, after compiling and burning the code generated by the present invention together with the application code on the Infineon chip TC399, it can be seen the correct message sending and receiving of the PduR module according to the configuration information and the data forwarding result from CANTP to LINTP.
[0041] The above embodiments are the preferred solutions for the implementation of the present invention. It should be noted that any obvious substitutions and minor changes are within the protection scope of the present invention without departing from the concept of the present invention.
Claims
1. A PDU module configuration code generation method based on AUTOSAR architecture, characterized in that include: The ARXML file is parsed to generate a first intermediate file, the first intermediate file is configured to generate a second intermediate file, the second intermediate file is imported into a compilation tool to generate a third intermediate file, and the third intermediate file is compiled together with an AUTOSAR standard operating system.
2. The configuration code generation method according to claim 1, characterized in that: Parsing the ARXML file includes using the AUTOSAR tool chain to parse the PDU information in the ARXML file and exporting a first intermediate file in the xlxs format.
3. The configuration code generation method according to claim 1, characterized in that: Configuring the first intermediate file to generate the second intermediate file includes the following methods: Edit the information of the first intermediate file, the information including the source PDU, source module, destination PDU, transmission path and destination module, and generate the second intermediate file after editing.
4. The configuration code generation method according to claim 1, characterized in that: Importing the second intermediate file into the compilation tool to generate the third intermediate file includes the following method: The second intermediate file is imported into the compilation tool Clarence Studio, and a PduR configuration file PduR_Lcfg.c is generated according to the code template in the compilation tool.
5. The configuration code generation method according to claim 1, characterized in that: The AUTOSAR standard operating system is an embedded operating system.
6. The PDU module configuration code generation system based on AUTOSAR architecture is characterized by: It includes an ARXML parsing module and a configuration code generation module. The ARXML parsing module includes a detection module and a parsing module. The detection module receives the imported ARXML format communication matrix and sends the judgment result to the parsing module. The parsing module sends the parsed PDU information to the configuration code generation module. The configuration code generation module receives the PDU information in the xlxs format, judges the legality of the PDU information file, and generates the configuration code according to the PDU information.
7. A device for generating PDU module configuration code based on AUTOSAR architecture, comprising a module for executing the method according to any one of claims 1 to 5, characterized in that: It includes a processor and an interface circuit, wherein the interface circuit is used to receive signals from other devices other than the device for executing kernel mode commands and transmit them to the processor or send signals from the processor to other devices other than the device for executing kernel mode commands, and the processor is used to implement the method as described in any one of claims 1 to 5 through logic circuits or execution code instructions.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Automatic configuration method for centralized diagnosis based on AUTOSAR
CN117270500A