Controller, data transmission method and system and vehicle
By integrating the CAN module and DDS module in the controller, using the protocol conversion function to directly convert CAN and DDS data, and combining the RTE and verification mechanism, the data transmission efficiency and real-time issues between CAN and DDS protocols are solved, and efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202511060457.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-10-10
AI Technical Summary
In the existing technology, the real-time performance of data transmission between CAN and DDS protocols is not high, and data conversion cannot be achieved efficiently.
The controller includes a CAN module and a DDS module. The CAN data and DDS data are directly converted through the protocol conversion function to avoid the complicated unpacking/depacketizing process. The data is directly called through the RTE, and the reliability of data transmission is ensured by combining CRC and serial number verification.
The conversion efficiency and real-time performance between CAN data and DDS data are improved, the accuracy and reliability of data transmission are ensured, and the search time of the transmission path and the interference of data types are reduced.
Smart Images

Figure CN120768968A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicles, in particular to a controller, a data transmission method, a system and a vehicle. BACKGROUND
[0002] The controller area network (CAN) and the data distribution service (DDS) are two different communication protocols applied in embedded systems and distributed systems. The CAN module is used to realize data interaction between nodes of the CAN bus. For example, data interaction between modules such as engine control and instrument panel. The DDS module is used to realize data distribution.
[0003] In a related technology, CAN data is sent to a domain controller through a CAN bus, the domain controller encapsulates the CAN data into DDS data according to a certain mapping rule, and sends the DDS data to a DDS subscription node on a central controller through an Ethernet network according to the DDS protocol. The DDS subscription node processes the feedback DDS data and sends it back to the domain controller through the Ethernet network according to the DDS protocol. The domain controller decapsulates the feedback DDS data into CAN data according to a certain mapping rule. The above technical solution for realizing data transmission between CAN and DDS does not elaborate the specific software transmission path, and the real-time performance of data transmission is not high.
[0004] In another related technology, the system architecture includes at least one first integrated module, a DDS architecture and an automotive open system architecture (AUTOSAR). The first integrated module is built in the DDS architecture, the DDS architecture is deployed in the AUTOSAR, and the AUTOSAR includes a runtime environment (RTE) and a software component (SWC). The first integrated module is used to manage message publishers and / or subscribers. The RTE is used to store the mapping relationship between the first integrated module and the SWC signal, and the SWC signal is sent by the SWC to the RTE and provided to the DDS architecture. The above technical solution only solves the communication problem of DDS and cannot realize efficient conversion between CAN and DDS. SUMMARY
[0005] The present application provides a controller, a data transmission method, a system and a vehicle, which improves the efficiency of conversion and transmission between CAN data and DDS data.
[0006] To achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0007] In a first aspect, the application provides a controller, the controller comprising a CAN module and a DDS module, the CAN module comprising a CAN sending interface and a DDS receiving interface, and the DDS module comprising a DDS sending interface and a CAN receiving interface.
[0008] The first target module is configured to, in response to receiving the target message, parse first data from the target message, and send the first data to a first receiving interface through a first sending interface, so that a second target module calls a protocol conversion function to convert the first data into second data. When the first target module is the CAN module, the target message, the first data, the first sending interface and the first receiving interface are respectively a CAN message, CAN data, a CAN sending interface and a CAN receiving interface, and the second target module and the second data are respectively a DDS module and DDS data. When the first target module is the DDS module, the target message, the first data, the first sending interface and the first receiving interface are respectively a DDS message, DDS data, a DDS sending interface and a DDS receiving interface, and the second target module and the second data are respectively a CAN module and CAN data.
[0009] The technical scheme provided in the embodiments of the application can parse first data from a target message when the CAN module or the DDS module receives the target message, and the CAN module or the DDS module can call a protocol conversion function to convert the data format of the first data (CAN data or DDS data), thereby avoiding a complicated unpacking / unpacking process of the data and improving the conversion efficiency between the CAN data and the DDS data.
[0010] In a possible implementation, the controller further comprises a protocol conversion module. When the first target module is the CAN module, the second target module calls a CAN-to-DDS protocol conversion function by calling a first calling interface of the protocol conversion module. When the first target module is the DDS module, the second target module calls a DDS-to-CAN protocol conversion function by calling a second calling interface of the protocol conversion module. The corresponding protocol conversion functions are called through the two calling interfaces respectively, the protocol conversion functions do not interfere with each other, the calling accuracy of the protocol conversion functions is improved, the calling efficiency of the protocol conversion functions is improved, and the data transmission efficiency is further improved.
[0011] In a possible implementation, for any target calling interface in the first calling interface and the second calling interface, the target calling interface comprises a plurality of sub-calling interfaces associated with data types, and the protocol conversion functions called through different sub-calling interfaces are different. The second target module is specifically configured to determine a target sub-calling interface based on the type of the first data, and call the protocol conversion function by calling the target sub-calling interface.
[0012] In a possible implementation, the controller further includes an RTE, and the first target module is specifically configured to send the first data to the RTE through the first sending interface, so that the RTE forwards the first data to the first receiving interface. By transmitting the data between the first target module and the second target module through the RTE, direct calling of the data is implemented, a complicated unpacking process is avoided, and the data transmission efficiency is improved.
[0013] In a possible implementation, a plurality of first sub-sending interfaces in the first sending interface are bound one-to-one with a plurality of first sub-receiving interfaces in the first receiving interface, each first sub-sending interface is configured to send first data of a data type associated with the first sub-sending interface to the first sub-receiving interface bound with the first sub-sending interface, and the plurality of first sub-sending interfaces are associated with different data types. The first sub-sending interface is bound with the first sub-receiving interface, and the corresponding interface does not need to be found during data transmission, so that the search time of the transmission path is reduced, and meanwhile, the data types of different transmission paths are different, so that interference between different types of data is avoided, and the data types are facilitated to be identified.
[0014] In a possible implementation, the first target module is specifically configured to determine a target first sub-sending interface based on a type identifier of the first data, and send the first data to the first sub-receiving interface bound with the target first sub-sending interface through the target first sub-sending interface. The type identifier is used to determine the data type, and then the target first sub-sending interface corresponding to the data type is determined, so that the target first sub-sending interface is efficiently and conveniently found.
[0015] In a possible implementation, the second target module is further configured to calculate a cyclic redundancy check (CRC) value of the first data, perform consistency check on the CRC value and the CRC value of the first data calculated by the first target module, and discard the first data and perform fault prompting in response to the consistency check failing. The consistency check is performed, and faults generated in the data transmission process are discovered in a timely manner.
[0016] In a possible implementation, the second target module is further configured to perform sequence number check on the first data, and perform fault prompting in response to the sequence number check failing. The sequence number check is performed, and packet loss, repetition, and out-of-order faults occurring in the data transmission process are monitored in real time.
[0017] In a possible implementation, the controller further includes a processing module. The second target module is further configured to increase a fault count by 1 in response to the consistency check failing, the sequence number check failing, or the first data transmission timing out. The processing module is configured to initialize the controller in response to determining that the fault count recorded by the second target module exceeds a fault number threshold. The fault count is used to process the fault in a timely manner, and the reliability of the data output process is ensured.
[0018] In a possible implementation, the processing module is further configured to, in response to determining that the failure count recorded by the second target module exceeds the failure threshold and the number of initializations exceeds the initialization threshold, prompt the maintenance controller; and disable the first target module from transmitting first data with a transmission priority lower than a preset priority to the second target module. In this way, the transmission of data with a higher priority is guaranteed when the controller cannot be initialized, without affecting the normal use of the controller.
[0019] In a second aspect, the present application provides a data transmission method, the data transmission method being applied to the controller in the first aspect, and the data transmission method comprising:
[0020] In response to receiving the target message, the first data is parsed from the target message, and the first data is sent to the first receiving interface through the first sending interface, so that the second target module converts the first data into second data by calling a protocol conversion function.
[0021] In the foregoing embodiment, the target message, the first data, the first sending interface and the first receiving interface are respectively a CAN message, CAN data, a CAN sending interface and a CAN receiving interface, and the second target module and the second data are respectively a DDS module and DDS data. Alternatively, the target message, the first data, the first sending interface and the first receiving interface are respectively a DDS message, DDS data, a DDS sending interface and a DDS receiving interface, and the second target module and the second data are respectively a CAN module and CAN data.
[0022] The data transmission method provided in the embodiments of the present application,
[0023] In a possible implementation, the first data is sent to the first receiving interface through the first sending interface, which can be specifically implemented as follows: the first data is sent to the RTE through the first sending interface, so that the RTE forwards the first data to the first receiving interface.
[0024] In a possible implementation, the plurality of first sub-sending interfaces in the first sending interface are one-to-one bound to the plurality of first sub-receiving interfaces in the first receiving interface; each first sub-sending interface sends first data of a data type associated with the first sub-sending interface to a first sub-receiving interface bound to the first sub-sending interface; and the plurality of first sub-sending interfaces are associated with different data types.
[0025] In a possible implementation, the first sub-sending interface sends first data of a data type associated with the first sub-sending interface to a first sub-receiving interface bound to the first sub-sending interface, which can be specifically implemented as follows: a target first sub-sending interface is determined based on a type identifier of the first data, and the first data is sent to a first sub-receiving interface bound to the target first sub-sending interface through the target first sub-sending interface.
[0026] In a possible implementation, the data transmission method provided by the embodiment of the present application further includes: calculating, by the second target module, the CRC value of the first data, performing consistency check on the CRC value and the CRC value of the first data calculated by the first target module, discarding the first data and performing fault prompting in response to the consistency check failing.
[0027] In a possible implementation, the data transmission method provided by the embodiment of the present application further includes: performing, by the second target module, sequence number check on the first data, and performing fault prompting in response to the sequence number check failing.
[0028] In a possible implementation, the data transmission method provided by the embodiment of the present application further includes: in response to the consistency check failing, the sequence number check failing or the first data transmission timing out, increasing the fault count by 1. In response to determining that the fault count recorded by the second target module exceeds the fault number threshold, initializing the controller.
[0029] In a possible implementation, the data transmission method provided by the embodiment of the present application further includes: in response to determining that the fault count recorded by the second target module exceeds the fault number threshold and the number of initialization exceeds the initialization threshold, prompting maintenance of the controller; and disabling the first target module from transmitting, to the second target module, the first data to be transmitted with a transmission priority lower than a preset priority.
[0030] In a third aspect, the present application provides a data transmission system, which includes: a CAN device, a DDS device and the controller in any implementation manner of the first aspect, and the controller further includes a CAN communication interface and an Ethernet (ETH) communication interface. The CAN communication interface is configured to transmit CAN messages between the CAN device and the CAN module in the controller. The ETH communication interface is configured to transmit DDS messages between the DDS device and the DDS module in the controller.
[0031] In a fourth aspect, the present application further provides a vehicle, which includes the controller in any implementation manner of the first aspect or the data transmission system in the third aspect.
[0032] It should be noted that the various possible implementation manners of any one of the above aspects can be combined on the premise that the schemes are not contradictory. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 A structural schematic diagram of a controller provided for an example embodiment;
[0034] Figure 2 A system architecture schematic diagram of a controller provided for an example embodiment;
[0035] Figure 3 A structural schematic diagram of a protocol conversion module provided for an example embodiment;
[0036] Figure 4 A flowchart of a code conversion method provided for an example embodiment;
[0037] Figure 5 A flowchart of a fault counting method provided for an example embodiment;
[0038] Figure 6 A flowchart of a fault processing method provided for an example embodiment;
[0039] Figure 7 A flowchart of a data transmission method provided for an example embodiment;
[0040] Figure 8 A structural schematic diagram of a data transmission system provided for an example embodiment. DETAILED DESCRIPTION
[0041] In the embodiments of the present application, in order to clearly describe the technical solutions of the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", etc. The skilled in the art can understand that "first", "second", etc. do not limit the quantity and execution order, and "first", "second", etc. also do not limit being different. The technical features described by "first", "second" have no order or size order.
[0042] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of the words "exemplary" or "for example" is intended to present concepts in a particular manner. It is understood that the concepts presented can be used in a variety of ways without departing from the spirit and scope of the embodiments of the present application.
[0043] In the embodiments of the present application, at least one can also be described as one or more, and the plurality can be two, three, four or more, which is not limited by the present application.
[0044] In order to facilitate understanding, the controller, data transmission method, system and vehicle provided by the present application are specifically introduced below in combination with the drawings.
[0045] As Figure 1As shown, the controller provided by the application comprises a CAN module 100 and a DDS module 200. The CAN module 100 comprises a CAN sending interface 10 and a DDS receiving interface 11, and the DDS module 200 comprises a DDS sending interface 20 and a CAN receiving interface 21.
[0046] Exemplarily, the first target module responds to receiving the target message, parses the first data from the target message, and sends the first data to the first receiving interface through the first sending interface, so that the second target module calls the protocol conversion function to convert the first data into the second data.
[0047] The first target module is the CAN module 100 or the DDS module 200.
[0048] Specifically, when the first target module is the CAN module 100, the target message, the first data, the first sending interface and the first receiving interface are respectively the CAN message, the CAN data, the CAN sending interface 10 and the CAN receiving interface 21, and the second target module and the second data are respectively the DDS module 200 and the DDS data. When the first target module is the DDS module 200, the target message, the first data, the first sending interface and the first receiving interface are respectively the DDS message, the DDS data, the DDS sending interface 20 and the DDS receiving interface 11, and the second target module and the second data are respectively the CAN module 100 and the CAN data. For example, the CAN module 100 responds to receiving the CAN message, parses the CAN data from the CAN message, and sends the CAN data to the CAN receiving interface 21 through the CAN sending interface 10, so that the DDS module 200 calls the protocol conversion function to convert the CAN data into the DDS data.
[0049] The CAN message is transmitted based on the rules formulated by the CAN protocol, and includes the CAN identifier, the data length code, the data field, the frame type, the other control fields and the like. Exemplarily, the CAN message is parsed into a protocol data unit (PDU), and the PDU is parsed to obtain the CAN data.
[0050] The DDS message is transmitted based on the rules formulated by the DDS protocol, and includes the message header, the sub-message, the serialized data and the like. Exemplarily, the DDS message is parsed into the structure data in the reverse sequence, and the independent signal, i.e., the DDS data, is obtained based on the mapping of the structure data.
[0051] Since the CAN data is usually raw binary signal and the DDS data is usually structured data, the data format, unit, byte and other contents need to be converted by the protocol conversion function when converting between the CAN data and the DDS data. For example, when the DDS module 200 receives the CAN data, the protocol conversion function is called to map and convert the CAN raw value 5000 in the CAN data to 50.0 km / h, and the DDS data is obtained.
[0052] Exemplarily, the controller further comprises a protocol conversion module (Convert) 300. The CAN module 100 calls the protocol conversion function of CAN to DDS by calling the first calling interface 30 of the protocol conversion module 300, and the DDS module 200 calls the protocol conversion function of DDS to CAN by calling the second calling interface 31 of the protocol conversion module 300.
[0053] The first calling interface 30 and the second calling interface 31 are client / server (C / S) interfaces, the first calling interface 30 is used to call the protocol conversion function of converting the CAN data to the DDS data, and the second calling interface 31 is used to call the protocol conversion function of converting the DDS data to the CAN data.
[0054] As an example, for any target calling interface in the first calling interface 30 and the second calling interface 31, the target calling interface comprises a plurality of sub-calling interfaces associated with data types, and the protocol conversion functions called through different sub-calling interfaces are different. The second target module determines the target sub-calling interface based on the type identification of the first data, and calls the protocol conversion function by calling the target sub-calling interface.
[0055] The target sub-calling interface is associated with different data types of the first data converted by the second module.
[0056] Optionally, the data types include vehicle speed data, engine data, global broadcast message, image data and the like.
[0057] Exemplarily, the data types of the CAN data are identified by CAN identifiers (CAN IDs), and the data types of the DDS data are identified by topics.
[0058] As an example, when the protocol conversion function is called through the first calling interface 30 or the second calling interface 31, the first passing parameter and the second passing parameter are included in the calling operation.
[0059] The first passing parameter represents the data type of the input data, and the second passing parameter represents the data type of the output data.
[0060] Exemplarily, when the protocol conversion function is invoked through the first invocation interface 31, the first passing parameter is the data type of the CAN data, and the second passing parameter is the data type of the DDS data. When the protocol conversion function is invoked through the second invocation interface 32, the first passing parameter is the data type of the DDS data, and the second passing parameter is the data type of the CAN data.
[0061] In some embodiments, a plurality of first sub-transmission interfaces in the first transmission interface are one-to-one bound to a plurality of first sub-reception interfaces in the first reception interface, each first sub-transmission interface is configured to transmit first data of a data type associated with the first sub-transmission interface to the first sub-reception interface bound to the first sub-transmission interface, and the plurality of first sub-transmission interfaces are associated with different data types.
[0062] Exemplarily, the first target module determines a target first sub-transmission interface based on the type of the first data, and transmits the first data to the first sub-reception interface bound to the target first sub-transmission interface through the target first sub-transmission interface.
[0063] Specifically, the CAN module 100 determines the data type of the CAN data based on the CAN ID, and then determines the target first sub-transmission interface corresponding to the data type, and transmits the CAN data to the first sub-reception interface bound to the target first sub-transmission interface through the target first sub-transmission interface. The DDS module 200 determines the data type of the DDS data based on the topic, and then determines the target first sub-transmission interface corresponding to the data type, and transmits the CAN data to the first sub-reception interface bound to the target first sub-transmission interface through the target first sub-transmission interface. In the data transmission process, the topic of the same data type is associated with the CAN ID. For example, the data content of the same topic is placed in the same CAN ID frame.
[0064] In some embodiments, the controller integrates the CAN module 100 and the DDS module 200 based on an automotive open system architecture classic platform (AUTOSAR Classic Platform, AUTOSAR CP).
[0065] The AUTOSAR CP is a software architecture platform designed for traditional automotive electronic control units (ECU) in the AUTOSAR standard.
[0066] Specifically, the AUTOSAR CP includes a basic software layer (BSW), an RTE, and an application layer.
[0067] The BSW is a standardized module (such as communication, storage, diagnosis, etc.) composed of a microcontroller abstraction layer (MCAL), a service layer, etc. The application layer includes the SWC, which implements specific functions.
[0068] Exemplarily, the first target module sends the first data to the RTE through the first sending interface, so that the RTE forwards the first data to the first receiving interface.
[0069] For example, as Figure 2As shown, the CAN module receives or sends CAN messages through CAN, and notifies the upper CAN interface module (interface, IF) of the received CAN message through interruption or polling. The CANIF serves as an adaptation layer of CAN and the upper module, provides a unified interface, and processes the differences of CAN hardware, such as converting the original frame of the CAN message into a unified format (such as PDU format) and filtering irrelevant CAN IDs according to the configuration. The first PDU router (PDUR) is used to forward the CAN message to the communication module (COM) according to the CAN ID or PDU ID. The COM is used for CAN message packaging / unpacking, signal group processing, data validity management, etc., such as parsing the CAN data (application layer signals such as vehicle speed, temperature, etc.) from the CAN message. The RTE automatically caches the CAN data parsed by the COM, so that the SWC_CAN reads the CAN data through the application programming interface (API) generated by the RTE. The DDS module interacts with the Ethernet controller directly through the Ethernet driver (ETH) to receive or send DDS messages and notify the ETHIF. The ETH interface module (ETHIF) is used to abstract the differences of different Ethernet hardware, and provides a unified interface to the upper layer (transmission control protocol / internet protocol stack (TCPIP)), such as converting the DDS message into a unified format. The TCPIP is used to implement the TCP / IP protocol stack (such as TCP, user datagram protocol (UDP), etc.), parse or encapsulate the network layer data, and obtain the abstract interface / socket data between the application layer and the transport layer. For example, the Ethernet header, IP header, transport layer header, etc. are stripped and parsed. The socket adaptor (SOAD) is used to adapt the TCP / IP protocol stack and the AUTOSAR communication stack, implement the socket communication management of DDS, and convert the socket data into interaction layer PDU (I-PDU) data. The second PDUR is used to route the I-PDU to different upper modules, such as the lightweight DDS COM (LDCOM), and the DDS connected with the second PDUR is used to implement all interface logics of DDS. The LDCOM is used to process the DDS protocol and parse the obtained DDS data.RTE automatically caches the DDS data parsed by LDCOM so that SWC_DDS can read the DDS data through the API generated by RTE.
[0070] Among them, such as Figure 3 As shown, the AUTOSAR CP also includes SWC_Convert. Communication between SWC_CAN and SWC_DDS is achieved through configured sender / receiver (S / R) interfaces. Specifically, SWC_CAN is configured with a CAN_CAN interface and a CAN_DDS interface. The CAN_CAN data interface represents the interface type for data in SWC_CAN that originates from CAN messages and serves as the CAN send interface 10. The CAN_DDS interface represents the interface type for data in SWC_CAN that originates from DDS messages and serves as the DDS receive interface 11. SWC_DDS is configured with a DDS_CAN interface and a DDS_DDS interface. The DDS_CAN interface represents the interface type for data in SWC_DDS that originates from CAN messages and serves as the CAN receive interface 21. The DDS_DDS interface represents the interface type for data in SWC_DDS that originates from DDS messages and serves as the DDS send interface 20.
[0071] The CAN_CAN interface is a provide port (PPort), and the DDS_CAN interface is a require port (RPort); the CAN_DDS interface is an RPort, and the DDS_DDS interface is a PPort. The data elements (dataelements) transmitted between the interfaces only contain specific signals, and the dataelements of different topics and CAN IDs are different. SWC_Convert provides protocol conversion function services for SWC_CAN and SWC_DDS as a server through the C / S interface. Specifically, SWC_CAN calls the DDS to CAN protocol conversion function by calling the first calling interface 30 of SWC_Convert, and SWC_DDS calls the CAN to DDS protocol conversion function by calling the second calling interface 31 of SWC_Convert.
[0072] Utilize the AUTOSAR tool chain (such as DaVinci and ISOLARA / B) to configure the interface, automatically establish an association between the SWC_CAN and SWC_CAN interfaces, and transfer data between the interfaces through the RTE. This eliminates the need to search for matching CAN IDs and topics each time, reducing the workload of running the code.
[0073] Exemplarily, when being configured, it is ensured that the content of one topic is placed in the same CAN ID, and the CAN with flexible data rate (CANFD) format is preferentially used for data transmission. CANFD can deliver more data. In the case where 64 bytes are not enough, a CANTP module is added between the PDUR and the COM to package.
[0074] In some embodiments, in order to guarantee the real-time performance of data transmission and reduce the delay, an RTE event triggered task is added in the operating system (OS), the trigger source is a data received event, and the event is respectively associated with the DDS_CAN interface and the CAN_DDS interface. The processing of data is triggered immediately when the data is received, thereby guaranteeing the timeliness of software processing of mutual conversion information.
[0075] In some embodiments, in order to further guarantee the time performance requirement of software, the dynamic discovery process of DDS is completed by the middleware (controller) to interact, and CAN data is not waited.
[0076] In order to improve the development efficiency, the embodiment also provides a tool (Convert helper) for generating conversion code in the SWC_Convert module based on matlab, as shown in Figure 4 The code conversion method comprises the following steps.
[0077] S401: Import the system description file (arxml format) corresponding to the CAN data and the DDS data. The system description file comprises detailed data information content.
[0078] S402: Perform data analysis on the imported arxml file, comb the data transmission path according to the data packet name and direction in the system description file, and establish an IN-OUT data list. The data type format of the input data is associated in IN, the data type format of the data to be output is associated in OUT, and the size (ListNum) of the IN-OUT data list represents the number of transmission paths.
[0079] S403: According to the IN-OUT data list, process the IN-OUT data in pieces, and find the input quantity (Num_IN) and the output quantity (Num_Out) of the data elements in the data type format associated in IN and OUT, respectively.
[0080] S404: According to the number of output data elements (Num_Out) in the data type of OUT, sequentially index the names of the elements in the data type of OUT, and find the matching element names in the elements in the data type of IN.
[0081] S405: Print the assignment statement of assigning the element value of the parameter of IN (the first parameter) to the element value of the parameter of OUT (the second parameter) to the found element names.
[0082] S406: After all the Num_Out in the path are filled, generate the corresponding function name according to the rules of generating the function name of RTE, avoid secondary association, adjust other formats, and complete the output of the code.
[0083] S407: Repeat S403-S406 until all the paths in the IN-OUT data list generate the corresponding code.
[0084] In some embodiments, the second target module is further configured to calculate a CRC value of the first data, perform consistency check on the CRC value and the CRC value of the first data calculated by the first target module, discard the first data and perform fault prompt in response to the consistency check failing.
[0085] The CRC is used to detect whether an error occurs in the data transmission or storage process, and a fixed-length check value (usually 16, 32 or 64 bits) is generated through a mathematical algorithm and attached to the original data. The receiver verifies the integrity of the data by recalculating the check value.
[0086] For example, the DDS module calculates the CRC value of the received CAN data, compares the CRC value with the CRC value calculated by the CAN module, and the two CRC values are inconsistent, indicating that the consistency check fails.
[0087] In some embodiments, the second target module is further configured to perform sequence number check on the first data, and perform fault prompt in response to the sequence number check failing.
[0088] The sequence number check refers to a check method for detecting whether the transmitted data is complete, ordered and without garbled code. For example, each data packet carries an increasing sequence number (such as 1, 2, 3, …), and the receiver checks whether the sequence number is continuous. If a skip number (such as 1, 2, 4) is found, it is determined that the data is missing or out of order, and if the sequence number is repeated, it is determined that the data is repeated.
[0089] Exemplarily, the CAN module compares the sequence number check value of the received DDS data this time with the sequence number check value of the last received DDS data, compares whether the received sequence number check value is incremental, and if the sequence number check value is out of order, repeated, or skipped, etc., it indicates that the sequence number check fails.
[0090] In some embodiments, in response to the consistency check failure, the sequence number check failure, and the message transmission timeout, etc., it is determined that the controller fails, and the controller is restarted / initialized.
[0091] Exemplarily, the controller further comprises a processing module, and the second target module increases the failure count by 1 in response to the consistency check failure, the sequence number check failure, or the first data transmission timeout, and the processing module initializes the controller in response to determining that the failure count recorded by the second target module exceeds the failure count threshold.
[0092] For example, as Figure 5 Fig. 1 shows a flowchart of a failure count method, the method comprising:
[0093] S501: receiving target data.
[0094] The target data is DDS data or CAN data.
[0095] S502: determining whether the consistency check passes, and if yes, executing S504, otherwise executing S503.
[0096] S503: discarding the target data, increasing the failure count by 1, and setting the failure bit.
[0097] The set failure bit indicates that a failure occurs in the data transmission process.
[0098] S504: determining whether the sequence number check passes, and if yes, executing S506, otherwise executing S505.
[0099] S505: normally processing and forwarding the target data, increasing the failure count by 1, and setting the failure bit.
[0100] S506: processing and sending the target data.
[0101] Exemplarily, the CAN module and the DDS module perform failure count respectively, and compare with the failure count threshold respectively. For example, the CAN module and the DDS module perform failure count respectively, and the failure count thresholds corresponding to the CAN module and the DDS module are A and B respectively, and if the failure count of the CAN module is greater than A or the failure count of the DDS module is greater than B, and the initialization times are less than the initialization threshold, the initialization is performed.
[0102] For example, the processing module prompts the maintenance controller in response to determining that the failure count recorded by the second target module exceeds the failure times threshold, and the initialization times exceeds the initialization threshold, and prohibits the first target module from transmitting the first data to be transmitted to the second target module, which has a transmission priority lower than a preset priority.
[0103] For example, as shown in Figure 6 A flowchart of a fault processing method is shown, the method comprising:
[0104] S601: Start fault processing.
[0105] For example, the fault processing process is started at the end of a fault processing period. For example, fault processing is performed once every 100 ms.
[0106] S602: Determine whether the initialization times is greater than the initialization threshold. If yes, execute S603, otherwise execute S604.
[0107] S603: Prohibit the first target module from transmitting the first data to be transmitted to the second target module, which has a transmission priority lower than a preset priority.
[0108] S604: In response to determining that the packet is timed out, the failure count is increased by 1, and the failure timeout bit is set.
[0109] The set failure timeout bit indicates that there is a packet timeout failure.
[0110] S605: Determine whether the failure count of the CAN module is greater than the first failure threshold, or the failure count of the DDS module is greater than the second failure threshold, and the initialization times is less than the initialization threshold. If yes, execute S606, otherwise execute S607.
[0111] S606: End.
[0112] S607: Determine whether the vehicle in which the controller is located is running. If yes, execute S603, otherwise execute S608.
[0113] S608: Initialize the CAN module / DDS module, increase the initialization times by 1, and clear the failure count.
[0114] For example, as shown in Figure 7 A data transmission method provided by the embodiment of the application comprises:
[0115] S701: In response to receiving a target packet, parse the first data from the target packet, and send the first data to the first receiving interface through the first sending interface, so that the second target module calls a protocol conversion function to convert the first data into second data.
[0116] The first target module is a CAN module or a DDS module.
[0117] Specifically, when the first target module is a CAN module, the target message, the first data, the first sending interface, and the first receiving interface are a CAN message, CAN data, a CAN sending interface, and a CAN receiving interface respectively, and the second target module and the second data are a DDS module and DDS data respectively. When the first target module is a DDS module, the target message, the first data, the first sending interface, and the first receiving interface are a DDS message, DDS data, a DDS sending interface, and a DDS receiving interface respectively, and the second target module and the second data are a CAN module and CAN data respectively. For example, the CAN module responds to receiving the CAN message, parses the CAN data from the CAN message, and sends the CAN data to the CAN receiving interface through the CAN sending interface, so that the DDS module calls a protocol conversion function to convert the CAN data into DDS data.
[0118] Since the CAN data is usually raw binary signals and the DDS data is usually structured data, when converting between the CAN data and the DDS data, a protocol conversion function is needed to convert the data format, units, bytes, and the like. For example, when the DDS module 200 receives the CAN data, the protocol conversion function is called to map and convert the CAN raw value 5000 in the CAN data to 50.0 km / h, obtaining the DDS data.
[0119] In some embodiments, the first data is sent to the RTE through the first sending interface, so that the RTE forwards the first data to the first receiving interface.
[0120] In some embodiments, a plurality of first sub-sending interfaces in the first sending interface are one-to-one bound to a plurality of first sub-receiving interfaces in the first receiving interface, and the first data of a data type associated with each first sub-sending interface is sent to the first sub-receiving interface bound thereto through the first sub-sending interface, and the plurality of first sub-sending interfaces are associated with different data types.
[0121] For example, based on the type identification of the first data, a target first sub-sending interface is determined, and the first data is sent to the first sub-receiving interface bound to the target first sub-sending interface through the target first sub-sending interface.
[0122] Specifically, the CAN module determines the data type of the CAN data based on the CAN ID, and then determines the target first sub-transmission interface corresponding to the data type, and transmits the CAN data to the first sub-reception interface bound to the target first sub-transmission interface through the target first sub-transmission interface. The DDS module determines the data type of the DDS data based on the topic, and then determines the target first sub-transmission interface corresponding to the data type, and transmits the CAN data to the first sub-reception interface bound to the target first sub-transmission interface through the target first sub-transmission interface. In the data transmission process, the same data type of topic and CAN ID are associated. For example, the data content of the same topic is placed in the same CAN ID frame.
[0123] In some embodiments, the second target module calculates the CRC value of the first data, and performs consistency check on the CRC value and the CRC value of the first data calculated by the first target module, and in response to the consistency check failing, discards the first data and performs fault prompting.
[0124] In some embodiments, the second target module performs sequence number check on the first data, and in response to the sequence number check failing, performs fault prompting.
[0125] In some embodiments, in response to the consistency check failing, the sequence number check failing, or the first data transmission timing out, the fault count is increased by 1. In response to determining that the fault count recorded by the second target module exceeds a fault number threshold, the controller is initialized.
[0126] In some embodiments, in response to determining that the fault count recorded by the second target module exceeds the fault number threshold, and the number of times of initialization exceeds an initialization threshold, the controller is prompted for maintenance; and the first target module is prohibited from transmitting the first data to be transmitted to the second target module, which has a transmission priority lower than a preset priority.
[0127] The above mainly describes the scheme provided by the embodiments of the present application from the perspective of the method. In order to realize the above functions, the data transmission device or the computing device contains the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is realized in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0128] The embodiments of the present application can divide the functional modules of the data transmission device or the computing device according to the data transmission method described above. For example, the data transmission system or the computing device can include various functional modules corresponding to the functional division, or two or more functions can be integrated into one processing module. The integrated module can be realized in the form of hardware or in the form of a software functional module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical functional division. In actual implementation, there can be another division manner.
[0129] As shown in Figure 8 The embodiments of the present application also provide a data transmission system. The data transmission system includes a CAN device, a DDS device and the controller in the above embodiments. The controller integrates a microcontroller unit (MCU). The MCU includes a CAN communication interface and an ETH communication interface. The CAN communication interface is used to transmit CAN messages between the CAN device and the CAN module 100 in the controller. The ETH communication interface is used to transmit DDS messages between the DDS device and the DDS module 200 in the controller. The MCU has sufficient random access memory (RAM) and read-only memory (ROM) space to meet the requirements of integrating the DDS middleware and the AUTOASR CP architecture software, for example, the RAM is greater than 1.5 MB, and the Flash space is greater than 10 MB.
[0130] The power supply method and the power supply system provided by the embodiments of the present application can be applied in a vehicle. The vehicle can also be referred to as a vehicle, a mobile carrier, an electric vehicle (EV), a hybrid electric vehicle (HEV), a plug-in hybrid electric vehicle (PHEV), a fuel cell vehicle (FCV), an autonomous vehicle, an intelligent and connected vehicle (ICV), a driverless vehicle, etc.
[0131] In the embodiments of the present application, the vehicle can be a car, a sport utility vehicle (SUV), a truck, an electric vehicle, a motorcycle, a tricycle, a special vehicle (such as an ambulance, a fire truck, a police car, etc.), an unmanned taxi, an intelligent networked bus, an automatic driving logistics vehicle, an electric truck, etc. In addition, the method is also applicable to various special vehicles, such as agricultural vehicles, mining vehicles, forestry vehicles, airport vehicles, port vehicles, etc. The present application does not make specific limitations thereto.
[0132] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete the full classification part or part of the functions described above.
[0133] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0134] The units described as separate components can or can not be physically separated, and the components shown as units can be one physical unit or multiple physical units, that is, can be located in one place, or can be distributed to multiple different places. According to actual needs, part or all of the units can be selected to achieve the purpose of the present embodiment.
[0135] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit. When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or say the parts that contribute to the prior art or the whole classification or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute the whole classification or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk and various program code storage media.
[0136] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any simple modification (such as adjustment of analysis model, boundary condition, design variable) made to the above specific embodiment according to the technical essence of the present application, equivalent change and replacement (such as adjustment of constraint condition and weight, increase or decrease of evaluation index) without departing from the content of the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A controller, characterized in that: The controller includes a CAN module and a DDS module; the CAN module includes a CAN sending interface and a DDS receiving interface; the DDS module includes a DDS sending interface and a CAN receiving interface; a first target module, configured to, in response to receiving a target message, parse first data from the target message and send the first data to the first receiving interface via a first sending interface, so that the second target module calls a protocol conversion function to convert the first data into second data; Wherein, when the first target module is the CAN module, the target message, the first data, the first sending interface and the first receiving interface are respectively a CAN message, CAN data, the CAN sending interface and the CAN receiving interface; the second target module and the second data are respectively the DDS module and DDS data; When the first target module is the DDS module, the target message, the first data, the first sending interface and the first receiving interface are respectively the DDS message, DDS data, the DDS sending interface and the DDS receiving interface; the second target module and the second data are respectively the CAN module and CAN data.
2. The controller according to claim 1, characterized in that The controller also includes a protocol conversion module; When the first target module is the CAN module, the second target module calls the CAN to DDS protocol conversion function by calling the first calling interface of the protocol conversion module; When the first target module is the DDS module, the second target module calls the DDS to CAN protocol conversion function by calling the second calling interface of the protocol conversion module.
3. The controller according to claim 2, characterized in that For any target calling interface of the first calling interface and the second calling interface, the target calling interface includes a plurality of sub-calling interfaces associated with data types; and the protocol conversion functions called by different sub-calling interfaces are different; The second target module is specifically configured to determine a target sub-calling interface based on a type identifier of the first data; and call a protocol conversion function by calling the target sub-calling interface.
4. The controller according to claim 1, wherein: The controller further includes a runtime environment RTE; and the first target module, specifically configured to: The first data is sent to the RTE through the first sending interface, so that the RTE forwards the first data to the first receiving interface.
5. The controller according to claim 1, wherein: The multiple first sub-sending interfaces in the first sending interface are bound one by one to the multiple first sub-receiving interfaces in the first receiving interface; each of the first sub-sending interfaces is used to send the first data of its associated data type to the first sub-receiving interface bound to itself; the data types associated with the multiple first sub-sending interfaces are different.
6. The controller according to claim 5, characterized in that The first target module is specifically configured to determine a target first sub-sending interface based on a type identifier of the first data; and send the first data to a first sub-receiving interface bound to the target first sub-sending interface through the target first sub-sending interface.
7. The controller according to claim 1, characterized in that The second target module is further configured to calculate a CRC value of the first data, and perform a consistency check between the CRC value and the CRC value of the first data calculated by the first target module; In response to the consistency check failing, the first data is discarded and a fault prompt is issued.
8. The controller according to claim 7, characterized in that The second target module is further configured to perform serial number verification on the first data; In response to the serial number verification failing, a fault prompt is issued.
9. The controller according to claim 8, characterized in that The controller further includes a processing module; The second target module is further configured to increase a fault count by 1 in response to a failure in the consistency check, a failure in the sequence number check, or a timeout in the first data transmission; The processing module is configured to initialize the controller in response to determining that the fault count recorded by the second target module exceeds a fault count threshold.
10. The controller according to claim 9, characterized in that The processing module is further configured to prompt maintenance of the controller in response to determining that the fault count recorded by the second target module exceeds the fault number threshold and the number of initializations exceeds the initialization threshold; and The first target module is prohibited from transmitting the to-be-transmitted first data having a transmission priority lower than a preset priority to the second target module.
11. A data transmission method, characterized in that: The data transmission method is applied to a controller, the controller including a CAN module and a DDS module; the CAN module including a CAN transmission interface and a DDS reception interface; the DDS module including a DDS transmission interface and a CAN reception interface; the data transmission method includes: In response to receiving the target message, parsing first data from the target message, and sending the first data to the first receiving interface through the first sending interface, so that the second target module calls the protocol conversion function to convert the first data into second data; Wherein, the target message, the first data, the first sending interface and the first receiving interface are respectively a CAN message, CAN data, the CAN sending interface and the CAN receiving interface; the second target module and the second data are respectively the DDS module and DDS data; or, The target message, the first data, the first sending interface and the first receiving interface are respectively a DDS message, DDS data, the DDS sending interface and the DDS receiving interface; the second target module and the second data are respectively the CAN module and CAN data.
12. A data transmission system, characterized in that: comprising a CAN device, a DDS device and a controller according to any one of claims 1 to 10, wherein the controller further comprises a CAN communication interface and an ETH communication interface; The CAN communication interface is used to transmit CAN messages between the CAN device and the CAN module in the controller; The ETH communication interface is used to transmit DDS messages between the DDS device and the DDS module in the controller.
13. A vehicle, characterized in that: The vehicle comprises the data transmission system of claim 12 .
Citation Information
Cited By
Generation method of application layer communication component in vehicle-mounted electronic control unit (ECU)
CN121255150A