Controller area network bus load adjusting method and device, equipment and medium

By dynamically adjusting the CAN bus load, the problem of network congestion and signal delay caused by excessive CAN bus load rate is solved, and the stability and reliability of vehicle communication are improved.

CN118713957APending Publication Date: 2024-09-27AVATR CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411041028.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Excessive CAN bus load rate in vehicles leads to network congestion, signal transmission delay and data loss, affecting the normal operation of the vehicle.

Method used

By obtaining the load rates of multiple CAN buses and performing adjustment operations according to different situations, including adjusting the transmission channels of some CAN messages from a high-load CAN bus to a low-load CAN bus, or increasing the sending cycle of CAN messages, To balance the load rate of the CAN bus.

Benefits of technology

Without changing the CAN bus bandwidth, the CAN bus load is dynamically adjusted to solve the problems of network congestion, signal transmission delay and data loss, and improve the stability and reliability of vehicle communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713957A
    Figure CN118713957A
Patent Text Reader

Abstract

The invention discloses a controller area network (CAN) bus load adjusting method and device, equipment and a medium. The method comprises the following steps: acquiring load rates of a plurality of CAN buses; if the load rate of at least one first CAN bus in the plurality of CAN buses is greater than a first preset value and the load rate of at least one second CAN bus is less than a second preset value, executing a first adjustment operation on the at least one first CAN bus; if the load rate of the at least one first CAN bus is greater than a first preset value and the load rate of the third CAN bus is greater than or equal to a second preset value, executing a second adjustment operation on the at least one first CAN bus; the first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used for balancing the load rate of the at least one first CAN bus; the second preset value is smaller than the first preset value. According to the scheme of the invention, the problems of network congestion, signal transmission delay and data loss caused by too high load rate of the CAN bus can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and relates to, but is not limited to, a method, device, equipment and medium for adjusting a controller area network bus load. Background Art

[0002] With the continuous development of vehicle intelligence, electrification, networking and sharing, the number and complexity of vehicle functions are increasing, and the number of on-board electronic control units (ECUs) is growing, resulting in a gradual increase in the load rate of the on-board controller area network (CAN) bus. Excessive load rate can cause network congestion, signal transmission delays, data loss and other problems, reduce the stability and reliability of vehicle communication, and affect the normal operation of the vehicle. Summary of the invention

[0003] The present application provides a method, device, equipment and medium for adjusting the load of a controller area network bus CAN, which can solve problems such as network congestion, signal transmission delay and data loss caused by an excessively high load rate of the CAN bus.

[0004] The technical solution of this application is implemented as follows:

[0005] In a first aspect, the present application provides a method for adjusting a controller area network (CAN) bus load, the method comprising:

[0006] Get the load rate of multiple CAN buses;

[0007] If the load rate of at least one first CAN bus among the plurality of CAN buses is greater than a first preset value, and the load rate of at least one second CAN bus is less than a second preset value, performing a first adjustment operation on the at least one first CAN bus;

[0008] If the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, performing a second adjustment operation on the at least one CAN bus;

[0009] The first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used to balance the load rate of the at least one first CAN bus; the second preset value is smaller than the first preset value.

[0010] In some embodiments, performing a first adjustment operation on the at least one first CAN bus includes:

[0011] The transmission channel of at least part of the CAN messages corresponding to the first CAN bus is adjusted from the first CAN bus to the second CAN bus.

[0012] In some embodiments, performing a second adjustment operation on the at least one first CAN bus includes:

[0013] Increase the sending period of at least part of the CAN messages corresponding to the first CAN bus.

[0014] In some embodiments, the method further comprises:

[0015] Determining whether the first adjustment operation is effective;

[0016] If the first adjustment operation is invalid, performing a third adjustment operation on the at least one first CAN bus;

[0017] The third adjustment operation is different from both the first adjustment operation and the second adjustment operation.

[0018] In some embodiments, determining whether the first adjustment operation is valid includes:

[0019] After performing the first adjustment operation on the at least one first CAN bus, obtaining a load rate of the at least one first CAN bus;

[0020] If the load rate of the at least one first CAN bus is still greater than the first preset value, determining that the first adjustment operation is invalid;

[0021] If the load rate of the at least one first CAN bus is less than or equal to the first preset value, it is determined that the first adjustment operation is effective.

[0022] In some embodiments, if the first adjustment operation is invalid, performing a third adjustment operation on the at least one first CAN bus includes:

[0023] Stop transmitting at least part of the CAN messages corresponding to the at least one first CAN bus; the at least part of the CAN messages are predefined non-critical CAN messages.

[0024] In some embodiments, the method further comprises:

[0025] If the load rates of the multiple CAN buses are all less than or equal to the first preset value, the load rates of the multiple CAN buses are not adjusted.

[0026] In a second aspect, the present application provides a CAN bus load adjustment device, the device comprising:

[0027] An acquisition unit, used for acquiring load rates of multiple CAN buses;

[0028] an adjustment unit, configured to perform a first adjustment operation on at least one CAN bus among the plurality of CAN buses if the load rate of at least one CAN bus among the plurality of CAN buses is greater than a first preset value and the load rate of at least one second CAN bus is less than a second preset value;

[0029] If the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, performing a second adjustment operation on the at least one first CAN bus;

[0030] The first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used to balance the load rate of the at least one first CAN bus; the second preset value is smaller than the first preset value.

[0031] In a third aspect, the present application provides an electronic device, comprising: a memory and a processor; the memory stores a computer program that can be run on the processor, and the processor implements the above-mentioned controller local area network bus load adjustment method when executing the computer program.

[0032] In a fourth aspect, the present application further provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned controller local area network bus load adjustment method is implemented.

[0033] The present application provides a method, apparatus, device and medium for adjusting the load of a controller area network bus, the method comprising: obtaining the load rates of multiple CAN buses; if the load rate of at least one first CAN bus among the multiple CAN buses is greater than a first preset value, and the load rate of at least one second CAN bus is less than a second preset value, performing a first adjustment operation on the at least one first CAN bus; if the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, performing a second adjustment operation on the at least one first CAN bus; wherein the first adjustment operation and the second adjustment operation are different, and the first adjustment operation and the second adjustment operation are used to balance the load rate of the at least one first CAN bus; the second preset value is less than the first preset value.

[0034] In the solution of the present application, the load rates of multiple CAN buses are obtained, and corresponding adjustment operations are performed according to different load rates of the multiple CAN buses to achieve dynamic adjustment of the CAN bus load. In this way, the dynamic adjustment of the CAN bus load can be flexibly and efficiently achieved according to the actual load conditions of the multiple CAN buses without changing the CAN bus bandwidth, so as to solve the problems of network congestion, signal transmission delay and data loss caused by excessive load rate of the CAN bus. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of a first optional flow chart of a method for adjusting a controller area network bus load provided in an embodiment of the present application;

[0036] Figure 2 An optional structural diagram of the vehicle-mounted CAN network architecture provided in an embodiment of the present application;

[0037] Figure 3 A second optional flow chart of the method for adjusting the controller area network bus load provided in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of an optional structure of a controller area network bus load adjustment device provided in an embodiment of the present application;

[0039] Figure 5 An optional structural diagram of an electronic device provided in an embodiment of the present application; DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.

[0041] In the following description, reference is made to “some embodiments” which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0042] In the following description, the terms "first\second\third" are used only as examples to distinguish different objects, and do not represent a specific order for the objects, nor do they have a limitation on the order of precedence. It is understandable that "first\second\third" can be interchanged with a specific order or order of precedence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0044] The embodiments of the present application provide a method, device, equipment and medium for adjusting the load of a controller area network CAN bus. In practical applications, the method for adjusting the load of the CAN bus can be implemented by a CAN bus load adjustment device, and each functional entity in the CAN bus load adjustment device can be collaboratively implemented by hardware resources of electronic equipment, such as computing resources such as processors, and communication resources (such as for supporting various communication methods such as optical cables and cellular).

[0045] Below, various embodiments of the CAN bus load adjustment method, device, equipment and medium provided in the embodiments of the present application are described.

[0046] In the first aspect, the embodiment of the present application provides a method for adjusting the load of a CAN bus. The function implemented by the method can be implemented by calling a program code by a processor in an electronic device (such as a controller), and of course the program code can be stored in a storage medium. It can be seen that the electronic device at least includes a processor and a storage medium.

[0047] Figure 1 FIG. 1 is a flow chart of a method for adjusting the CAN bus load according to an embodiment of the present application. Figure 1 As shown, the process may include but is not limited to the following S101 to S103.

[0048] S101. Obtain load rates of multiple CAN buses.

[0049] In some embodiments, Figure 2 As shown, multiple controller area networks (CAN) are divided inside the vehicle system, and the vehicle includes a gateway (Gate Way, GW) 110 and a controller area network (CAN). The controller area network may include, but is not limited to: a body controller area network (Body CAN) 111, a chassis controller area network (Chassis CAN) 112, a powertrain controller area network (Power Train CAN) 113, a diagnostic controller area network (DiagnoseCAN) 114, and an entertainment system controller area network (Infomercial CAN) 115. Each controller area network includes a CAN bus and at least one electronic control unit ECU. The ECUs in the same controller area network are connected through the CAN bus in the controller area network, and each controller area network is connected to the gateway through its own CAN bus.

[0050] In some embodiments, the body controller area network 111 may include but is not limited to an air conditioner (AC) ECU, a body control module (BCM) ECU, a tire pressure monitoring system (TPMS) ECU, and an immobilizer (IMMO) ECU. The ECUs in the body controller area network 111 are connected via a body control CAN bus. The chassis controller area network 112 may include but is not limited to an anti-lock brake system (ABS) ECU, an electronic stability program (ESP) ECU, and an electric power steering (EPS) ECU. The ECUs in the chassis controller area network 112 are connected via a chassis control CAN bus. The powertrain Controller Area Network 113 may include but is not limited to the Engine Control Module (ECM) ECU, the Supplemental Restraint System (SRS) ECU, and the Electronic Park Brake (EPB) ECU. The ECUs in the powertrain Controller Area Network 113 are connected via the powertrain CAN bus. The diagnostic Controller Area Network 114 may include but is not limited to the Telematics BOX (T-Box) ECU. The entertainment system Controller Area Network 115 may include but is not limited to the Video Audio Entertainment System (VAES) ECU and the Instrument Pack (IPK) ECU. The ECUs in the entertainment system Controller Area Network 115 are connected via the entertainment CAN bus.

[0051] The gateway is the core control device in the vehicle, used to coordinate different CANs, as well as protocol conversion, data exchange, fault diagnosis, etc. between the CAN and the data network (DN). The gateway can receive network signals with different transmission rates from each CAN. The gateway can process the network signals according to the preset processing rules and then transmit them to the CAN through each CAN bus. If an ECU in the CAN subscribes to this network signal, the ECU can parse the network signal and process it accordingly.

[0052] In some implementations, the data network in the vehicle system generally refers to Ethernet or other high-speed communication networks.

[0053] Here, the load rate of the CAN bus (Busload) refers to the ratio of the bandwidth actually used by the CAN bus to the total bandwidth within a given time, which is intended to reflect the density of data transmission on the CAN bus. It can be understood that the load rate of the CAN bus represents the ratio of the actual data transmission rate to the theoretically achievable data transmission rate.

[0054] In some embodiments, the step of obtaining the load rates of the plurality of CAN buses includes:

[0055] Step S1, real-time collection of data traffic on the CAN bus, including all transmitted CAN messages;

[0056] Step S2: define a fixed time window and count the amount of data transmitted within the time window;

[0057] Step S3: Calculate the load rate of the CAN bus according to the amount of data transmitted in the time window.

[0058] The calculation formula of the load factor is: load factor = [n / (t×k)]×100%.

[0059] It should be noted that in the above calculation formula, n represents the number of bits transmitted in the time window, that is, the total number of bits of the CAN message actually transmitted in the set time window. t represents the length of the set time window in seconds or milliseconds. k represents the total bandwidth of the CAN bus in bits per second (bps).

[0060] Here, the total bandwidths of different CAN buses may be the same or different.

[0061] In some implementations, the load rates of multiple CAN buses may be acquired using a Bus Mirror function in an AUTOSAR (Automotive Open System Architecture) protocol stack.

[0062] Exemplarily, obtaining the load rate of the CAN bus by using the bus mirroring function includes the following steps: step S10 to step S60.

[0063] Step S10: Configure the Bus Mirror function.

[0064] Exemplarily, the CAN bus and ECU that need to be mirrored are defined in an AUTOSAR configuration file.

[0065] Step S20: configure cache.

[0066] Exemplarily, the cache location and size of the mirror data are specified, and the cache can be a data storage area in the memory for temporarily storing data on the CAN bus. In the AUTOSAR protocol stack, these caches are usually implemented as arrays or queue structures in the memory for storing data sent and received on the CAN bus. The cache can be set anywhere in the memory, usually in the random access memory (RAM). This ensures that the cache has fast read and write speeds and efficient access performance. In actual implementation, the size of the cache is usually configurable and can be adjusted according to the needs of the system. For example, the size of the cache can be determined according to the bandwidth and data transmission rate of the CAN bus to ensure that the expected amount of data can be accommodated and prevent data loss. In short, the cache in the AUTOSAR protocol stack is a memory area for temporarily storing data on the CAN bus, usually located in RAM, with a configurable size, and usually implemented in an array or queue structure.

[0067] Step S30: Implement the Bus Mirror function.

[0068] Exemplarily, when data is sent or received on the CAN bus, the AUTOSAR protocol stack copies the data to the corresponding Bus Mirror cache to track the data traffic on each CAN bus in the cache.

[0069] Step S40: Obtain cache data at regular intervals.

[0070] Exemplarily, the data in the cache may be periodically acquired through a timer or a periodic task, for example, by calling an AUTOSAR API (Application Programming Interface) to acquire the CAN messages stored in the cache.

[0071] Step S50: Calculate the data volume.

[0072] Exemplarily, after acquiring the cache data, the amount of data on each CAN bus is calculated. Exemplarily, this can be achieved by counting the number of bytes of data in the cache.

[0073] Step S60: Calculate the load factor.

[0074] Exemplarily, the load rate of each CAN bus may be calculated according to the amount of acquired data and the time interval.

[0075] Through the above steps, the Bus Mirror function in the AUTOSAR protocol stack can be used to effectively obtain the load rate of the CAN bus. This is helpful for real-time understanding of the load status of each CAN bus, so as to perform performance analysis and corresponding adjustments.

[0076] In some implementations, the cache used to implement the Bus Mirror function may have a corresponding relationship with different CAN buses, so that the data traffic on each CAN bus can be tracked and managed more conveniently for load analysis and adjustment.

[0077] Specifically, the data on each CAN bus will usually be stored in the cache corresponding to the bus. In other words, the data sent from which CAN bus will be stored in the corresponding cache, and the received data will also be stored in the corresponding cache, so as to more accurately monitor the load of each CAN bus and make adjustments as needed.

[0078] In other implementations, hardware tools, such as CAN analysis tools and hardware debuggers (such as CAN analyzer (CANalyzer), CAN bus development environment (CAN open environment, CANoe) etc.) may be used to monitor and calculate the load rate of the CAN bus in real time.

[0079] In some embodiments, the execution subject of obtaining the load rate of multiple CAN buses may be a gateway controller of the vehicle. The vehicle may be any vehicle equipment. The embodiments of the present application do not limit the specific type of vehicle equipment, and may be set according to actual conditions. For example, the vehicle equipment may be a fuel vehicle, a pure electric vehicle, a hybrid vehicle, and the like.

[0080] S102: If the load rate of at least one first CAN bus among the plurality of CAN buses is greater than a first preset value, and the load rate of at least one second CAN bus is less than a second preset value, perform a first adjustment operation on the at least one first CAN bus.

[0081] S103: If the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, perform a second adjustment operation on the at least one first CAN bus.

[0082] The first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used to balance the load rate of the at least one first CAN bus; the second preset value is smaller than the first preset value.

[0083] In some embodiments, the first preset value represents an upper threshold value of the load rate of the CAN bus. When the load rate of a CAN bus exceeds the first preset value, measures need to be taken to avoid overloading the CAN bus. The second preset value represents a threshold value for evaluating whether the load rate of the CAN bus is too low. When the load rate of a CAN bus exceeds the second preset value, it indicates that the utilization rate of the CAN bus is insufficient, and measures need to be taken to improve the utilization rate and overall efficiency of the CAN bus to avoid the CAN bus being idle for too long.

[0084] In some embodiments, the gateway controller determines the load type of the CAN bus according to the load rate of the CAN bus. Exemplarily, a CAN bus whose load rate is greater than a first preset value is a high load type, i.e., a first CAN bus. A CAN bus whose load rate is lower than a second preset value is a low load type, i.e., a second CAN bus. A CAN bus whose load rate is greater than or equal to the second preset value and less than or equal to the first preset value is a medium load type, i.e., a third CAN bus.

[0085] In some embodiments, the first preset value ranges from 50% to 60%, and the second preset value ranges from 25% to 30%. More specifically, the first preset value may be 50%, 55% or 60%, and the second preset value may be 25% or 30%.

[0086] It should be noted that the value range of the first preset value and the second preset value provided in the embodiment of the present application is only an example. The value range of the first preset value and the second preset value is related to the CAN bus and should not excessively limit the protection scope of the present application.

[0087] In the solution of the present application, by acquiring the load rates of multiple CAN buses and performing corresponding first adjustment operations and second adjustment operations according to different load rates of the multiple CAN buses, dynamic adjustment of the CAN bus load is achieved. In this way, the dynamic adjustment of the CAN bus load can be flexibly and efficiently achieved according to the actual load conditions of the multiple CAN buses without changing the CAN bus bandwidth, so as to solve the problems of network congestion, signal transmission delay and data loss caused by excessively high load rates of the CAN buses.

[0088] In some embodiments, performing a first adjustment operation on the at least one first CAN bus includes:

[0089] The transmission channel of at least part of the CAN messages corresponding to the first CAN bus is adjusted from the first CAN bus to the second CAN bus.

[0090] In some embodiments, performing a second adjustment operation on the at least one first CAN bus includes:

[0091] Increase the sending period of at least part of the CAN messages corresponding to the first CAN bus.

[0092] In some embodiments, each CAN bus can transmit a large number of CAN messages, but the specific number of CAN messages transmitted by each CAN bus depends on the design and application scenario of the vehicle.

[0093] In some implementations, a CAN message list is created in advance for multiple CAN buses, listing the CAN messages corresponding to each CAN bus. The CAN message list includes but is not limited to the CAN message ID, data format, and sending cycle corresponding to each CAN bus.

[0094] In some embodiments, when performing the first adjustment operation on the first CAN bus, the gateway controller updates the CAN message list, for example, updates the transmission channel of at least part of the CAN messages corresponding to the first CAN bus in the CAN message list to the second CAN bus, and the gateway controller transmits the CAN message according to the information in the updated CAN message list.

[0095] It should be noted that, in order to avoid the load rate of the second CAN bus being too high after the first adjustment operation is performed, the transmission channels of all CAN messages corresponding to the first CAN bus will not be switched to the second CAN bus. The CAN messages that need to adjust the transmission channels can be selected according to the actual load of the CAN bus and the importance of the CAN messages.

[0096] Exemplarily, when creating a CAN message list for multiple CAN buses, the CAN messages are predefined as critical CAN messages and non-critical CAN messages according to requirements, and corresponding identifiers or tags are assigned to the CAN messages corresponding to each CAN bus. The critical CAN messages include information that is critical to the vehicle's operating status, such as engine speed, vehicle speed, brake status, etc., and the non-critical CAN messages include information related to vehicle comfort and convenience, such as interior light control, audio system status, electric window control, etc. When performing the first adjustment operation on the first CAN bus, the transmission channels of at least some non-critical CAN messages in the CAN messages corresponding to the first CAN bus are switched, so as to ensure that the transmission of critical CAN messages is not affected while reducing the load rate of the first CAN bus, thereby improving the flexibility and reliability of the entire vehicle system.

[0097] In some embodiments, when performing the second adjustment operation on the first CAN bus, the gateway controller updates the CAN message list, adjusts the sending period of at least some CAN messages corresponding to the first CAN bus, for example, increases the sending period of at least some CAN messages corresponding to the first CAN bus, and reduces the sending frequency of at least some CAN messages corresponding to the first CAN bus. The gateway controller transmits the CAN message according to the sending period in the updated CAN message list.

[0098] It should be noted that, in order to avoid affecting the operating condition of the vehicle, when performing the second adjustment operation on the first CAN bus, the CAN messages whose sending cycles need to be adjusted can be selected according to the actual load condition of the CAN bus and the importance of the CAN messages.

[0099] Exemplarily, when the second adjustment operation is performed on the first CAN bus, the sending period of at least non-critical CAN messages among the CAN messages corresponding to the first CAN bus is increased to ensure that the transmission of critical CAN messages is not affected.

[0100] In some embodiments, the method for adjusting the CAN bus load further includes:

[0101] Determining whether the first adjustment operation is effective;

[0102] If the first adjustment operation is invalid, performing a third adjustment operation on the at least one first CAN bus;

[0103] The third adjustment operation is different from both the first adjustment operation and the second adjustment operation.

[0104] In order to further ensure effective adjustment of the CAN bus load, whether the first adjustment operation is effective is verified after the first adjustment operation is performed.

[0105] Specifically, after performing the first adjustment operation, the load rate of the first CAN bus is obtained; if the load rate of the first CAN bus is still greater than the first preset value, it is determined that the first adjustment operation is invalid.

[0106] If the load rate of the first CAN bus is less than or equal to the first preset value, it is determined that the first adjustment operation is effective.

[0107] In some embodiments, if the first adjustment operation is invalid, a third adjustment operation is performed on the at least one first CAN bus, including: stopping transmission of at least part of the CAN messages corresponding to the first CAN bus; the at least part of the CAN messages are predefined non-critical CAN messages.

[0108] In some embodiments, when performing the third adjustment operation on the at least one first CAN bus, the gateway controller stops transmitting predefined non-critical CAN messages corresponding to the first CAN bus based on the identifier or label of the non-critical message in the CAN message corresponding to the first CAN bus in the CAN message list, thereby further reducing the load rate of the first CAN bus and ensuring effective adjustment of the CAN bus load.

[0109] In some embodiments, the method for adjusting the CAN bus load further includes:

[0110] If the load rates of the multiple CAN buses are all less than or equal to the first preset value, the load rates of the multiple CAN buses are not adjusted.

[0111] It is understandable that when the load rates of multiple CAN buses are less than or equal to the first preset value, it indicates that there is no high-load CAN bus among the multiple CAN buses, so there is no need to adjust the load of the CAN bus.

[0112] Figure 3 A second optional flow chart of the method for adjusting the controller area network bus load provided in the embodiment of the present application is shown below. Figure 3 Describe the process of CAN bus load adjustment.

[0113] In step S101, the program for obtaining the load rates of multiple CAN buses is triggered, and the process of obtaining the load rates of multiple CAN buses is started. Next, step S201 is executed.

[0114] In some embodiments, before obtaining the load rates of the plurality of CAN buses in the above step S101, it is necessary to predefine and store configuration information for classifying the load types of the CAN buses. Exemplarily, according to the relationship between the load rate of the CAN bus and the first preset value and the second preset value, the CAN bus is divided into a first CAN bus (a high load type CAN bus), a second CAN bus (a low load type CAN bus) and a third CAN bus (a medium load type CAN bus), and an adjustable flag bit for marking the state and adjustment requirements of each CAN bus is set.

[0115] For example, the adjustable flag Flag of the first CAN bus is set to -1, the adjustable flag Flag of the third CAN bus is set to 0, and the adjustable flag Flag of the second CAN bus is set to +1. The adjustable flag is used to indicate the load status of the CAN bus for subsequent system decision-making and control.

[0116] In some implementations, before obtaining the load rates of the multiple CAN buses in the above step S10, it is also necessary to pre-define and store a configuration strategy for CAN bus load regulation.

[0117] Exemplarily, no adjustment operation is required for the second CAN bus and the third CAN bus, but an adjustment operation is required for the first CAN bus, and the specific adjustment operations performed on the first CAN bus include a first adjustment operation, a second adjustment operation and a third adjustment operation. The first adjustment operation is marked as configuration 1, the second adjustment operation is marked as configuration 2, and the third adjustment operation is marked as configuration 3.

[0118] In some specific implementations, the configuration sending strategy includes: (1) if the adjustable flag bit Flag of at least one CAN bus among multiple CAN buses is set to -1, and the adjustable flag bits Flag of other CAN buses are not set to +1, then send configuration 2; (2) if the adjustable flag bit Flag of at least one CAN bus among multiple CAN buses is set to -1, and the adjustable flag bit Flag of at least one CAN bus among other CAN buses is set to +1, then send configuration 1; (3) if the adjustable flag bit Flag of at least one CAN bus among multiple CAN buses is set to -1, and the load rate of the CAN bus is still greater than the first preset value after sending configuration 1, then send configuration 3.

[0119] The above-mentioned configuration information, configuration strategy and specific distribution method can be stored in the configuration file of the gateway controller. When the gateway controller obtains the real-time load rate of multiple CAN buses, it can quickly call the corresponding configuration information to divide the CAN bus load type, and distribute the configuration strategy according to the load type of the CAN bus and the pre-defined configuration strategy, and perform corresponding adjustment operations on the first CAN bus to balance the load rate of the first CAN bus.

[0120] It should be noted that after the gateway controller obtains the load rates of multiple CAN buses, it divides the CAN bus types and then issues specific configuration strategies. In the configuration strategy issuance stage, the gateway controller sends the selected configuration strategy instructions to the CAN controller of the corresponding CAN bus. The CAN controller receives the configuration strategy instructions and performs specific adjustment operations on the high-load CAN bus according to the instruction content.

[0121] The gateway controller may also directly broadcast or send the configuration strategy on the CAN bus and, as an execution subject, perform specific adjustment operations on the high-load CAN bus.

[0122] In step S201, it is mainly determined whether the load rates of the plurality of CAN buses are all less than or equal to the first preset value.

[0123] If the load rates of the multiple CAN buses are all less than or equal to the first preset value, it is determined that there is no first CAN bus among the multiple CAN buses, and there is no need to adjust the multiple CAN buses, and step S207 is executed to end the operation.

[0124] If the load rate of at least one CAN bus among the multiple CAN buses is greater than the first preset value, it is determined that there is at least one first CAN bus among the multiple CAN buses, and step S202 is executed.

[0125] In step S202, if the load rate of at least one first CAN bus among the plurality of CAN buses is greater than a first preset value, it is determined whether the load rate of at least one second CAN bus is less than a second preset value.

[0126] If the judgment result of step S202 is no, the load rate of at least one first CAN bus among the plurality of CAN buses is greater than the first preset value, and the load rate of the third CAN bus is greater than or equal to the second preset value, and step S203 is executed, that is, the second adjustment operation is performed on the at least one first CAN bus. After executing step S203, step S207 is executed to end the operation.

[0127] If the determination result of step S202 is yes, step S204 is executed, that is, a first adjustment operation is performed on at least one first CAN bus.

[0128] After executing step S204, step S205 is executed to determine whether the first adjustment operation is valid.

[0129] When the load rate of at least one first CAN bus after the first adjustment operation is still greater than the first preset value, the first adjustment operation is determined to be invalid; when the load rate of at least one first CAN bus after the first adjustment operation is less than or equal to the first preset value, the first adjustment operation is determined to be valid.

[0130] If the first adjustment operation is valid, execute step S207 and end the operation.

[0131] If the first adjustment operation is invalid, step S206 is executed, that is, a third adjustment operation is performed on at least one first CAN bus. After step S206, step S207 is executed to end the operation.

[0132] It should be noted that after step S207 , the acquisition of the load rates of the multiple CAN buses in the next time window and the corresponding adjustment operations can be started.

[0133] Figure 3 For the specific implementation of the first adjustment operation, the second adjustment operation and the third adjustment operation, reference may be made to the relevant description of the aforementioned embodiment and will not be repeated here.

[0134] The CAN bus load adjustment method provided by this embodiment of the present application obtains the load rates of multiple CAN buses in real time, and performs corresponding adjustment operations according to different load rates of different multiple CAN buses. In this way, the CAN bus load can be dynamically adjusted flexibly and efficiently according to the actual load conditions of multiple CAN buses without changing the CAN bus bandwidth, so as to solve the problems of network congestion, signal transmission delay and data loss caused by excessive CAN bus load rate.

[0135] In a second aspect, the present application provides a CAN bus load adjustment device, such as Figure 4 As shown, the CAN bus load adjustment device 40 includes: an acquisition unit 401 and an adjustment unit 402; the acquisition unit 401 is used to acquire the load rate of multiple CAN buses; the adjustment unit 402 is used to perform a first adjustment operation on the at least one first CAN bus if the load rate of at least one first CAN bus among the multiple CAN buses is greater than a first preset value, and the load rate of at least one second CAN bus is less than a second preset value; when the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, perform a second adjustment operation on the at least one first CAN bus;

[0136] The first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used to balance the load rate of at least one first CAN bus; and the second preset value is smaller than the first preset value.

[0137] In some embodiments, the adjusting unit 402 is further configured to: adjust the transmission channel of at least part of the CAN messages corresponding to the first CAN bus from the first CAN bus to the second CAN bus.

[0138] In some embodiments, the adjusting unit 402 is further configured to: increase a sending period of at least part of CAN messages corresponding to the first CAN bus.

[0139] In some embodiments, the CAN bus load adjustment device 40 further includes a judgment unit. The judgment unit is used to: judge whether the first adjustment operation is valid; the adjustment unit 402 is used to: if the first adjustment operation is invalid, perform a third adjustment operation on the at least one first CAN bus; wherein the third adjustment operation is different from both the first adjustment operation and the second adjustment operation.

[0140] In some embodiments, the acquisition unit 401 is also used to: acquire the load rate of the at least one first CAN bus after performing the first adjustment operation on the at least one first CAN bus; the judgment unit is used to: if the load rate of the at least one first CAN bus is still greater than the first preset value, determine that the first adjustment operation is invalid; if the load rate of the at least one first CAN bus is less than or equal to the first preset value, determine that the first adjustment operation is valid.

[0141] In some embodiments, the adjusting unit 402 is further configured to: stop transmitting at least part of the CAN messages corresponding to the at least one first CAN bus; the at least part of the CAN messages are predefined non-critical CAN messages.

[0142] In some embodiments, the adjustment unit 402 is further configured to: if the load rates of the plurality of CAN buses are all less than or equal to the first preset value, not adjust the load rates of the plurality of CAN buses.

[0143] It should be noted that the various units included in the CAN bus load adjustment device provided in the embodiment of the present application can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; exemplarily, in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0144] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0145] It should be noted that in the embodiment of the present application, if the above-mentioned CAN bus load adjustment method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0146] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory and a processor; the memory stores a computer program that can be run on the processor, and when the processor executes the program, it implements the steps in the CAN bus load adjustment method provided in the above embodiment.

[0147] Combine the following Figure 5 The electronic device 50 shown is a block diagram of the electronic device.

[0148] In one example, if Figure 5 As shown, the electronic device 50 includes: a processor 51, at least one communication bus 52, at least one external communication interface 53 and a memory 54. The communication bus 52 is configured to realize the connection and communication between these components. The external communication interface 53 may include a standard wired interface and a wireless interface.

[0149] The memory 54 is configured to store instructions and applications executable by the processor 51, and can also cache data to be processed or processed by the processor 51 and various modules in the electronic device 50 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or RAM.

[0150] In another example, the electronic device may be a gateway controller. The gateway controller is used to execute the steps in the method for adjusting the CAN bus load provided in the above embodiment.

[0151] In a fourth aspect, an embodiment of the present application further provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the method for adjusting the CAN bus load provided in the above embodiment are implemented.

[0152] In some specific embodiments, the storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface storage, an optical disk, or a compact disc read-only memory (CD-ROM) and other memories.

[0153] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0154] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean 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 embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0155] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0156] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0157] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0158] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0159] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, the aforementioned program can be stored, and when the program is executed, the execution includes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories, magnetic disks or optical disks, and other media that can store program codes.

[0160] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0161] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for adjusting the load of a controller area network (CAN) bus, characterized in that: The method comprises: Get the load rate of multiple CAN buses; If the load rate of at least one first CAN bus among the plurality of CAN buses is greater than a first preset value, and the load rate of at least one second CAN bus is less than a second preset value, performing a first adjustment operation on the at least one first CAN bus; If the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, performing a second adjustment operation on the at least one first CAN bus; The first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used to balance the load rate of the at least one first CAN bus; the second preset value is smaller than the first preset value.

2. The method according to claim 1, characterized in that The performing a first adjustment operation on the at least one first CAN bus includes: The transmission channel of at least part of the CAN messages corresponding to the first CAN bus is adjusted from the first CAN bus to the second CAN bus.

3. The method according to claim 1, characterized in that The performing a second adjustment operation on the at least one first CAN bus includes: Increase the sending period of at least part of the CAN messages corresponding to the first CAN bus.

4. The method according to claim 2, characterized in that: The method further comprises: Determining whether the first adjustment operation is effective; If the first adjustment operation is invalid, performing a third adjustment operation on the at least one first CAN bus; The third adjustment operation is different from both the first adjustment operation and the second adjustment operation.

5. The method according to claim 4, characterized in that The determining whether the first adjustment operation is valid includes: After performing the first adjustment operation on the at least one first CAN bus, obtaining a load rate of the at least one first CAN bus; If the load rate of the at least one first CAN bus is still greater than the first preset value, determining that the first adjustment operation is invalid; If the load rate of the at least one first CAN bus is less than or equal to the first preset value, it is determined that the first adjustment operation is effective.

6. The method according to claim 4, characterized in that If the first adjustment operation is invalid, performing a third adjustment operation on the at least one first CAN bus includes: Stop transmitting at least part of the CAN messages corresponding to the at least one first CAN bus; the at least part of the CAN messages are predefined non-critical CAN messages.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: If the load rates of the multiple CAN buses are all less than or equal to the first preset value, the load rates of the multiple CAN buses are not adjusted.

8. A CAN bus load adjustment device, characterized in that: The device comprises: An acquisition unit, used for acquiring load rates of multiple CAN buses; an adjustment unit, configured to perform a first adjustment operation on at least one first CAN bus among the plurality of CAN buses if the load rate of the at least one first CAN bus among the plurality of CAN buses is greater than a first preset value and the load rate of the at least one second CAN bus is less than a second preset value; If the load rate of the at least one first CAN bus is greater than the first preset value, and the load rates of the third CAN buses are greater than or equal to the second preset value, performing a second adjustment operation on the at least one first CAN bus; The first adjustment operation is different from the second adjustment operation, and the first adjustment operation and the second adjustment operation are used to balance the load rate of the at least one first CAN bus; the second preset value is smaller than the first preset value.

9. An electronic device, characterized in that: include: Memory and processor; The memory stores a computer program that can be run on the processor, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Scheduling method, device, equipment and program product of KNX bus flow

    CN122160326A