A communication bus load occupancy optimization method, device, medium and equipment
Patent Information
- Application Number
- CN202610877274.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-10-02
AI Technical Summary
但该专利申请中压缩后的数据报文可能改变原有的信号周期性,从而影响实时信号的接收和处理,其次,压缩方法可能增加对硬件存储的需求,尤其是在工程机械行业中,较高的硬件成本可能成为负担
[0074]本发明通过有效打包信号和优化信号周期序列等手段,显著提高了CAN总线系统的带宽利用率和传输效率。该方法能够在设计过程中最大限度地减少总线带宽的占用,降低了系统中节点连接产生的通信负担,提升了信号传输的稳定性和实时性,适用于工程机械电气控制系统中。通过减少不必要的带宽占用和优化数据传输策略,本发明有效解决了信号过载的问题,并提供了一种高效的解决方案,不仅提高了整体系统的运行可靠性,还具有广泛的推广应用前景。
Smart Images

Figure CN122870575A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method, apparatus, medium, and equipment for optimizing the load utilization of a communication bus, belonging to the field of communication security technology in the engineering machinery industry. Background Technology
[0002] With the rapid development of intelligent construction machinery technology, the functions undertaken by electronic control units (ECUs) are becoming increasingly complex, resulting in a significant increase in the amount of data transmitted through mechanical electronic control networks. To ensure the efficient and reliable operation of the mechanical electronic control system, this data is typically packaged into signal frames and transmitted via a bus. As data transmission demands increase, the bandwidth utilization rate of the construction machinery communication bus has become one of the key indicators for measuring the system's scalability and real-time performance.
[0003] Bus bandwidth utilization is commonly used to assess the use of bus resources, and this metric is crucial for determining whether the bus can accommodate more messages. Lower bandwidth utilization not only improves the bus's scalability but also ensures system real-time performance. Therefore, effectively reducing bandwidth utilization, especially when dealing with a large number of signals and increasing transmission demands, becomes a critical issue.
[0004] Since the 1970s, an upper limit for bus bandwidth utilization has been identified, and this upper limit is closely related to real-time performance. Under single-processor, fixed-priority, and rate-monotonically-priority configurations, 69% is considered the upper limit for bandwidth utilization. In the early 1990s, designers typically set an upper limit of 30% for the bandwidth utilization of automotive networks (such as CAN) based on experience to ensure system stability and real-time performance. With technological advancements and the emergence of new scheduling techniques and priority allocation methods, the upper limit for CAN bus utilization has increased to 80%, but overall, the bandwidth utilization of automotive buses remains limited by an upper limit.
[0005] As a serial communication protocol, CAN transmits data through bit-by-bit arbitration. Simultaneous transmission from multiple nodes can cause arbitration delays, and the transmission of numerous short frames wastes significant bandwidth. Furthermore, the inconsistent trigger cycles of signals from different ECUs and sensors mean that signal packetization also affects bus bandwidth utilization. Therefore, a proper signal packetization method can not only reduce the transmission of frame headers and trailers, lowering bandwidth occupancy, but also improve bus transmission efficiency.
[0006] Chinese patent application CN115001893A discloses a CAN bus data compression method, comprising: acquiring the current CAN message of a vehicle; segmenting the current CAN message to obtain a current compression unit; comparing the current compression unit with the compression unit of the previous CAN message of the vehicle, and removing duplicate information in the current compression unit that is the same as the compression unit of the previous CAN message; recording the data changes of the compression units within a preset time period to obtain the change rate of the compression units; rearranging the order of the current compression units according to the change rate; and compressing the rearranged compression units to obtain the compressed CAN bus data of the vehicle. This method re-divides the messages within the vehicle's CAN bus into compression units, and obtains the final arrangement of each compression unit by recording the change rate of each compression unit within a preset time period. It overcomes the limitation that different vehicle models define different signals within the CAN bus message.
[0007] Chinese patent application CN116800852 A discloses a message data compression method and apparatus. The method includes: when it is determined that message data exists in the memory block corresponding to a currently received first message data frame, acquiring first timestamp information and first data information corresponding to the first message data frame, and second timestamp information and second data information corresponding to a second message data frame; calculating a first difference between the first timestamp information and the second timestamp information, and a second difference between the first data information and the second data information; compressing the first timestamp information based on the first difference, and compressing the first data information based on the second difference, to obtain compressed first timestamp information and first data information; and obtaining a compressed target message data frame based on the compressed first timestamp information and first data information. This compressed message data can occupy storage space accurate to the bit level, significantly reducing the compression ratio and decreasing the network transmission load.
[0008] Chinese patent application CN115001893A provides a CAN bus data compression method. This method involves segmenting the current CAN message, removing duplicate information, and recording data changes within a preset time period to obtain the change rate of the compression unit. The data order is then rearranged according to the change rate to obtain the final compressed CAN bus data. However, the scientific validity and rigor of the CAN data change rate setting in this patent application are questionable, and its applicability to engineering machinery products is significantly limited. Chinese patent application CN116800852A provides a message data compression method and apparatus. This method includes: calculating the timestamp information difference and the data information difference when a first frame of message data is determined to exist in a memory block; performing data compression based on timestamp interpolation and information interpolation to obtain a compressed target message data frame. However, the compressed data message in this patent application may alter the original signal periodicity, thus affecting the reception and processing of real-time signals. Furthermore, the compression method may increase the demand for hardware storage, which could be a burden, especially in the engineering machinery industry where higher hardware costs could be a significant issue. Summary of the Invention
[0009] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a method, apparatus, medium and equipment for optimizing the load utilization of communication bus, so as to minimize the bus bandwidth utilization during the design process. By effectively packaging signals and optimizing the signal period sequence, the bandwidth utilization and transmission efficiency of the CAN bus system can be improved, which has broad application prospects.
[0010] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution.
[0011] In a first aspect, the present invention discloses a method for optimizing the load utilization rate of a communication bus, comprising:
[0012] Acquire the signals to be transmitted generated by tasks on each ECU mounted on a CAN bus;
[0013] The signals to be transmitted are divided according to their target attributes, and signals belonging to the same target attribute are clustered into the same signal cluster to obtain multiple signal clusters with different target attributes;
[0014] Determine the total number of signal bits for each signal cluster;
[0015] For each signal cluster, when the total number of bits of the signal within the cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits of the remaining signal in the updated signal cluster is not greater than the target value.
[0016] When the total number of bits in all signal clusters is no greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy.
[0017] Furthermore, the target attribute is the signal period.
[0018] Furthermore, the CAN bus is a CAN bus for engineering machinery communication.
[0019] Further, when the total number of bits in the signal cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal cluster is continuously packed into new empty frames and updated until the total number of bits in the updated signal cluster does not exceed the target value, including:
[0020] Based on the ILP algorithm, the decision variables are determined, linear constraints are created, and the linear objective function is set.
[0021] The decision variable one represents whether the signal is packaged into a certain data frame, expressed as:
[0022] ;
[0023] In the formula, x i Let the first decision variable be... This represents the i-th signal in the k-th signal cluster. Indicates a data frame. It is an integer and satisfies , To divide signals into clusters according to their periodicity, that is, to group signals of the same period into the same cluster. This represents the total number of signals in the k-th signal cluster. This represents the k-th ECU. express The set of all messages sent;
[0024] The creation of linear constraints is represented as follows:
[0025] ;
[0026] In the formula, express The sum of the internal signal magnitudes;
[0027] The linear objective function includes: and ;
[0028] in, Indicates the current signal cluster Packed into data frames China maximizes ; This indicates that when multiple solutions have the same maximization... At that time, by maximizing To minimize the number of remaining signals to be packed.
[0029] Furthermore, when the total number of bits in the signal cluster is not greater than the target value, the data frame is constructed by optimizing to minimize bus occupancy, including:
[0030] Based on the ILP algorithm, we determine two decision variables, create two linear constraints, and set two linear objective functions.
[0031] The second decision variable represents whether the signal is packaged into a certain data frame, expressed as:
[0032] ;
[0033] In the formula, y i,j Let i and j be decision variables, where i and j are integers and satisfy the following conditions: , ;
[0034] The second linear constraint includes:
[0035] Constraint 1: The source ECU of each signal assigned to the current data frame must be the same as the source ECU of all its internal signals;
[0036] Constraint 2: Each signal can only be assigned to one data frame, as shown below:
[0037] ;
[0038] Constraint 3: The periods of the internal signals allocated to the current data frame must be divisible by each other, expressed as follows:
[0039] ;
[0040] In the formula, This indicates the period of the corresponding signal; IF means "if". Represents the modulo function. Indicating the k-th signal cluster The Middle One signal;
[0041] Constraint 4: The payload of each data frame must meet the CAN specification, specifically:
[0042] Calculate data frame payload size ,when ,
[0043] ;
[0044] when ,
[0045] ;
[0046] Using intermediate binary variables To instruct Does it contain a signal?
[0047] ;
[0048] ;
[0049] For the sum of signal magnitudes within a data frame It should be less than or equal to the target value allowed by CAN, expressed as:
[0050] ;
[0051] The second linear objective function is to minimize the bus bandwidth utilization rate, expressed as: ;
[0052] In the formula, Indicates transmission time. Represents a data frame The cycle.
[0053] Furthermore, constraint 3 also includes:
[0054] The period of the signal that needs to be packed into the data frame is longer than the period of the signal that has already been packed into the data frame.
[0055] Furthermore, the second linear constraint also includes: Constraint 5: For ,if ,but Same as before packaging; if ,but
[0056] ;
[0057] In the formula, Represents a data frame Transmission time, and These are respectively represented as data frames. The time required to transmit 1 bit in the arbitration segment and data segment. Represents a data frame The sum of all digits;
[0058] Data Frame Deadline It is an internal signal set The minimum value of the signal cutoff time.
[0059] ;
[0060] In the formula, Represents a data frame The cutoff time of the internal signals;
[0061] Calculating response time requires considering priority allocation and message scheduling strategies, and ensuring that transmission time meets the requirements.
[0062] Bundle, represented as:
[0063] .
[0064] Secondly, the present invention also discloses a communication bus load occupancy optimization device, comprising:
[0065] The acquisition module is used to acquire the signals to be transmitted generated by the tasks on each ECU mounted on a CAN bus;
[0066] The segmentation module is used to segment the signal to be transmitted according to the target attribute, and cluster signals belonging to the same target attribute into the same signal cluster to obtain multiple signal clusters with different target attributes;
[0067] The optimization module is used to determine the total number of signal bits for each signal cluster;
[0068] For each signal cluster, when the total number of bits of the signal within the cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits of the remaining signal in the updated signal cluster is not greater than the target value.
[0069] When the total number of bits in all signal clusters is no greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy.
[0070] Thirdly, the present invention also discloses a computer-readable storage medium for storing one or more programs, characterized in that the one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the method described in the first aspect.
[0071] Fourthly, the present invention also discloses a computer device, comprising,
[0072] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for performing the method described in the first aspect.
[0073] The beneficial effects achieved by this invention are as follows:
[0074] This invention significantly improves the bandwidth utilization and transmission efficiency of a CAN bus system by effectively packaging signals and optimizing signal cycle sequences. This method minimizes bus bandwidth usage during the design process, reduces the communication burden caused by node connections in the system, and enhances the stability and real-time performance of signal transmission. It is applicable to electrical control systems for engineering machinery. By reducing unnecessary bandwidth usage and optimizing data transmission strategies, this invention effectively solves the problem of signal overload and provides a highly efficient solution. It not only improves the overall system reliability but also has broad application prospects. Attached Figure Description
[0075] Figure 1 The bus communication system of the present invention includes nodes (ECUs), signals, and messages (frames), which are the main components, and are represented by tuples {E, T, S, M} respectively.
[0076] Figure 2 This is a schematic diagram of the design logic of the present invention;
[0077] Figure 3 This is a schematic diagram of the algorithm for minimizing the number of frames in this invention;
[0078] Figure 4 This is a schematic diagram of the algorithm for minimizing bus occupancy when sending data in this invention. Detailed Implementation
[0079] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0080] Example 1: This example introduces a method for optimizing the load utilization of a communication bus, including:
[0081] Acquire the signals to be transmitted generated by tasks on each ECU mounted on a CAN bus;
[0082] The signals to be transmitted are divided according to their target attributes, and signals belonging to the same target attribute are clustered into the same signal cluster to obtain multiple signal clusters with different target attributes;
[0083] Determine the total number of signal bits for each signal cluster;
[0084] For each signal cluster, when the total number of bits of the signal within the cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits of the remaining signal in the updated signal cluster is not greater than the target value.
[0085] When the total number of bits in all signal clusters is no greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy.
[0086] In this embodiment, the target attribute is the signal period.
[0087] In this embodiment, the CAN bus is a CAN bus for engineering machinery communication.
[0088] In this embodiment, when the total number of bits in the signal cluster is greater than the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits in the remaining signal in the updated signal cluster is not greater than the target value, including:
[0089] Based on the ILP algorithm, the decision variables are determined, linear constraints are created, and the linear objective function is set.
[0090] The decision variable one represents whether the signal is packaged into a certain data frame, expressed as:
[0091] ;
[0092] In the formula, x i Let the first decision variable be... This represents the i-th signal in the k-th signal cluster. Indicates a data frame. It is an integer and satisfies , To divide signals into clusters according to their periodicity, that is, to group signals of the same period into the same cluster. This represents the total number of signals in the k-th signal cluster. This represents the k-th ECU. express The set of all messages sent;
[0093] The creation of linear constraints is represented as follows:
[0094] ;
[0095] In the formula, express The sum of the internal signal magnitudes;
[0096] The linear objective function includes: and ;
[0097] in, Indicates the current signal cluster Packed into data frames China maximizes ; This indicates that when multiple solutions have the same maximization... At that time, by maximizing To minimize the number of remaining signals to be packed.
[0098] In this embodiment, when the total number of bits in the signal cluster is not greater than the target value, the optimization to construct a data frame with the goal of minimizing bus occupancy includes:
[0099] Based on the ILP algorithm, we determine two decision variables, create two linear constraints, and set two linear objective functions.
[0100] The second decision variable represents whether the signal is packaged into a certain data frame, expressed as:
[0101] ;
[0102] In the formula, y i,j Let i and j be decision variables, where i and j are integers and satisfy the following conditions: , ;
[0103] The second linear constraint includes:
[0104] Constraint 1: The source ECU of each signal assigned to the current data frame must be the same as the source ECU of all its internal signals;
[0105] Constraint 2: Each signal can only be assigned to one data frame, as shown below:
[0106] ;
[0107] Constraint 3: The periods of the internal signals allocated to the current data frame must be divisible by each other, expressed as follows:
[0108] ;
[0109] In the formula, This indicates the period of the corresponding signal; IF means "if". Represents the modulo function. Indicating the k-th signal cluster The Middle One signal;
[0110] Constraint 4: The payload of each data frame must meet the CAN specification, specifically:
[0111] Calculate data frame payload size ,when ,
[0112] ;
[0113] when ,
[0114] ;
[0115] Using intermediate binary variables To instruct Does it contain a signal?
[0116] ;
[0117] ;
[0118] For the sum of signal magnitudes within a data frame It should be less than or equal to the target value allowed by CAN, expressed as:
[0119] ;
[0120] The second linear objective function is to minimize the bus bandwidth utilization rate, expressed as: ;
[0121] In the formula, Indicates transmission time. Represents a data frame The cycle.
[0122] In this embodiment, constraint 3 further includes:
[0123] The period of the signal that needs to be packed into the data frame is longer than the period of the signal that has already been packed into the data frame.
[0124] In this embodiment, the second linear constraint further includes: Constraint 5: For ,if ,but Same as before packaging; if ,but
[0125] ;
[0126] In the formula, Represents a data frame Transmission time, and These are respectively represented as data frames. The time required to transmit 1 bit in the arbitration segment and data segment. Represents a data frame The sum of all digits;
[0127] Data Frame Deadline It is an internal signal set The minimum value of the signal cutoff time.
[0128] ;
[0129] In the formula, Represents a data frame The cutoff time of the internal signals;
[0130] Calculating response time requires considering priority allocation and message scheduling strategies, and ensuring that transmission time meets the requirements.
[0131] Bundle, represented as: .
[0132] Example 2, based on the same inventive concept as Example 1, introduces a method for optimizing the load utilization of a communication bus. This example is applied to a functional safety fieldbus for engineering machinery. The specific steps of the method are as follows:
[0133] 1) Divide the signal clusters;
[0134] 2) Maximize frame utilization and minimize the number of frames;
[0135] 3) Minimize bus occupancy;
[0136] like Figure 1 As shown, the bus communication system mainly includes nodes (ECUs), signals, and messages (frames), which are the main components, and are represented by tuples. express.
[0137] in, use It means, and all They are all connected to a CAN bus. (Collection) The size is In this article Used to represent a set Size.
[0138] For task use This indicates that these tasks are assigned to different ECUs, and multiple tasks constitute a specific application.
[0139] The signals are data generated periodically by tasks on the node ECU, and this signal data needs to be transmitted via the bus to meet communication requirements.
[0140] A frame is a data frame formed by combining signals generated by the same source ECU in different ways, and by adding corresponding frame headers and frame trailers to form a specific format to meet the requirements of bus transmission.
[0141] The specific model of the bus communication system of the present invention is as follows:
[0142] The signals in the system are represented as follows: ,in, For the node The set of signals generated by the task; represented as: ,in, for The first in One signal.
[0143] The frame in the system is represented as: ,in express The set of messages sent is denoted as: , express The first in One message frame.
[0144] like Figure 2 As shown, the division method in step 1) is as follows:
[0145] The signals in the system model are divided into signal clusters according to their period length, and then arranged in ascending order of period, with signals of the same period grouped into the same cluster. Cluster The sum of the magnitudes of the internal signals, i.e.:
[0146] ;
[0147] For each ,judge Is it greater than 64? If, run step 2), until the condition is no longer met. Then proceed to step 3).
[0148] like Figure 3 As shown, the design method for step 2) is as follows:
[0149] 1) Define decision variables: Define a set of decision variables to represent whether a signal is packaged into a certain data frame. For Each signal in Define decision variables Determine the signal Whether it is packaged into a data frame middle:
[0150] ;
[0151] in, It is an integer and satisfies .
[0152] 2) Create linear constraints, This represents the sum of signal magnitudes within a frame. For data frames... , Less than or equal to the maximum allowable load of CAN, that is:
[0153] ;
[0154] 3) Set a linear objective function involving two objectives: Objective 1: maximize frame utilization; Objective 2: minimize the number of frames. That is, minimize the number of frames while maximizing frame utilization. By combining these two objective functions, we can maximize bandwidth utilization while minimizing the number of packets, ensuring efficient data transmission.
[0155] Among them, target 1 will be the current signal cluster Packed into data frames China maximizes ; As stated in objective 2, when multiple solutions have the same At that time, the goal is to minimize the number of packetized signals, i.e., reduce the number of packets. .
[0156] 4) Solve the above model using the ILP algorithm, calculate the optimal packing scheme, and pack the signals according to the optimal solution. For the packed signal clusters... ,judge Is it greater than 64? Then, iterate through step 2 until the condition is no longer met. If Then proceed to step 3).
[0157] like Figure 4 As shown, the design method for step 3) is as follows:
[0158] (1) Define decision variables. Define a set of decision variables to represent whether a signal is packaged into a data frame. For the signal Define decision variables Determine the signal Is it packed into a frame? middle,
[0159] ;
[0160] in, It is an integer and satisfies , .
[0161] (2) Create linear constraint 1: Source ECU consistency. The source ECU of each message must be the same as all its internal signal source ECUs. Signals in each ECU are packaged, therefore... and They have the same source ECU.
[0162] (3) Create linear constraint 2: unique signal allocation, requiring that each signal can only be allocated to one data frame. Therefore, this constraint can be expressed as:
[0163] ;
[0164] (4) Create linear constraint 3: signal period constraint, which requires that the periods of the signals within the message must be divisible by each other. Since they are arranged in ascending order of period, the period of the current signal must be greater than the period of the signals already packaged into the message. Therefore, this constraint can be expressed as:
[0165] ;
[0166] (5) Create linear constraint 4: message payload constraint, requiring that the payload of each message must meet the CAN specification. First, calculate the frame payload size. For packing into the current frame, i.e., when ,
[0167] ;
[0168] For packing into a new frame, i.e. when ,
[0169] ;
[0170] For the sum of the intra-frame signal magnitudes It should be less than or equal to the maximum allowable payload of CAN, which is 64 bits.
[0171] ;
[0172] (5) Create linear constraint 5: transmission time constraint, requiring the transmission time to be completed before the deadline. For ,if ,but Same as before packaging. If ,but:
[0173] ;
[0174] Message Frame The deadline is the internal signal set The smaller value of the signal cutoff time is:
[0175] ;
[0176] In this calculation, the message's deadline satisfies the deadline constraints of all internal signals.
[0177] Calculating response time requires considering priority allocation and message scheduling strategies, while ensuring that transmission time meets constraints.
[0178] .
[0179] (6) Set a linear objective function to minimize the bus bandwidth utilization, i.e.:
[0180] .
[0181] The above model is solved using the ILP algorithm to calculate the optimal packing scheme, and the remaining signals from step two are packed into the existing frames and empty frames based on the optimal solution.
[0182] Example 3, based on the same inventive concept as other examples, introduces a communication bus load occupancy optimization device, comprising:
[0183] The acquisition module is used to acquire the signals to be transmitted generated by the tasks on each ECU mounted on a CAN bus;
[0184] The segmentation module is used to segment the signal to be transmitted according to the target attribute, and cluster signals belonging to the same target attribute into the same signal cluster to obtain multiple signal clusters with different target attributes;
[0185] The optimization module is used to determine the total number of signal bits for each signal cluster;
[0186] For each signal cluster, when the total number of bits of the signal within the cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits of the remaining signal in the updated signal cluster is not greater than the target value.
[0187] When the total number of bits in all signal clusters is no greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy.
[0188] Example 4, based on the same inventive concept as other examples, describes a computer-readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the method described in Example 1.
[0189] Example 5, based on the same inventive concept as other examples, describes a computer device, including,
[0190] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for performing the method described in Embodiment 2.
[0191] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0192] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0193] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0194] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0195] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for optimizing the load utilization of a communication bus, characterized in that, include: Acquire the signals to be transmitted generated by tasks on each ECU mounted on a CAN bus; The signals to be transmitted are divided according to their target attributes, and signals belonging to the same target attribute are clustered into the same signal cluster to obtain multiple signal clusters with different target attributes; Determine the total number of signal bits for each signal cluster; For each signal cluster, when the total number of bits of the signal within the cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits of the remaining signal in the updated signal cluster is not greater than the target value. When the total number of bits in all signal clusters is no greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy.
2. The communication bus load occupancy optimization method according to claim 1, characterized in that, The target attribute is the signal period.
3. The method for optimizing the load utilization rate of the a communication bus according to claim 1, characterized in that, The CAN bus mentioned is the CAN bus for communication in engineering machinery.
4. The communication bus load occupancy optimization method according to claim 1, characterized in that, When the total number of bits in the signal cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits in the remaining signal cluster after the update is not greater than the target value, including: Based on the ILP algorithm, the decision variables are determined, linear constraints are created, and the linear objective function is set. The decision variable one represents whether the signal is packaged into a certain data frame, expressed as: ; In the formula, x i Let the first decision variable be... This represents the i-th signal in the k-th signal cluster. Indicates a data frame. It is an integer and satisfies , To divide signal clusters according to signal period, This represents the total number of signals in the k-th signal cluster. This represents the k-th ECU. express The set of all messages sent; The creation of linear constraints is represented as follows: ; In the formula, express The sum of the internal signal magnitudes; The linear objective function includes: and ; in, Indicates the current signal cluster Packed into data frames China maximizes ; This indicates that when multiple solutions have the same maximization... At that time, by maximizing To minimize the number of remaining signals to be packed.
5. The communication bus load occupancy optimization method according to claim 4, characterized in that, When the total number of bits in the signal cluster is not greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy, including: Based on the ILP algorithm, we determine two decision variables, create two linear constraints, and set two linear objective functions. The second decision variable represents whether the signal is packaged into a certain data frame, expressed as: ; In the formula, y i,j Let i and j be decision variables, where i and j are integers and satisfy the following conditions: , ; The second linear constraint includes: Constraint 1: The source ECU of each signal assigned to the current data frame must be the same as the source ECU of all its internal signals; Constraint 2: Each signal can only be assigned to one data frame, as shown below: ; Constraint 3: The periods of the internal signals allocated to the current data frame must be divisible by each other, expressed as follows: ; In the formula, This indicates the period of the corresponding signal; IF means "if". Represents the modulo function. Indicating the k-th signal cluster The Middle One signal; Constraint 4: The payload of each data frame must meet the CAN specification, specifically: Calculate data frame payload size , when , ; when , ; Using intermediate binary variables To instruct Does it contain a signal? ; ; For the sum of signal magnitudes within a data frame It should be less than or equal to the target value allowed by CAN, expressed as: ; The second linear objective function is to minimize the bus bandwidth utilization rate, expressed as: ; In the formula, Indicates transmission time. Represents a data frame The cycle.
6. The communication bus load occupancy optimization method according to claim 5, characterized in that, The constraint 3 also includes: The period of the signal that needs to be packed into the data frame is longer than the period of the signal that has already been packed into the data frame.
7. The communication bus load occupancy optimization method according to claim 5, characterized in that, The second linear constraint also includes: Constraint 5: For ,if ,but Same as before packaging; if ,but ; In the formula, Represents a data frame Transmission time, and These are respectively represented as data frames. The time required to transmit 1 bit in the arbitration segment and data segment. Represents a data frame The sum of all digits; Data Frame Deadline It is an internal signal set The minimum value of the signal cutoff time. ; In the formula, Represents a data frame The cutoff time of the internal signals; Calculating response time requires considering priority allocation and message scheduling strategies, and ensuring that transmission time meets the requirements. Bundle, represented as: 。 8. A communication bus load occupancy optimization device, characterized in that, include: The acquisition module is used to acquire the signals to be transmitted generated by the tasks on each ECU mounted on a CAN bus; The segmentation module is used to segment the signal to be transmitted according to the target attribute, and cluster signals belonging to the same target attribute into the same signal cluster to obtain multiple signal clusters with different target attributes; The optimization module is used to determine the total number of signal bits for each signal cluster; For each signal cluster, when the total number of bits of the signal within the cluster exceeds the target value, with the goal of maximizing frame utilization and minimizing the number of frames, the signal is continuously packed into new empty frames, and the signal cluster is updated until the total number of bits of the remaining signal in the updated signal cluster is not greater than the target value. When the total number of bits in all signal clusters is no greater than the target value, the data frame is constructed with the goal of minimizing bus occupancy.
9. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any of the methods of claims 1 to 7.
10. A computer device, characterized in that, include, One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the method of any of claims 1 to 7.
Citation Information
Patent Citations
CAN bus data compression method and system
CN115001893A
Message data compression method and device
CN116800852A