Abnormal controller determination method and device, vehicle, and computer-readable storage medium
By sending target messages to the target controller on the CAN bus and receiving responses from other controllers for verification, the problem of not being able to identify abnormal controllers in the prior art is solved, and accurate identification of abnormal controllers on the CAN bus is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DEEPAL AUTOMOBILE TECH CO LTD
- Filing Date
- 2023-10-24
- Publication Date
- 2026-07-21
AI Technical Summary
Existing CAN bus anomaly diagnosis methods can only determine whether an anomaly exists in the CAN bus, but cannot identify the specific anomaly controller.
By sending a target message to the target controller on the CAN bus and receiving and verifying the responses of other controllers within a predetermined time period, the abnormal controller is determined based on the verification results and response time.
It can accurately identify controllers that malfunction in the CAN bus, improving the accuracy and efficiency of anomaly diagnosis.
Smart Images

Figure CN117250941B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and more particularly to the field of vehicle bus communication, specifically to an abnormal controller determination method, device, vehicle, and computer-readable storage medium. Background Technology
[0002] To diagnose anomalies in a vehicle's Controller Area Network (CAN) bus, existing solutions typically involve collecting the CAN high and CAN low voltages and then determining if there are any anomalies in the CAN bus.
[0003] This solution can only determine whether there is an anomaly on the CAN bus, but it cannot identify the controller in the CAN bus that is experiencing an anomaly. Summary of the Invention
[0004] One of the objectives of this invention is to provide a method, apparatus, vehicle, and computer-readable storage medium for determining abnormal controllers, which can identify controllers that have malfunctioned in the CAN bus.
[0005] In a first aspect, a method for determining an abnormal controller is provided. The method includes: sending a first request message to a target controller among multiple controllers on a CAN bus; the first request message is used to request the target controller to send a target message; receiving a first response message from the target controller, and determining the duration of a first time period and a second time period; the start time of the first time period and the start time of the second time period are the times when the target controller receives the first request message, the end time of the first time period is the time when the target controller sends the first data frame of the message in the first response message, and the end time of the second time period is the time when the target controller sends the last data frame of the message in the first response message. The message is used to indicate that the target message has been sent; if the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, a second request message is sent to each of the remaining controllers; the remaining controllers are the controllers other than the target controller among multiple controllers, and the second request message is used to request verification of the received message; the second response message is received from each controller; the second response message is used to indicate the verification result of the controller's verification of the received message; if the first verification result is not found among the verification results indicated by multiple second response messages, the target controller is determined to be an abnormal controller; the first verification result is used to indicate that the received message is consistent with the target message.
[0006] Based on this scheme, the present application's scheme enables the target controller to send a target message. If the duration of the first time period is less than a first threshold and the duration of the second time period is less than a second threshold, other controllers will verify the received message and obtain multiple verification results. If there is no first verification result indicating that the received message is consistent with the target message, it indicates that the message sent by the target controller is an incorrect target message, and the target controller has malfunctioned, thereby identifying the controller that malfunctioned in the CAN bus.
[0007] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: when a first verification result and a second verification result exist among multiple verification results, determining the controller corresponding to the second verification result as an abnormal controller; the second verification result is used to indicate that the received message is inconsistent with the target message.
[0008] Based on this scheme, since there is a first verification result among the multiple verification results indicating that the received message is inconsistent with the target message, it means that the message sent by the target controller is a correct target message. In this case, if there is a second verification result among the multiple verification results indicating that the received message is inconsistent with the target message, it means that the controller corresponding to the second verification result made an error in the process of verifying the message. The controller corresponding to the second verification result is an abnormal controller, thus identifying the abnormal controller in the CAN bus.
[0009] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: determining the duration of a third time period corresponding to each of the plurality of second response messages; the start time of the third time period is the time when the second request message is sent, and the end time of the third time period is the time when the second response message is received; determining the controller corresponding to the target second response message among the plurality of second response messages as an abnormal controller; and the duration of the third time period corresponding to the target second response message is greater than a third threshold.
[0010] Based on this scheme, by determining the duration of the third time period corresponding to each of the multiple second response messages, since the duration of the third time period corresponding to the target second response message is greater than the third threshold, it indicates that the controller that sent the target second response message is abnormal, causing the controller to respond slowly. Therefore, the controller corresponding to the target second response message is identified as the abnormal controller, and the abnormal controller in the CAN bus can be identified.
[0011] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: determining the target controller as an abnormal controller if the duration of the first time period is not less than a first threshold and / or the duration of the second time period is not less than a second threshold.
[0012] Based on this scheme, if the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, it indicates that the target controller is abnormal, causing the target controller to respond slowly. Therefore, the target controller is identified as the abnormal controller, which can identify the abnormal controller in the CAN bus.
[0013] In conjunction with the first aspect, in some embodiments of the first aspect, the method further includes: sending a third request message to each of a plurality of controllers; the third request message is used to request a controller identifier; determining a first controller among the plurality of controllers as an abnormal controller based on at least one received third response message; the third response message includes a controller identifier, the duration of a fourth time period corresponding to the first controller is greater than a fourth threshold, or the first controller is a controller whose third response message has not been received, the start time of the fourth time period is the time when the third request message is sent, and the end time of the fourth time period is the time when the third response message is received.
[0014] Based on this scheme, by sending a third request message requesting the controller identifier to each of the multiple controllers and receiving a third response message from each controller, on the one hand, since the duration of the third time period corresponding to the first controller is greater than the third threshold, or the first controller is a controller whose third response message has not been received, it indicates that the first controller is abnormal, causing its response to be slow or unresponsive. Therefore, the first controller is identified as an abnormal controller, thus identifying the abnormal controller in the CAN bus. On the other hand, the controller identifier of each controller can be obtained, so that messages can be sent to the controller subsequently.
[0015] Secondly, an anomaly controller determination apparatus is provided for implementing the anomaly controller determination method of the first aspect described above. The anomaly controller determination apparatus includes modules, units, or means corresponding to the above method. These modules, units, or means can be implemented in hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0016] In conjunction with the second aspect, in some embodiments of the second aspect, the anomaly controller determination device includes: a transceiver module and a processing module; the transceiver module is used to send a first request message to a target controller among multiple controllers on the CAN bus; the first request message is used to request the target controller to send a target message; the processing module is used to receive a first response message from the target controller and determine the duration of a first time period and a second time period; the start time of the first time period and the start time of the second time period are the times when the target controller receives the first request message, the end time of the first time period is the time when the target controller sends the first data frame of the message in the first response message, and the end time of the second time period is the time when the target controller sends the last data frame of the message in the first response message. The first response message is used to indicate that the target message has been sent; the transceiver module is further used to send a second request message to each of the remaining controllers when the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold; the remaining controllers are controllers other than the target controller among multiple controllers, and the second request message is used to request verification of the received message; the transceiver module is further used to receive the second response message from each controller; the second response message is used to indicate the verification result of the controller in verifying the received message; the processing module is further used to determine that the target controller is an abnormal controller when there is no first verification result among the verification results indicated by multiple second response messages; the first verification result is used to indicate that the received message is consistent with the target message.
[0017] In conjunction with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: determine the controller corresponding to the second verification result as an abnormal controller when a first verification result and a second verification result exist among multiple verification results; the second verification result is used to indicate that the received message is inconsistent with the target message.
[0018] In conjunction with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: determine the duration of a third time period corresponding to each of the plurality of second response messages; the start time of the third time period is the time when the second request message is sent, and the end time of the third time period is the time when the second response message is received; determine the controller corresponding to the target second response message among the plurality of second response messages as an abnormal controller; and the duration of the third time period corresponding to the target second response message is greater than a third threshold.
[0019] In conjunction with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: determine the target controller as an abnormal controller if the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold.
[0020] In conjunction with the second aspect, in some embodiments of the second aspect, the processing module is further configured to: send a third request message to each of the plurality of controllers; the third request message is used to request a controller identifier; determine a first controller among the plurality of controllers as an abnormal controller based on at least one received third response message; the third response message includes a controller identifier, the duration of a fourth time period corresponding to the first controller is greater than a fourth threshold, or the first controller is a controller whose third response message has not been received, the start time of the fourth time period is the time when the third request message is sent, and the end time of the fourth time period is the time when the third response message is received.
[0021] Thirdly, an anomaly controller determination apparatus is provided, comprising: at least one processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the method provided by the first aspect and any possible implementation thereof.
[0022] Fourthly, a computer-readable storage medium is provided, which, when the instructions in the computer-readable storage medium are executed by the processor of an anomaly controller determining device, enables the anomaly controller determining device to perform the method provided by the first aspect and any possible implementation thereof.
[0023] Fifthly, a computer program product containing instructions is provided that, when run on a computer, enables the computer to perform the methods provided in the first aspect and any possible implementation thereof.
[0024] In a sixth aspect, a chip system is provided, comprising: a processor and an interface circuit; the interface circuit being configured to receive a computer program or instructions and transmit them to the processor; the processor being configured to execute the computer program or instructions to cause the chip system to perform the methods provided in the first aspect and any of its possible embodiments.
[0025] In a seventh aspect, a vehicle is provided, including the anomaly controller determination device provided in the third aspect above.
[0026] Therefore, the above-mentioned technical features of this application have the following beneficial effects:
[0027] (1) By having the target controller send a target message, and when the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, a second request message is sent to each of the remaining controllers to request verification of the received message. After receiving multiple second response messages, if there is no first verification result among the verification results indicated by the multiple second response messages, the target controller is determined to be an abnormal controller. Compared with the existing scheme of collecting the CAN high and CAN low voltages of the CAN bus and then determining whether there is an abnormality in the CAN bus, the scheme of this application, by having the target controller send a target message, and when the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, allows other controllers to verify the received message and obtain multiple verification results. If there is no first verification result indicating that the received message is consistent with the target message, it is said that the message sent by the target controller is an incorrect target message, and the target controller has become abnormal, thereby identifying the abnormal controller in the CAN bus.
[0028] (2) Because there is a first verification result among the multiple verification results that indicates that the received message is inconsistent with the target message, it means that the message sent by the target controller is a correct target message. In this case, if there is a second verification result among the multiple verification results that indicates that the received message is inconsistent with the target message, it means that the controller corresponding to the second verification result made an error in the process of verifying the message. The controller corresponding to the second verification result is an abnormal controller, thus identifying the abnormal controller in the CAN bus.
[0029] (3) By determining the duration of the third time period corresponding to each of the multiple second response messages, since the duration of the third time period corresponding to the target second response message is greater than the third threshold, it indicates that the controller that sent the target second response message is abnormal, causing the controller to respond slowly. Therefore, the controller corresponding to the target second response message is identified as the abnormal controller, and the abnormal controller in the CAN bus can be identified.
[0030] (4) If the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, it indicates that the target controller is abnormal, causing the target controller to respond slowly. Therefore, the target controller is identified as the abnormal controller, and the abnormal controller in the CAN bus can be identified.
[0031] (5) By sending a third request message to each of the multiple controllers to request the controller identifier and receiving a third response message from each controller, on the one hand, since the duration of the third time period corresponding to the first controller is greater than the third threshold, or the first controller is a controller whose third response message has not been received, it indicates that the first controller is abnormal, causing the first controller to respond slowly or not at all. Therefore, the first controller is identified as an abnormal controller, and the abnormal controller in the CAN bus can be identified. On the other hand, the controller identifier of each controller can be obtained so that messages can be sent to the controller in the future.
[0032] The technical effects of any one of the second to seventh aspects can be found in the technical effects of the different embodiments of the first aspect described above, and will not be repeated here.
[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.
[0035] Figure 1 This is a schematic diagram of the architecture of an anomaly controller determination system provided in an embodiment of this application;
[0036] Figure 2 A flowchart illustrating an abnormal controller determination method provided in an embodiment of this application;
[0037] Figure 3 A flowchart illustrating another method for determining an exception controller provided in this application embodiment;
[0038] Figure 4 A flowchart illustrating another method for determining an exception controller provided in this application embodiment;
[0039] Figure 5 A flowchart illustrating another method for determining an exception controller provided in this application embodiment;
[0040] Figure 6 This is a schematic diagram of the structure of an anomaly controller determination device provided in an embodiment of this application;
[0041] Figure 7 This is a schematic diagram of another anomaly controller determination device provided in an embodiment of this application. Detailed Implementation
[0042] In the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0043] Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0044] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being better or more advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.
[0045] It is understood that the term "embodiment" used throughout the specification means that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, various embodiments throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0046] It is understood that in this application, "when," "if," and "if" all refer to the corresponding processing that will be carried out under certain objective circumstances, and are not limited to a specific time, nor do they require that there must be a judgment action when implemented, nor do they imply any other limitations.
[0047] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Correspondingly, the apparatus given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.
[0048] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referred to each other. In the various embodiments and implementation methods of the various embodiments in this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments and between the implementation methods of the various embodiments are consistent and can be mutually referenced. The technical features in different embodiments and between the implementation methods of the various embodiments can be combined according to their inherent logical relationships to form new embodiments, implementation methods, implementation methods, or implementation approaches. The following embodiments of this application do not constitute a limitation on the scope of protection of this application.
[0049] Figure 1 This is a schematic diagram of the architecture of an anomaly controller determination system provided in this application. The technical solutions of the embodiments of this application can be applied to... Figure 1 The anomaly controller shown determines the system, such as Figure 1 As shown, the anomaly controller determination system 10 includes an anomaly controller determination device 11, multiple controllers 12, and a CAN bus 13.
[0050] The anomaly controller determination device 11 and each controller 12 are respectively connected to the CAN bus 13 for communication.
[0051] In practical applications, the abnormal controller determination method provided in this application embodiment can be applied to the abnormal controller determination device 11, or to the devices included in the abnormal controller determination device 11.
[0052] The abnormal controller determination method provided in this application embodiment will be described below with reference to the accompanying drawings, taking the application of the abnormal controller determination method to the abnormal controller determination device 11 as an example.
[0053] Figure 2 This application provides a flowchart illustrating a method for determining an anomaly controller. Figure 2 As shown, the method includes the following steps:
[0054] S201, The abnormal controller determination device sends a first request message to the target controller among multiple controllers on the CAN bus.
[0055] The first request message is used to request the target controller to send the target message.
[0056] It should be noted that the target message can also be called a routine for troubleshooting bus communication anomalies.
[0057] The target message may include multiple data frames, each of which may contain regular content, such as the same number in each data frame. The last data frame contains content indicating that the target message has been sent.
[0058] As an example, the target message could be 0000 1111 2222 0000 1111 2222FFFF.
[0059] In this example, the target message consists of 7 data frames. The first data frame contains 4 zeros, the second data frame contains 4 ones, the third data frame contains 4 twos, the fourth data frame contains 4 zeros, the fifth data frame contains 4 ones, the sixth data frame contains 4 twos, and the sixth data frame contains 4 Fs. The 4 Fs are used to indicate that the target message has been sent.
[0060] The length of the target message can be matched with the controller's communication protocol.
[0061] As an example, when the controller's communication protocol is Controller Area Network Flexible Data (CANFD), the length of the target message can be 5120 bits, that is, the target message includes 10 frames of CANFD messages with a data length code (DLC) of 64.
[0062] As another example, when the controller's communication protocol is CAN, the length of the target message can be 6400 bits, that is, the target message includes 100 frames of CAN messages with DLC 8.
[0063] As one possible implementation, the anomaly controller determination device encapsulates the controller identifier of the target controller and the first indication information for requesting the target controller to send a target message to obtain a first request message. Then, the first request message is sent to the target controller via the CAN bus in the form of Unified Diagnostic Services (UDS) on CAN or UDS on CANFD.
[0064] It should be noted that the specific method of encapsulating information in this possible implementation can refer to existing solutions, and will not be described in this application.
[0065] S202, the anomaly controller determination device receives the first response message from the target controller and determines the duration of the first time period and the duration of the second time period.
[0066] The start time of the first time period and the start time of the second time period are the times when the target controller receives the first request message, the end time of the first time period is the time when the target controller sends the first data frame of the message in the first response message, and the end time of the second time period is the time when the target controller sends the last data frame of the message in the first response message. The first response message is used to indicate that the target message has been sent.
[0067] It should be noted that the first response message may include the time when the target controller receives the first request message, the time when the target controller sends the first data frame of the message in the first response message, and the time when the target controller sends the last data frame of the message in the first response message.
[0068] As one possible implementation, after the anomaly controller determines the first time period, the duration of the time interval between the time when the target controller sends the first data frame of the message in the first response message and the time when the target controller receives the first request message is determined as the duration of the first time interval.
[0069] The anomaly controller determination device determines the duration of the second time period by the time interval between the moment when the target controller sends the last data frame of the message in the first response message and the moment when the target controller receives the first request message.
[0070] S203. If the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, the abnormal controller determines that the device sends a second request message to each of the remaining controllers.
[0071] Among them, the remaining controllers are controllers other than the target controller among multiple controllers, and the second request message is used to request verification of the received message.
[0072] It should be noted that the first threshold can be 2000 milliseconds (ms), or it can be 3000 ms; this application does not impose a specific limitation on this. The second threshold can be 3000 milliseconds (ms), or it can be 4000 ms; this application does not impose a specific limitation on this.
[0073] As one possible implementation, the anomaly controller determination device compares the duration of a first time period with a first threshold, and the duration of a second time period with a second threshold. If the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, the anomaly controller determination device encapsulates the second indication information used to request verification of the received message to obtain a second request message, and then sends the second request message to each of the remaining controllers via the CAN bus in the manner of UDS on CAN or UDS on CANFD.
[0074] It should be noted that each controller pre-stores the target messages of each of the other controllers.
[0075] The specific method of encapsulating information in this possible implementation can be found in existing solutions, and will not be described further in this application.
[0076] S204. The anomaly controller determination device receives a second response message from each controller.
[0077] The second response message is used to indicate the verification result of the received message to the controller.
[0078] It should be noted that if the received message is consistent with the target message, the verification result indicates that the received message is consistent with the target message.
[0079] For example, the verification result can be "verification passed".
[0080] If the received message is missing compared to the target message, or if the received message does not match the target message, the verification result indicates that the received message is inconsistent with the target message.
[0081] For example, the verification result could be "verification failed".
[0082] After the controller verifies the received message, it can obtain the verification result. Then, the controller sends a second response message to the anomaly controller determination device via the CAN bus. Correspondingly, the anomaly controller determination device receives the second response message from each controller.
[0083] S205. If the first verification result is not found among the verification results indicated by multiple second response messages, the abnormal controller determination device determines the target controller as a faulty abnormal controller.
[0084] The first verification result is used to indicate that the received message matches the target message. As one possible implementation, the anomaly controller determining device determines whether one of the multiple verification results is a verification result used to indicate that the received message matches the target message. If yes, the verification result is determined to be the first verification result; otherwise, it is determined to be the second verification result.
[0085] The anomaly controller determines the type of each verification result by performing the above processing procedure.
[0086] The abnormal controller determination device determines whether a first verification result exists among multiple verification results. If it does, the target controller is determined to be an abnormal controller; otherwise, the target controller is determined not to be an abnormal controller.
[0087] Based on this scheme, by having the target controller send a target message, and if the duration of the first time period is less than a first threshold and the duration of the second time period is less than a second threshold, a second request message is sent to each of the remaining controllers to request verification of the received message. After receiving multiple second response messages, if the first verification result is not found among the verification results indicated by the multiple second response messages, the target controller is determined to be an abnormal controller. Compared with the existing scheme that collects the CAN high and CAN low voltages of the CAN bus and then determines whether the CAN bus is abnormal, the scheme of this application, by having the target controller send a target message, and if the duration of the first time period is less than a first threshold and the duration of the second time period is less than a second threshold, allows other controllers to verify the received message, obtaining multiple verification results. If the first verification result indicating that the received message matches the target message is not found, it indicates that the message sent by the target controller is an incorrect target message, and the target controller has malfunctioned, thereby identifying the abnormal controller in the CAN bus.
[0088] The above is a general description of the abnormal controller determination method provided in this application. The following will further explain the solution of this application with reference to the accompanying drawings.
[0089] In one design, after S204, the exception controller determination method provided in this application may further include the following steps:
[0090] S301. When there is a first verification result and a second verification result among multiple verification results, the abnormal controller determination device determines the controller corresponding to the second verification result as the abnormal controller.
[0091] The second verification result is used to indicate that the received message is inconsistent with the target message.
[0092] As one possible implementation, the anomaly controller determining device determines whether one of the multiple verification results is used to indicate that the received message is consistent with the target message. If yes, the verification result is determined to be the first verification result; if no, the verification result is determined to be the second verification result.
[0093] The anomaly controller determines the type of each verification result by performing the above processing procedure.
[0094] The abnormal controller determination device determines the controller corresponding to the second verification result as the abnormal controller.
[0095] Based on this scheme, since there is a first verification result among the multiple verification results indicating that the received message is inconsistent with the target message, it means that the message sent by the target controller is a correct target message. In this case, if there is a second verification result among the multiple verification results indicating that the received message is inconsistent with the target message, it means that the controller corresponding to the second verification result made an error in the process of verifying the message. The controller corresponding to the second verification result is an abnormal controller, thus locating the controller in the CAN bus that is abnormal.
[0096] In one design, Figure 3 A flowchart illustrating another method for determining an exception controller provided in this application is shown below. Figure 3 As shown, after S204, the abnormal controller determination method provided in this application may further include the following steps:
[0097] S401, the anomaly controller determining device determines the duration of the third time period corresponding to each of the multiple second response messages.
[0098] The start time of the third time period is the time when the second request message is sent, and the end time of the third time period is the time when the second response message is received.
[0099] As one possible implementation, the anomaly controller determining device determines the duration of the time interval between the time of receiving a second response message and the time of sending a second request message as the duration of the third time interval corresponding to the second response message.
[0100] The anomaly controller determination device performs the above processing procedure for each second response message to obtain the duration of the third time period corresponding to each second response message.
[0101] S402, the abnormal controller determination device determines the controller corresponding to the target second response message among multiple second response messages as the abnormal controller.
[0102] Among them, the duration of the third time period corresponding to the second response message of the target is greater than the third threshold.
[0103] It should be noted that the third threshold can be 2000ms or 3000ms; this application does not impose any specific restrictions on it.
[0104] As one possible implementation, the anomaly controller determination device compares the duration of a third time period corresponding to a second response message with a third threshold. If the duration of the third time period is greater than the third threshold, the second response message is determined to be the target second response message. If the duration of the third time period is not greater than the third threshold, the second response message is determined not to be the target second response message.
[0105] The anomaly controller determination device performs the above processing procedure for each second response message and classifies each second response message.
[0106] The anomaly controller determination device determines the controller corresponding to the target second response message among multiple second response messages as the anomaly controller.
[0107] Based on this scheme, by determining the duration of the third time period corresponding to each of the multiple second response messages, since the duration of the third time period corresponding to the target second response message is greater than the third threshold, it indicates that the controller that sent the target second response message is abnormal, causing the controller to respond slowly. Therefore, the controller corresponding to the target second response message is identified as the abnormal controller, and the controller that is abnormal in the CAN bus can be located.
[0108] In one design, after S202, the exception controller determination method provided in this application may further include the following steps:
[0109] S501, if the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, the abnormal controller determining device determines the target controller as an abnormal controller.
[0110] As one possible implementation, the anomaly controller determination device compares the duration of a first time period with a first threshold, compares the duration of a second time period with a second threshold, and determines the target controller as an anomaly controller if the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold.
[0111] Based on this scheme, if the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, it indicates that the target controller is abnormal, causing the target controller to respond slowly. Therefore, the target controller is identified as the abnormal controller, and the controller that is abnormal in the CAN bus can be located.
[0112] In one design, Figure 4 A flowchart illustrating another method for determining an exception controller provided in this application is shown below. Figure 4 As shown, prior to S201, the abnormal controller determination method provided in this application may further include the following steps:
[0113] S601, The anomaly controller determination device sends a third request message to each of the multiple controllers.
[0114] The third request message is used to request the controller identifier.
[0115] As one possible implementation, the anomaly controller determination device encapsulates the third indication information used to request the controller identifier to obtain a third request message, and then sends the third request message to each of the multiple controllers via the CAN bus in the manner of UDS on CAN or UDS on CANFD.
[0116] It should be noted that the specific method of encapsulating information in this possible implementation can refer to existing solutions, and will not be described in this application.
[0117] S602, the abnormal controller determination device determines the first controller among a plurality of controllers as an abnormal controller based on at least one received third response message.
[0118] The third response message includes a controller identifier, the duration of the fourth time period corresponding to the first controller is greater than the fourth threshold, or the first controller is a controller whose third response message has not been received, the start time of the fourth time period is the time when the third request message is sent, and the end time of the fourth time period is the time when the third response message is received.
[0119] It should be noted that the controller identifier can be 0x781 or 0x782; this application does not impose any specific restrictions on this.
[0120] The fourth threshold can be 1000ms, or it can be 2000ms; this application does not impose any specific restrictions on it.
[0121] As one possible implementation, the anomaly controller determining device determines the duration of the time interval between the time when it receives a third response message from a controller and the time when it sends a third request message as the duration of the fourth time interval corresponding to that controller.
[0122] The anomaly controller determination device performs the above processing procedure for each third response message to obtain the duration of the fourth time period corresponding to each controller.
[0123] The abnormal controller determination device compares the duration of the fourth time period corresponding to a controller with the fourth threshold. If the duration of the fourth time period is greater than the fourth threshold, the controller is determined to be the first controller. If the duration of the fourth time period is not greater than the fourth threshold, the controller is determined not to be the first controller.
[0124] Alternatively, if the anomaly controller determination device sends a third request message and does not receive a third response message from a controller after a fourth threshold period of time, then that controller is determined to be the first controller.
[0125] The anomaly controller determination device performs the above processing procedure for each controller and classifies each controller.
[0126] Finally, the abnormal controller determination device determines the first controller among multiple controllers as the abnormal controller.
[0127] Based on this scheme, by sending a third request message requesting the controller identifier to each of the multiple controllers and receiving a third response message from each controller, on the one hand, since the duration of the third time period corresponding to the first controller is greater than the third threshold, or the first controller is a controller whose third response message has not been received, it indicates that the first controller is abnormal, causing the first controller to respond slowly or not at all. Therefore, the first controller is identified as the abnormal controller, and the controller in the CAN bus that is abnormal can be located. On the other hand, the controller identifier of each controller can be obtained so that messages can be sent to the controller in the future.
[0128] After S602, the abnormal controller determination device can determine the target controller from multiple controllers in ascending or descending order according to the size of the controller identifier of each controller, and then execute the above scheme.
[0129] In one design, Figure 5 A flowchart illustrating another method for determining an exception controller provided in this application is shown below. Figure 5 As shown, the method for determining the exception controller may include the following steps:
[0130] S701, the anomaly controller determination device sends a third request message to each of the multiple controllers.
[0131] It should be noted that the specific description of S701 can be found in the description of S601 above, and will not be repeated here.
[0132] S702, the anomaly controller determination device receives the third response message.
[0133] S703, the abnormal controller determination device determines the first controller among multiple controllers as the abnormal controller.
[0134] It should be noted that the specific description of S703 can be found in the relevant description in S602 above, and will not be repeated here.
[0135] S704, the abnormal controller determination device sends a first request message to the target controller among multiple controllers on the CAN bus.
[0136] It should be noted that the specific description of S704 can be found in the description of S201 above, and will not be repeated here.
[0137] S705, the anomaly controller determination device receives the first response message from the target controller and determines the duration of the first time period and the duration of the second time period.
[0138] It should be noted that the specific description of S705 can be found in the description of S202 above, and will not be repeated here.
[0139] S706. If the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, the abnormal controller determining device determines the target controller as an abnormal controller.
[0140] It should be noted that the specific description of S706 can be found in the description of S501 above, and will not be repeated here.
[0141] S707. If the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, the abnormal controller determining device sends a second request message to each of the remaining controllers.
[0142] It should be noted that the specific description of S707 can be found in the description of S203 above, and will not be repeated here.
[0143] S708, the anomaly controller determination device receives a second response message from each controller.
[0144] It should be noted that the specific description of S708 can be found in the description of S204 above, and will not be repeated here.
[0145] S709. When there is a first verification result and a second verification result among multiple verification results, the abnormal controller determination device determines the controller corresponding to the second verification result as the abnormal controller.
[0146] It should be noted that the specific description of S709 can be found in the description of S301 above, and will not be repeated here.
[0147] S7010, If the first verification result is not found among the verification results indicated by multiple second response messages, the abnormal controller determination device determines that the target controller is a faulty abnormal controller.
[0148] It should be noted that the specific description of S7010 can be found in the description of S205 above, and will not be repeated here.
[0149] S7011, the anomaly controller determining device determines the duration of the third time period corresponding to each of the multiple second response messages.
[0150] It should be noted that the specific description of S7011 can be found in the description of S401 above, and will not be repeated here.
[0151] S7012, the abnormal controller determination device determines the controller corresponding to the target second response message among multiple second response messages as the abnormal controller.
[0152] It should be noted that the specific description of S7012 can be found in the description of S402 above, and will not be repeated here.
[0153] The above mainly describes the solution provided by the embodiments of this application from the perspective of the anomaly controller determination method executed by the anomaly controller determination device. To achieve the above functions, the anomaly controller determination device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0154] This application embodiment can divide the anomaly controller determination device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation. Furthermore, "module" here can refer to an application-specific integrated circuit (ASIC), a circuit, a processor and memory executing one or more software or firmware programs, integrated logic circuits, and / or other devices that can provide the above functions.
[0155] When using functional module division Figure 6 A schematic diagram of an anomaly controller determination device is shown. Figure 6 As shown, the anomaly controller determination device 80 includes a transceiver module 801 and a processing module 802.
[0156] In some embodiments, the anomaly controller determination device 80 may further include a storage module ( Figure 6 (Not shown in the image) is used to store program instructions and data.
[0157] The transceiver module 801 is used to send a first request message to a target controller among multiple controllers on the CAN bus; the first request message is used to request the target controller to send a target message; the processing module 802 is used to receive a first response message from the target controller and determine the duration of a first time period and a second time period; the start time of the first time period and the start time of the second time period are the times when the target controller receives the first request message, the end time of the first time period is the time when the target controller sends the first data frame of the message in the first response message, and the end time of the second time period is the time when the target controller sends the last data frame of the message in the first response message. The first response message is used to indicate that the target message has been sent; the transceiver module... Block 801 is further configured to send a second request message to each of the remaining controllers when the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold; the remaining controllers are controllers other than the target controller among multiple controllers, and the second request message is used to request verification of the received message; transceiver module 801 is further configured to receive a second response message from each controller; the second response message is used to indicate the verification result of the controller's verification of the received message; processing module 802 is further configured to determine that the target controller is an abnormal controller when there is no first verification result among the verification results indicated by multiple second response messages; the first verification result is used to indicate that the received message is consistent with the target message.
[0158] Optionally, the processing module 802 is further configured to: determine the controller corresponding to the second verification result as an abnormal controller when there is a first verification result and a second verification result among multiple verification results; the second verification result is used to indicate that the received message is inconsistent with the target message.
[0159] Optionally, the processing module 802 is further configured to: determine the duration of a third time period corresponding to each of the multiple second response messages; the start time of the third time period is the time when the second request message is sent, and the end time of the third time period is the time when the second response message is received; determine the controller corresponding to the target second response message among the multiple second response messages as an abnormal controller; and the duration of the third time period corresponding to the target second response message is greater than a third threshold.
[0160] Optionally, the processing module 802 is further configured to: determine the target controller as an abnormal controller if the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold.
[0161] Optionally, the processing module 802 is further configured to: send a third request message to each of the plurality of controllers; the third request message is used to request a controller identifier; based on at least one received third response message, determine the first controller among the plurality of controllers as an abnormal controller; the third response message includes a controller identifier, the duration of the fourth time period corresponding to the first controller is greater than a fourth threshold, or the first controller is a controller whose third response message has not been received, the start time of the fourth time period is the time when the third request message is sent, and the end time of the fourth time period is the time when the third response message is received.
[0162] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0163] When the functions of the above modules are implemented in hardware... Figure 7 A schematic diagram of an anomaly controller determination device is shown. Figure 7 As shown, the anomaly controller determination device 90 includes a processor 901, a memory 902, and a bus 903. The processor 901 and the memory 902 can be connected via the bus 903.
[0164] Processor 901 is the control center of the anomaly controller determination device 90. It can be a single processor or a collective term for multiple processing elements. For example, processor 901 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0165] As one embodiment, processor 901 may include one or more CPUs, for example Figure 7 CPU 0 and CPU 1 are shown in the diagram.
[0166] The memory 902 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0167] As one possible implementation, the memory 902 can exist independently of the processor 901. The memory 902 can be connected to the processor 901 via a bus 903 and is used to store instructions or program code. When the processor 901 calls and executes the instructions or program code stored in the memory 902, it can implement the abnormal controller determination method provided in the embodiments of this application.
[0168] In another possible implementation, the memory 902 can also be integrated with the processor 901.
[0169] Bus 903 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0170] It should be pointed out that, Figure 7 The structure shown does not constitute a limitation on the anomaly controller determination device 90. Except... Figure 7 In addition to the components shown, the anomaly controller determination device 90 may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0171] As an example, combined Figure 6 The transceiver module 801 and processing module 802 in the anomaly controller determination device 80 perform the same functions as... Figure 7 The processor 901 in it has the same function.
[0172] Optional, such as Figure 7 As shown, the anomaly controller determination device 90 provided in this application embodiment may further include a communication interface 904.
[0173] Communication interface 904 is used to connect with other devices via a communication network. This communication network can be Ethernet, a wireless access network, a wireless local area network (WLAN), etc. Communication interface 904 may include a receiving unit for receiving data and a transmitting unit for transmitting data.
[0174] In one possible implementation, the communication interface 904 in the abnormal controller determination device 90 provided in this application embodiment can also be integrated into the processor 901, and this application embodiment does not specifically limit this.
[0175] As a possible product form, the anomaly controller determination device of this application embodiment can also be implemented using the following: one or more field programmable gate arrays (FPGAs), programmable logic devices (PLDs), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout this application.
[0176] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0177] This application embodiment also provides a vehicle including the above-described anomaly controller determination device 90.
[0178] This application also provides a computer-readable storage medium storing a computer program or instructions thereon, which, when executed, causes a computer to perform the various steps in the method flow shown in the above method embodiments.
[0179] Embodiments of this application provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the various steps in the method flow shown in the above-described method embodiments.
[0180] This application provides a chip system, including: a processor and an interface circuit; the interface circuit is used to receive computer programs or instructions and transmit them to the processor; the processor is used to execute the computer programs or instructions so that the chip system performs each step in the method flow shown in the above method embodiments.
[0181] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in a purpose-specific ASIC. In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0182] Since the anomaly controller determination device, computer-readable storage medium, and computer program product provided in this embodiment can be applied to the anomaly controller determination method provided in this embodiment, the technical effects they can achieve can also be referred to the above method embodiments. The embodiments of this application will not be repeated here.
[0183] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0184] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
Claims
1. A method for determining an abnormal controller, characterized in that, The method includes: A first request message is sent to a target controller among multiple controllers on the CAN bus; the first request message is used to request the target controller to send a target message. The system receives a first response message from the target controller and determines the duration of a first time period and a second time period. The start time of the first time period and the start time of the second time period are the times when the target controller receives the first request message. The end time of the first time period is the time when the target controller sends the first data frame of the message in the first response message. The end time of the second time period is the time when the target controller sends the last data frame of the message in the first response message. The first response message is used to indicate that the target message has been sent. If the duration of the first time period is less than the first threshold and the duration of the second time period is less than the second threshold, a second request message is sent to each of the remaining controllers; the remaining controllers are controllers other than the target controller among the plurality of controllers, and the second request message is used to request verification of the received message; Receive a second response message from each controller; the second response message is used to indicate the verification result of the controller verifying the received message; If the first verification result is not found among the verification results indicated by multiple second response messages, the target controller is determined to be an abnormal controller; the first verification result is used to indicate that the received message is consistent with the target message.
2. The method for determining an abnormal controller according to claim 1, characterized in that, The method further includes: If the first verification result and the second verification result exist among multiple verification results, the controller corresponding to the second verification result is determined to be an abnormal controller; the second verification result is used to indicate that the received message is inconsistent with the target message.
3. The method for determining an anomaly controller according to claim 1, characterized in that, The method further includes: The duration of a third time period corresponding to each of the multiple second response messages is determined; the start time of the third time period is the time when the second request message is sent, and the end time of the third time period is the time when the second response message is received. The controller corresponding to the target second response message among the plurality of second response messages is determined as the abnormal controller; the duration of the third time period corresponding to the target second response message is greater than the third threshold.
4. The method for determining an anomaly controller according to any one of claims 1-3, characterized in that, The method further includes: If the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, the target controller is determined to be an abnormal controller.
5. The method for determining an abnormal controller according to any one of claims 1-3, characterized in that, The method further includes: A third request message is sent to each of the plurality of controllers; the third request message is used to request a controller identifier; Based on at least one received third response message, the first controller among the plurality of controllers is identified as an abnormal controller; the third response message includes a controller identifier, the duration of the fourth time period corresponding to the first controller is greater than a fourth threshold, or the first controller is a controller whose third response message has not been received, the start time of the fourth time period is the time when the third request message is sent, and the end time of the fourth time period is the time when the third response message is received.
6. An anomaly controller determination device, characterized in that, The anomaly controller determination device includes: a transceiver module and a processing module; The transceiver module is used to send a first request message to a target controller among multiple controllers on the CAN bus; the first request message is used to request the target controller to send a target message. The processing module is configured to receive a first response message from the target controller and determine the duration of a first time period and a second time period; the start time of the first time period and the start time of the second time period are the times when the target controller receives the first request message, the end time of the first time period is the time when the target controller sends the first data frame of the message in the first response message, and the end time of the second time period is the time when the target controller sends the last data frame of the message in the first response message, wherein the first response message is used to indicate that the target message has been sent; The transceiver module is further configured to send a second request message to each of the remaining controllers when the duration of the first time period is less than a first threshold and the duration of the second time period is less than a second threshold; the remaining controllers are controllers other than the target controller among the plurality of controllers, and the second request message is used to request verification of the received message; The transceiver module is further configured to receive a second response message from each controller; the second response message is used to indicate the verification result of the controller verifying the received message; The processing module is further configured to determine that the target controller is an abnormal controller if the first verification result is not present among the verification results indicated by multiple second response messages; the first verification result is used to indicate that the received message is consistent with the target message.
7. The anomaly controller determination device according to claim 6, characterized in that, The processing module is further configured to: If the first verification result and the second verification result exist among multiple verification results, the controller corresponding to the second verification result is determined to be an abnormal controller; The second verification result is used to indicate that the received message is inconsistent with the target message.
8. The anomaly controller determination device according to claim 6, characterized in that, The processing module is further configured to: The duration of a third time period corresponding to each of the multiple second response messages is determined; the start time of the third time period is the time when the second request message is sent, and the end time of the third time period is the time when the second response message is received. The controller corresponding to the target second response message among the plurality of second response messages is determined as the abnormal controller; the duration of the third time period corresponding to the target second response message is greater than the third threshold.
9. The anomaly controller determination device according to any one of claims 6-8, characterized in that, The processing module is further configured to: If the duration of the first time period is not less than the first threshold and / or the duration of the second time period is not less than the second threshold, the target controller is determined to be an abnormal controller.
10. The anomaly controller determination device according to any one of claims 6-8, characterized in that, The processing module is further configured to: A third request message is sent to each of the plurality of controllers; the third request message is used to request a controller identifier; Based on at least one received third response message, the first controller among the plurality of controllers is identified as an abnormal controller; the third response message includes a controller identifier, the duration of the fourth time period corresponding to the first controller is greater than a fourth threshold, or the first controller is a controller whose third response message has not been received, the start time of the fourth time period is the time when the third request message is sent, and the end time of the fourth time period is the time when the third response message is received.
11. An anomaly controller determination device, characterized in that, The anomaly controller determination device includes: a processor coupled to a memory for storing programs or instructions, which, when executed by the processor, cause the device to perform the method as described in any one of claims 1 to 5.
12. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they cause the computer to perform the method as described in any one of claims 1 to 5.
13. A vehicle, characterized in that, Includes the anomaly controller determination device as described in claim 11.