Message transmission time estimation method for automotive CANFD network

By constructing a two-layer CANFD network model and calculating the message transmission weight ratio and time, the design defects of ECU communication in the CANFD network are solved, the real-time performance and stability of the network are improved, and the communication needs of intelligent connected vehicles are met.

CN116055248BActive Publication Date: 2024-11-22CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310073116.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-17
Publication Date
2024-11-22
Estimated Expiration
2043-01-17

AI Technical Summary

Technical Problem

Existing technologies in the CANFD network ECU communication design of intelligent connected vehicles fail to effectively consider the mutual influence between ECUs, making it difficult to detect potential design defects in the network communication matrix during the design simulation stage, thus affecting the real-time performance and stability of the network.

Method used

Construct a message transmission model for a two-layer CANFD network, calculate the weight ratio of each transmission logic in the message, estimate the transmission time, and optimize network utilization.

Benefits of technology

By estimating message transmission time, network utilization is improved, ensuring the real-time performance and stability of ECU communication, and meeting the requirements of automotive network control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116055248B_ABST
    Figure CN116055248B_ABST
Patent Text Reader

Abstract

The present invention relates to a message transmission time estimation method for a CANFD network of an automobile, which belongs to the field of automobile control networks and comprises the following steps: S1: according to the network topology structure and node transmission characteristics, network transmission messages, and signal quantities, the network characteristics are analyzed, a double-layer CANFD network message transmission model is constructed, and the weight ratio of each message transmission logic is calculated; S2: a binary sequence model is constructed, the distribution mean of the number of filled bits of the message is calculated, a single message transmission time is obtained, and the network message transmission time is estimated according to the single message transmission time and the weight ratio of each message transmission logic. The present invention realizes the estimation of the message transmission time, calculates the worst response time, and improves the network utilization rate by optimizing the weight ratio of each message transmission logic and calculating the mean value of the message transmission time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of automobile control networks and relates to a message transmission time estimation method for an automobile CANFD network. Background Art

[0002] CAN bus is the most commonly used communication method in vehicle buses. Although the CANFD network was developed earlier, it has only been used in intelligent connected cars recently due to hardware costs and architecture updates. Its goal is to expand the functions of in-vehicle network devices and increase the bandwidth and transmission speed of the network under the new functions of connected cars. With the increase of new functions of intelligent connected cars, the real-time and stability requirements for communication between ECUs are more stringent. When adding new functions, automotive parts suppliers and vehicle manufacturers often use reverse development and design to save costs. After adding new messages to the old network, they verify the communication performance of the network.

[0003] The ECU communication under the new functions of connected cars has higher and higher requirements for real-time and stability. The above methods do not consider the mutual influence between ECU communications from a system perspective, which makes it difficult to find potential design defects in the network communication matrix in the design simulation stage. When all changes are loaded into the vehicle network, new communication protocols need to be released in the development stage, which has a direct or indirect impact on the real-time performance of the system in the process. This potential design defect may reduce the real-time performance of the network, fail to meet the control requirements of the vehicle network, and make a certain function impossible to achieve or fail, thereby affecting the stability of the network. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a message transmission time estimation method for an automotive CANFD network, construct a message transmission model of a double-layer CANFD network, calculate the weight ratio of each transmission logic of the message, estimate the transmission time of the message in the transmission model, and improve the utilization rate of the network.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A method for estimating message transmission time for an automotive CANFD network comprises the following steps:

[0007] S1: Analyze network characteristics according to network topology, node transmission characteristics, network transmission messages, and signal quantities, build a two-layer CANFD network message transmission model, and calculate the weight ratio of each message transmission logic;

[0008] S2: Build a binary sequence model, calculate the mean value of the distribution of the number of padding bits in the message, obtain the transmission time of a single message, and estimate the network message transmission time based on the weight ratio of the single message transmission time and each message transmission logic.

[0009] Furthermore, according to the network topology, the network layer transmission logic is divided into E i Type, i ranges from 1 to 5, E1 is internal transmission within the network segment, E2 is single-layer network to single-layer network transmission, E3 is single-layer network to double-layer network transmission, E4 is double-layer network to single-layer network transmission, and E5 is double-layer network to double-layer network transmission;

[0010] According to the node transmission characteristics, the network layer transmission logic is divided into F j Type, j is 1~4, F1 is single-node to single-node transmission, F2 is single-node to multi-node transmission, F3 is multi-node to single-node transmission, and F4 is multi-node to multi-node transmission.

[0011] Further, E. i The weight ratio of the transmission logic is determined by the hierarchical analysis method, according to F j Class message importance level, build judgment matrix A, calculate F j The weight ratio of class messages in the network; according to E i F j The importance level of the class message, construct the judgment matrix B j , for F1, F2, F3, F4, construct judgment matrices B1, B2, B3, B4 in turn, and calculate E i This message is relative to F j The weight ratio of the class message is obtained by approximating the eigenvector of the judgment matrix. i The weight ratio of the transmission logic.

[0012] Further, step S1 specifically includes the following steps:

[0013] S11: Build F j Relationship judgment matrix of transmission messages of different types: compare the transmission types in pairs to obtain the importance scale a of each transmission type αβ , α, β = 1, 2, 3, 4, construct the judgment matrix A:

[0014]

[0015] The first column vector represents the importance scale of F1, F2, F3, F4 messages compared with F1; the second column vector represents the importance scale of F1, F2, F3, F4 messages compared with F2; the third column vector represents the importance scale of F1, F2, F3, F4 messages compared with F3; the fourth column vector represents the importance scale of F1, F2, F3, F4 messages compared with F4;

[0016] S12: Find F j The weight ratio of the class transmission message in the network: normalize each column vector of the judgment matrix A. Get the element a' αβ Normalized matrix A', sum A' row by row: So W=[W1 W2 W3 W4] T , where W1 represents the sum of the importance of F1, F2, F3, and F4 transmission modes compared to F1, and the vector W is normalized Get the eigenvector approximate solution W A =[W1 A W2 A W3 A W4 A ] T , that is, to find F j Weight ratio of class messages in the network, W1 A , W2 A , W3 A , W4 A Respectively represent the weight ratios of F1, F2, F3, and F4 message transmission modes;

[0017] S13: Build a pair of F j For class messages, E i The relation judgment matrix B of the transmission message j ; The judgment matrix B1 is for the F1 type transmission message, E i The importance of the two transmission logics is compared, including the judgment scale b xy , x,y=1,2,3,4,5, the importance increases from 1 to 5, and the value is selected according to the network characteristics; similarly, the judgment matrices B2, B3, and B4 are constructed for F2, F3, and F4 messages respectively;

[0018] S14: Seeking E i The transmission message is relative to F j The weight ratio of the class, solving the matrix B j The eigenvector approximation solution of in Respectively for F j For example, the weight ratio of E1 to E5 transmission messages;

[0019] S15: According to F j The weight ratio of the class transmission message in the network is W A , E i The transmission message is relative to F j Class weight ratio Find E i The weight ratio of the message transmission logic, where Respectively represent the weight ratios of E1, E2, E3, E4, and E5 message transmission logics:

[0020]

[0021] Further, when the sending node detects 5 bit streams of the same polarity in the sent bit stream, it inserts a bit of opposite polarity as padding; the mean value of the distribution of the number of padding bits refers to the data field byte length L g The distribution mean of the number of message padding when the value is different In the CANFD network standard frame, the bits involved in filling include the frame start, arbitration field, control field, data field, and CRC field, and the length is (43+8L g ) / (47+8L g ) bit; number of message bits After adding the padding bits, the total number of bits in the message

[0022] Further, the estimating network message transmission time in step S2 specifically includes the following steps:

[0023] S21: Construct a binary sequence model as G(S f ,d), consisting of M d-bit binary sequences S f (f∈[1,M]), where M is a random number greater than 10000; the binary sequence consists of a series of data messages, including the message frame start, arbitration field, control field, data field, CRC field, response field, and frame end;

[0024] S22: Determine the value of the binary sequence model data message, wherein the frame start bit, remote transmission request bit, identifier extension bit, CANFD format flag, reserved bit, bit rate switch, and error status flag are all dominant and take the value 0;

[0025] S23: Generate a binary sequence;

[0026] S24: Count the probability λ of the number of padding bits N N ,λ N It obeys normal distribution; there are two cases. In the first case, there are 43+8Lg bits involved in filling. The byte length of the data field is L g In the middle, g is 0 to 64, indicating that the data field length of the message is 0 to 64 bytes; in the second case, when the transmission bytes exceed 16 bytes, the CRC is 21 bits, and a total of 47+8L are involved in the filling. g bits, number of padding bits In summary Count the byte length of the data field L respectively g When the number of bytes is between 0 and 64, the probability of the number of bits filled in the message is λ N ;

[0027] S25: Calculate the mean of the number of fill bits distribution According to the probability distribution of the number of filled digits, the mean number of filled digits is obtained Number of bits per binary sequence data message After adding the average number of padding bits, the total number of bits in the message is CANFD uses two bit rates: the variable rate from the BRS bit in the control field to the ACK field, and the rest of the message is the rate used by the original CAN bus, using τ c To represent the variable rate, τ f To represent a fixed rate, the mean message transmission time is where d' c The number of bits representing the variable rate, d' f Indicates the number of bits of fixed rate messages, and d'=d' c +d' f ;

[0028] S26: Calculate E i The weight ratio of the message transmission logic; using the hierarchical analysis method, select E i The optimal weight ratio of the transmission logic;

[0029] S27: estimating the transmission time of the network control process message;

[0030] S28: The padding bit increases the maximum transmission time of the CANFD message. Assuming that the total number of bits of the worst message transmission in the message frame m is C m ,but The 16 bytes of the data field are calculated in segments. By default, the number of bytes of the CANFD data field is greater than 16, that is, L g ≥16, then the CRC field is 26 bits; after knowing the worst total number of bits of the CANFD message, the worst transmission time of the message is calculated according to the two variable rates defined by S25, that is, in The function returns the largest integer less than or equal to a / b, and finally T = (39 + 10L g )τ c +(31)τ f ; Calculate the worst response time R based on the worst transmission time T i .

[0031] Further, in step S29, the worst response time R is calculated according to the worst transmission time T. i , including the following steps:

[0032] S291: First, a single message frame m for which the worst response time needs to be calculated is selected from the set of message frames. i .

[0033] S292: After selecting message frame mi After that, it is necessary to calculate the priority not higher than the message frame m i The blocking time caused by other frames is recorded i Blocking time B i .

[0034] S293: Establishing an arbitration set, i.e., message frame m i Waiting for B i After the blocking time, arbitration is performed with other frames in the set.

[0035] In the worst case, all message frames in the set have a higher priority than message frame m. i The priority is high, so all must participate in the message frame m i In the message frame m i Before sending it out, record how many times other high-priority frames have been sent.

[0036] S294: According to the arbitration principle of CANFD, the smaller the ID, the higher the priority. Then, the minimum ID frame needs to be selected, which means that the minimum ID frame will win the arbitration. Then the transmission time T of the minimum ID frame on the bus is calculated. At this time, if the minimum ID frame happens to be the message frame m i , then prove that message frame m i Win arbitration and send successfully, terminate the loop and return the waiting time B i , at this time B i That is the message frame m i The worst response time.

[0037] S295: If the minimum ID frame is not a message frame m i , then the message frame m i If the arbitration fails in this round, then return to the loop, m i Continue to wait for the next bus idle time to participate in arbitration again.

[0038] S296: Finally, the message frames that have been successfully sent in the set frame need to be deleted, and each high-priority frame needs to be judged whether it has entered the next cycle and needs to be sent again. If so, it rejoins the arbitration set for arbitration.

[0039] The beneficial effects of the present invention are as follows: the present invention optimizes the logical weight ratios of each message transmission, calculates the mean message transmission time, realizes the estimation of the message transmission time, calculates the worst response time, and improves the network utilization.

[0040] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0042] Figure 1 This is a logical diagram of message transmission within the network segment of the present invention;

[0043] Figure 2 A logical schematic diagram of message transmission between single-layer networks of the present invention;

[0044] Figure 3 A logical schematic diagram of message transmission from a single-layer network to a multi-layer network according to the present invention;

[0045] Figure 4 A logical schematic diagram of message transmission from a multi-layer network to a single-layer network according to the present invention;

[0046] Figure 5 A logical schematic diagram of message transmission between multiple layers of networks according to the present invention;

[0047] Figure 6 The calculation E of the present invention i Business flow chart of the logical weight ratio of message transmission;

[0048] Figure 7 A business flow chart for estimating the transmission time of a CANFD standard frame message according to the present invention;

[0049] Figure 8 is the worst case for bit stuffing. DETAILED DESCRIPTION

[0050] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0051] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0052] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0053] The present invention constructs a double-layer CANFD network message transmission model, assuming that the first-layer CANFD network is called network CANFD1, and the second-layer CANFD network is called network CANFD2, and a double-layer network is formed through a gateway connection. The network transmission bandwidth ranges from 1 to 5Mbps, and the specific transmission bandwidth is determined according to the network characteristics. Each layer of the network contains n nodes.

[0054] The two-layer CANFD network message transmission model can be divided into E according to the network topology. i network layer transmission logic; according to the node transmission characteristics, it can be divided into F j Class transfer type.

[0055] Figure 1 It is a logical diagram of message transmission within a network segment.

[0056] like Figure 1 As shown, the message of network CANFD1 returns to CANFD1 through the gateway, which is the E1 network layer transmission logic; it includes F1 type single node to single node transmission, F2 type single node to multi-node transmission, F3 type multi-node to single node transmission, and F4 type multi-node to multi-node transmission messages.

[0057] Figure 2 It is a logical diagram of message transmission between single-layer networks.

[0058] like Figure 2As shown, the message of network CANFD1 is transmitted to network CANFD2 through the gateway, which is the E2 type network layer transmission logic; it includes F1 type single node to single node transmission, F2 type single node to multi-node transmission, F3 type multi-node to single node transmission, and F4 type multi-node to multi-node transmission messages.

[0059] Figure 3 It is a logical diagram of message transmission from a single-layer network to a double-layer network.

[0060] like Figure 3 As shown, the message of network CANFD1 is transmitted to two networks CANFD1 and CANFD2 through the gateway, which is the E3 network layer transmission logic; it includes F2 type single node to multi-node transmission and F4 type multi-node to multi-node transmission messages.

[0061] Figure 4 It is a logical diagram of message transmission from a multi-layer network to a single-layer network.

[0062] like Figure 4 As shown, the messages of network CANFD1 and CANFD2 are processed and analyzed by the gateway, and new messages are obtained and transmitted to CANFD1, which is the E4 network layer transmission logic; it includes F3 type multi-node to single node transmission and F4 type multi-node to multi-node transmission messages.

[0063] Figure 5 It is a logical diagram of message transmission between multi-layer networks.

[0064] like Figure 5 As shown, the messages of network CANFD1 and CANFD2 are processed by the gateway, and the new messages are transmitted to CANFD1 and CANFD2 respectively, which is the E5 network layer transmission logic; among them, only the F4 type multi-node to multi-node transmission message.

[0065] Figure 6 Is to calculate E i The business flow diagram of the logical weight ratio of message transmission. Figure 6 As shown, the specific steps are as follows:

[0066] Step 1. Build F j Relationship judgment matrix of class transmission messages.

[0067] As shown in Table 1, F j The importance comparison table of the transmission types is shown in Figure 1. The transmission types are compared in pairs. For example, the importance scale of F1 transmission mode is compared with F2 transmission mode. 12 ; then the importance scale of F2 transmission mode compared with F1 transmission mode is a 21 =1 / a 12 ; where a αβ(α, β = 1, 2, 3, 4) is the judgment scale, ranging from 1 to 4, with the importance increasing from 1 to 4. The specific value is selected according to the network characteristics.

[0068] Table 1

[0069]

[0070] The judgment matrix A is constructed based on the comparison of the importance of transmission types.

[0071]

[0072] Step 2. Find F j The weight ratio of the class of transmitted messages in the network.

[0073] The first column vector of the judgment matrix A represents the importance scale of F1, F2, F3, and F4 messages compared with F1. Each column vector of the judgment matrix A is normalized. Get the element a' αβ Normalized matrix A', sum A' row by row: So W=[W1 W2 W3 W4] T , where W1 represents the sum of the importance of F1, F2, F3, and F4 transmission modes compared to F1. Normalize the vector W Get the eigenvector approximate solution W A =[W1 A W2 A W3 A W4 A ] T , that is, to find F j Weight ratio of class messages in the network, W1 A , W2 A , W3 A , W4 A Respectively represent the weight ratios of F1, F2, F3, and F4 message transmission modes.

[0074] Step 3. Build the F j For class messages, E i The relation judgment matrix B of the transmission message j (j=1,2,3,4). For example, for F1 type transmission message, E i The importance of the five transmission logics is compared in pairs, and the judgment matrix B1 is constructed. For example, the importance scale of E1 transmission mode compared with E2 transmission mode is b 12 ; then the importance scale of E2 transmission mode compared with E1 transmission mode is b 21 =1 / b 12 ; where b xy(x,y=1,2,3,4,5) is the judgment scale, ranging from 1 to 5, with the importance increasing from 1 to 5. The specific value is selected according to the network characteristics.

[0075] Table 2

[0076] Transmission Logic <![CDATA[E1]]> <![CDATA[E2]]> <![CDATA[E3]]> <![CDATA[E4]]> <![CDATA[E5]]> <![CDATA[E1]]> 1 <![CDATA[b 12 ]]> <![CDATA[b 13 ]]> <![CDATA[b 14 ]]> <![CDATA[b 15 ]]> <![CDATA[E2]]> <![CDATA[b 21 ]]> 1 <![CDATA[B 23 ]]> <![CDATA[b 24 ]]> <![CDATA[b 25 ]]> <![CDATA[E3]]> <![CDATA[b 31 ]]> <![CDATA[b 32 ]]> 1 <![CDATA[b 34 ]]> <![CDATA[b 35 ]]> <![CDATA[E4]]> <![CDATA[b 41 ]]> <![CDATA[b 42 ]]> <![CDATA[B 43 ]]> 1 <![CDATA[b 45 ]]> <![CDATA[E5]]> <![CDATA[b 51 ]]> <![CDATA[b 52 ]]> <![CDATA[b 53 ]]> <![CDATA[b 54 ]]> 1

[0077] The judgment matrix B1 is constructed based on the comparison of the importance of transmission logic.

[0078]

[0079] Repeat step 3 to construct judgment matrices B2, B3, and B4 for F2, F3, and F4 messages respectively.

[0080] Step 4. Find E i The transmission message is relative to F j Repeat step 2 to solve the matrix B j The eigenvector approximation solution of The approximate solution of the required eigenvector of matrix B1 is For F1 type messages, E i The weight ratio of the transmitted messages.

[0081] Step 5. Calculate E i The weight ratio of the message transmission logic. j The weight of the class message in the network is W A , E in step 4 i The transmission message is relative to F j Class weight ratio Find E i The weight ratio of the message transmission logic. They respectively represent the weight ratios of E1, E2, E3, E4, and E5 message transmission logics.

[0082]

[0083] Figure 7 This is a business flow chart for estimating the transmission time of CANFD standard frame messages. Figure 7 As shown, the specific steps are as follows:

[0084] S2-1: Construct a binary sequence model G(s f ,d), consisting of M d-bit binary sequences S f (f∈[1,M]), where M is a random number greater than 10000. The binary sequence consists of a series of data messages, including the message frame start, arbitration field, control field, data field, CRC field, response field, and frame end.

[0085] S2-2: Determine the value of the binary sequence model data message, among which the frame start bit (Start Of Frame, SOF), remote transmission request bit (Remote Request Substitution, RRS), identifier extension bit (Identifier Extension flag, IDE), CAN FD format flag (FD Format indicator, FDF), reserved bit (RES), bit rate switch (Bit Rate Switch, BRS), and error state flag (Error State Indicator, ESI) are all dominant and take the value 0.

[0086] S2-3: Generate a binary sequence.

[0087] S2-4: Count the probability λ of the number of padding bits N N ,λ N It obeys normal distribution. In the CANFD protocol, when the transmitted data is 16 bytes or less, the CRC is 17 bits, and when the transmitted bytes exceed 16 bytes, the CRC is 21 bits, so there are two cases. In the first case, there are 43+8Lg bits involved in the filling. The byte length of the data field is L g In the case where g is 0 to 64, it means that the data field length of the message is 0 to 64 bytes. In the second case, when the transmission byte exceeds 16 bytes, the CRC is 21 bits, and the total number of bits involved in the filling is 47+8L g bits, number of padding bits In summary, Count the byte length of the data field L respectively g When the number of bytes is between 0 and 64, the probability of the number of bits filled in the message is λ N .

[0088] S2-5: Calculate the mean of the number of filled bits distribution According to the probability distribution of the number of filled digits, the mean number of filled digits is obtained Number of bits per binary sequence data message After adding the average number of padding bits, the total number of bits in the message is Due to the variable rate in the CANFD communication protocol, CANFD uses two bit rates: the variable rate from the BRS bit in the control field to the ACK field (including the CRC delimiter), and the rest of the message is the rate used by the original CAN bus, so τ is used. c To represent the variable rate, τ f To represent a fixed rate, the mean message transmission time is where d' crepresents the number of bits of the variable rate, and d' f Indicates the number of bits of fixed rate messages, and d'=d' c +d' f As shown in Table 3, the distribution mean of the number of padding bits and the mean transmission time of a single message are shown in Table 3 when the data field length is 0 to 64 bytes.

[0089] S2-6: Calculate E i The weight ratio of the message transmission logic. Using the hierarchical analysis method, select E i The optimal weight ratio of message transmission logic.

[0090] S2-7: Estimate the transmission time of the network control process message. E is calculated by the hierarchical analysis method. i The weight ratio of the message transmission logic is obtained, thus E i Number of messages[ηω P1 ηω P2 ηω P3 ηω P4 ηω P5 ], η represents the number of all messages participating in the network control process. The mean matrix of message transmission time Where g is 0 to 64 according to the byte length of the message data field. The estimated control process time T is as follows.

[0091]

[0092] S2-8: Since bit stuffing affects the transmission time of the message, the worst case of bit stuffing is as follows Figure 8 shown.

[0093] The padding bit increases the maximum transmission time of the CANFD message. Assuming that the total number of bits of the worst message transmission in the message frame m is C m ,but

[0094] For the convenience of calculation, the 16 bytes of the data field are calculated in segments, and the number of bytes of the CANFD data field is assumed to be greater than 16, that is, L g ≥16, then the CRC field is 4+21+1=26 (bit). After knowing the worst total number of bits of the CANFD message, the worst transmission time of the message can be calculated according to the two variable rates defined in S2-5, that is, in The function returns the largest integer less than or equal to a / b. The above T calculation finally yields T = (39 + 10L g )τ c +(31)τ fThe worst response time is calculated based on the worst transmission time T. With the message transmission time, the worst response time can be calculated. Let the worst response time be Q, which is used to calculate the message frame m under a specific message set. i The worst response time Q on the CAN bus. The core idea of ​​the algorithm proposed in this patent is to simulate the entire CANFD message frame sending process on the CAN bus. In order to accurately analyze the delay of the CANFD contention band, the algorithm is described.

[0095]

[0096]

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A method for estimating message transmission time for an automotive CANFD network, characterized in that: The following steps are involved: S1: Analyze network characteristics according to network topology, node transmission characteristics, network transmission messages, and signal quantities, build a two-layer CANFD network message transmission model, and calculate the weight ratio of each message transmission logic; S2: Build a binary sequence model, calculate the mean value of the number of padding bits in a message, obtain the transmission time of a single message, and estimate the network message transmission time based on the weight ratio of the transmission time of a single message and each transmission logic of the message; According to the network topology, the network layer transmission logic is divided into E i Type, i ranges from 1 to 5, E1 is internal transmission within the network segment, E2 is single-layer network to single-layer network transmission, E3 is single-layer network to double-layer network transmission, E4 is double-layer network to single-layer network transmission, and E5 is double-layer network to double-layer network transmission; According to the node transmission characteristics, the network layer transmission logic is divided into F j Type, j is 1 to 4, F1 is single-node to single-node transmission, F2 is single-node to multi-node transmission, F3 is multi-node to single-node transmission, F4 is multi-node to multi-node transmission; E i The weight ratio of the transmission logic is determined by the hierarchical analysis method, according to F j Class message importance level, build judgment matrix A, calculate F j The weight ratio of class messages in the network; according to E i F j The importance level of the class message, construct the judgment matrix B j , for F1, F2, F3, F4, construct judgment matrices B1, B2, B3, B4 in turn, and calculate E i This message is relative to F j The weight ratio of the class message is obtained by approximating the eigenvector of the judgment matrix. i The weight ratio of the transmission logic; Step S1 specifically includes the following steps: S11: Build F j Relationship judgment matrix of transmission messages of different types: compare the transmission types in pairs to obtain the importance scale a of each transmission type αβ , α, β = 1, 2, 3, 4, construct the judgment matrix A: The first column vector represents the importance scale of F1, F2, F3, F4 messages compared with F1; the second column vector represents the importance scale of F1, F2, F3, F4 messages compared with F2; the third column vector represents the importance scale of F1, F2, F3, F4 messages compared with F3; the fourth column vector represents the importance scale of F1, F2, F3, F4 messages compared with F4; S12: Find F j The weight ratio of the class transmission message in the network: normalize each column vector of the judgment matrix A. Get the element a' αβ Normalized matrix A', sum A' row by row: So W=[W1 W2 W3 W4] T , where W1 represents the sum of the importance of F1, F2, F3, and F4 transmission modes compared to F1, and the vector W is normalized Get the eigenvector approximate solution That is to find F j The weight ratio of the class of messages in the network, Respectively represent the weight ratios of F1, F2, F3, and F4 message transmission modes; S13: Build a pair of F j For class messages, E i The relation judgment matrix B of the transmission message j ; The judgment matrix B1 is for the F1 type transmission message, E i The importance of the two transmission logics is compared, including the judgment scale b xy , x,y=1,2,3,4,5, the importance increases from 1 to 5, and the value is selected according to the network characteristics; similarly, the judgment matrices B2, B3, and B4 are constructed for F2, F3, and F4 messages respectively; S14: Seeking E i The transmission message is relative to F j The weight ratio of the class, solving the matrix B j The eigenvector approximation solution of in Respectively for F j For example, the weight ratio of E1 to E5 transmission messages; S15: According to F j The weight ratio of the class transmission message in the network is W A , E i The transmission message is relative to F j Class weight ratio Find E i The weight ratio of the message transmission logic, where Respectively represent the weight ratios of E1, E2, E3, E4, and E5 message transmission logics: When the sending node detects 5 bit streams of the same polarity in the transmitted bit stream, it inserts a bit of opposite polarity as padding; the mean value of the distribution of the number of padding bits refers to the data field byte length L g The distribution mean of the number of message padding when the value is different In the CANFD network standard frame, the bits involved in filling include the frame start, arbitration field, control field, data field, and CRC field, and the length is (43+8L g ) / (47+8L g ) bit; number of message bits After adding the padding bits, the total number of bits in the message The estimating of the network message transmission time in step S2 specifically includes the following steps: S21: Construct a binary sequence model as G(S f ,d), consisting of M d-bit binary sequences S f (f∈[1,M]), where M is a random number greater than 10000; the binary sequence consists of a series of data messages, including the message frame start, arbitration field, control field, data field, CRC field, response field, and frame end; S22: Determine the value of the binary sequence model data message, wherein the frame start bit, remote transmission request bit, identifier extension bit, CANFD format flag, reserved bit, bit rate switch, and error status flag are all dominant and take the value 0; S23: Generate a binary sequence; S24: Count the probability λ of the number of padding bits N N ,λ N It obeys normal distribution; there are two cases. In the first case, there are 43+8Lg bits involved in filling. The byte length of the data field is L g In the middle, g is 0 to 64, indicating that the data field length of the message is 0 to 64 bytes; in the second case, when the transmission bytes exceed 16 bytes, the CRC is 21 bits, and a total of 47+8L are involved in the filling. g bits, number of padding bits In summary Count the byte length of the data field L respectively g When the number of bytes is between 0 and 64, the probability of the number of bits filled in the message is λ N ; S25: Calculate the mean of the number of fill bits distribution According to the probability distribution of the number of filled digits, the mean number of filled digits is obtained Number of bits per binary sequence data message After adding the average number of padding bits, the total number of bits in the message is CANFD uses two bit rates: the variable rate from the BRS bit in the control field to the ACK field, and the rest of the message is the rate used by the original CAN bus, using τ c To represent the variable rate, τ f To represent a fixed rate, the mean message transmission time is where d' c The number of bits representing the variable rate, d' f Indicates the number of bits of fixed rate messages, and d'=d' c +d' f ; S26: Calculate E i The weight ratio of the message transmission logic; using the hierarchical analysis method, select E i The optimal weight ratio of the transmission logic; S27: estimating the transmission time of the network control process message; S28: The padding bit increases the maximum transmission time of the CANFD message. Assuming that the total number of bits of the worst message transmission in the message frame m is C m ,but The 16 bytes of the data field are calculated in segments. By default, the number of bytes of the CANFD data field is greater than 16, that is, L g ≥16, then the CRC field is 26 bits; after knowing the worst total number of bits of the CANFD message, the worst transmission time of the message is calculated according to the two variable rates defined by S25, that is, in The function returns the largest integer less than or equal to a / b, and finally T = (39 + 10L g )τ c +(31)τ f ; Calculate the worst response time R based on the worst transmission time T i ; Step S29 calculates the worst response time R based on the worst transmission time T i , including the following steps: S291: First, a single message frame m for which the worst response time needs to be calculated is selected from the set of message frames. i ; S292: The calculation priority is not higher than the message frame m i The blocking time caused by other frames is recorded i Blocking time B i ; S293: Establishing an arbitration set, i.e., message frame m i Waiting for B i After the blocking time, arbitration is performed with other frames in the set; In the worst case, all message frames in the set have a higher priority than message frame m. i The priority is high, and all need to participate in the message frame m i Competition; in message frame m i Before sending out, record the number of times other high-priority frames are sent; S294: Select the minimum ID frame and calculate the transmission time T of the minimum ID frame on the bus; if the minimum ID frame is exactly the message frame m i , proves that the message frame m i Win arbitration and send successfully, terminate the loop and return the waiting time B i , at this time B i That is the message frame m i Worst response time; S295: If the minimum ID frame is not a message frame m i , then return to the loop, m i Continue to wait for the next bus idle time to participate in arbitration again; S296: Delete the message frames that have been successfully sent in the set frame, and determine for each high priority frame whether it has entered the next cycle and needs to be sent again. If so, rejoin the arbitration set for arbitration.