Controller CAN bus baud rate adaptive method, controller and vehicle

By implementing the CAN bus baud rate adaptive method in the controller, the communication abnormality problem caused by the incorrect baud rate setting of the device in the CAN bus is solved, the maintenance cost is reduced, the production efficiency is improved, and the CAN bus baud rate is realized. adaptive matching.

CN118740543APending Publication Date: 2024-10-01SANY AUTOMOBILE MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410858042.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the prior art, the incorrect baud rate setting of the device in the CAN bus leads to abnormal bus communication, resulting in high maintenance costs and low production efficiency, and it is difficult to diagnose and eliminate baud rate mismatches.

Method used

By implementing the CAN bus baud rate adaptive method in the controller, the bus messages are received based on the initial controller baud rate, and the baud rate matching is verified. If the verification fails, the baud rate adaptive matching algorithm is used to update. The controller baud rate and the number of error interrupts are checked until the error interrupt number is cleared and the error interrupt number is dynamically adjusted.

Benefits of technology

It realizes the adaptive matching of the controller to the CAN bus baud rate, reduces maintenance costs, improves production efficiency, and avoids bus paralysis caused by baud rate mismatch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740543A_ABST
    Figure CN118740543A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of field bus communication, provides a controller CAN bus Baud rate self-adaption method, a controller and a vehicle, and aims to solve the problem of bus communication abnormity caused by equipment Baud rate setting errors in a CAN bus. The method comprises the following steps: firstly, receiving a bus message based on an initial controller Baud rate; performing Baud rate matching verification according to the bus message; responding to the bus message under the condition that the baud rate matching verification is passed; under the condition that baud rate matching verification is not passed, the updated controller baud rate and the error interrupt number are determined on the basis of a baud rate self-adaptive matching algorithm, iteration is repeated on the basis of the updated controller baud rate until the updated controller baud rate passes verification, the error interrupt number is reset, and the bus message is responded; the threshold value of the error interruption number is dynamically adjusted according to the number of the bus messages. The controller can adapt to the Baud rate of the bus, the maintenance cost is reduced, and the production efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of field bus communication, and in particular to a controller CAN bus baud rate self-adaptation method, a controller and a vehicle. Background Art

[0002] The CAN (Controller Area Network) bus is one of the most widely used field buses in the field of automotive electronics, and it excels in anti-electromagnetic interference, error detection, and error handling. The network topology of the vehicle's electronic and electrical architecture connects multiple controllers via the CAN bus. Once a large number of error frames appear on the bus, the CAN bus may be paralyzed, and multiple controllers may not work properly. Therefore, it is necessary to check whether the baud rate of the controller is configured correctly or use professional diagnostic tools to locate the problem to eliminate the baud rate mismatch, which greatly increases maintenance costs and affects production efficiency. Therefore, it is very necessary to enable the controller to automatically match the baud rate according to the baud rate of the CAN bus. Summary of the invention

[0003] The present invention provides a controller CAN bus baud rate self-adaptation method, a controller and a vehicle, which are used to solve the defect in the prior art that the device baud rate setting error in the CAN bus leads to abnormal bus communication. The controller of the present invention can adapt to the bus baud rate, reduce maintenance costs and improve production efficiency.

[0004] The present invention provides a controller CAN bus baud rate self-adaptation method, comprising: receiving a bus message based on an initial controller baud rate; performing a baud rate matching check according to the bus message; responding to the bus message if the baud rate matching check is passed; determining an updated controller baud rate and an error interrupt number based on a baud rate self-adaptation matching algorithm if the baud rate matching check is not passed, and repeatedly iterating and executing the steps of receiving the bus message and the baud rate matching check based on the updated controller baud rate until the updated controller baud rate passes the check, clearing the error interrupt number and responding to the bus message; and dynamically adjusting the threshold of the error interrupt number according to the number of the bus messages.

[0005] According to a controller CAN bus baud rate adaptation method provided by the present invention, the baud rate matching check is performed according to the bus message, including: determining the bus baud rate according to the bus message; passing the baud rate matching check when the initial controller baud rate is the same as the bus baud rate; and failing the baud rate matching check when the initial controller baud rate is different from the bus baud rate.

[0006] According to a controller CAN bus baud rate adaptation method provided by the present invention, the responding to the bus message when the baud rate matching check is passed includes: performing a received message interrupt check according to the bus message; when the received message interrupt check is passed, entering a data transmission mode and sending a response message to the CAN bus; when the received message interrupt check is not passed, repeatedly and iteratively executing the steps of receiving the bus message and the step of the received message interrupt check until the received message interrupt check is passed.

[0007] According to a controller CAN bus baud rate adaptation method provided by the present invention, in the case where the baud rate matching check fails, the updated controller baud rate and the number of error interrupts are determined based on the baud rate adaptive matching algorithm, including: performing an error message interrupt check according to the bus message; in the case where the error message interrupt check passes and is in the baud rate switching mode, determining the number of error interrupts to be checked and the controller baud rate to be checked; based on the number of error interrupts to be checked and the controller baud rate to be checked, when the baud rate switching condition is met, switching and updating the controller baud rate to be checked from high to low according to a preset baud rate table; based on the number of error interrupts to be checked and the controller baud rate to be checked, when the baud rate switching condition is not met, repeatedly and iteratively executing the steps of receiving the bus message and the step of performing the error message interrupt check until the baud rate switching condition is met.

[0008] According to a controller CAN bus baud rate adaptive method provided by the present invention, the baud rate switching condition is that the number of error interrupts to be checked is greater than the threshold of the number of error interrupts and the controller baud rate to be checked is greater than the lowest baud rate in the preset baud rate table.

[0009] According to a controller CAN bus baud rate adaptation method provided by the present invention, when the error interrupt number to be checked is greater than the threshold value of the error interrupt number, the error interrupt number to be checked is cleared to zero; when the controller baud rate to be checked is not greater than the lowest baud rate in the preset baud rate table, the baud rate switching fails and enters the default mode.

[0010] According to a controller CAN bus baud rate adaptation method provided by the present invention, after performing an error message interrupt check according to the bus message, it also includes: when passing the error message interrupt check and not being in the baud rate switching mode, repeatedly iteratively executing the step of receiving the bus message and the step of the error message interrupt check until passing the error interrupt check and being in the baud rate switching mode.

[0011] According to a controller CAN bus baud rate self-adaptation method provided by the present invention, before receiving a bus message based on an initial controller baud rate, the method further includes: entering a baud rate switching mode.

[0012] The present invention also provides a controller, comprising: a message receiving module, used for receiving a bus message based on an initial controller baud rate; a matching check module, used for performing a baud rate matching check according to the bus message; a passing module, used for responding to the bus message if the baud rate matching check is passed; a failing module, used for determining an updated controller baud rate and an error interrupt number based on a baud rate adaptive matching algorithm if the baud rate matching check is not passed, and repeatedly iterating the steps of receiving the bus message and the baud rate matching check based on the updated controller baud rate, until the updated controller baud rate passes the check, then the error interrupt number is cleared and the bus message is responded to; the threshold of the error interrupt number is dynamically adjusted according to the number of bus messages.

[0013] The present invention also provides a vehicle, comprising the above-mentioned controller.

[0014] The present invention provides a controller CAN bus baud rate self-adaptation method, controller and vehicle. In order to solve the problem of abnormal bus communication caused by incorrect device baud rate setting in the CAN bus, the present invention first receives a bus message based on the initial controller baud rate; performs baud rate matching check according to the bus message; responds to the bus message when the baud rate matching check is passed; determines the updated controller baud rate and the number of error interrupts based on the baud rate self-adaptation matching algorithm when the baud rate matching check is not passed, and repeatedly iterates based on the updated controller baud rate until the updated controller baud rate passes the check, clears the number of error interrupts and responds to the bus message; the threshold of the number of error interrupts is dynamically adjusted according to the number of bus messages. The controller of the present invention can adapt to the bus baud rate, reduce maintenance costs, and improve production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 The present invention is a flowchart of a controller CAN bus baud rate self-adaptation method.

[0017] Figure 2It is a specific flow chart of the controller CAN bus baud rate self-adaptation method provided by the present invention.

[0018] Figure 3 It is a structural schematic diagram of the controller provided by the present invention.

[0019] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] As consumers' requirements for automobile performance and comfort continue to increase, the number of automobile electronic control systems has also increased accordingly. Various controllers need to be connected to each other through a communication network. The most widely used interface at present is the CAN bus. Due to the advantages of strong anti-interference, long transmission distance and low maintenance cost, the CAN bus has been widely used in various industrial sites. Each controller is monitored and managed through the CAN bus. The controller and the CAN bus must have the same baud rate for mutual communication, that is, the controller can only communicate with a specific CAN bus with the same baud rate as itself. The baud rate of the CAN bus is not unique. Different CAN buses have different baud rates, such as 1Mbps, 800Kbps, 400Kbps, 250Kbps, 153Kbps, 125Kbps, 100Kbps, etc. In general, the baud rate of the controller is fixed during factory production, resulting in the inability to communicate when the controller is transplanted to a CAN bus with a different baud rate, which limits the versatility of the controller. When there is an error frame on the bus, it may even cause the CAN bus to be paralyzed, making the remaining controllers unable to work properly. The diagnostic instrument cannot reconfigure the controller baud rate, so the only solution is to replace the controller with a new one. This wastes resources, increases costs, and reduces work efficiency. Therefore, it is very necessary to enable the controller to automatically match the baud rate according to the baud rate of the CAN bus.

[0022] Please refer to Figure 1 , Figure 1 A schematic flow chart of a controller CAN bus baud rate self-adaptation method provided by the present invention.

[0023] The present invention provides a controller CAN bus baud rate self-adaptation method, comprising: 101: Receive bus message based on the initial controller baud rate; 102: Perform baud rate matching check according to bus message; 103: respond to the bus message when the baud rate matching check is passed; 104: In the case where the baud rate matching check fails, the baud rate of the updated controller and the number of error interrupts are determined based on the baud rate adaptive matching algorithm, and the steps of receiving bus messages and the baud rate matching check are repeatedly and iteratively executed based on the updated controller baud rate, until the updated controller baud rate passes the check, the number of error interrupts is cleared and the bus message is responded to; the threshold value of the number of error interrupts is dynamically adjusted according to the number of bus messages.

[0024] In order to solve the problem that the device baud rate setting error in the CAN bus leads to abnormal bus communication, the present invention provides a controller CAN bus baud rate adaptive method, firstly, the adaptive controller is connected to the CAN bus, and the adaptive controller sets an initial baud rate during initialization to eliminate most interferences, for example, it can be the highest baud rate 1000K in the preset baud rate switching table, because the higher the baud rate, and it does not match the bus baud rate, the faster it will enter the passive error state, reducing the interference to the bus during the node active error. Of course, in addition to the CAN adaptive controller, the CAN bus can also be connected to the CAN ordinary controller. Compared with the CAN ordinary controller, the baud rate of the CAN adaptive controller can be adaptively adjusted. The adaptive controller receives a bus message from the CAN bus, for example, in the form of a message sent by the CAN ordinary controller. Then the adaptive controller parses the bus message and judges (baud rate matching check) whether the baud rate of the bus message matches its own baud rate. If the baud rate matches (through baud rate matching check), the bus message is responded. If the baud rate does not match (failed to pass the baud rate matching check), the continuous error interrupts of CAN communication are used to determine the updated controller baud rate and the number of error interrupts based on the baud rate adaptive matching algorithm, and the steps of receiving bus messages and baud rate matching check are repeated and iterated based on the updated controller baud rate. Periodic messages with unmatched baud rates on the bus will cause continuous error interrupts in the adaptive controller, so the threshold of the number of error interrupts can be set in the algorithm as the upper limit of the number of errors to eliminate the impact of interference. Of course, the threshold of the number of error interrupts can also be dynamically adjusted according to actual conditions to eliminate the impact of larger interference. Once a message with a baud rate match is parsed, the interrupt error number is directly cleared to respond quickly to messages with a baud rate match to eliminate misjudgments caused by non-continuous interference.

[0025] The CAN bus of the present invention can be connected to multiple adaptive controllers. The adaptive controller can use a passive receiving strategy to determine the baud rate error, and only accept data frames before the baud rate matches. In the active error state, a baud rate mismatch will generate a receiving error and send an error frame; no data frame will be sent to the bus, and no sending error will be generated, so there will be no busoff (bus off state: a state in which communication on the bus cannot be participated in. Both the reception and transmission of information are prohibited) to ensure the stability of the adaptive controller.

[0026] It is important to note that the rate at which information is transmitted in a communication channel is known as the baud rate. In layman's terms, baud rate is the speed / rate at which data is transmitted over a network. This is expressed in bits per second. Therefore, the number of bits transmitted over a communication network in one second is the baud rate.

[0027] The message frames of the CAN bus are divided into five types: data frame, remote frame, error frame, overload frame and frame interval. The data frame is used for the sending unit to transmit data to the receiving unit. The error frame is used to notify other units of the error when an error is detected. When an error occurs, the sending or receiving node will send an error frame.

[0028] In summary, the controller CAN bus baud rate self-adaptation method of the present invention, the self-adaptive controller can adapt the bus baud rate, reduce maintenance costs, and improve production efficiency.

[0029] Please refer to Figure 2 , Figure 2 A schematic diagram of a specific flow chart of a controller CAN bus baud rate self-adaptation method provided by the present invention.

[0030] As a preferred embodiment, a baud rate matching check is performed according to the bus message, including: determining the bus baud rate according to the bus message; passing the baud rate matching check when the initial controller baud rate is the same as the bus baud rate; and failing the baud rate matching check when the initial controller baud rate is different from the bus baud rate.

[0031] As a preferred embodiment, when the baud rate matching check is passed, responding to the bus message includes: performing a received message interrupt check according to the bus message; when the received message interrupt check is passed, entering the data transmission mode and sending a response message to the CAN bus; when the received message interrupt check is not passed, repeatedly iterating the steps of receiving the bus message and the step of receiving the message interrupt check until the received message interrupt check is passed.

[0032] As a preferred embodiment, before receiving the bus message based on the initial controller baud rate, the method further includes: entering a baud rate switching mode.

[0033] In this embodiment, after the vehicle is powered on, the adaptive controller enters the baud rate switching mode, in which the adaptive controller cannot send messages to the CAN bus. The adaptive controller receives messages sent by ordinary devices and determines whether the baud rate of the bus message matches its own baud rate. If the baud rates match, the adaptive controller will generate a message reception interrupt. During the reception interrupt, the adaptive controller enters the data transmission mode to parse the bus message normally and clears the number of error interrupts. If the adaptive controller does not generate a message reception interrupt, the steps of receiving the bus message and the steps of checking the reception message interrupt are iterated repeatedly until the reception message interrupt check is passed.

[0034] Among them, the role of the receive message interrupt is to process the data immediately when the adaptive controller receives the bus data to ensure the real-time and accuracy of the data. It is an important link in realizing real-time data transmission, which can process the received data in time and perform corresponding operations according to the needs.

[0035] As a preferred embodiment, when the baud rate matching check fails, the updated controller baud rate and the number of error interrupts are determined based on the baud rate adaptive matching algorithm, including: performing an error message interrupt check according to the bus message; when the error message interrupt check passes and the baud rate switching mode is in place, determining the number of error interrupts to be checked and the controller baud rate to be checked; based on the number of error interrupts to be checked and the controller baud rate to be checked, when the baud rate switching condition is met, switching and updating the controller baud rate to be checked from high to low according to a preset baud rate table; based on the number of error interrupts to be checked and the controller baud rate to be checked, when the baud rate switching condition is not met, repeatedly iteratively executing the steps of receiving the bus message and the step of performing the error message interrupt check until the baud rate switching condition is met.

[0036] As a preferred embodiment, the baud rate switching condition is that the number of error interrupts to be checked is greater than a threshold of the number of error interrupts and the baud rate of the controller to be checked is greater than the lowest baud rate in the preset baud rate table.

[0037] As a preferred embodiment, when the number of error interrupts to be checked is greater than the threshold value of the error interrupt number, the number of error interrupts to be checked is cleared to zero; when the baud rate of the controller to be checked is not greater than the lowest baud rate in the preset baud rate table, the baud rate switching fails and enters the default mode.

[0038] In this embodiment, if the baud rate does not match, the adaptive controller will generate an error interrupt, and determine whether it is a baud rate switching mode in the error interrupt. If it is a baud rate switching mode, the number of error interrupts is increased by 1 to obtain the number of error interrupts to be checked.

[0039] Then, after the number of error interrupts to be checked increases to the upper limit (threshold of the number of error interrupts), the number of error interrupts that do not match the current baud rate is cleared, and it is determined whether the current baud rate (controller baud rate to be checked) is the lowest baud rate in the preset baud rate switching table.

[0040] If the baud rate of the controller to be verified is the lowest baud rate, it means that the bus baud rate does not match all the baud rates in the baud rate table, the baud rate switching fails, and the default mode is entered.

[0041] If the baud rate of the controller to be checked is not the lowest baud rate, the baud rate is switched from high baud rate to low baud rate according to the preset baud rate switching table.

[0042] The steps of receiving bus messages and interrupt checking of error messages are executed cyclically until the baud rate switching condition is met and the baud rate switching is successful.

[0043] Before the baud rate of the adaptive device matches the bus baud rate, the baud rate of the adaptive device is higher than the bus baud rate, which can make the adaptive device enter the passive error state from the active error state faster and reduce the impact on the CAN bus.

[0044] It should be noted that after a node is connected to the CAN bus, when the baud rate does not match, the node is in an active error state. The active error state allows the node to participate in bus communication normally. When a unit in the active error state detects an error, it outputs an active error flag (sends an error frame to the bus, interfering with the bus).

[0045] When the number of errors exceeds 127, the node enters a passive error state and does not send messages to the bus, which will not interfere with the bus. The passive error state is a state that is prone to errors. Although the controller in the passive error state can participate in bus communication, it cannot actively send error notifications when receiving in order not to interfere with the communication of other controllers; even if the controller in the passive error state detects an error, if other controllers in the active error state do not find the error, the entire bus is considered to be error-free. When a controller in the passive error state detects an error, it outputs a passive error flag. In addition, the controller in the passive error state cannot start sending again immediately. Before starting the next transmission, a "delayed transmission" (8 bits of recessive bits) must be inserted during the interval frame.

[0046] As a preferred embodiment, after performing an error message interrupt check according to the bus message, it also includes: when the error message interrupt check is passed and the system is not in the baud rate switching mode, repeatedly and iteratively executing the steps of receiving the bus message and the error message interrupt check until the error interrupt check is passed and the system is in the baud rate switching mode.

[0047] In this embodiment, considering the baud rate matching, the received bus message may also cause an error message interrupt due to interference or other reasons. This is because the non-baud rate switching mode avoids starting the baud rate switching. The adaptive device will re-receive the bus message and execute the error message interrupt check step until it passes the error interrupt check and is in the baud rate switching mode.

[0048] The controller provided by the present invention is described below. The controller described below and the controller CAN bus baud rate adaptation method described above can be referenced to each other.

[0049] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of the controller provided by the present invention.

[0050] The present invention also provides a controller, comprising: a message receiving module 1, used for receiving a bus message based on an initial controller baud rate; a matching check module 2, used for performing a baud rate matching check according to the bus message; a passing module 3, used for responding to the bus message when the baud rate matching check is passed; a failing module 4, used for determining the updated controller baud rate and the number of error interrupts based on a baud rate adaptive matching algorithm when the baud rate matching check is not passed, and repeatedly iteratively executing the steps of receiving the bus message and the steps of baud rate matching check based on the updated controller baud rate, until the updated controller baud rate passes the check, the number of error interrupts is cleared and the bus message is responded to; the threshold value of the number of error interrupts is dynamically adjusted according to the number of bus messages.

[0051] The vehicle provided by the present invention is described below. The vehicle described below and the controller CAN bus baud rate adaptation method described above can be referenced to each other.

[0052] The present invention also provides a vehicle, comprising the above-mentioned controller.

[0053] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 complete mutual communication through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the controller CAN bus baud rate adaptive method, including: receiving bus messages based on the initial controller baud rate; performing baud rate matching check according to the bus message; responding to the bus message if the baud rate matching check is passed; determining the updated controller baud rate and the number of error interrupts based on the baud rate adaptive matching algorithm if the baud rate matching check is not passed, and repeatedly iterating the steps of receiving the bus message and the baud rate matching check based on the updated controller baud rate, until the updated controller baud rate passes the check, the number of error interrupts is cleared and the bus message is responded; the threshold of the number of error interrupts is dynamically adjusted according to the number of bus messages.

[0054] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0055] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the controller CAN bus baud rate adaptation method provided by the above methods, including: receiving bus messages based on the initial controller baud rate; performing baud rate matching check according to the bus message; responding to the bus message if the baud rate matching check passes; if the baud rate matching check fails, determining the updated controller baud rate and the number of error interrupts based on the baud rate adaptive matching algorithm, and repeatedly iterating the steps of receiving the bus message and the baud rate matching check based on the updated controller baud rate, until the updated controller baud rate passes the check, clearing the number of error interrupts and responding to the bus message; the threshold of the number of error interrupts is dynamically adjusted according to the number of bus messages.

[0056] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the controller CAN bus baud rate adaptation method provided by the above-mentioned methods, including: receiving bus messages based on the initial controller baud rate; performing baud rate matching check according to the bus message; responding to the bus message if the baud rate matching check passes; if the baud rate matching check fails, determining the updated controller baud rate and the number of error interrupts based on a baud rate adaptive matching algorithm, and repeatedly iterating the steps of receiving bus messages and baud rate matching check based on the updated controller baud rate, until the updated controller baud rate passes the check, clearing the number of error interrupts and responding to the bus message; the threshold of the number of error interrupts is dynamically adjusted according to the number of bus messages.

[0057] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A controller CAN bus baud rate adaptive method, characterized in that: include: Receive bus messages based on the initial controller baud rate; Performing a baud rate matching check according to the bus message; In the case of passing the baud rate matching check, responding to the bus message; In the case where the baud rate matching check fails, determining the updated controller baud rate and the number of error interrupts based on the baud rate adaptive matching algorithm, and repeatedly iteratively executing the step of receiving the bus message and the step of baud rate matching check based on the updated controller baud rate, until the updated controller baud rate passes the check, clearing the number of error interrupts and responding to the bus message; The threshold of the number of error interrupts is dynamically adjusted according to the number of bus messages.

2. The controller CAN bus baud rate adaptive method according to claim 1, characterized in that: The performing baud rate matching check according to the bus message comprises: Determining a bus baud rate according to the bus message; In the case where the initial controller baud rate is the same as the bus baud rate, passing the baud rate matching check; In the case where the initial controller baud rate is different from the bus baud rate, the baud rate matching check fails.

3. The controller CAN bus baud rate adaptive method according to claim 1, characterized in that: In the case of passing the baud rate matching check, responding to the bus message includes: Performing a received message interrupt check according to the bus message; If the received message interrupt check is passed, enter the data transmission mode and send a response message to the CAN bus; if the received message interrupt check is not passed, repeatedly iteratively execute the steps of receiving the bus message and the steps of the received message interrupt check until the received message interrupt check is passed.

4. The controller CAN bus baud rate adaptive method according to claim 1, characterized in that: The method of determining the updated controller baud rate and the number of error interrupts based on a baud rate adaptive matching algorithm when the baud rate matching check fails comprises: Performing error message interruption check according to the bus message; In the case of passing the error message interrupt check and being in the baud rate switching mode, determining the number of error interrupts to be checked and the controller baud rate to be checked; Based on the number of error interrupts to be verified and the baud rate of the controller to be verified, when a baud rate switching condition is met, updating the baud rate of the controller to be verified by switching from high to low according to a preset baud rate table; Based on the number of error interrupts to be checked and the controller baud rate to be checked, when the baud rate switching condition is not met, the steps of receiving the bus message and checking the error message interrupt are repeatedly and iteratively executed until the baud rate switching condition is met.

5. The controller CAN bus baud rate adaptive method according to claim 4, characterized in that: The baud rate switching condition is that the number of error interrupts to be checked is greater than the threshold of the number of error interrupts and the baud rate of the controller to be checked is greater than the lowest baud rate in the preset baud rate table.

6. The controller CAN bus baud rate self-adaptation method according to claim 5, characterized in that: When the number of error interrupts to be checked is greater than a threshold value of the number of error interrupts, clearing the number of error interrupts to be checked; When the controller baud rate to be verified is not greater than the lowest baud rate in the preset baud rate table, the baud rate switching fails and the default mode is entered.

7. The controller CAN bus baud rate self-adaptation method according to claim 4, characterized in that: After the error message interrupt check is performed according to the bus message, the method further includes: In the case where the error message interrupt check is passed and the system is not in the baud rate switching mode, the steps of receiving the bus message and the error message interrupt check are repeatedly and iteratively executed until the error interrupt check is passed and the system is in the baud rate switching mode.

8. The controller CAN bus baud rate adaptive method according to any one of claims 1 to 7, characterized in that: Before receiving the bus message based on the initial controller baud rate, the method further includes: Enter baud rate switching mode.

9. A controller, characterized in that: include: A message receiving module, used for receiving bus messages based on an initial controller baud rate; A matching check module, used for performing a baud rate matching check according to the bus message; A passing module, used for responding to the bus message when the baud rate matching check is passed; A failed module is used to determine the updated controller baud rate and the number of error interrupts based on the baud rate adaptive matching algorithm when the baud rate matching check fails, and repeatedly iteratively perform the steps of receiving the bus message and the baud rate matching check based on the updated controller baud rate until the updated controller baud rate passes the check, then clear the number of error interrupts and respond to the bus message; The threshold of the number of error interrupts is dynamically adjusted according to the number of bus messages.

10. A vehicle comprising the controller according to claim 9.