CANFD bus delay rate calculation method, device, electronic device and storage medium

By calculating the message type, DLC and transmission cycle of CANFD messages, and determining the bitstream length after filling, the problem of inapplicability of the CAN bus delay rate method is solved, the accuracy of the CANFD bus delay rate is achieved, and the risk of vehicle network design is reduced.

CN116319457BActive Publication Date: 2025-09-02CHERY AUTOMOBILE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310245910.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2025-09-02
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

In the prior art, the method of determining the CAN bus delay rate is not applicable to the determination of the CANFD bus delay rate, resulting in unreasonable vehicle network topology design and increasing the time and cost risks in the later stage of project development.

Method used

Through the CANFD communication matrix file based on the target network segment, the message type, data length code DLC and message sending cycle of the CANFD message are determined, the bit stream length after filling is calculated, and the message sending cycle is combined with the CANFD message bus delay rate is calculated.

Benefits of technology

The accuracy determination of the CANFD bus delay rate is achieved, reducing the time and cost risk of vehicle network design in the later stage of project development, and is suitable for any vehicle model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319457B_ABST
    Figure CN116319457B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, electronic device, and storage medium for calculating the CANFD bus delay rate. The method includes: determining, based on a variable rate controller area network (CANFD) communication matrix file corresponding to a target network segment, at least one CANFD message contained in the target network segment and the message type, data length code (DLC), and message transmission period corresponding to each CANFD message; determining the padded bit stream length corresponding to each CANFD message; determining the CANFD message bus delay coefficient corresponding to the target network segment based on the padded bit stream length corresponding to each CANFD message and the message transmission period corresponding to each CANFD message; and determining the bus delay rate of the CANFD message corresponding to the target network segment. This solves the problem of being unable to determine the CANFD bus delay rate and effectively ensures the accuracy of the CANFD bus delay rate determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a method, device, electronic device, and storage medium for calculating a CANFD bus delay rate. Background Art

[0002] With the increasing number of electronic devices used in vehicles, user requirements for vehicle network data transmission rates and bandwidth have increased exponentially. The existing Controller Area Network (CAN) is increasingly unable to meet user needs in terms of transmission rate and bandwidth. The CANFD network uses a variable rate. When transmitting a data segment, the communication rate switches to a higher rate, up to 10Mbit / s. After the data segment is transmitted, the communication rate switches back to standard mode. In addition, CANFD expands the data field length to a maximum of 64 bytes. The CANFD network inherits the main characteristics of the traditional CAN network while also addressing its shortcomings in data transmission rate, bandwidth, and data field length. As a result, the CANFD network has been widely used.

[0003] However, both CAN and CANFD networks require an effective determination of their bus latency rate as a key constraint in vehicle network topology design. Vehicle network topology design is the foundation for all subsequent vehicle network designs. Inaccurate determination of the CAN / CANFD bus latency rate, as a key constraint in vehicle network topology design, will lead to an irrational vehicle network topology design, significantly increasing the time and cost risks associated with changes to the vehicle network design later in project development.

[0004] For vehicles that use the CAN FD network as a network communication solution, it is crucial to ensure the accuracy of the CAN FD bus delay rate. However, compared with the CAN network, the determination of the bus delay rate of the CAN FD network is more complicated. The determination method of the CAN bus delay rate in the relevant technology is not applicable to the determination of the CAN FD bus delay rate. Summary of the Invention

[0005] The present application provides a method, device, electronic device, and storage medium for calculating the CAN FD bus delay rate to address the problem in related arts that methods for determining the CAN bus delay rate are not suitable for determining the CAN FD bus delay rate. The method can effectively ensure the accuracy of determining the CAN FD bus delay rate, thereby greatly reducing the time and cost risks associated with changing the vehicle network design in the later stages of project development. The method is applicable to determining the CAN FD bus delay rate of any vehicle model and has strong versatility.

[0006] A first aspect embodiment of the present application provides a method for calculating a CANFD bus delay rate, comprising the following steps: based on a variable rate controller local area network CANFD communication matrix file corresponding to a target network segment, determining at least one CANFD message contained in the target network segment and the message type, data length code DLC and message sending period corresponding to each CANFD message; based on the message type and DLC corresponding to each CANFD message, determining the padded bit stream length corresponding to each CANFD message; and based on the padded bit stream length corresponding to each CANFD message and the message sending period corresponding to each CANFD message, determining a CANFD message bus delay coefficient corresponding to the target network segment, and based on the CANFD message bus delay coefficient corresponding to the target network segment, determining the bus delay rate of the CANFD message corresponding to the target network segment.

[0007] Optionally, in some embodiments, determining the CAN FD message bus delay coefficient corresponding to the target network segment based on the padded bit stream length corresponding to each CAN FD message and the message sending period corresponding to each CAN FD message includes:

[0008] DelayCoef_Arbitrate=Frame_Arbitrate / BaudRate_Arbitrate;

[0009] DelayCoef_Payload=Frame_Payload / BaudRate_Payload;

[0010] DelayCoef=DelayCoef_Arbitrate+DelayCoef_Payload;

[0011] Among them, DelayCoef_Arbitrate is the bus delay rate of the arbitration segment of the CANFD message, Frame_Arbitrate is the bit stream length after the arbitration segment is padded, BaudRate_Arbitrate is the communication rate of the arbitration segment, DelayCoef_Payload is the bus delay rate of the data segment of the CANFD message, Frame_Payload is the bit stream length after the data segment is padded, BaudRate_Payload is the communication rate of the data segment, and DelayCoef is the full-frame message delay coefficient.

[0012] Optionally, in some embodiments, determining the bus delay rate of the CAN FD message corresponding to the target network segment based on the CAN FD message bus delay coefficient corresponding to the target network segment includes:

[0013] Delay=Time–DelayCoef;

[0014] Among them, Delay is the bus delay rate of the CANFD message corresponding to the target network segment, Time is the message sending period, and DelayCoef is the full-frame message delay coefficient.

[0015] Optionally, in some embodiments, determining the padded bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message includes: determining the pre-padded bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message, wherein the pre-padded bit stream length includes the bit-padded bit stream length and the full-frame bit stream length; obtaining the sample filling rate mean corresponding to the message type corresponding to each CAN FD message, and determining the padded bit stream length corresponding to each CAN FD message in combination with the padded bit stream length and the full-frame bit stream length corresponding to each CAN FD message.

[0016] A second aspect embodiment of the present application provides a CANFD bus delay rate calculation device, including: a first determination module, used to determine at least one CANFD message contained in the target network segment and the message type, data length code DLC and message sending period corresponding to each CANFD message based on the variable rate controller local area network CANFD communication matrix file corresponding to the target network segment; a second determination module, used to determine the padded bit stream length corresponding to each CANFD message based on the message type and DLC corresponding to each CANFD message; and a third determination module, used to determine the CANFD message bus delay coefficient corresponding to the target network segment based on the padded bit stream length corresponding to each CANFD message and the message sending period corresponding to each CANFD message, and determine the bus delay rate of the CANFD message corresponding to the target network segment based on the CANFD message bus delay coefficient corresponding to the target network segment.

[0017] Optionally, in some embodiments, the third determining module includes:

[0018] DelayCoef_Arbitrate=Frame_Arbitrate / BaudRate_Arbitrate;

[0019] DelayCoef_Payload=Frame_Payload / BaudRate_Payload;

[0020] DelayCoef=DelayCoef_Arbitrate+DelayCoef_Payload;

[0021] Among them, DelayCoef_Arbitrate is the bus delay rate of the arbitration segment of the CANFD message, Frame_Arbitrate is the bit stream length after the arbitration segment is padded, BaudRate_Arbitrate is the communication rate of the arbitration segment, DelayCoef_Payload is the bus delay rate of the data segment of the CANFD message, Frame_Payload is the bit stream length after the data segment is padded, BaudRate_Payload is the communication rate of the data segment, and DelayCoef is the full-frame message delay coefficient.

[0022] Optionally, in some embodiments, the third determining module includes:

[0023] Delay=Time–DelayCoef;

[0024] Among them, Delay is the bus delay rate of the CANFD message corresponding to the target network segment, Time is the message sending period, and DelayCoef is the full-frame message delay coefficient.

[0025] Optionally, in some embodiments, the first determination module includes: determining the pre-filling bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message, wherein the pre-filling bit stream length includes the bit-filling bit stream length and the full-frame bit stream length; obtaining the sample filling rate mean corresponding to the message type corresponding to each CAN FD message, and determining the post-filling bit stream length corresponding to each CAN FD message in combination with the filling bit stream length and the full-frame bit stream length corresponding to each CAN FD message.

[0026] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the method for calculating the CANFD bus delay rate as described in the above embodiment.

[0027] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the method for calculating the CANFD bus delay rate as described in the above embodiment.

[0028] Therefore, by determining the CAN FD messages contained in the target network segment and the corresponding message type, data length code DLC and message sending period, and determining the padded bit stream length corresponding to each CAN FD message according to the message type and DLC corresponding to each CAN FD message, and then combining the message sending period corresponding to each CAN FD message, the CAN FD bus delay rate corresponding to the target network segment is determined. This solves the problem that the method for determining the CAN bus delay rate in the relevant technology is not suitable for determining the CAN FD bus delay rate, and can effectively ensure the accuracy of the determination of the CAN FD bus delay rate, thereby greatly reducing the time and cost risks brought about by the need to change the vehicle network design in the later stage of project development. In addition, this method is applicable to the determination of the CAN FD bus delay rate of any vehicle model and has strong versatility.

[0029] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0031] Figure 1 Flowchart of a method for calculating a CAN FD bus delay rate according to an embodiment of the present application;

[0032] Figure 2 Schematic diagram of a block diagram of a device for calculating a CAN FD bus delay rate according to an embodiment of the present application;

[0033] Figure 3 A schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0035] The following describes a method, device, electronic device, and storage medium for calculating a CAN FD bus delay rate according to an embodiment of the present application with reference to the accompanying drawings. In response to the problem that the related art methods for determining CAN bus delay rates mentioned in the background art are not applicable to determining CAN FD bus delay rates, the present application provides a method for calculating a CAN FD bus delay rate. In this method, the CAN FD messages contained in a target network segment and their corresponding message types, data length codes (DLCs), and message transmission periods are determined, and the padded bit stream length corresponding to each CAN FD message is determined based on the message type and DLC corresponding to each CAN FD message. Subsequently, the CAN FD bus delay rate corresponding to the target network segment is determined based on the message transmission period corresponding to each CAN FD message. This solves the problem that the related art methods for determining CAN bus delay rates are not applicable to determining CAN FD bus delay rates, effectively ensures the accuracy of CAN FD bus delay rate determination, and thus significantly reduces the time and cost risks associated with changing the vehicle network design in the later stages of project development. Furthermore, this method is applicable to determining the CAN FD bus delay rate of any vehicle model and has strong versatility.

[0036] Specifically, Figure 1 A flowchart of a method for calculating the CAN FD bus delay rate provided in an embodiment of the present application.

[0037] like Figure 1 As shown, the calculation method of the CANFD bus delay rate includes the following steps:

[0038] In step S101, based on the variable rate controller area network CANFD communication matrix file corresponding to the target network segment, at least one CANFD message contained in the target network segment and the message type, data length code DLC and message sending period corresponding to each CANFD message are determined.

[0039] The target network segment refers to a network physically separated by a network connection device. For example, two local area networks connected by a routing device (or switch, or even a hub) can be called two network segments. It can also refer to a network segment logically distinguished by the network address in the Internet Protocol (IP) address. For a vehicle's CAN network or CANFD network, the number of network segments corresponding to different vehicle models can vary, generally ranging from 1 to 10, depending on the number of Electronic Control Units (ECUs) in the vehicle model and the network communication volume between each ECU. The target network segment can be understood as any network segment in the CANFD network corresponding to any vehicle model.

[0040] The CANFD communication matrix file can be understood as the CANFD communication message design file corresponding to the target network segment. The message transmission cycle refers to the transmission cycle corresponding to each CANFD message in the target network segment.

[0041] The message types corresponding to CANFD messages can include two types: classic standard frames and CANFD standard frames; both types of CANFD message data frames contain 7 predefined bit fields, namely, start of frame (SOF), arbitration field, control field, data field, cyclic redundancy check field (CRC), acknowledgement field (ACK) and end of frame (EOF).

[0042] The Data Length Code (DLC) specifies the number of bytes in the data field, thereby determining the data field length. The data field of a CAN FD message consists of the data to be sent. Its length is determined by the DLC in the control field and ranges from 0 to 64 bytes, with each byte containing 8 bits.

[0043] It can be understood that the communication messages of the CAN FD network are defined in the CAN FD communication matrix file corresponding to the corresponding network segment. By obtaining the CAN FD communication matrix file corresponding to the target network segment, the CAN FD messages contained in the target network segment and the corresponding message type, data length code DLC, message sending cycle and other message information can be read from it.

[0044] In step S102, based on the message type and DLC corresponding to each CAN FD message, the padded bit stream length corresponding to each CAN FD message is determined.

[0045] The bit stream length after padding can be understood as the actual bit stream length of the CAN FD message after the bit stream that needs to be encoded by the bit padding method in the CAN FD message is bit-stuffed according to the bit padding rule.

[0046] Optionally, in some embodiments, based on the message type and DLC corresponding to each CAN FD message, the padded bit stream length corresponding to each CAN FD message is determined, including: determining the pre-padded bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message, wherein the pre-padded bit stream length includes the bit-padded bit stream length and the full-frame bit stream length; obtaining the sample filling rate mean corresponding to the message type corresponding to each CAN FD message, and determining the padded bit stream length corresponding to each CAN FD message in combination with the padded bit stream length and the full-frame bit stream length corresponding to each CAN FD message.

[0047] In step S103, the CAN FD message bus delay coefficient corresponding to the target network segment is determined based on the padded bit stream length corresponding to each CAN FD message and the message sending period corresponding to each CAN FD message, and the bus delay rate of the CAN FD message corresponding to the target network segment is determined based on the CAN FD message bus delay coefficient corresponding to the target network segment.

[0048] Optionally, in some embodiments, determining a CAN FD message bus delay coefficient corresponding to the target network segment based on a padded bit stream length corresponding to each CAN FD message and a message sending period corresponding to each CAN FD message includes:

[0049] DelayCoef_Arbitrate=Frame_Arbitrate / BaudRate_Arbitrate;

[0050] DelayCoef_Payload=Frame_Payload / BaudRate_Payload;

[0051] DelayCoef=DelayCoef_Arbitrate+DelayCoef_Payload;

[0052] Among them, DelayCoef_Arbitrate is the bus delay rate of the arbitration segment of the CANFD message, Frame_Arbitrate is the bit stream length after the arbitration segment is padded, BaudRate_Arbitrate is the communication rate of the arbitration segment, DelayCoef_Payload is the bus delay rate of the data segment of the CANFD message, Frame_Payload is the bit stream length after the data segment is padded, BaudRate_Payload is the communication rate of the data segment, and DelayCoef is the full-frame message delay coefficient.

[0053] Optionally, in some embodiments, determining the bus delay rate of the CAN FD message corresponding to the target network segment based on the CAN FD message bus delay coefficient corresponding to the target network segment includes:

[0054] Delay=Time–DelayCoef;

[0055] Among them, Delay is the bus delay rate of the CANFD message corresponding to the target network segment, Time is the message sending period, and DelayCoef is the full-frame message delay coefficient.

[0056] According to the calculation method of the CAN FD bus delay rate proposed in the embodiment of the present application, by determining the CAN FD messages contained in the target network segment and the corresponding message type, data length code DLC and message sending period, and determining the padded bit stream length corresponding to each CAN FD message according to the message type and DLC corresponding to each CAN FD message, and then combining the message sending period corresponding to each CAN FD message, the CAN FD bus delay rate corresponding to the target network segment is determined. This solves the problem that the method for determining the CAN bus delay rate in the related art is not suitable for determining the CAN FD bus delay rate, and can effectively ensure the accuracy of the determination of the CAN FD bus delay rate, thereby greatly reducing the time and cost risks brought about by the need to change the vehicle network design in the later stage of project development. In addition, this method is applicable to the determination of the CAN FD bus delay rate of any vehicle model and has strong versatility.

[0057] Next, a device for calculating the CAN FD bus delay rate according to an embodiment of the present application is described with reference to the accompanying drawings.

[0058] Figure 2 4 is a block diagram of a device for calculating a CAN FD bus delay rate according to an embodiment of the present application.

[0059] like Figure 2 As shown, the CAN FD bus delay rate calculation device 10 includes: a first determination module 100 , a second determination module 200 and a third determination module 300 .

[0060] Among them, the first determination module 100 is used to determine at least one CAN FD message contained in the target network segment and the message type, data length code DLC and message sending period corresponding to each CAN FD message based on the variable rate controller local area network CAN FD communication matrix file corresponding to the target network segment; the second determination module 200 is used to determine the padded bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message; and the third determination module 300 is used to determine the CAN FD message bus delay coefficient corresponding to the target network segment based on the padded bit stream length corresponding to each CAN FD message and the message sending period corresponding to each CAN FD message, and determine the bus delay rate of the CAN FD message corresponding to the target network segment based on the CAN FD message bus delay coefficient corresponding to the target network segment.

[0061] Optionally, in some embodiments, the third determining module 300 includes:

[0062] DelayCoef_Arbitrate=Frame_Arbitrate / BaudRate_Arbitrate;

[0063] DelayCoef_Payload=Frame_Payload / BaudRate_Payload;

[0064] DelayCoef=DelayCoef_Arbitrate+DelayCoef_Payload;

[0065] Among them, DelayCoef_Arbitrate is the bus delay rate of the arbitration segment of the CANFD message, Frame_Arbitrate is the bit stream length after the arbitration segment is padded, BaudRate_Arbitrate is the communication rate of the arbitration segment, DelayCoef_Payload is the bus delay rate of the data segment of the CANFD message, Frame_Payload is the bit stream length after the data segment is padded, BaudRate_Payload is the communication rate of the data segment, and DelayCoef is the full-frame message delay coefficient.

[0066] Optionally, in some embodiments, the third determining module 300 includes:

[0067] Delay=Time–DelayCoef;

[0068] Among them, Delay is the bus delay rate of the CANFD message corresponding to the target network segment, Time is the message sending period, and DelayCoef is the full-frame message delay coefficient.

[0069] Optionally, in some embodiments, the second determination module 200 includes: determining the pre-filling bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message, wherein the pre-filling bit stream length includes the bit-filling bit stream length and the full-frame bit stream length; obtaining the sample filling rate mean corresponding to the message type corresponding to each CAN FD message, and determining the post-filling bit stream length corresponding to each CAN FD message in combination with the filling bit stream length and the full-frame bit stream length corresponding to each CAN FD message.

[0070] It should be noted that the above explanation of the embodiment of the method for calculating the CAN FD bus delay rate is also applicable to the device for calculating the CAN FD bus delay rate of this embodiment, and will not be repeated here.

[0071] According to the CAN FD bus delay rate calculation device proposed in the embodiment of the present application, by determining the CAN FD messages contained in the target network segment and the corresponding message type, data length code DLC and message sending period, and determining the padded bit stream length corresponding to each CAN FD message according to the message type and DLC corresponding to each CAN FD message, and then combining the message sending period corresponding to each CAN FD message, the CAN FD bus delay rate corresponding to the target network segment is determined. This solves the problem that the method for determining the CAN bus delay rate in the related art is not suitable for determining the CAN FD bus delay rate, and can effectively ensure the accuracy of the CAN FD bus delay rate determination, thereby greatly reducing the time and cost risks brought about by the need to change the vehicle network design in the later stage of project development. In addition, this method is applicable to the determination of the CAN FD bus delay rate of any vehicle model and has strong versatility.

[0072] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0073] Memory 301 , processor 302 , and computer programs stored in the memory 301 and executable on the processor 302 .

[0074] When the processor 302 executes the program, the calculation method of the CAN FD bus delay rate provided in the above embodiment is implemented.

[0075] Furthermore, the electronic device further includes:

[0076] The communication interface 303 is used for communication between the memory 301 and the processor 302 .

[0077] The memory 301 is used to store computer programs that can be run on the processor 302 .

[0078] The memory 301 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0079] If the memory 301, processor 302, and communication interface 303 are implemented independently, the communication interface 303, memory 301, and processor 302 can be connected to each other via a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0080] Optionally, in a specific implementation, if the memory 301, the processor 302 and the communication interface 303 are integrated on a chip, the memory 301, the processor 302 and the communication interface 303 can communicate with each other through an internal interface.

[0081] The processor 302 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0082] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for calculating the CAN FD bus delay rate.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0084] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0085] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0086] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0087] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0088] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for calculating the delay rate of a CANFD bus, characterized in that: The following steps are involved: Determine, based on a variable rate controller area network (CANFD) communication matrix file corresponding to a target network segment, at least one CANFD message included in the target network segment and a message type, a data length code (DLC), and a message sending period corresponding to each CANFD message; Determine the padded bit stream length corresponding to each CAN FD message based on the message type and DLC corresponding to each CAN FD message; as well as Determining a CAN FD message bus delay coefficient corresponding to the target network segment based on a padded bit stream length corresponding to each CAN FD message and a message sending period corresponding to each CAN FD message, and determining a bus delay rate of the CAN FD message corresponding to the target network segment based on the CAN FD message bus delay coefficient corresponding to the target network segment; The determining the CAN FD message bus delay coefficient corresponding to the target network segment based on the padded bit stream length corresponding to each CAN FD message and the message sending period corresponding to each CAN FD message includes: DelayCoef_Arbitrate=Frame_Arbitrate / BaudRate_Arbitrate; DelayCoef_Payload=Frame_Payload / BaudRate_Payload; DelayCoef=DelayCoef_Arbitrate+DelayCoef_Payload; Among them, DelayCoef_Arbitrate is the bus delay rate of the arbitration segment of the CANFD message, Frame_Arbitrate is the bit stream length after the arbitration segment is filled, BaudRate_Arbitrate is the communication rate of the arbitration segment, DelayCoef_Payload is the bus delay rate of the data segment of the CANFD message, Frame_Payload is the bit stream length after the data segment is filled, BaudRate_Payload is the communication rate of the data segment, and DelayCoef is the full-frame message delay coefficient; The determining, based on the CAN FD message bus delay coefficient corresponding to the target network segment, the bus delay rate of the CAN FD message corresponding to the target network segment includes: Delay=Time–DelayCoef; Among them, Delay is the bus delay rate of the CANFD message corresponding to the target network segment, Time is the message sending period, and DelayCoef is the full-frame message delay coefficient.

2. The method according to claim 1, characterized in that The determining, based on the message type and DLC corresponding to each CAN FD message, the padded bit stream length corresponding to each CAN FD message includes: Determine a pre-filling bit stream length corresponding to each CAN FD message based on a message type and a DLC corresponding to each CAN FD message, wherein the pre-filling bit stream length includes a bit-filling bit stream length and a full-frame bit stream length; Obtain a sample filling rate mean corresponding to the message type corresponding to each CAN FD message, and determine the padded bit stream length corresponding to each CAN FD message in combination with the padded bit stream length and the full-frame bit stream length corresponding to each CAN FD message.

3. A device for calculating a CANFD bus delay rate, characterized in that: include: A first determination module is configured to determine, based on a variable rate controller area network (CANFD) communication matrix file corresponding to a target network segment, at least one CANFD message included in the target network segment and a message type, a data length code (DLC), and a message sending period corresponding to each CANFD message; A second determining module is configured to determine a padded bit stream length corresponding to each CAN FD message based on a message type and a DLC corresponding to each CAN FD message; as well as a third determining module, configured to determine a CAN FD message bus delay coefficient corresponding to the target network segment based on the padded bit stream length corresponding to each CAN FD message and the message sending period corresponding to each CAN FD message, and determine a bus delay rate of the CAN FD message corresponding to the target network segment based on the CAN FD message bus delay coefficient corresponding to the target network segment; The third determining module includes: DelayCoef_Arbitrate=Frame_Arbitrate / BaudRate_Arbitrate; DelayCoef_Payload=Frame_Payload / BaudRate_Payload; DelayCoef=DelayCoef_Arbitrate+DelayCoef_Payload; Among them, DelayCoef_Arbitrate is the bus delay rate of the arbitration segment of the CANFD message, Frame_Arbitrate is the bit stream length after the arbitration segment is filled, BaudRate_Arbitrate is the communication rate of the arbitration segment, DelayCoef_Payload is the bus delay rate of the data segment of the CANFD message, Frame_Payload is the bit stream length after the data segment is filled, BaudRate_Payload is the communication rate of the data segment, and DelayCoef is the full-frame message delay coefficient; The third determining module includes: Delay=Time–DelayCoef; Among them, Delay is the bus delay rate of the CANFD message corresponding to the target network segment, Time is the message sending period, and DelayCoef is the full-frame message delay coefficient.

4. The device according to claim 3, characterized in that The first determination module includes: Determine a pre-filling bit stream length corresponding to each CAN FD message based on a message type and a DLC corresponding to each CAN FD message, wherein the pre-filling bit stream length includes a bit-filling bit stream length and a full-frame bit stream length; Obtain a sample filling rate mean corresponding to the message type corresponding to each CAN FD message, and determine the padded bit stream length corresponding to each CAN FD message in combination with the padded bit stream length and the full-frame bit stream length corresponding to each CAN FD message.

5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for calculating the CAN FD bus delay rate according to any one of claims 1 to 2.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method for calculating the CAN FD bus delay rate as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Baud rate adaptive method and device, computer equipment and readable storage medium

    CN112751738A