A message channel diagnosis method and device
By comparing the channel number values of messages and recording the first match in the communication architecture of the automotive electronic control unit, the communication conflict problem caused by data message multiplexing is solved, effective diagnosis and reverse tracing are realized, and the stability and reliability of the system are improved.
Patent Information
- Application Number
- CN202411263430.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-09-10
AI Technical Summary
In the complex communication architecture of automotive electronic control units, the multiplexing of data packets on multiple communication channels leads to communication conflicts and abnormal conditions, affecting the normal operation of the vehicle system, and requires effective diagnostic and reverse tracing methods.
By selecting unchecked messages from the message set to be checked and the target message set, reading their channel number values, comparing the matching results, accumulating the number of matchings, recording the channel number value and message number value of the first matching, and analyzing the situation of channel reuse.
It enables the diagnosis and reverse tracing of channel reuse, saving storage space and improving system stability and reliability.
Smart Images

Figure CN119110003B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automobile electronic control, and in particular to a message channel diagnosis method and device. BACKGROUND
[0002] In the current complex communication architecture of automobile electronic control unit (ECU), the data messages sent by the ECU can be configured on up to three independent communication channels at the same time. This design significantly enhances the expansion capability and redundancy of the system, providing a strong guarantee for the stability and reliability of the automobile electronic system. However, at the same time, it also brings challenges that cannot be ignored.
[0003] Specifically, since each communication channel may face competitive use from multiple messages, when these messages have inconsistencies in terms of sending period, data content, or activation conditions, etc., a series of communication conflicts and abnormal conditions may be triggered. These conditions include but are not limited to direct conflicts between messages, timing chaos caused by periodic inconsistencies, confusion of data due to concurrent transmission, and even temporary or complete interruption of the entire communication link, which poses a potential threat to the normal operation of the vehicle system.
[0004] In view of this, it is particularly important and urgent to diagnose and trace back the multiplexing of ECU data messages on communication channels (i.e., to determine which specific messages share a certain communication channel). SUMMARY
[0005] In view of the above problems, the present application provides a message channel diagnosis method and device to achieve the purpose of diagnosing all cases of channel multiplexing and performing reverse trace diagnosis while saving storage space. The specific scheme is as follows:
[0006] The first aspect of the present application provides a message channel diagnosis method, comprising:
[0007] Every first time interval, select an unexamined message in the to-be-checked message set as a current to-be-checked message, and read the channel number value matched by the current to-be-checked message; the to-be-checked message set is determined based on an initial message set and a starting to-be-checked message;
[0008] For the channel number value matched by the current to-be-checked message, every second time interval, select an unexamined target message in the target message set, and read the channel number value matched by the target message; the target message set includes all messages in the initial message set except the current to-be-checked message and messages that have been examined as to-be-checked messages before; the first time interval is not less than the time interval required to complete the comparison of all messages in the target message set;
[0009] comparing the channel number value matched by the target message with the channel number value matched by the current message under inspection;
[0010] If matched, the matching times are accumulated;
[0011] When the comparison of all messages in the target message set is completed, the current message under inspection is marked as having been inspected as a message under inspection;
[0012] When the matching times are equal to 1, the channel number value is recorded as a target channel number value, and the message number value of the target message and the message number value of the current message under inspection are recorded.
[0013] In a possible implementation, the message channel diagnosis method further includes:
[0014] Defining variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array, and M, where M is the number of messages in the initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps, and T2 = T1 × (M-num1);
[0015] Every first time interval, a message under inspection in the message set under inspection is selected as a current message under inspection, and the channel number value matched by the current message under inspection is read, including:
[0016] Every T2, a value in a first range that has not been inspected is selected as m1, the message corresponding to m1 is selected as a current message under inspection, and the channel number value matched by the current message under inspection is read and assigned to B; the first range includes: J to M-1;
[0017] For the channel number value matched by the current message under inspection, every second time interval, a target message in the target message set that has not been compared is selected, and the channel number value matched by the target message is read, including:
[0018] For B, every T1, a value in a second range that has not been compared is selected as m2, and the channel number value matched by the message corresponding to m2 is read and assigned to A2; the second range includes: num1+J to M;
[0019] Comparing the channel number value matched by the target message with the channel number value matched by the current message under inspection, including:
[0020] Comparing the values of A2 and B;
[0021] If matched, the matching times are accumulated, including:
[0022] If equal, num2 is increased by 1;
[0023] When the comparison of all the messages in the target message set is completed, the current message under examination is marked as having been examined as a message under examination, including:
[0024] When the comparison of all the values in the second range is completed, the num1 is increased by 1;
[0025] When the number of matches is equal to 1, the channel number value of the target message is recorded as a target channel number value and the message number value of the target message and the message number value of the current message under examination, including:
[0026] If the num2 is equal to 1, the value of the B is assigned to the C, and the m1 and the m2 are stored in association to the array.
[0027] In one possible implementation, the message channel diagnosis method further includes:
[0028] Defining variables J, num1, T1, T2, A2, B, m1, m2, num2, C, array and M, wherein M is the number of messages in an initial message set, num1 is initialized to 1, num2 is initialized to 0, J is initialized to one of 2 to M, T1 and T2 are time steps and T2 = T1 x (M-num1);
[0029] Every first time interval, a message under examination in the message set under examination is selected as a current message under examination, and the channel number value matched by the current message under examination is read, including:
[0030] Every T2, a value not yet examined in the first range is selected and assigned to the m1, the message corresponding to the m1 is selected as the message number value of the current message under examination, and the channel number value matched by the current message under examination is read and assigned to the B; the first range includes J to M and 1 to J-2.
[0031] For the channel number value matched by the current message under examination, every second time interval, a target message not yet compared in the target message set is selected, and the channel number value matched by the target message is read, including:
[0032] For the B, every T1, a value not yet compared in the second range is selected and assigned to the m2, and the channel number value matched by the message corresponding to the m2 is read and assigned to the A2; the second range includes num1+J to M and 1 to J-1.
[0033] The channel number values matched by the target message and the current message under examination are compared to determine whether they match, including:
[0034] The values of the A2 and the B are compared to determine whether they are equal.
[0035] If match, accumulate the number of matches, including:
[0036] If equal, then num2 is increased by 1;
[0037] When the comparison of all packets in the target packet set is completed, then the current packet under examination is marked as having been examined as a packet under examination, including:
[0038] When the comparison of all values in the second range is completed, then num1 is increased by 1;
[0039] When the number of matches is equal to 1, record the channel number value as a target channel number value and the packet number value of the target packet and the packet number value of the current packet under examination, including:
[0040] If num2 is equal to 1, then the value of B is assigned to C, and m1 and m2 are stored in association to the array.
[0041] In one possible implementation, the packet channel diagnosis method further includes:
[0042] Multiplying M and T1;
[0043] Defining at least one of variable A1 and ByteT1 and variable F, the variable F being initialized to 1;
[0044] Every T1, incrementing F by 1, and performing at least one of:
[0045] Reading the channel number value of the packet match corresponding to F, and outputting the channel number value of the packet match corresponding to F;
[0046] Reading the content of the packet corresponding to F, and outputting the content of the packet corresponding to F.
[0047] In one possible implementation, the packet channel diagnosis method further includes:
[0048] Multiplying M;
[0049] Defining at least one of variable A1 and ByteT1 and variable F, assigning one of 1 to M to the variable F;
[0050] Reading the channel number value of the packet match corresponding to F, and assigning the channel number value of the packet match corresponding to F to A1;
[0051] Reading the content of the packet corresponding to F, and assigning the content of the packet corresponding to F to ByteT1.
[0052] In another aspect of the present application, a message channel diagnosis device is provided, comprising:
[0053] A first processing module is configured to select an unexamined message from a message set to be examined as a current message to be examined every first time interval, and read a channel number value matched by the current message to be examined; the message set to be examined is determined based on an initial message set and a starting message to be examined;
[0054] A second processing module is configured to:
[0055] select an unexamined target message from a target message set every second time interval for the channel number value matched by the current message to be examined, and read a channel number value matched by the target message; the target message set comprises all messages in the initial message set except the current message to be examined and messages that have been examined as messages to be examined; the first time interval is not less than a time interval required for completing comparison of all messages in the target message set;
[0056] compare whether the channel number value matched by the target message and the channel number value matched by the current message to be examined match;
[0057] If the channel number values match, the number of matches is accumulated;
[0058] When the comparison of all messages in the target message set is completed, the current message to be examined is marked as having been examined as a message to be examined;
[0059] A recording module is configured to record the channel number value as a target channel number value, a message number value of the target message, and a message number value of the current message to be examined when the number of matches is equal to 1.
[0060] In a possible implementation, the message channel diagnosis device further comprises:
[0061] A first defining module is configured to define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array, and M, wherein M is the number of messages in the initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps, and T2=T1×(M-num1);
[0062] The first processing module is specifically configured to select an unexamined value in a first range every T2, assign the unexamined value to m1, take a message corresponding to m1 as the current message to be examined, and assign a channel number value matched by the current message to be examined to B; the first range comprises J to M-1.
[0063] The second processing module selects one un-compared target packet in the target packet set every second time length according to the channel number value matched by the current packet to be checked, and reads the channel number value matched by the target packet, and the process specifically comprises:
[0064] For the B, one un-compared value in a second range is selected every T1 to be assigned to the m2, and the channel number value matched by the packet corresponding to the m2 is read to be assigned to the A2; the second range comprises num1+J to M;
[0065] The second processing module compares whether the channel number values matched by the target packet and the current packet to be checked match, and the process specifically comprises:
[0066] The A2 and the B are compared to see whether the values are equal;
[0067] The second processing module accumulates the matching times if the values match, and the process specifically comprises:
[0068] If the values are equal, the num2 is increased by 1;
[0069] The second processing module marks the current packet to be checked as having been checked as a packet to be checked when the comparison of all packets in the target packet set is completed, and the process specifically comprises:
[0070] The num1 is increased by 1 when the comparison of all values in the second range is completed;
[0071] The recording module is specifically configured to assign the value of the B to the C if the num2 is equal to 1, and store the m1 and the m2 in association to the array.
[0072] In a possible implementation, the packet channel diagnosis apparatus further comprises:
[0073] A second defining module is configured to define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array and M, wherein M is the number of packets in an initial packet set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as one of 2 to M, T1 and T2 are time steps and T2=T1×(M-num1);
[0074] The first processing module is specifically configured to select one un-checked value in a first range every T2 to be assigned to the m1, read the channel number value matched by the current packet to be checked to be assigned to the B, and the first range comprises J to M and 1 to J-2;
[0075] The second processing module selects an un-compared target packet in the target packet set every second time length for the channel number value matched by the current packet to be checked, and reads the channel number value matched by the target packet, specifically comprising:
[0076] For the B, an un-compared value in a second range is selected every T1 to assign to the m2, and the channel number value matched by the packet corresponding to the m2 is read to assign to the A2; the second range includes: num1+J to M and 1 to J-1;
[0077] The second processing module compares whether the channel number values matched by the target packet and the current packet to be checked match, specifically comprising:
[0078] The second processing module compares whether the values of the A2 and the B are equal, specifically comprising:
[0079] The second processing module accumulates the matching times if matching, specifically comprising:
[0080] If equal, the num2 is increased by 1;
[0081] The second processing module marks the current packet to be checked as having been checked as a packet to be checked when the comparison of all packets in the target packet set is completed, specifically comprising:
[0082] When the comparison of all values in the second range is completed, the num1 is increased by 1;
[0083] The recording module is specifically configured to assign the value of the B to the C if the num2 is equal to 1, and store the m1 and the m2 in association to the array.
[0084] In a possible implementation, the packet channel diagnosis apparatus further comprises:
[0085] The third processing module is configured to:
[0086] Multiplex the M and the T1;
[0087] Define at least one of variables A1 and ByteT1 and a variable F, and the variable F is initialized to 1;
[0088] Every T1, the F is increased by 1, and at least one of the following is performed:
[0089] Read the channel number value matched by the packet corresponding to the F, and output the channel number value matched by the packet corresponding to the F;
[0090] Read the content of the packet corresponding to the F, and output the content of the packet corresponding to the F.
[0091] In a possible implementation, the message channel diagnosis apparatus further comprises:
[0092] The fourth processing module is configured to:
[0093] multiplex the M;
[0094] define at least one of a variable A1 and a variable ByteT1 and a variable F, and assign one of 1 to M to the variable F;
[0095] read a channel number value corresponding to the message matched by the F, and assign the channel number value corresponding to the message matched by the F to A1;
[0096] read the content of the message corresponding to the F, and assign the content of the message corresponding to the F to ByteT1.
[0097] In the present application, one message is selected from an initial message set as a current to-be-checked message, the initial message set comprises a plurality of messages arranged in sequence, a to-be-checked message set is determined from the initial message set based on the current to-be-checked message, a channel number value matched by the current to-be-checked message is read, one un-compared message is selected from the target message set, and it is compared whether the un-compared message and the channel number value matched by the current to-be-checked message match. If the matching is successful and it is the first time to encounter the channel number value (i.e., when the matching number is 1), the channel number value is recorded as a target channel number value, and the message number value of the matched message is recorded. Meanwhile, the matching number is accumulated. If the matching is successful but it is not the first time, only the matching number is accumulated, and no new target channel number value and message number value are recorded. Whether the matching is successful or not, the next un-compared message is continuously selected from the target message set for comparison until all the messages participate in the comparison. After one round of comparison is completed, the first message after the current to-be-checked message in the to-be-checked message set is set as a new to-be-checked message. The process from reading the channel number value to completing the comparison of all the messages is repeatedly executed until each message in the to-be-checked message set is selected as a to-be-checked message at least once. In the above process, only the first matched channel number value and the corresponding message number value are recorded, which can effectively save the storage space.
[0098] Moreover, through the accumulated matching number, the recorded target channel number value and message number value, it can be analyzed which channels are multiplexed and the multiplexing degree. If the accumulated matching number is equal to the number of recorded message number values, it indicates that only one channel (i.e., the target channel number value) is multiplexed. If the matching number is greater than the number of recorded message number values, it may mean that multiple channels are multiplexed, and further checking is required to ensure that all the situations of channel multiplexing are diagnosed and reverse tracing diagnosis is performed. BRIEF DESCRIPTION OF DRAWINGS
[0099] The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which:
[0100] Figure 1 A flowchart of a packet channel diagnosis method provided for Embodiment 1 of the present application;
[0101] Figure 2 A flowchart of a packet channel diagnosis method provided for Embodiment 2 of the present application;
[0102] Figure 3 A flowchart of a packet channel diagnosis method provided for Embodiment 3 of the present application;
[0103] Figure 4 A structural diagram of a packet channel diagnosis apparatus provided for the present application. DETAILED DESCRIPTION
[0104] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the embodiment part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0105] The embodiments of the present application are described below in conjunction with the drawings. It is known to those skilled in the art that as technology develops and new scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0106] The terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is only a distinguishing way used in the description of the embodiments of the present application to describe the objects with the same attributes. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that the processes, methods, systems, products or equipment containing a series of units do not have to be limited to those units, but can include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0107] In order to make the above-mentioned purposes, features and advantages of the present application more apparent and easy to understand, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0108] Reference Figure 1 A flowchart of a packet channel diagnosis method provided for Embodiment 1 of the present application, as shown in Figure 1As shown, the method can include, but is not limited to, the following steps:
[0109] In step S101, every first time length, an unexamined message in the message set to be examined is selected as a current message to be examined, and a channel number value matched by the current message to be examined is read; the message set to be examined is determined based on the initial message set and a starting message to be examined.
[0110] In this embodiment, a message can be selected as the starting message to be examined from the initial message set as needed, which is not limited herein. For example, the first message in the initial message set can be selected as the starting message to be examined. For example, the initial message set includes 10 messages arranged in sequence, which are message 1, message 2, message 3, message 4, message 5, message 6, message 7, message 8, message 9 and message 10, and message 1 can be selected as the starting message to be examined. Alternatively, a message other than the first message in the initial message set can be selected as the starting message to be examined. For example, the initial message set includes 10 messages arranged in sequence, which are message 1, message 2, message 3, message 4, message 5, message 6, message 7, message 8, message 9 and message 10, and message 4 can be selected as the starting message to be examined.
[0111] If message 1 is selected as the starting message to be examined, messages 2-9 can be selected as the message set to be examined. Alternatively, if message 4 is selected as the starting message to be examined, messages 5-10 and messages 1-2 can be selected as the initial message range.
[0112] The channel number value matched by the current message to be examined can identify the channel selected by the current message to be examined.
[0113] In step S102, every second time length, a target message not compared in the target message set is selected for the channel number value matched by the current message to be examined, and a channel number value matched by the target message is read.
[0114] The target message set can include all messages in the initial message set except the current message to be examined and messages previously examined as messages to be examined.
[0115] The first time length is not less than a time length required for completing comparison of all messages in the target message set.
[0116] Still taking the initial message set of step S101 as an example, step S102 is described. For example, if message 1 is selected as the initial message to be checked, and the current message to be checked is message 1, the target message set can include messages 2-10. Or, if message 1 is selected as the initial message to be checked, and the current message to be checked is updated to message 2, the target message set can include messages 3-10. Or, if message 4 is selected as the initial message to be checked, and the current message to be checked is message 4, the target message set can include messages 5-10 and messages 1-3. Or, if message 4 is selected as the initial message to be checked, and the current message to be checked is updated to message 5, the target message set can include messages 6-10 and messages 1-3.
[0117] Step S103, compare whether the target message and the current message to be checked match in the channel number value.
[0118] If yes, step S104 is executed.
[0119] Step S104, accumulate the matching times.
[0120] Step S105, when the comparison of all messages in the target message set is completed, the current message to be checked is marked as having been checked as a message to be checked.
[0121] Still taking the initial message set of step S101 as an example, step S105 is described. For example, if message 1 is selected as the current message to be checked, and the current message to be checked is message 1 (i.e., after message 1 is selected as the current message to be checked, the current message to be checked has not been updated), the target message set includes messages 2-10. After messages 2-10 are compared with the current message to be checked (i.e., message 1) in the channel number value, message 1 is marked as having been checked as a message to be checked. After message 2 is reselected as the current message to be checked after an interval of the first time length, because message 1 is marked as having been checked as a message to be checked, based on the marking, it can be determined that the target message set includes messages 3-10, i.e., all messages in messages 1-10 except the current message to be checked (i.e., message 2) and the message to be checked (i.e., message 1) that has been checked as a message to be checked.
[0122] Step S106, when the matching times are equal to 1, record the channel number value as the target channel number value, and the message number value of the target message and the message number value of the current message to be checked.
[0123] Still taking step S101 as an example, the initial packet set is described in steps S102-S106, for example, if packet 1 is selected as the starting packet to be searched, packets 2-9 can be selected as the packet set to be searched. At al time, packet 1 is selected as the current packet to be searched in the packet set to be searched, and the channel number value matched by the current packet to be searched is read as xl.
[0124] For the current packet to be searched, packet 2 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 2 is read as x2, the channel number value matched by packet 2 is not matched with xl; packet 3 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 3 is read as x2, the channel number value matched by packet 3 is not matched with xl; packet 4 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 4 is read as x3, the channel number value matched by packet 4 is not matched with xl; packet 5 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 5 is read as x3, the channel number value matched by packet 5 is not matched with xl; packet 6 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 6 is read as x4, the channel number value matched by packet 6 is not matched with xl; packet 7 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 7 is read as x5, the channel number value matched by packet 7 is not matched with xl; packet 8 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 8 is read as x6, the channel number value matched by packet 8 is not matched with xl; packet 9 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 9 is read as x7, the channel number value matched by packet 9 is not matched with xl; packet 10 is selected from the target packet set (i.e., packets 2-10), the channel number value matched by packet 10 is read as x8, the channel number value matched by packet 10 is not matched with xl.
[0125] At a2 moment (the interval between a2 moment and a1 moment is the first time length), packet 2 is selected as the current to-be-checked packet from the to-be-checked packet set, the channel number value matched by the current to-be-checked packet (i.e. packet 2) is read as x2, packet 3 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 3 is read as x2, the channel number value x2 matched by packet 3 matches x1 and is the first match, the channel number value x2 is recorded as the target channel number value and the packet number values of packet 2 and packet 3 are recorded; packet 4 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 4 is read as x3, the channel number value x3 matched by packet 4 does not match x2; packet 5 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 5 is read as x3, the channel number value x3 matched by packet 5 does not match x2; packet 6 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 6 is read as x4, the channel number value x4 matched by packet 6 does not match x2; packet 7 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 7 is read as x5, the channel number value x5 matched by packet 7 does not match x2; packet 8 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 8 is read as x6, the channel number value x6 matched by packet 8 does not match x2; packet 9 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 9 is read as x7, the channel number value x7 matched by packet 9 does not match x2; packet 10 is selected from the target packet set (i.e. packets 3-10), the channel number value matched by packet 10 is read as x8, the channel number value x8 matched by packet 10 does not match x2.
[0126] At a3 moment (the interval between a3 moment and a2 moment is the first time length), packet 3 is selected as the current to-be-checked packet from the to-be-checked packet set, the channel number value matched by the current to-be-checked packet (i.e. packet 3) is read as x2, packet 4 is selected from the target packet set (i.e. packets 4-10), the channel number value matched by packet 4 is read as x3, the channel number value x3 matched by packet 4 does not match x2; …; packet 10 is selected from the target packet set (i.e. packets 4-10), the channel number value matched by packet 10 is read as x8, the channel number value x8 matched by packet 10 does not match x2.
[0127] At time a4 (the interval between time a4 and time a3 is the first duration), message 4 is selected from the set of messages to be checked as the current message to be checked, and the channel number value x3 matched by the current message to be checked (i.e., message 4) is read. Message 5 is selected from the target message set (i.e., messages 5-10), and the channel number value x3 matched by message 5 is read. Since the channel number value x3 matched by message 5 matches the channel number value x3 matched by the new message to be checked and this is not the first match, the channel number value x3 and the corresponding message number value are not recorded. ...; message 10 is selected from the target message set (i.e., messages 5-10), and the channel number value x8 matched by message 10 is read. The channel number value x8 matched by message 10 does not match x3.
[0128] In this embodiment, by recording the channel number value as the target channel number value, the message number value of the target message, and the message number value of the current message to be checked, it is possible to determine which messages share the channel identified by the recorded target channel number value.
[0129] In this embodiment, every first time interval, an unchecked message is selected from the set of messages to be checked as the current message to be checked. The matching channel number value of the current message to be checked is read. Based on the matching channel number value of the current message to be checked, every second time interval, an uncompared target message is selected from the set of target messages. The matching channel number value of the target message is read. The uncompared message is compared with the matching channel number value of the current message to be checked to see if they match. If a match is successful and this is the first time the channel number value is encountered (i.e., when the number of matches is 1), the channel number value is recorded as the target channel number value, the message number value of the matching message is recorded, and the number of matches is accumulated. If a match is successful but not the first time, only the number of matches is accumulated; the new target channel number value and message number value are not recorded. Regardless of whether a match is found, the next uncompared message is selected from the set of target messages for comparison until all messages have been compared. After a round of comparison is completed, a new unchecked message is selected from the set of messages to be checked as the current message to be checked. Repeat the process from reading the channel number value to completing all message comparisons until each message in the set of messages to be checked has been selected as a message to be checked at least once. During this process, only the first matched channel number value and corresponding message number are recorded, which can effectively save storage space.
[0130] And, by the accumulated matching times, the recorded target channel number value and the message number value, it can be analyzed which channels are multiplexed and the degree of multiplexing. If the accumulated matching times are equal to the number of recorded message number values, it indicates that only one channel (i.e. the target channel number value) is multiplexed. If the matching times are greater than the number of recorded message number values, it can mean that there are multiple channel multiplexing, which needs to be further checked to ensure that all cases of channel multiplexing are diagnosed and reverse trace diagnosis is performed.
[0131] As another optional embodiment of the present application, referring to Figure 2 , a flowchart of a message channel diagnosis method provided in Embodiment 2 of the present application, in the present embodiment, mainly an implementation of the message channel diagnosis method provided in Embodiment 1, as shown in Figure 2 , the message channel diagnosis method can include but is not limited to the following steps:
[0132] Step S201, define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, array and M, wherein M is the number of messages in the initial message set, num1 is initialized to 1, num2 is initialized to 0, J is initialized to 1, T1 and T2 are time steps and T2 = T1 x (M-num1).
[0133] The value of J is the message number value of the starting message to be checked selected from the initial message set.
[0134] Step S202, every T2, select an unexamined value in the first range and assign it to m1, take the message corresponding to m1 as the current message to be checked, and read the channel number value matched by the current message to be checked and assign it to B; the first range includes: J to M-1.
[0135] Step S202 is an implementation of step S101 in Embodiment 1.
[0136] Step S203, for B, every T1, select an unexamined value in the second range and assign it to m2, read the channel number value matched by the message corresponding to m2 and assign it to A2; the second range includes: num1+J to M.
[0137] Step S203 is an implementation of step S102 in Embodiment 1.
[0138] Step S204, compare whether the values of A2 and B are equal.
[0139] If yes, perform step S205.
[0140] Step S204 is an implementation of step S103 in Embodiment 1.
[0141] Step S205: num2 is increased by 1.
[0142] Step S205 is an implementation of step S104 in Example 1.
[0143] Step S206: When the comparison of all values in the second range is completed, the num1 is increased by 1.
[0144] Step S206 is an implementation of step S105 in Example 1.
[0145] Step S207: If num2 is equal to 1, assign the value of B to C, and associate m1 with m2 and store them in the array.
[0146] Step S207 is an implementation of step S106 in Example 1.
[0147] In this embodiment, the first range includes J to M-1. It can be seen that when J is fixed, the first range remains unchanged. As num1 is accumulated, the second range changes.
[0148] Although num2 will be accumulated when the values of A2 and B are equal, only when num2 is equal to 1, the value of B is assigned to C, and m1 and m2 are associated and stored in the array, C is the target channel number value, and the array and C are associated and stored.
[0149] In this embodiment, the small loop process may include: steps S203-S206.
[0150] The large cycle process may include: steps S202-S207.
[0151] The duration of a small cycle process can be recorded as a small period d, and the duration of a large cycle process can be recorded as a large period D.
[0152] The following example illustrates the large and small loop processes. For example, the initial message set includes 10 messages arranged in sequence: message 1, message 2, message 3, message 4, message 5, message 6, message 7, message 8, message 9, and message 10. Accordingly, the first range is 1-9. The initial value of the second range is 2-10, and the initial value of T2 is 9T1.
[0153] At time 0, select 1 in the first range and assign it to m1. The message corresponding to m1 is used as the current message to be checked. The channel number value matched by the current message to be checked is read as x1, and x1 is assigned to B.
[0154] At time 0, select 2 in the second range (i.e., 2-10) for m2, assign the value x2 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0155] At time T1, select 3 in the second range (i.e., 2-10) for m2, assign the value x2 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0156] At time 2T1, select 4 in the second range (i.e., 2-10) for m2, assign the value x3 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0157] At time 3T1, select 5 in the second range (i.e., 2-10) for m2, assign the value x3 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0158] At time 4T1, select 6 in the second range (i.e., 2-10) for m2, assign the value x4 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0159] At time 5T1, select 7 in the second range (i.e., 2-10) for m2, assign the value x5 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0160] At time 6T1, select 8 in the second range (i.e., 2-10) for m2, assign the value x6 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0161] At time 7T1, select 9 in the second range (i.e., 2-10) for m2, assign the value x7 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0162] At time 8T1, select 10 in the second range (i.e., 2-10) for m2, assign the value x8 of the channel number matched by m2 to A2, compare the values of A2 and B, and the two are not equal.
[0163] That is, after the comparison of the channel number value matched by the packet 10 and the value of B is completed, the time length used is 9T1 (i.e., one small cycle d), and one small cycle is completed. At this time, T2 is reached. At the first T2, 2 is selected in the first range to be assigned to m1, the packet corresponding to m1 is taken as the current packet to be searched, the channel number value matched by the current packet to be searched is read as x2, x2 is assigned to B; and in the same way, at the eighth T2, 9 is selected in the first range to be assigned to m1, the packet corresponding to m1 is taken as the current packet to be searched, the channel number value matched by the current packet to be searched is read as x7, x7 is assigned to B, and a new small cycle process is started. At the end of the small cycle process, the large cycle process is also ended, and the time length experienced by the large cycle process is the first T2+the second T2+the third T2+…+the eighth T2 (i.e., one large cycle D). Any two of the first T2 to the eighth T2 are different.
[0164] In the embodiment, by defining the variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array, and M, where M is the number of packets in the initial packet set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps and T2=T1×(M-num1), the storage space of the ECU can be saved, and a more flexible processing algorithm space can be provided for development, so that the operation time is more saved. For example, the inner loop process and the outer loop process can reduce the number of comparisons, save the operation time, and improve the efficiency of diagnosis.
[0165] The calculation of num2 provides a more intuitive means of evaluating the channel multiplexing degree.
[0166] The definition and monitoring of num1 can more conveniently assist in locating the position of the abnormal packet. Based on num1, num2, and A2, the INCA oscilloscope monitoring can locate multiple multiplexing channels at a time.
[0167] In addition, through the range of the large cycle D and the small cycle d1 and the trigger calculation algorithm of num2, the automatic reverse search function can be realized. Combined with the variable J, the precise personalized reverse search requirement can also be realized (to cope with the case of solving only a single multiplexing in a large number of multiplexings).
[0168] As another optional embodiment of the application, refer to Figure 3 A flowchart of a packet channel diagnosis method provided by the embodiment 3 of the application is shown in FIG. 3. Figure 3 The method can include but is not limited to the following steps:
[0169] Step S301, defining variables J, num1, T1, T2, A2, B, m1, m2, num2, C, array and M, wherein M is the number of messages in the initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as one of the values from 2 to M, T1 and T2 are time steps and T2 = T1 x (M-num1).
[0170] The value of J is the message number value of the mth message selected from the initial message set (i.e. the starting message to be searched). m is greater than 1 and less than M.
[0171] Step S302, every T2, selecting an unexamined value in the first range to assign to m1, taking the message corresponding to m1 as the message number value of the current message to be searched, and reading the channel number value matched by the current message to be searched to assign to B; the first range includes J to M and 1 to J-2.
[0172] Step S302 is an embodiment of step S101 in Embodiment 1.
[0173] Step S303, for B, every T1, selecting an unexamined value in the second range to assign to m2, and reading the channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M and 1 to J-1.
[0174] Step S303 is an embodiment of step S102 in Embodiment 1.
[0175] Step S304, comparing whether the values of A2 and B are equal.
[0176] If yes, step S305 is executed.
[0177] Step S304 is an embodiment of step S103 in Embodiment 1.
[0178] Step S305, num2 is increased by 1.
[0179] Step S305 is an embodiment of step S104 in Embodiment 1.
[0180] Step S306, when the comparison of all values in the second range is completed, num1 is increased by 1.
[0181] Step S306 is an embodiment of step S105 in Embodiment 1.
[0182] Step S307, if num2 is equal to 1, the value of B is assigned to C, and m1 and m2 are stored in association in the array.
[0183] Step S307 is an embodiment of step S106 in Embodiment 1.
[0184] In this embodiment, the first range is kept unchanged in the case of J being fixed. The second range is changed as numl is accumulated.
[0185] Although num2 is accumulated when the value of A2 is equal to the value of B, only when num2 is equal to 1, the value of B is assigned to C, and m1 and m2 are stored in association in the array, C is the target channel number value, and the array and C are stored in association.
[0186] In this embodiment, the small cycle process can include steps S303-S306.
[0187] The large cycle process can include steps S302-S307.
[0188] The duration of one small cycle process can be denoted as a small period d, and the duration of the large cycle process can be denoted as a large period D.
[0189] The large cycle process and the small cycle process are described by way of example. For example, the initial packet set includes 10 packets arranged in sequence, namely, packet 1, packet 2, packet 3, packet 4, packet 5, packet 6, packet 7, packet 8, packet 9, and packet 10. J is initialized as 4, and accordingly, the first range includes 4-10 and 1-2. The initial value of the second range is 5-10 and 1-3, and the initial value of T2 is 9T1.
[0190] At time 0, 4 is selected in the first range to be assigned to m1, the packet corresponding to m1 is taken as the current packet to be searched, the channel number value x3 matched by the current packet to be searched is read, and x3 is assigned to B.
[0191] At time 0, 5 is selected in the second range (i.e., 5-10 and 1-3) to be assigned to m2, the channel number value x3 matched by the packet corresponding to m2 is assigned to A2, and the values of A2 and B are compared. The values of A2 and B are equal. This is the first matching, and the target channel number value x3, the packet number value 5, and the packet number value 4 can be recorded.
[0192] At time T1, 6 is selected in the second range (i.e., 5-10 and 1-3) to be assigned to m2, the channel number value x4 matched by the packet corresponding to m2 is assigned to A2, and the values of A2 and B are compared. The values of A2 and B are not equal.
[0193] At time 2T1, 7 is selected in the second range (i.e., 5-10 and 1-3) to be assigned to m2, the channel number value x5 matched by the packet corresponding to m2 is assigned to A2, and the values of A2 and B are compared. The values of A2 and B are not equal.
[0194] At 3T1, 8 is selected in the second range (i.e. 5-10 and 1-3) to be assigned to m2, the value x6 of the channel number corresponding to the message matched by m2 is assigned to A2, and A2 and B are compared, and the values are not equal.
[0195] At 4T1, 9 is selected in the second range (i.e. 5-10 and 1-3) to be assigned to m2, the value x7 of the channel number corresponding to the message matched by m2 is assigned to A2, and A2 and B are compared, and the values are not equal.
[0196] At 5T1, 10 is selected in the second range (i.e. 5-10 and 1-3) to be assigned to m2, the value x8 of the channel number corresponding to the message matched by m2 is assigned to A2, and A2 and B are compared, and the values are not equal.
[0197] At 6T1, 1 is selected in the second range (i.e. 5-10 and 1-3) to be assigned to m2, the value x1 of the channel number corresponding to the message matched by m2 is assigned to A2, and A2 and B are compared, and the values are not equal.
[0198] At 7T1, 2 is selected in the second range (i.e. 5-10 and 1-3) to be assigned to m2, the value x2 of the channel number corresponding to the message matched by m2 is assigned to A2, and A2 and B are compared, and the values are not equal.
[0199] At 8T1, 3 is selected in the second range (i.e. 5-10 and 1-3) to be assigned to m2, the value x3 of the channel number corresponding to the message matched by m2 is assigned to A2, and A2 and B are compared, and the values are not equal.
[0200] That is, after the comparison of the channel number value of the message 3 and the value of B is completed, the time taken is 9T1 (i.e. one small cycle d), and one inner loop is completed. At this time, T2 is reached, at the first T2, 5 is selected in the first range to be assigned to m1, the message corresponding to m1 is taken as the current message to be checked, the channel number value x3 of the current message to be checked is read, and x3 is assigned to B; and in the same way, at the eighth T2, 2 is selected in the first range to be assigned to m1, the message corresponding to m1 is taken as the current message to be checked, the channel number value x2 of the current message to be checked is read, and x2 is assigned to B, and a new small loop process is started. At the end of the small loop process, the large loop process is also completed, and the time taken by the large loop process is the first T2+the second T2+the third T2+…+the eighth T2 (i.e. one large cycle D). Any two of the first T2 to the eighth T2 are different.
[0201] In the embodiment, by defining variables J, num1, T1, T2, A2, B, m1, m2, num2, C, array and M, wherein M is the number of messages in the initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps and T2 = T1 x (M-num1), the storage space of the ECU can be saved, and more flexible processing operation algorithm space can be provided for development, the operation time is more saved, for example, the inner loop process and the outer loop process can reduce the number of comparisons, save the operation time and improve the efficiency of diagnosis.
[0202] The calculation of num2 provides a more intuitive means of evaluating the multiplexing degree of the channel.
[0203] The definition and monitoring of num1 can more conveniently assist in locating the position of the abnormal message, and the INCA oscilloscope monitoring based on num1, num2 and A2 can locate multiple multiplexing channels at a time.
[0204] In addition, by the range of the size period D, d1 and the trigger calculation algorithm of num2, the automatic backtracking function can be realized. Combined with the variable J, the precise personalized backtracking requirement can also be realized (to cope with the case of solving only a single multiplexing in a large number of multiplexings).
[0205] As another optional embodiment of the application, a message channel diagnosis method is provided for the embodiment 4 of the application, which can include but is not limited to the following steps:
[0206] Step S401, defining variables J, num1, T1, T2, A2, B, m1, m2, num2, C, array and M, wherein M is the number of messages in the initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps and T2 = T1 x (M-num1).
[0207] Step S402, every T2, selecting an unexamined value in a first range for m1, taking the message corresponding to m1 as the current message to be searched, and reading the channel number value matched with the current message to be searched and assigning it to B; the first range includes J to M-1.
[0208] Step S403, for B, every T1, selecting an unexamined value in a second range for m2, reading the channel number value matched with the message corresponding to m2 and assigning it to A2; the second range includes num1+J to M.
[0209] Step S404, comparing whether the values of A2 and B are equal.
[0210] If yes, step S405 is performed.
[0211] Step S405, the num2 is increased by 1.
[0212] Step S406, when the comparison of all values in the second range is completed, the num1 is increased by 1.
[0213] Step S407, if the num2 is equal to 1, the value of B is assigned to C, and the m1 and the m2 are stored in the array.
[0214] The detailed process of steps S401-S407 can refer to the relevant introduction of steps S201-S207 in embodiment 2, which will not be repeated here.
[0215] Step S408, multiplexing the M and the T1.
[0216] Step S409, defining at least one of variable A1 and ByteT1 and variable F, the variable F is initialized to 1.
[0217] Step S410, every T1, the F is increased by 1, and at least one of the following is performed:
[0218] Reading the channel number value matched by the packet corresponding to F, and assigning the channel number value matched by the packet corresponding to F to A1;
[0219] Reading the content of the packet corresponding to F, and assigning the content of the packet corresponding to F to ByteT1.
[0220] The value of F does not exceed the M.
[0221] In this embodiment, by increasing F by 1 every T1, F becomes a dynamic index that increases dynamically. Depending on the dynamic index F, data can be extracted in order, without the need to store a large amount of original packet data in the monitoring system, thereby saving a large amount of storage space. This makes it possible to effectively monitor a large number of packet values even in a resource-limited environment.
[0222] When a service has a problem or needs to be repaired, by looking at or analyzing the variable A1 (channel number value) and / or ByteT1 (packet content), the specific packet or channel where the problem occurs can be quickly located, thereby greatly simplifying the process of troubleshooting and diagnosis.
[0223] In this embodiment, steps S408-S410 can also be performed after step S307 in embodiment 3.
[0224] As another optional embodiment of the present application, a packet channel diagnosis method is provided for the embodiment 5 of the present application. The method can include, but is not limited to, the following steps:
[0225] In step S501, variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array and M are defined, where M is the number of packets in the initial packet set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps and T2=T1×(M-num1).
[0226] In step S502, every T2, an unexamined value in a first range is selected as m1, the packet corresponding to m1 is taken as a current packet to be examined, and the channel number value matched by the current packet to be examined is taken as B; the first range includes J to M-1.
[0227] In step S503, every T1, an unexamined value in a second range is selected as m2 for B, and the channel number value matched by the packet corresponding to m2 is taken as A2; the second range includes num1+J to M.
[0228] In step S504, A2 and B are compared.
[0229] If A2 and B are equal, step S505 is performed.
[0230] In step S505, num2 is increased by 1.
[0231] In step S506, when the comparison of all values in the second range is completed, num1 is increased by 1.
[0232] In step S507, if num2 is equal to 1, the value of B is taken as C, and m1 and m2 are stored in the array.
[0233] The detailed process of steps S501-S507 can refer to the related description of steps S201-S207 in embodiment 2, which will not be repeated here.
[0234] In step S508, M is multiplexed.
[0235] In step S509, at least one of variables A1 and ByteT1 and variable F are defined, and one of values from 1 to M is taken as F.
[0236] In the present embodiment, one of values from 1 to M can be taken as F according to needs, which is not limited here.
[0237] Step S510: Read the channel number value of the message matching corresponding to F, and assign the channel number value of the message matching corresponding to F to A1.
[0238] Step S511: Read the content of the message corresponding to F, and assign the content of the message corresponding to F to ByteT1.
[0239] In this embodiment, by defining at least one of variables A1 and ByteT1 and a variable F, and assigning a value from 1 to M to the variable F, the channel number and content of any message can be quickly located and obtained, avoiding the need to check or traverse all messages one by one to find a specific message, thereby saving a lot of monitoring space and processing time.
[0240] This indexing mechanism makes data access more efficient and flexible, and is particularly suitable for application scenarios that require frequent reverse query of the correspondence between messages and channels, such as network communications and data processing systems.
[0241] Next, the message channel diagnostic device provided by the present application is introduced. The message channel diagnostic device introduced below and the message channel diagnostic method introduced above can refer to each other.
[0242] Reference Figure 4 The message channel diagnostic device includes: a first processing module 100, a second processing module 200 and a third processing module 300.
[0243] The first processing module 100 is configured to select, at a first time interval, an unchecked message from the set of messages to be checked as a current message to be checked, and read a channel number value matched by the current message to be checked; the set of messages to be checked is determined based on the initial message set and the starting message to be checked;
[0244] The second processing module 200 is configured to:
[0245] For the channel number value matched by the current message to be checked, every second time duration, selecting an uncompared target message in the target message set and reading the channel number value matched by the target message; the target message set includes: all messages in the initial message set except the current message to be checked and messages previously checked as messages to be checked; the first time duration is not less than the time duration required to complete the comparison of all messages in the target message set;
[0246] Compare the target message and the channel number value of the current message to be checked to see if they match;
[0247] If there is a match, the number of matches is accumulated;
[0248] When the comparison of all the messages in the target message set is completed, the current message under examination is marked as having been examined as a message under examination;
[0249] The recording module 300 is configured to record the channel number value as a target channel number value when the number of matches is equal to 1, and record a message number value of the target message and a message number value of the current message under examination.
[0250] The message channel diagnosis apparatus can further include:
[0251] The first defining module is configured to define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array, and M, where M is the number of messages in an initial message set, num1 is initialized to 1, num2 is initialized to 0, J is initialized to 1, T1 and T2 are time steps and T2 = T1 × (M-num1);
[0252] The first processing module 100 can be specifically configured to: every T2, select an unexamined value in a first range to assign to m1, take the message corresponding to m1 as a current message under examination, and read a channel number value matched by the current message under examination to assign to B; the first range includes J to M-1.
[0253] The second processing module 200 can be specifically configured to: every T1, select an unexamined value in a second range to assign to m2 for the B, and read a channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M.
[0254] The second processing module 200 can be specifically configured to: every T1, select an unexamined value in a second range to assign to m2 for the B, and read a channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M.
[0255] The second processing module 200 can be specifically configured to: every T1, select an unexamined value in a second range to assign to m2 for the B, and read a channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M.
[0256] The second processing module 200 can be specifically configured to: every T1, select an unexamined value in a second range to assign to m2 for the B, and read a channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M.
[0257] The second processing module 200 can be specifically configured to: every T1, select an unexamined value in a second range to assign to m2 for the B, and read a channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M.
[0258] If the A2 and the B are equal, the num2 is increased by 1.
[0259] The second processing module 200 can be specifically configured to: every T1, select an unexamined value in a second range to assign to m2 for the B, and read a channel number value matched by the message corresponding to m2 to assign to A2; the second range includes num1+J to M.
[0260] When the comparison of all values in the second range is completed, then the num1 is increased by 1;
[0261] The recording module 300, in particular, can be used to assign the value of the B to the C if the num2 is equal to 1, and store the m1 and the m2 to the array.
[0262] The message channel diagnosis device can further include:
[0263] A second defining module is configured to define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array, and M, wherein M is the number of messages in an initial message set, num1 is initialized to 1, num2 is initialized to 0, J is initialized to one of 2 to M, T1 and T2 are time steps and T2 = T1 x (M-num1);
[0264] The first processing module 100, in particular, can be used to select an unchecked value in a first range to assign to the m1 every T2, take the message number value of the message corresponding to the m1 as the current message to be checked, and read the channel number value matched by the current message to be checked to assign to the B; the first range includes J to M and 1 to J-2.
[0265] The second processing module 200, for the channel number value matched by the current message to be checked, can be used to select an unchecked target message in the target message set every second time length, read the channel number value matched by the target message, and the process can include:
[0266] For the B, select an unchecked value in a second range to assign to the m2 every T1, and read the channel number value matched by the message corresponding to the m2 to assign to the A2; the second range includes num1+J to M and 1 to J-1.
[0267] The second processing module 200, in particular, can be used to compare the channel number values matched by the target message and the current message to be checked, and the process can include:
[0268] The second processing module 200, in particular, can be used to compare the values of the A2 and the B, and the process can include:
[0269] The second processing module 200, in particular, can be used to accumulate the matching times if the values of the A2 and the B are equal, and the process can include:
[0270] If the values are equal, then the num2 is increased by 1;
[0271] The second processing module 200 marks the current to-be-inspected packet as having been inspected as a to-be-inspected packet when the comparison of all packets in the target packet set is completed, and specifically can include:
[0272] When the comparison of all values in the second range is completed, the num1 is increased by 1.
[0273] The recording module 300 can specifically be used for assigning the value of the B to the C and storing the m1 and the m2 in association to the array if the num2 is equal to 1.
[0274] The packet channel diagnosis apparatus can further include:
[0275] The third processing module is used for:
[0276] Multiplying the M and the T1;
[0277] Defining at least one of a variable A1 and ByteT1 and a variable F, and initializing the variable F as 1;
[0278] Every T1, the F is increased by 1, and at least one of the following is performed:
[0279] Reading a channel number value matched by the packet corresponding to the F and outputting the channel number value matched by the packet corresponding to the F;
[0280] Reading content of the packet corresponding to the F and outputting the content of the packet corresponding to the F.
[0281] The packet channel diagnosis apparatus can further include:
[0282] The fourth processing module is used for:
[0283] Multiplying the M;
[0284] Defining at least one of a variable A1 and ByteT1 and a variable F, and assigning one of 1 to M to the variable F;
[0285] Reading a channel number value matched by the packet corresponding to the F and assigning the channel number value matched by the packet corresponding to the F to A1;
[0286] Reading content of the packet corresponding to the F and assigning the content of the packet corresponding to the F to ByteT1.
[0287] In addition, it should be noted that the apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment. In addition, the connection relationship between the modules in the apparatus embodiments provided in the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.
[0288] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and the necessary universal hardware, and of course can also be realized by special hardware including special integrated circuits, special CPUs, special memories, special components and the like. Generally, functions completed by computer programs can be easily realized by corresponding hardware, and the specific hardware structure for realizing the same function can also be various, such as analog circuit, digital circuit or special circuit. However, for the present application, software program implementation is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products, which are stored in readable storage media, such as computer floppy disks, U disks, mobile hard disks, ROM, RAM, magnetic or optical disks, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a training device, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0289] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, it can be realized in the form of a computer program product in whole or in part.
[0290] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
Claims
1. A method of packet path diagnosis, the method comprising: The method comprises the following steps: Every first time length, a message in a message set to be checked is selected as a current message to be checked, and a channel number value matched with the current message to be checked is read; the message set to be checked is determined based on an initial message set and a starting message to be checked; Every second time length, a target message in a target message set is selected, and a channel number value matched with the target message is read; The target message set comprises all messages in the initial message set except the current message to be checked and messages that have been checked as messages to be checked; Whether the channel number value matched with the target message and the channel number value matched with the current message to be checked are matched is compared; If matched, a matching number is accumulated; When the comparison of all messages in the target message set is completed, the current message to be checked is marked as having been checked as a message to be checked; the first time length is not less than a time length required for completing the comparison of all messages in the target message set; When the matching number is equal to 1, the channel number value is recorded as a target channel number value, a message number value of the target message and a message number value of the current message to be checked.
2. The method of claim 1, wherein, The method further comprises the following steps: Variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array and M are defined, wherein M is the number of messages in the initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps and T2=T1×(M-num1); Every first time length, a message in a message set to be checked is selected as a current message to be checked, and a channel number value matched with the current message to be checked is read; the message set to be checked is determined based on an initial message set and a starting message to be checked; Every T2, a value in a first range is selected as m1, a message corresponding to m1 is selected as a current message to be checked, and a channel number value matched with the current message to be checked is read and assigned to B; the first range comprises J to M-1; Every second time length, a target message in a target message set is selected, and a channel number value matched with the target message is read; Every T1, a value in a second range is selected as m2, and a channel number value matched with a message corresponding to m2 is read and assigned to A2; the second range comprises num1+J to M; Whether the channel number value matched with the target message and the channel number value matched with the current message to be checked are matched is compared; Whether A2 and B are equal is compared; If matched, a matching number is accumulated; If equal, num2 is increased by 1; When the comparison of all messages in the target message set is completed, the current message to be checked is marked as having been checked as a message to be checked; When the comparison of all values in the second range is completed, num1 is increased by 1; When the matching number is equal to 1, record the channel number value as a target channel number value, and the message number value of the target message and the message number value of the current message to be checked, comprising: If the num2 is equal to 1, assign the value of the B to the C, and store the m1 and the m2 in the array.
3. The method of claim 1, wherein, The message channel diagnosis method further comprises: Define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, array and M, wherein M is the number of messages in the initial message set, num1 is initialized to 1, num2 is initialized to 0, J is initialized to one of 2 to M, T1 and T2 are time steps and T2 = T1 x (M-num1); Every first time interval, select one unexamined message in the message set to be checked as a current message to be checked, read the channel number value matched by the current message to be checked, comprising: Every T2, select one unexamined value in the first range and assign it to the m1, take the message corresponding to the m1 as the message number value of the current message to be checked, read the channel number value matched by the current message to be checked and assign it to the B; the first range comprises J to M and 1 to J-2; For the channel number value matched by the current message to be checked, every second time interval, select one unexamined target message in the target message set, read the channel number value matched by the target message, comprising: For the B, every T1, select one unexamined value in the second range and assign it to the m2, read the channel number value matched by the message corresponding to the m2 and assign it to the A2; the second range comprises: num1+J to M and 1 to J-1; Compare whether the channel number values matched by the target message and the current message to be checked match, comprising: Compare whether the values of the A2 and the B are equal; If they match, accumulate the matching number, comprising: If they are equal, the num2 increases by 1; When the comparison of all messages in the target message set is completed, mark the current message to be checked as having been examined, comprising: When the comparison of all values in the second range is completed, the num1 increases by 1; When the matching number is equal to 1, record the channel number value as a target channel number value, and the message number value of the target message and the message number value of the current message to be checked, comprising: If the num2 is equal to 1, assign the value of the B to the C, and store the m1 and the m2 in the array.
4. The message path diagnostic method according to claim 2 or 3, characterized by, The message channel diagnosis method further comprises: Reuse the M and the T1; Define at least one of variables A1 and ByteT1 and variable F, and initialize the variable F to 1; Every T1, increase the F by 1, and perform at least one of the following: Read the channel number value matched by the message corresponding to the F, and output the channel number value matched by the message corresponding to the F; Read the content of the message corresponding to the F, and output the content of the message corresponding to the F.
5. The message path diagnostic method according to claim 2 or 3, characterized by, The message channel diagnosis method further comprises: Reuse the M; defining at least one of a variable A1 and ByteT1 and a variable F, and assigning one of values from 1 to M to the variable F; reading a channel number value matched by the message corresponding to the variable F, and assigning the channel number value matched by the message corresponding to the variable F to the variable A1; reading content of the message corresponding to the variable F, and assigning the content of the message corresponding to the variable F to the variable ByteT1.
6. A message path diagnostic apparatus characterized by comprising: comprise: a first processing module, configured to select an unexamined message from a set of to-be-checked messages as a current to-be-checked message every first time length, and read a channel number value matched by the current to-be-checked message; the set of to-be-checked messages is determined based on an initial message set and a starting to-be-checked message; a second processing module, configured to: select an unexamined target message from a set of target messages every second time length according to the channel number value matched by the current to-be-checked message, and read a channel number value matched by the target message; the set of target messages comprises all messages in the initial message set except the current to-be-checked message and messages that have been examined as to-be-checked messages; compare the channel number values matched by the target message and the current to-be-checked message; if the channel number values matched by the target message and the current to-be-checked message are matched, accumulate a matching number; when comparison of all messages in the set of target messages is completed, mark the current to-be-checked message as having been examined as a to-be-checked message; the first time length is not less than a time length required for completing the comparison of all messages in the set of target messages; a recording module, configured to record, when the matching number is equal to 1, the channel number value as a target channel number value, a message number value of the target message, and a message number value of the current to-be-checked message.
7. The message path diagnostic apparatus according to claim 6, wherein The message channel diagnosis apparatus further comprises: a first defining module, configured to define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array, and M, wherein M is a number of messages in an initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as 1, T1 and T2 are time steps and T2=T1×(M-num1); the first processing module is specifically configured to: select an unexamined value in a first range every T2, assign the unexamined value to the m1, take a message corresponding to the m1 as a current to-be-checked message, and assign a channel number value matched by the current to-be-checked message to the B; the first range comprises J to M-1; the process that the second processing module selects an unexamined target message from a set of target messages every second time length according to the channel number value matched by the current to-be-checked message, and reads a channel number value matched by the target message, specifically comprises: for the B, select an unexamined value in a second range every T1, assign the unexamined value to the m2, and read a channel number value matched by a message corresponding to the m2 and assign the channel number value to the A2; the second range comprises num1+J to M; the process that the second processing module compares whether the channel number values matched by the target message and the current to-be-checked message are matched, specifically comprises: compare whether the values of the A2 and the B are equal. The second processing module accumulates the matching times if matching, and the process specifically includes: If equal, the num2 is increased by 1; The second processing module marks the current message to be checked as having been checked as a message to be checked when the comparison of all messages in the target message set is completed, and the process specifically includes: When the comparison of all values in the second range is completed, the num1 is increased by 1; The recording module is specifically configured to assign the value of the B to the C if the num2 is equal to 1, and store the m1 and the m2 in association to the array.
8. The message path diagnostic apparatus of claim 6, wherein The message channel diagnosis device further includes: The second defining module is configured to define variables J, num1, T1, T2, A2, B, m1, m2, num2, C, an array and M, wherein M is the number of messages in an initial message set, num1 is initialized as 1, num2 is initialized as 0, J is initialized as one of 2 to M, T1 and T2 are time steps and T2=T1×(M-num1); The first processing module is specifically configured to select one unchecked value in a first range as the m1 every T2, assign the message number value of the message corresponding to the m1 as the current message to be checked, and assign the channel number value matched by the current message to be checked to the B; the first range includes J to M and 1 to J-2; The second processing module selects one unchecked target message in the target message set every second time length for the channel number value matched by the current message to be checked, and reads the channel number value matched by the target message, and the process specifically includes: For the B, one unchecked value in a second range is selected as the m2 every T1, and the channel number value matched by the message corresponding to the m2 is assigned to the A2; the second range includes num1+J to M and 1 to J-1; The second processing module compares whether the channel number values matched by the target message and the current message to be checked are matched, and the process specifically includes: The second processing module compares whether the values of the A2 and the B are equal, and the process specifically includes: The second processing module accumulates the matching times if matching, and the process specifically includes: If equal, the num2 is increased by 1; The second processing module marks the current message to be checked as having been checked as a message to be checked when the comparison of all messages in the target message set is completed, and the process specifically includes: When the comparison of all values in the second range is completed, the num1 is increased by 1; The recording module is specifically configured to assign the value of the B to the C if the num2 is equal to 1, and store the m1 and the m2 in association to the array.
9. The message path diagnostic apparatus according to claim 7 or 8, characterized by The message channel diagnosis device further includes: The third processing module is configured to: multiplex the M and the T1; define at least one of variables A1 and ByteT1 and a variable F, wherein the variable F is initialized as 1; every T1, increase the F by 1, and perform at least one of the following: reading the channel number value matched by the packet corresponding to the F, and outputting the channel number value matched by the packet corresponding to the F; reading the content of the packet corresponding to the F, and outputting the content of the packet corresponding to the F.
10. The message path diagnostic apparatus according to claim 7 or 8, characterized by The packet channel diagnosis device further comprises: The fourth processing module is used for: multiplexing the M; defining at least one of a variable A1 and ByteT1 and a variable F, and assigning one of 1 to M to the variable F; reading the channel number value matched by the packet corresponding to the F, and assigning the channel number value matched by the packet corresponding to the F to A1; reading the content of the packet corresponding to the F, and assigning the content of the packet corresponding to the F to ByteT1.
Citation Information
Patent Citations
Message forwarding method and device
CN115225620A
Method and device for determining fault of message transmission path
CN115913910A