AUTOSAR data transmission method and storage medium
By creating different software components based on inter-core communication in a multi-core processor and realizing cross-core data transmission, the problem of failures in DV experiments is solved, and diagnostic efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411903106.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-08
AI Technical Summary
In DV experiments, periodic transmission of DV diagnostic data mainly depends on fixed time intervals and cannot respond at critical moments of failure, resulting in missed faults or difficulty in diagnosis.
By creating different software components based on inter-core communication in a multi-core processor, configuring corresponding SR interfaces, generating configuration information files, and associating events with shared tasks based on the runtime environment RTE to achieve cross-core data transmission.
It realizes data transmission and decoupling between different cores and different networks under multi-core conditions, reduces the coupling of different modules, can respond quickly at critical moments of failure, and improves diagnostic efficiency and accuracy.
Smart Images

Figure CN119782246A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data communication, and in particular to an AUTOSAR data transmission method and a storage medium. Background Art
[0002] AUTOSAR (Automotive Open System Architecture), also known as "Automotive Open System Architecture" in Chinese, is an alliance jointly established by global automobile manufacturers, component suppliers and other electronic, semiconductor and software system companies. The alliance was established in 2003 to develop an open and standardized software architecture for the automotive industry to simplify the exchange and update of vehicle electronic system software and improve development efficiency and cost-effectiveness.
[0003] In the verification phase of multi-core prototype design, DV experiments (i.e., design verification tests, which are mainly conducted during the design and development phase) often use the data transmission method of ETH (Ethereum) to CAN (bus). In multi-core chips, in order to optimize real-time performance, achieve data flow separation, and improve system parallelism and throughput, ETH and CAN are usually assigned to different cores. In multi-core processors, communication between different cores will result in data transmission delays, cache consistency protocol overhead, and context switching time issues, which affect program execution efficiency. Summary of the invention
[0004] The present invention provides an AUTOSAR data transmission method and storage medium, which solves the technical problem that the periodic sending of DV diagnostic data in a DV experiment mainly depends on a fixed time interval and cannot respond at the critical moment when a fault occurs, thus causing missed faults or difficult diagnosis.
[0005] In order to solve the above technical problems, the present invention provides an AUTOSAR data transmission method, comprising:
[0006] Based on inter-core communication, respectively create a first software component and a second software component corresponding to different processor cores, and respectively configure corresponding SR interfaces for the first software component and the second software component, thereby generating a configuration information file;
[0007] Generate a runtime environment RTE according to the configuration information file, and associate events in the first software component and the second software component with a shared task based on the runtime environment RTE;
[0008] Based on the requested or responded transmission data, the first software component / the second software component obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes the transmission data into another processor core, thereby realizing cross-core data transmission.
[0009] In this embodiment, based on inter-core communication, first software components and second software components corresponding to different processor cores are respectively created, and corresponding SR interfaces are respectively configured for the first software components and the second software components, including:
[0010] Configure the data type Dv_CommonResponse to be transmitted;
[0011] Create an SRIf_DVCan2Eth interface and an SRIf_DVEth2Can interface for data transmission, and associate them with the data type Dv_CommonResponse;
[0012] Create corresponding ports in the first software component and the second software component respectively, and associate the ports with the corresponding SRIf_DVCan2Eth interface / SRIf_DVEth2Can interface;
[0013] Create corresponding running entities Runnable and events in the first software component and the second software component respectively;
[0014] PR port mapping is implemented in the container BottomComposition, and both ends of the port are connected to the running entity Runnable to realize the data transmission path.
[0015] In this embodiment, corresponding running entities Runnable and events are created in the first software component and the second software component respectively, including:
[0016] Create a running entity Runnable and an event in the first software component / the second software component, wherein the event includes a data sending completion event and a data writing completion event,
[0017] Associating the data sending completion event and the data writing completion event to the corresponding running entity Runnable;
[0018] Create a port of the running entity Runnable to access the data sending point dataSendPoint and the data receiving point dataReceivePointByArgument.
[0019] In this embodiment, before creating the first software component and the second software component, the process further includes:
[0020] The CAN network and ETH network are assigned to core 0 and core 1 respectively;
[0021] Among them, the SRIf_DVCan2Eth interface and the SRIf_DVEth2Can interface correspond to the first software component and the second software component respectively, and the first software component and the second software component correspond to the core core0 and the core core1 respectively.
[0022] In this embodiment, generating a runtime environment RTE according to the configuration information file, and associating events in the first software component and the second software component with a shared task based on the runtime environment RTE, includes:
[0023] Use the BSW tool to read the configuration information file to generate the latest runtime environment RTE;
[0024] In the runtime environment RTE, the created running entities Runnable in the first software component and the second software component are mapped to the tasks of the corresponding cores;
[0025] Create OSEvent in the OS module and associate the event corresponding to OSEvent with the shared task of the corresponding MCU core;
[0026] Generate an RTE code, and save the RTE code in the RTE.c file and header files corresponding to the first software component and the second software component.
[0027] In this embodiment, before performing cross-core data transmission, the following is also included:
[0028] Allocate an ETH transfer file Cdd_Ldcom.c to the core core0, and implement the running entity Runnable_Eth2Can() corresponding to the first software component in the ETH transfer file Cdd_Ldcom.c; the ETH transfer file Cdd_Ldcom.c corresponds to ETH network data;
[0029] A CAN transfer file Cdd_DVCan.c is allocated to the core core1, and a running entity Runnable_Can2Eth() corresponding to the second software component is implemented in the CAN transfer file Cdd_DVCan.c; the CAN transfer file Cdd_DVCan.c corresponds to CAN network data.
[0030] In this embodiment, based on the requested transmission data, the first software component obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes it into another processor core to implement cross-core data transmission, including:
[0031] Determine whether a request from the device under test (DUT) is received on the CAN network, and if so, obtain the requested transmission data;
[0032] Call the write function Rte_Write_DV_Req to write the transmission data from core0 to core1 through the runtime environment RTE;
[0033] Call the read function Rte_Read_DV_Req to send a request to the SOC through the ETH network;
[0034] Among them, the write function Rte_Write_DV_Req and the read function Rte_Read_DV_Req are the embodiment of the SRIf_DVCan2Eth interface in the RTE file.
[0035] In this embodiment, based on the transmission data of the response, the second software component obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes it into another processor core, thereby realizing cross-core data transmission, including:
[0036] Determine whether a response from the SOC is received in the ETH network, and if so, obtain the transmission data of the response;
[0037] Call the write function Rte_Write_DV_Rsp to write the transmission data from core1 to core0 through the runtime environment RTE;
[0038] Call the read function Rte_Read_DV_Rsp to send a response to the device under test DUT through the CAN network;
[0039] Among them, the write function Rte_Write_DV_Rsp and the read function Rte_Read_DV_Rsp are the embodiments of the SRIf_DVEth2Can interface in the RTE file.
[0040] In this embodiment, after the cross-core data transmission is performed, it also includes: based on the first software component, adding a flag bit in the event-triggered running entity Runnable_Eth2Can(), setting it to be set after receiving the data, and sending the latest diagnostic data.
[0041] The present invention also provides a storage medium on which a computer program is stored, and the computer program is used to implement an AUTOSAR data transmission method as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0042] The present invention uses the AUTOSAR (Automotive Open System Architecture) standard SR interface to write the data to be transmitted into the No Cache variable defined in the runtime environment RTE to realize data transmission between cores, realize data transmission and decoupling between different cores and different networks under multi-core conditions, and effectively reduce the coupling of different modules; it can realize cross-core trigger transmission of SWC data allocated to different cores in the same ECU, and can effectively deal with the transmission of data between the ETH network and the CAN network in the DV experiment. When distributed to different cores, it is transmitted through the SR interface generated by the runtime environment RTE, with data consistency protection. At the same time, the response time is shortened by triggering the Event when the data is received, responding at the critical moment of the failure, and improving the diagnostic efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a workflow diagram of an AUTOSAR data transmission method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following specifically illustrates the implementation mode of the present invention in conjunction with the accompanying drawings. The embodiments are provided for illustrative purposes only and cannot be understood as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0045] Example 1
[0046] An AUTOSAR data transmission method provided by an embodiment of the present invention is as follows: Figure 1 As shown, in this embodiment, it includes:
[0047] In this embodiment, taking E3640 as an example: the maximum number of cores available for the MCU is 5 and the minimum is 3. The first group of cores are lock-step cores and cannot be split. The remaining four cores can be freely configured.
[0048] In order to relieve the pressure of data transmission and balance the load, the CAN network and ETH network are respectively assigned to core 0 and core 1. In the DV experiment, the device under test DUT communicates with the MCU through the UDS diagnostic interface of CAN; the MCU communicates with the SOC through ETH.
[0049] Among them, the SRIf_DVCan2Eth interface and the SRIf_DVEth2Can interface correspond to the first software component SWC_DV_CAN and the second software component SWC_DV_ETH respectively, and the first software component SWC_DV_CAN and the second software component SWC_DV_ETH correspond to the core core0 and the core core1 respectively.
[0050] S1. Based on inter-core communication, a first software component SWC_DV_CAN and a second software component SWC_DV_ETH corresponding to different processor cores are created respectively, and corresponding SR interfaces are configured for the first software component SWC_DV_CAN and the second software component SWC_DV_ETH respectively, thereby generating a configuration information file, including:
[0051] S11. Configure the data type Dv_CommonResponse to be transmitted. The data will be created in the RTE.c file.
[0052] Among them, RTE (Run Time Environment) is a key component in the AUTOSAR system. It implements the virtual function bus (VFB) in the AUTOSAR system, provides access interfaces between software components (SWC) and SWC's access interface to basic software (BSW) resources.
[0053] S12 creates an SRIf_DVCan2Eth interface and an SRIf_DVEth2Can interface for data transmission, and associates them with the data type Dv_CommonResponse;
[0054] The ports of software components can be divided into require ports (Require Port, RPort), provide ports (Provide Port, PPort), and provide and require ports (Provide and Require Port, PRPort) according to the input / output direction.
[0055] For the SR interface, the Rport demand port is the receiver, and the Pport supply port is the sender.
[0056] S13, creating corresponding ports in the first software component SWC_DV_CAN and the second software component SWC_DV_ETH respectively, and associating the ports with the corresponding SRIf_DVCan2Eth interface / SRIf_DVEth2Can interface;
[0057] S14, creating corresponding running entities Runnable and events in the first software component SWC_DV_CAN and the second software component SWC_DV_ETH respectively, including:
[0058] Create a running entity Runnable and events in the first software component SWC_DV_CAN / the second software component SWC_DV_ETH, wherein the events include a data sending completion event and a data writing completion event.
[0059] Associating the data sending completion event DataSendCompletedEvent and the data writing completion event DataWriteCompletedEvent to the corresponding running entity Runnable;
[0060] Create a port of the running entity Runnable to access the data sending point dataSendPoint and the data receiving point dataReceivePointByArgument.
[0061] Among them, in Autosar, the running entity Runnable refers to a minimum execution unit that can be scheduled. It can be understood as an independent task or function with specific inputs and outputs.
[0062] S15. Implement PR port mapping in the container BottomComposition, and connect the two ends of the port to the running entity Runnable to implement the data transmission path.
[0063] The container BottomComposition is used to connect the first software component SWC_DV_CAN and the second software component SWC_DV_ETH.
[0064] S16. Generate a configuration information file EcuExtract.
[0065] S2, generating a runtime environment RTE according to the configuration information file, and associating events in the first software component SWC_DV_CAN and the second software component SWC_DV_ETH with a shared task based on the runtime environment RTE, including:
[0066] Use the BSW tool to read the configuration information file to generate the latest runtime environment RTE;
[0067] In the runtime environment RTE, the runnable entities in the created first software component SWC_DV_CAN and the second software component SWC_DV_ETH are mapped to the tasks of the corresponding cores;
[0068] Create OSEvent in the OS module and associate the event corresponding to OSEvent with the shared task of the corresponding MCU core (for example, EcuPartition_0_OsTask_Share_0);
[0069] Generate RTE code, and save the RTE code in the RTE.c file and header files (SWC_DV_CAN.h file and SWC_DV_ETH.h file) corresponding to the first software component SWC_DV_CAN and the second software component SWC_DV_ETH.
[0070] S3. Based on the transmission data of the request or response, the first software component SWC_DV_CAN / the second software component SWC_DV_ETH obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes it into another processor core to realize cross-core data transmission.
[0071] There are declarations of the running entity Runnable in the SWC_DV_CAN.h and SWC_DV_ETH.h files, and the running entity (Runnable) needs to be implemented in the file to be called.
[0072] S31. Allocate an ETH transfer file Cdd_Ldcom.c to the core core0, and implement the running entity Runnable_Eth2Can() corresponding to the first software component SWC_DV_CAN in the ETH transfer file Cdd_Ldcom.c; the ETH transfer file Cdd_Ldcom.c corresponds to ETH network data;
[0073] A CAN transfer file Cdd_DVCan.c is allocated to the core core1, and the running entity Runnable_Can2Eth() corresponding to the second software component SWC_DV_ETH is implemented in the CAN transfer file Cdd_DVCan.c; the CAN transfer file Cdd_DVCan.c corresponds to CAN network data.
[0074] S32A, based on the requested transmission data, the first software component SWC_DV_CAN obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes the transmission data into another processor core, thereby realizing cross-core data transmission, including:
[0075] Determine whether a request from the device under test (DUT) is received on the CAN network, and if so, obtain the requested transmission data;
[0076] Call the write function Rte_Write_DV_Req to write the transmission data from core0 to core1 through the runtime environment RTE;
[0077] Call the read function Rte_Read_DV_Req to send a request to the SOC through the ETH network;
[0078] Among them, the write function Rte_Write_DV_Req and the read function Rte_Read_DV_Req are the embodiment of the SRIf_DVCan2Eth interface in the RTE file.
[0079] S32B, based on the response transmission data, the second software component SWC_DV_ETH obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes it into another processor core, thereby realizing cross-core data transmission, including:
[0080] Determine whether a response from the SOC is received in the ETH network, and if so, obtain the transmission data of the response;
[0081] Call the write function Rte_Write_DV_Rsp to write the transmission data from core1 to core0 through the runtime environment RTE;
[0082] Call the read function Rte_Read_DV_Rsp to send a response to the device under test DUT through the CAN network;
[0083] Among them, the write function Rte_Write_DV_Rsp and the read function Rte_Read_DV_Rsp are the embodiments of the SRIf_DVEth2Can interface in the RTE file.
[0084] S4. Based on the first software component, add a flag bit in the event-triggered running entity Runnable_Eth2Can(), set it to be set after receiving data, and send the latest diagnostic data.
[0085] Example 2
[0086] The embodiment of the present invention further provides a storage medium on which a computer program is stored, and the computer program is used to implement an AUTOSAR data transmission method as described in the above embodiment 1. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0087] The embodiment of the present invention uses the AUTOSAR (Automotive Open System Architecture) standard SR interface to write the data to be transmitted into the No Cache variable defined in the runtime environment RTE to realize data transmission between cores, and realizes data transmission and decoupling between different cores and different networks under multi-core conditions, effectively reducing the coupling of different modules; it can realize cross-core trigger transmission of SWC data allocated to different cores in the same ECU, and can effectively deal with the transmission of data between the ETH network and the CAN network in the DV experiment. When distributed to different cores, it is transmitted through the SR interface generated by the runtime environment RTE, with data consistency protection. At the same time, the response time is shortened by triggering the Event when the data is received, and the response is performed at the critical moment when the fault occurs, thereby improving the diagnostic efficiency and accuracy.
[0088] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. An AUTOSAR data transmission method, characterized in that: include: Based on inter-core communication, respectively create a first software component and a second software component corresponding to different processor cores, and respectively configure corresponding SR interfaces for the first software component and the second software component, thereby generating a configuration information file; Generate a runtime environment RTE according to the configuration information file, and associate events in the first software component and the second software component with a shared task based on the runtime environment RTE; Based on the requested or responded transmission data, the first software component / the second software component obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes the transmission data into another processor core, thereby realizing cross-core data transmission.
2. An AUTOSAR data transmission method as claimed in claim 1, characterized in that: Based on the inter-core communication, a first software component and a second software component corresponding to different processor cores are respectively created, and corresponding SR interfaces are respectively configured for the first software component and the second software component, including: Configure the data type Dv_CommonResponse to be transmitted; Create an SRIf_DVCan2Eth interface and an SRIf_DVEth2Can interface for data transmission, and associate them with the data type Dv_CommonResponse; Create corresponding ports in the first software component and the second software component respectively, and associate the ports with the corresponding SRIf_DVCan2Eth interface / SRIf_DVEth2Can interface; Create corresponding running entities Runnable and events in the first software component and the second software component respectively; PR port mapping is implemented in the container BottomComposition, and both ends of the port are connected to the running entity Runnable to realize the data transmission path.
3. An AUTOSAR data transmission method as claimed in claim 2, characterized in that: The corresponding running entities Runnable and events are created in the first software component and the second software component respectively, including: Create a running entity Runnable and an event in the first software component / the second software component, wherein the event includes a data sending completion event and a data writing completion event, Associating the data sending completion event and the data writing completion event to the corresponding running entity Runnable; Create a port of the running entity Runnable to access the data sending point dataSendPoint and the data receiving point dataReceivePointByArgument.
4. An AUTOSAR data transmission method as claimed in claim 2, characterized in that: Before creating the first software component and the second software component, the method further includes: The CAN network and ETH network are assigned to core 0 and core 1 respectively; Among them, the SRIf_DVCan2Eth interface and the SRIf_DVEth2Can interface correspond to the first software component and the second software component respectively, and the first software component and the second software component correspond to the core core0 and the core core1 respectively.
5. An AUTOSAR data transmission method as claimed in claim 4, characterized in that: Generating a runtime environment RTE according to the configuration information file, and associating events in the first software component and the second software component with a shared task based on the runtime environment RTE, including: Use the BSW tool to read the configuration information file to generate the latest runtime environment RTE; In the runtime environment RTE, the created running entities Runnable in the first software component and the second software component are mapped to the tasks of the corresponding cores; Create OSEvent in the OS module and associate the event corresponding to OSEvent with the shared task of the corresponding MCU core; Generate an RTE code, and save the RTE code in the RTE.c file and header files corresponding to the first software component and the second software component.
6. The AUTOSAR data transmission method according to claim 1, characterized in that: Before cross-core data transfer, it also includes: Allocate an ETH transfer file Cdd_Ldcom.c to the core core0, and implement the running entity Runnable_Eth2Can() corresponding to the first software component in the ETH transfer file Cdd_Ldcom.c; the ETH transfer file Cdd_Ldcom.c corresponds to ETH network data; A CAN transfer file Cdd_DVCan.c is allocated to the core core1, and a running entity Runnable_Can2Eth() corresponding to the second software component is implemented in the CAN transfer file Cdd_DVCan.c; the CAN transfer file Cdd_DVCan.c corresponds to CAN network data.
7. An AUTOSAR data transmission method as claimed in claim 2, characterized in that: Based on the requested transmission data, the first software component obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes the transmission data into another processor core to implement cross-core data transmission, including: Determine whether a request from the device under test (DUT) is received on the CAN network, and if so, obtain the requested transmission data; Call the write function Rte_Write_DV_Req to write the transmission data from core0 to core1 through the runtime environment RTE; Call the read function Rte_Read_DV_Req to send a request to the SOC through the ETH network; Among them, the write function Rte_Write_DV_Req and the read function Rte_Read_DV_Req are the embodiment of the SRIf_DVCan2Eth interface in the RTE file.
8. An AUTOSAR data transmission method as claimed in claim 2, characterized in that: Based on the response transmission data, the second software component obtains the transmission data from the corresponding processor core through the runtime environment RTE and writes the transmission data into another processor core to realize cross-core data transmission, including: Determine whether a response from the SOC is received in the ETH network, and if so, obtain the transmission data of the response; Call the write function Rte_Write_DV_Rsp to write the transmission data from core1 to core0 through the runtime environment RTE; Call the read function Rte_Read_DV_Rsp to send a response to the device under test DUT through the CAN network; Among them, the write function Rte_Write_DV_Rsp and the read function Rte_Read_DV_Rsp are the embodiments of the SRIf_DVEth2Can interface in the RTE file.
9. An AUTOSAR data transmission method as claimed in claim 6, characterized in that: After the cross-core data transmission is performed, it also includes: based on the first software component, adding a flag bit in the event-triggered running entity Runnable_Eth2Can(), setting it to be set after receiving the data, and sending the latest diagnostic data.
10. A storage medium having a computer program stored thereon, characterized in that: The computer program is used to implement an AUTOSAR data transmission method according to any one of claims 1 to 9.