Bus load adjusting method and device, electronic equipment and storage medium

By acquiring and analyzing the time of the detection frames on the CAN bus, determining the time difference, and adjusting the bus load according to the preset threshold, the problem of the bus load cannot be effectively adjusted is solved, and the stable operation of the bus and uniform load distribution is achieved.

CN119561901APending Publication Date: 2025-03-04CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411428865.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art cannot effectively adjust the CAN bus load, resulting in the bus in an unstable state.

Method used

By obtaining the actual issuance time and target issuance time of the detection frame in the target network segment, determining the time difference value, and calling the bus adjustment strategy to adjust the bus load according to the time difference value and the preset time difference threshold.

Benefits of technology

Effective adjustment of bus load is achieved, making the bus in a stable operating state, and ensuring the uniform distribution of bus load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561901A_ABST
    Figure CN119561901A_ABST
Patent Text Reader

Abstract

The invention discloses a bus load adjusting method and device, electronic equipment and a storage medium. The method comprises the following steps: in a target network segment, acquiring actual sending time of a detection frame and target sending time corresponding to the actual sending time; determining a time difference value of the detection frame based on the actual sending time and the target sending time; based on the time difference value, a first time difference threshold value which the time difference value is allowed to reach and a second time difference threshold value which the time difference value is allowed to reach, the bus load is adjusted by using an adjustment strategy of the bus in the target network segment to obtain an adjustment result, and the first time difference threshold value is larger than the second time difference threshold value. The adjustment result is used for enabling the bus to be in a stable operation state, and the adjustment strategy is used for enabling bus loads to be evenly distributed. The technical problem that the bus load cannot be effectively adjusted is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bus technology, and in particular to a method, device, electronic device and storage medium for adjusting bus load. Background Art

[0002] At present, the Controller Area Network (CAN) bus is a serial communication protocol bus for real-time applications, which can use twisted pair cables to transmit signals. However, due to the widespread application of the CAN bus, it may be over-designed in some usage scenarios, causing some electronic controllers to send a large number of messages to occupy the load, making the bus unstable, resulting in the technical problem of being unable to effectively adjust the bus load.

[0003] With respect to the above technical problem that the bus load cannot be effectively adjusted, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a bus load adjustment method, device, electronic device and storage medium, so as to at least solve the technical problem that the bus load cannot be effectively adjusted.

[0005] According to one aspect of an embodiment of the invention, a bus load adjustment method is provided. The method may include: in a target network segment, obtaining an actual sending time of a detection frame and a target sending time corresponding to the actual sending time; determining a time difference of the detection frame based on the actual sending time and the target sending time; adjusting the bus load using an adjustment strategy of the bus in the target network segment based on the time difference, a first time difference threshold allowed for the time difference, and a second time difference threshold allowed for the time difference, to obtain an adjustment result, wherein the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load.

[0006] Optionally, based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the bus adjustment strategy to obtain an adjustment result, including: in response to the time difference being less than the first time difference threshold and greater than the second time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a first calling result of the bus; based on the first calling result, determining the adjustment result.

[0007] Optionally, in response to a time difference being less than a first time difference threshold and greater than a second time difference threshold, the load reduction strategy of the adjustment strategy is called to obtain a first call result of the bus, including: obtaining an initial load reduction number of the bus; in response to a time difference being less than a first time difference threshold and greater than a second time difference threshold, determining a first message period of a first target message, a second message period of a second target message, and an initial message period of a detection frame in a target network segment, wherein the first time difference of the first target message is less than the second time difference of the second target message; summing the second message period and the first target value to obtain a summed second message period; adding one to the initial load reduction number to obtain a first target load reduction number of the bus; subtracting the first target value from the initial message period to obtain a differenced initial message period; determining the first call result based on the first message period, the summed second message period, the first target load reduction number, and the differenced initial message period.

[0008] Optionally, based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the bus adjustment strategy to obtain an adjustment result, including: in response to the time difference being less than or equal to the second time difference threshold, calling the load recovery strategy of the adjustment strategy to obtain a second call result of the bus; based on the second call result, determining the adjustment result.

[0009] Optionally, in response to the time difference being less than or equal to a second time difference threshold, the load recovery strategy of the adjustment strategy is called to obtain a second calling result of the bus, including: in response to the time difference being less than or equal to the second time difference threshold, determining the initial load reduction times of the bus; comparing the initial load reduction times with the load reduction times threshold of the initial load reduction times to obtain a comparison result of the initial load reduction times; based on the comparison result, calling the load recovery strategy to determine the second calling result.

[0010] Optionally, based on the comparison result, the load recovery strategy is called to determine a second call result, including: obtaining the initial number of load reductions of the bus; in response to the comparison result that the initial number of load reductions is greater than the load reduction number threshold, determining the first message period of the first target message, the second message period of the second target message, and the initial message period of the detection frame in the target network segment, wherein the first time difference of the first target message is less than the second time difference of the second target message; subtracting the second target value from the second message period to obtain the second message period after difference; subtracting the third target value from the initial number of load reductions to obtain the second target number of load reductions of the bus; summing the initial message period and the second target value to obtain the summed initial message period; determining the second call result based on the first message period, the second message period after difference, the second target number of load reductions, and the summed initial message period.

[0011] Optionally, based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the bus adjustment strategy to obtain an adjustment result, including: in response to the time difference being greater than or equal to the first time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a third calling result of the bus; based on the third calling result, determining the adjustment result.

[0012] According to one aspect of an embodiment of the present invention, a bus load adjustment device is provided. The device may include: an acquisition unit, used to acquire the actual sending time of the detection frame and the target sending time corresponding to the actual sending time in the target network segment; a determination unit, used to determine the time difference of the detection frame based on the actual sending time and the target sending time; an adjustment unit, used to adjust the bus load using the adjustment strategy of the bus in the target network segment based on the time difference, the first time difference threshold allowed for the time difference, and the second time difference threshold allowed for the time difference, to obtain an adjustment result, wherein the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load.

[0013] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.

[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0015] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0016] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0017] According to another aspect of the embodiments of the present invention, a computer program is provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.

[0018] According to another aspect of an embodiment of the present invention, a vehicle is further provided. When the vehicle is executed, the method in each embodiment of the present invention is implemented.

[0019] In an embodiment of the present invention, in a target network segment, an actual sending time of a detection frame and a target sending time corresponding to the actual sending time are obtained; based on the actual sending time and the target sending time, a time difference of the detection frame is determined; based on the time difference, a first time difference threshold value that the time difference is allowed to reach, and a second time difference threshold value that the time difference is allowed to reach, an adjustment strategy of the bus in the target network segment is used to adjust the bus load to obtain an adjustment result, wherein the first time difference threshold value is greater than the second time difference threshold value, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to make the bus load evenly distributed. That is, in an embodiment of the present invention, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time are first obtained in the target network segment, and then the time difference of the detection frame can be determined according to the actual sending time and the target sending time obtained above, and finally the bus load is adjusted according to the time difference, the first time difference threshold value that the time difference is allowed to reach, and the second time difference threshold value that the time difference is allowed to reach, using the adjustment strategy to adjust the bus load, so as to achieve the purpose of obtaining an adjustment result for characterizing that the bus is in a stable operating state. Considering that after obtaining the time difference of the detection frame, the bus load can be adjusted using the bus adjustment strategy based on the time difference, as well as the first time difference threshold that the time difference is allowed to reach and the second time difference threshold that the time difference is allowed to reach, so that the bus is in a stable operating state, thereby solving the technical problem that the bus load cannot be effectively adjusted and achieving the technical effect of being able to effectively adjust the bus load. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0021] Figure 1 is a flow chart of a bus load adjustment method according to an embodiment of the present invention;

[0022] Figure 2 is a flow chart of a method for adjusting a CAN bus load according to an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of a bus load adjustment device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] According to an embodiment of the present invention, a method for adjusting a bus load is provided. It should be noted that in the flowchart of the accompanying drawings, the steps shown therein can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0027] The following is an introduction to a bus load adjustment method according to an embodiment of the present invention.

[0028] Figure 1 is a flow chart of a bus load adjustment method according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:

[0029] Step S101, in a target network segment, obtaining an actual sending time of a detection frame and a target sending time corresponding to the actual sending time.

[0030] In the technical solution provided in the above step S101 of the present invention, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time can be obtained by the electronic control unit (ECU) of the vehicle in the target network segment.

[0031] Optionally, the target sending time may be the time when the detection frame is expected to be sent each time recorded by the ECU, which may be represented by t1. The actual sending time may be the time when the detection frame is actually sent, which may be represented by t2.

[0032] Optionally, each ECU can define a detection frame, whose priority is higher than the priority of the diagnostic message, lower than the priority of the application message, the tracking point message, the network management message and other messages, and has no conflict with the existing network segment protocol identifier (ID).

[0033] For example, the ECU needs to record the time when the detection frame is expected to be sent each time, which may be t1; and the time when the detection frame is actually sent, which may be t2.

[0034] It should be noted that this is only a preferred implementation method for obtaining the actual sending time of the detection frame and the target sending time corresponding to the actual sending time in the target network segment, and does not specifically limit the process and method for obtaining the actual sending time of the detection frame and the target sending time corresponding to the actual sending time in the target network segment.

[0035] Step S102: determining the time difference of the detection frame based on the actual sending time and the target sending time.

[0036] In the technical solution provided in the above step S102 of the present invention, after obtaining the actual sending time and the target sending time of the detection frame, the time difference of the detection frame can be determined, wherein the time difference can be represented by Δt, which can also be called the value of Δt.

[0037] Optionally, the value obtained by subtracting the target sending time from the actual sending time is determined as the time difference of the detection frame. For example, the ECU needs to record the time when the detection frame is expected to be sent each time, which can be t1, and the time when the detection frame is actually sent, which can be t2, and then the △t time can be calculated, which can be expressed by the following formula: △t=t2-t1.

[0038] Step S103, based on the time difference, the first time difference threshold allowed for the time difference, and the second time difference threshold allowed for the time difference, the bus load is adjusted using the adjustment strategy of the bus in the target network segment to obtain an adjustment result.

[0039] In the technical solution provided in the above step S103 of the present invention, after obtaining the time difference, the first time difference threshold allowed by the time difference and the second time difference threshold allowed by the time difference can be adjusted according to the time difference, and by using the adjustment strategy of the bus in the target network segment, so as to achieve the purpose of obtaining the adjustment result.

[0040] Optionally, the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load. The first time difference threshold can be a preset time difference threshold, such as 50 milliseconds (ms). The second time difference threshold can also be a preset time difference threshold, such as 30ms.

[0041] Optionally, the adjustment strategy may include a load reduction strategy and a load recovery strategy, wherein the load reduction strategy is used to reduce the load pressure of the bus, and the load recovery strategy is used to perform certain recovery operations on the bus load when the bus load is too high or abnormal, so that the bus load returns to a normal level.

[0042] It should be noted that this is only a preferred implementation method for determining the adjustment result of the bus, and the process and method for determining the adjustment result of the bus are not specifically limited. As long as the bus load is adjusted based on the time difference, the first time difference threshold allowed by the time difference, and the second time difference threshold allowed by the time difference, the adjustment strategy of the bus in the target network segment is used to adjust the bus load, the process and method for obtaining the adjustment result are all within the scope of protection of the present invention and are not listed here.

[0043] In the above steps S101 to S103 of the present invention, in the target network segment, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time are obtained; based on the actual sending time and the target sending time, the time difference of the detection frame is determined; based on the time difference, the first time difference threshold value allowed to be reached by the time difference and the second time difference threshold value allowed to be reached by the time difference, the bus load is adjusted by using the adjustment strategy of the bus in the target network segment to obtain an adjustment result, wherein the first time difference threshold value is greater than the second time difference threshold value, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to make the bus load evenly distributed. That is to say, in the embodiment of the present invention, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time are first obtained in the target network segment, and then the time difference of the detection frame can be determined according to the actual sending time and the target sending time obtained above, and finally the bus load is adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference and the second time difference threshold value allowed to be reached by the time difference, so as to achieve the purpose of obtaining the adjustment result used to characterize that the bus is in a stable operating state. Considering that after obtaining the time difference of the detection frame, the bus load can be adjusted using the bus adjustment strategy based on the time difference, as well as the first time difference threshold that the time difference is allowed to reach and the second time difference threshold that the time difference is allowed to reach, so that the bus is in a stable operating state, thereby solving the technical problem that the bus load cannot be effectively adjusted and achieving the technical effect of being able to effectively adjust the bus load.

[0044] The above method of this embodiment is further introduced below.

[0045] As an optional implementation method, step S103, based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the bus adjustment strategy to obtain an adjustment result, including: in response to the time difference being less than the first time difference threshold and greater than the second time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a first calling result of the bus; based on the first calling result, determining the adjustment result.

[0046] In this embodiment, after the time difference is obtained, the time difference can be compared with the first time difference threshold and the second time difference threshold respectively. If the time difference is less than the first time difference threshold and greater than the second time difference threshold, the load reduction strategy of the adjustment strategy needs to be called to obtain the first call result of the bus, and then according to the first call result obtained above, the purpose of determining the adjustment result can be achieved. Among them, the load reduction strategy can be called a load reduction mechanism.

[0047] For example, when the value of Δt is between 50 ms and 30 ms, that is, when 50 ms>the value of Δt>30 ms, the load reduction mechanism may be triggered to adjust the bus load, so as to obtain an adjustment result of the bus.

[0048] As an optional implementation method, in response to a time difference value being less than a first time difference threshold and greater than a second time difference threshold, calling a load reduction strategy of an adjustment strategy to obtain a first calling result of the bus, including: obtaining an initial load reduction number of the bus; in response to a time difference value being less than a first time difference threshold and greater than a second time difference threshold, determining a first message period of a first target message, a second message period of a second target message, and an initial message period of a detection frame in a target network segment, wherein the first time difference of the first target message is less than the second time difference of the second target message; summing the second message period and the first target value to obtain a summed second message period; adding one to the initial load reduction number to obtain a first target load reduction number of the bus; subtracting the first target value from the initial message period to obtain a differenced initial message period; determining the first calling result based on the first message period, the summed second message period, the first target load reduction number, and the differenced initial message period.

[0049] In this embodiment, the initial number of load reductions of the bus can be obtained first. When the time difference is less than the first time difference and greater than the second time difference, the first message period of the first target message in the target network segment, the second message period of the second target message and the initial message period of the detection frame are determined, and then the obtained second message period and the first target value are summed to obtain the summed second message period, and the obtained initial number of load reductions is added by one to obtain the first target number of load reductions of the bus, and the initial message period after subtraction of the first target value is obtained from the initial message period, and finally the first call result can be determined based on the above-obtained first message period, the summed second message period, the first target number of load reductions and the initial message period after subtraction.

[0050] Optionally, the initial load reduction times are recorded and updated by the ECU, and can be represented by an initial P, or simply referred to as P, and the initial P=0. The first target message can be a message with a time difference of 50ms and less than 50ms. The second target message can be a message with a time difference of more than 50ms and less than 1000ms. The first target value can be 10ms. The initial message period can be represented by an initial Tp, and the initial Tp=200ms. Except for the detection frame, the initial message period of the remaining messages on the target network segment can be represented by T0, and the updated message period can be represented by T.

[0051] For example, the message period of 50ms and below remains unchanged; the message period of 50ms to 1000ms is +10ms, P=P+1, Tp-10ms, so as to reduce the pressure of bus load. Here, taking the buried message as an example, the buried message can be changed from stopping to sending, then the period T of the buried message can be completed according to T=T0+P*10, where P is 10 at most.

[0052] For another example, in a node A of the network segment, the detection frame sends messages with a period of Tp. The value of △t is judged each time it is sent. The first time the detection frame detects △t=40ms, then P=0, Tp=200ms, which means that the bus load needs to be reduced at this time, so that the message period of 50ms and less messages sent by A remains unchanged, and the remaining message periods are +10ms, P=1, and Tp=190ms.

[0053] As an optional implementation method, based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the bus adjustment strategy to obtain an adjustment result, including: in response to the time difference being less than or equal to the second time difference threshold, calling the load recovery strategy of the adjustment strategy to obtain a second call result of the bus; based on the second call result, determining the adjustment result.

[0054] In this embodiment, after obtaining the time difference, if the time difference is less than or equal to the second time difference threshold, the load recovery strategy of the adjustment strategy can be called to obtain the second call result of the bus. According to the second call result obtained above, the adjustment result of the bus can be determined.

[0055] For example, when the value of △t is ≤30ms, it is necessary to check the value of P and then call the load recovery strategy of the adjustment strategy to achieve the purpose of determining the adjustment result.

[0056] As an optional implementation method, in response to the time difference being less than or equal to a second time difference threshold, the load recovery strategy of the adjustment strategy is called to obtain a second calling result of the bus, including: in response to the time difference being less than or equal to the second time difference threshold, determining the initial load reduction times of the bus; comparing the initial load reduction times with the load reduction times threshold of the initial load reduction times to obtain a comparison result of the initial load reduction times; based on the comparison result, calling the load recovery strategy to determine the second calling result.

[0057] In this embodiment, if the time difference is less than or equal to the second time difference threshold, the initial load reduction times of the bus can be determined, and the initial load reduction times are compared with the load reduction times threshold of the initial load reduction times, so as to obtain a comparison result, and according to the comparison result, the load recovery strategy can be called to determine the second calling result. The load reduction times threshold can be a preset threshold, such as 0.

[0058] Optionally, when the initial number of load reductions is greater than the load reduction threshold, it is necessary to call the load recovery strategy so as to determine the second call result; when the initial number of load reductions is equal to the load reduction threshold, the message can be sent normally. For example, when the value of P = 0, the load reduction or load recovery behavior will no longer be performed, and the message can be sent normally.

[0059] As an optional implementation method, based on the comparison result, the load recovery strategy is called to determine the second call result, including: obtaining the initial load reduction times of the bus; in response to the comparison result that the initial load reduction times are greater than the load reduction times threshold, determining the first message period of the first target message, the second message period of the second target message and the initial message period of the detection frame in the target network segment, wherein the first time difference of the first target message is less than the second time difference of the second target message; subtracting the second target value from the second message period to obtain the second message period after difference; subtracting the third target value from the initial load reduction times to obtain the second target load reduction times of the bus; summing the initial message period and the second target value to obtain the summed initial message period; determining the second call result based on the first message period, the second message period after difference, the second target load reduction times and the summed initial message period.

[0060] In this embodiment, the initial load reduction times of the bus can be obtained first. If the comparison result at this time is that the initial load reduction times are greater than the load reduction times threshold, the first message period of the first target message in the target network segment, the second message period of the second target message and the initial message period of the detection frame can be determined, and then the second message period is subtracted from the second target value to obtain the second message period after difference; the initial load reduction times are subtracted from the third target value to obtain the second target load reduction times; the initial message period and the second target value are summed to obtain the summed initial message period, and finally the purpose of determining the second call result is achieved based on the first message period, the second message period after difference, the second target load reduction times and the summed initial message period obtained above.

[0061] Optionally, the second target value may be a preset value, such as 5 ms. The third target value may be a preset value, such as 0.5 ms. The first message period, the second message period and the initial message period have been explained above and will not be described again here.

[0062] For example, when the value of △t is ≤30ms, the value of P can be checked. If the value of P is greater than 0, the message period of messages with a time difference of 50ms or less remains unchanged; the message period of messages with a time difference of more than 50ms and less than 1000ms is -5ms, P=P-0.5, Tp+5ms.

[0063] For another example, in a node A of the network segment, the detection frame sends messages with a period of Tp. The value of △t is judged each time it is sent. The third time the detection frame detects △t=29ms, P=2, and Tp=180ms, which means that the bus load needs to be restored at this time, so that the message period of 50ms and less messages sent by A remains unchanged, and the message period of the remaining messages is -0.5ms, P=1.5, and Tp=185ms.

[0064] As an optional implementation method, based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the bus adjustment strategy to obtain an adjustment result, including: in response to the time difference being greater than or equal to the first time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a third calling result of the bus; based on the third calling result, determining the adjustment result.

[0065] In this embodiment, after obtaining the time difference, if the time difference is greater than or equal to the first time difference threshold, it is necessary to call the load reduction strategy of the adjustment strategy, so that the third call result of the bus can be obtained, and then according to the third call result, the adjustment result of the bus can be determined.

[0066] Optionally, if the time difference is greater than or equal to the first time difference threshold, an advanced load reduction strategy in the load reduction strategy may be called to obtain a third call result to achieve the purpose of determining the adjustment result of the bus. The advanced load reduction strategy may be called an advanced load reduction mechanism.

[0067] For example, when the value of △t is ≥50ms, the load reduction advanced mechanism is triggered. The implementation process of the load reduction advanced mechanism is as follows: the message period of messages with a time difference of 50ms or less remains unchanged; the message period of application messages and network management messages with a time difference of more than 50ms and less than 1000ms is increased by 10ms, and P=P+1, Tp-10ms, at which time the buried point message is stopped. Among them, the maximum value of P is 10.

[0068] In this embodiment, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time can be first obtained in the target network segment, and then the time difference of the detection frame can be determined according to the actual sending time and the target sending time obtained above, and finally the bus load is adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference, and the second time difference threshold value allowed to be reached by the time difference, using the adjustment strategy to adjust the bus load, so as to achieve the purpose of obtaining the adjustment result for characterizing that the bus is in a stable operating state. Considering that after obtaining the time difference of the detection frame, the bus load can be adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference, and the second time difference threshold value allowed to be reached by the time difference, using the adjustment strategy of the bus, so that the bus is in a stable operating state, so as to solve the technical problem that the bus load cannot be effectively adjusted, and achieve the technical effect that the bus load can be effectively adjusted.

[0069] The technical solution of the embodiment of the present invention is illustrated below in conjunction with preferred implementation modes.

[0070] At present, CAN bus, full name Controller Area Network bus, is a serial communication protocol bus for real-time applications. It can use twisted pair to transmit signals and is one of the most widely used field buses in the world. The CAN protocol is used for communication between various components in the car to replace expensive and bulky distribution harnesses. The robustness of the protocol extends its use to other automation and industrial applications. The characteristics of the CAN protocol include integrity of serial data communication, real-time support, a transmission rate of up to 1 megabit per second (Mb / s), and 11-bit addressing and error detection capabilities.

[0071] Compared with other buses, the CAN bus also has obvious shortcomings. For example, compared with the automotive Ethernet with a speed of up to 100 megabits (M) and 1000M, the bandwidth capacity of the CAN bus is very small; compared with the cyclic execution of the serial communication network (Local Interconnect Network, abbreviated as LIN) bus application scheduling table, the CAN bus lacks predictability, which makes the load rate a key path in the design and application of the CAN bus.

[0072] The current industry's use of LIN is very mature, but because CAN is widely used and the load rate is a critical path, it may be over-designed in some usage scenarios, causing some electronic controllers to send a large number of messages to occupy the load, making the bus unstable, resulting in technical problems such as the inability to effectively adjust the bus load.

[0073] Therefore, in order to solve the above problems, the present invention provides a CAN bus load optimization method. The method requires all CAN nodes in the network to detect the bus load in real time to confirm that the CAN bus load fluctuates within a reasonable range. When the bus load is excessive and causes an increase in delay, some messages are selected for cycle reduction. While ensuring normal functions, CAN messages with low priority IDs can successfully complete communication interactions, ultimately achieving improved communication quality, so as to solve the technical problem of being unable to effectively adjust the bus load.

[0074] In an embodiment of the present invention, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time can be first obtained in the target network segment, and then the time difference of the detection frame can be determined according to the actual sending time and the target sending time obtained above, and finally the bus load can be adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference, and the second time difference threshold value allowed to be reached by the time difference, using the adjustment strategy to adjust the bus load, so as to achieve the purpose of obtaining the adjustment result used to characterize that the bus is in a stable operating state. Considering that after obtaining the time difference of the detection frame, the bus load can be adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference, and the second time difference threshold value allowed to be reached by the time difference, using the adjustment strategy of the bus, so that the bus is in a stable operating state, so as to solve the technical problem that the bus load cannot be effectively adjusted, and achieve the technical effect that the bus load can be effectively adjusted.

[0075] Figure 2 is a flow chart of a method for adjusting a CAN bus load according to an embodiment of the present invention, such as Figure 2 As shown, the main steps of the CAN bus load adjustment method include:

[0076] Step S201, the detection frame sends a message with Tp as the message period, and determines the value of Δt each time it sends.

[0077] In this embodiment, the detection frame sends messages with Tp as the message period, and the value of Δt must be determined each time it is sent. The message period of the detection frame message is Tp, and the initial Tp=200ms.

[0078] Optionally, each ECU can define a detection frame, whose priority is higher than the priority of the diagnostic message, lower than the priority of the application message, the tracking point message, the network management message and other messages, and has no conflict with the existing network segment protocol identifier (ID).

[0079] Optionally, the ECU needs to record the time when the detection frame is expected to be sent each time, which can be t1, and the time when the detection frame is actually sent, which can be t2, and then the △t time can be calculated, which can be expressed by the following formula:

[0080] △t=t2-t1.

[0081] Optionally, the ECU needs to record the number of times it performs load reduction actions, which can be represented by P, where initially P=0 and each time the load is reduced P=P+1.

[0082] Step S2021, when 50ms>△t value>30ms, the load reduction mechanism is triggered.

[0083] In this embodiment, when 50ms>Δt>30ms, the load reduction mechanism is triggered and step S20211 is executed.

[0084] Step S20211, the message period of messages with a time difference of 50ms or less remains unchanged; the message period of messages with a time difference of more than 50ms and less than 1000ms is +10ms, P=P+1, Tp-10ms. Taking the buried point message as an example, the buried point message can be switched from stopping to sending, and the period T of the buried point message can be completed according to T=T0+P*10, where P is a maximum of 10.

[0085] Step S2022, when the value of Δt is ≤30ms, check the value of P.

[0086] In this embodiment, when the value of Δt is ≤30 ms, the value of P is checked and step S20221 is executed.

[0087] Step S20221, when the value of P = 0, no load reduction or load recovery behavior is performed, and the message can be sent normally; when the value of P is greater than 0, the message period of the message with a time difference of 50ms or less remains unchanged; the message period of the message with a time difference of more than 50ms and less than 1000ms is -5ms, P=P-0.5, Tp+5ms.

[0088] Step S2023, when the value of Δt is ≥ 50ms, the load reduction advanced mechanism is triggered.

[0089] In this embodiment, when the value of Δt is ≥50 ms, the load reduction advanced mechanism is triggered and step S20231 is executed.

[0090] Step S20231: The message period of messages with a time difference of 50ms or less remains unchanged; the message period of application messages and network management messages with a time difference of more than 50ms and less than 1000ms is +10ms, and P=P+1, Tp-10ms, at which time the buried point message stops sending. Where P is a maximum of 10.

[0091] In the embodiment of the present invention, a node A in the network segment detects △t=40ms through the detection frame for the first time, at which time P=0, Tp=200ms, jumps to step S2021, and executes step S20211; the message period of the message with a time difference of 50ms or less sent by A remains unchanged, and the message period of the remaining messages is +10ms, P=1, Tp=190ms; the second detection frame detects △t=35ms, jumps to step S2021, and executes step S20211; the message period of the message sent by A is 50ms or less, and the message period of the remaining messages is +10ms, P=1, Tp=190ms; the second detection frame detects △t=35ms, jumps to step S2021, and executes step S20211; The message period of the message with a time difference of 50ms or less remains unchanged, and the message period of the other messages is +10ms, P=2, Tp=180ms; the third detection frame detects △t=29ms, jump to step S2022, P=2, and execute step S20221; the message period of the message with a time difference of 50ms or less sent by A remains unchanged, and the message period of the other messages is -0.5ms, P=1.5, Tp=185ms; the fourth detection frame detects △t=27ms, jump to Step S2022, P=1.5, execute step S20221; the message period of the message sent by A with a time difference of 50ms or less remains unchanged, and the message period of the other messages is -0.5ms, P=1, Tp=190ms; the fifth detection frame detects △t=29ms, jump to step S2022, P=1, execute step S20221; the message period of the message sent by A with a time difference of 50ms or less remains unchanged, and the message period of the other messages is -0.5ms, P=0.5, Tp=195ms; the sixth time through the detection frame, △t=25ms is detected, jump to step S2022, P=0.5, and execute step S20221; the message period of the message with a time difference of 50ms or less sent by A remains unchanged, and the message period of the remaining messages is -0.5ms, P=0, Tp=200ms; the seventh time through the detection frame, △t=22ms is detected, jump to step S2022, P=0, and execute step S20221; at this point, a cycle of reducing and restoring load ends.

[0092] In this embodiment, the actual sending time of the detection frame and the target sending time corresponding to the actual sending time can be first obtained in the target network segment, and then the time difference of the detection frame can be determined according to the actual sending time and the target sending time obtained above, and finally the bus load is adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference, and the second time difference threshold value allowed to be reached by the time difference, using the adjustment strategy to adjust the bus load, so as to achieve the purpose of obtaining the adjustment result for characterizing that the bus is in a stable operating state. Considering that after obtaining the time difference of the detection frame, the bus load can be adjusted according to the time difference, the first time difference threshold value allowed to be reached by the time difference, and the second time difference threshold value allowed to be reached by the time difference, using the adjustment strategy of the bus, so that the bus is in a stable operating state, so as to solve the technical problem that the bus load cannot be effectively adjusted, and achieve the technical effect that the bus load can be effectively adjusted.

[0093] According to an embodiment of the present invention, a bus load adjustment device is provided. It should be noted that the bus load adjustment device can be used to execute a bus load adjustment method in the embodiment.

[0094] Figure 3 Schematic diagram of a bus load adjustment device according to an embodiment of the present invention. Figure 3 As shown, a bus load adjustment device 300 may include: an acquisition unit 301 , a determination unit 302 and an adjustment unit 303 .

[0095] The acquisition unit 301 is used to acquire, in a target network segment, an actual sending time of a detection frame and a target sending time corresponding to the actual sending time.

[0096] The determination unit 302 is configured to determine a time difference of the detection frame based on the actual sending time and the target sending time.

[0097] The adjustment unit 303 is used to adjust the bus load based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, using the adjustment strategy of the bus in the target network segment to obtain an adjustment result, wherein the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load.

[0098] Optionally, the adjustment unit 303 may include: a first calling module, used to call the load reduction strategy of the adjustment strategy in response to the time difference being less than a first time difference threshold and greater than a second time difference threshold, to obtain a first calling result of the bus; and a first determination module, used to determine the adjustment result based on the first calling result.

[0099] Optionally, the first calling module may include: a first acquisition submodule, used to acquire the initial number of load reductions of the bus; a first determination submodule, used to determine the first message period of the first target message, the second message period of the second target message, and the initial message period of the detection frame in the target network segment in response to the time difference being less than the first time difference threshold and greater than the second time difference threshold, wherein the first time difference of the first target message is less than the second time difference of the second target message; a second acquisition submodule, used to sum the second message period and the first target value to obtain the summed second message period; a third acquisition submodule, used to add one to the initial number of load reductions to obtain the first target number of load reductions of the bus; a fourth acquisition submodule, used to subtract the first target value from the initial message period to obtain the initial message period after difference; a second determination submodule, used to determine the first calling result based on the first message period, the summed second message period, the first target number of load reductions, and the initial message period after difference.

[0100] Optionally, the adjustment unit 303 may include: a second calling module, used to call the load recovery strategy of the adjustment strategy in response to the time difference being less than or equal to a second time difference threshold, to obtain a second calling result of the bus; and a second determining module, used to determine the adjustment result based on the second calling result.

[0101] Optionally, the second calling module may include: a third determination submodule, used to determine the initial load reduction times of the bus in response to the time difference being less than or equal to the second time difference threshold; a comparison submodule, used to compare the initial load reduction times with the load reduction times threshold of the initial load reduction times to obtain a comparison result of the initial load reduction times; and a calling submodule, used to call the load recovery strategy based on the comparison result to determine the second calling result.

[0102] Optionally, the calling submodule can be used to obtain the initial number of load reductions of the bus; to determine the first message period of the first target message, the second message period of the second target message and the initial message period of the detection frame in the target network segment in response to the comparison result that the initial number of load reductions is greater than the load reduction number threshold, wherein the first time difference of the first target message is less than the second time difference of the second target message; to subtract the second target value from the second message period to obtain the second message period after difference; to subtract the third target value from the initial number of load reductions to obtain the second target number of load reductions of the bus; to sum the initial message period and the second target value to obtain the summed initial message period; to determine the second calling result based on the first message period, the second message period after difference, the second target number of load reductions and the summed initial message period.

[0103] Optionally, the adjustment unit 303 may include: a third calling module, used to call the load reduction strategy of the adjustment strategy in response to the time difference being greater than or equal to the first time difference threshold, and obtain a third calling result of the bus; a third determination module, used to determine the adjustment result based on the third calling result.

[0104] In this embodiment, an actual sending time of a detection frame and a target sending time corresponding to the actual sending time are obtained in a target network segment by an obtaining unit; a time difference of the detection frame is determined based on the actual sending time and the target sending time by a determining unit; and an adjustment unit adjusts the bus load by using an adjustment strategy of the bus in the target network segment based on the time difference, a first time difference threshold that the time difference is allowed to reach, and a second time difference threshold that the time difference is allowed to reach, to obtain an adjustment result, wherein the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to put the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load, thereby solving the technical problem that the bus load cannot be effectively adjusted and achieving the technical effect that the bus load can be effectively adjusted.

[0105] According to an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.

[0106] According to an embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored executable program. When the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0107] According to an embodiment of the present invention, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0108] According to an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0109] According to an embodiment of the present invention, a computer program is also provided. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0110] According to an embodiment of the present invention, a vehicle is also provided, which implements the method in each embodiment of the present invention when executed.

[0111] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0112] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0113] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units can be a logical function division, and there can be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

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

[0117] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for adjusting bus load, characterized in that: include: In the target network segment, obtaining an actual sending time of the detection frame and a target sending time corresponding to the actual sending time; Determine a time difference of the detection frame based on the actual sending time and the target sending time; Based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the adjustment strategy of the bus in the target network segment to obtain an adjustment result, wherein the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load.

2. The method according to claim 1, characterized in that Based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the adjustment strategy of the bus to obtain an adjustment result, including: In response to the time difference being less than the first time difference threshold and greater than the second time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a first calling result of the bus; Based on the first calling result, the adjustment result is determined.

3. The method according to claim 2, characterized in that In response to the time difference being less than the first time difference threshold and greater than the second time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a first calling result of the bus, including: Obtaining the initial load reduction times of the bus; In response to the time difference being less than the first time difference threshold and greater than the second time difference threshold, determining a first message period of a first target message, a second message period of a second target message, and an initial message period of the detection frame in the target network segment, wherein the first time difference of the first target message is less than the second time difference of the second target message; Performing a sum operation on the second message period and the first target value to obtain the summed second message period; Adding one to the initial load reduction times to obtain a first target load reduction times of the bus; Subtracting the first target value from the initial message period to obtain the initial message period after difference; The first calling result is determined based on the first message period, the summed second message period, the first target load reduction times, and the differenced initial message period.

4. The method according to claim 1, characterized in that: Based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the adjustment strategy of the bus to obtain an adjustment result, including: In response to the time difference being less than or equal to the second time difference threshold, calling the load recovery strategy of the adjustment strategy to obtain a second calling result of the bus; Based on the second calling result, the adjustment result is determined.

5. The method according to claim 4, characterized in that In response to the time difference being less than or equal to the second time difference threshold, calling the load recovery strategy of the adjustment strategy to obtain a second calling result of the bus, including: In response to the time difference being less than or equal to the second time difference threshold, determining an initial load reduction number of the bus; Comparing the initial load reduction times with a load reduction times threshold of the initial load reduction times to obtain a comparison result of the initial load reduction times; Based on the comparison result, the load recovery strategy is called to determine the second calling result.

6. The method according to claim 5, characterized in that Based on the comparison result, calling the load recovery strategy to determine the second calling result includes: Obtaining the initial load reduction times of the bus; In response to the comparison result that the initial load reduction number is greater than the load reduction number threshold, determining a first message period of the first target message, a second message period of the second target message, and an initial message period of the detection frame in the target network segment, wherein the first time difference of the first target message is less than the second time difference of the second target message; Subtracting the second target value from the second message period to obtain the second message period after difference is calculated; Subtract a third target value from the initial load reduction times to obtain a second target load reduction times of the bus; Performing a sum operation on the initial message period and the second target value to obtain the summed initial message period; The second calling result is determined based on the first message period, the second message period after difference, the second target load reduction times and the sum of the initial message period.

7. The method according to claim 1, characterized in that Based on the time difference, the first time difference threshold that the time difference is allowed to reach, and the second time difference threshold that the time difference is allowed to reach, the bus load is adjusted using the adjustment strategy of the bus to obtain an adjustment result, including: In response to the time difference being greater than or equal to the first time difference threshold, calling the load reduction strategy of the adjustment strategy to obtain a third calling result of the bus; Based on the third calling result, the adjustment result is determined.

8. A bus load adjustment device, characterized in that: include: An acquisition unit, used to acquire, in a target network segment, an actual sending time of the detection frame and a target sending time corresponding to the actual sending time; A determining unit, configured to determine a time difference of the detection frame based on the actual sending time and the target sending time; An adjustment unit is used to adjust the bus load based on the time difference, a first time difference threshold that the time difference is allowed to reach, and a second time difference threshold that the time difference is allowed to reach, using the adjustment strategy of the bus in the target network segment to obtain an adjustment result, wherein the first time difference threshold is greater than the second time difference threshold, the adjustment result is used to make the bus in a stable operating state, and the adjustment strategy is used to evenly distribute the bus load.

9. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.

12. A vehicle, characterized in that: The vehicle is used to perform the method according to any one of claims 1 to 7.