A method, apparatus, and medium for collision coordination arbitration of a carrier sense bus

By introducing coordination and exemption mechanisms on the carrier listening bus, the transmission order is adaptively adjusted, which solves the problem of low-priority units being blocked due to high-priority units occupying transmission rights for a long time, and achieves a balance between communication efficiency and reliability.

CN118233241BActive Publication Date: 2025-11-21NANJING GUODIAN NANZI POWER GRID AUTOMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410402805.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2025-11-21
Estimated Expiration
2044-04-03

AI Technical Summary

Technical Problem

In the fields of power and industrial control, as the scale of the system expands and the number of communication units increases, the long-term occupation of transmission rights by high-priority units can cause communication frame transmission blockage by low-priority units, reduce communication efficiency, and may even lead to system crashes.

Method used

By introducing a coordination mechanism on the carrier listening bus, the transmitting unit is adaptively selected according to the communication load, allowing low-priority units to transmit first under high load, and optimizing the communication process through transmission flags and exemption mechanisms to ensure the transmission efficiency of high-priority units.

Benefits of technology

By maintaining high-priority communication efficiency under low load and avoiding low-priority blocking under high load, a balance between communication efficiency and reliability is achieved, thus alleviating the problem of communication frame transmission blocking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118233241B_ABST
    Figure CN118233241B_ABST
Patent Text Reader

Abstract

The application discloses a carrier monitoring bus conflict coordination arbitration method, equipment and medium, relates to the technical field of industrial automation control, and adds a coordination mechanism on the basis of original bus carrier monitoring conflict arbitration. The sending unit can be adaptively selected according to a communication load condition. In the case that the communication load is low, the priority communication function of the original carrier monitoring conflict arbitration mechanism can be reserved. In the case that the communication load is large, the low-priority unit is allowed to be sent in advance, so that the communication blockage of the low-priority unit is avoided, the sending efficiency of the high-priority unit is effectively considered, and the organic unification of communication efficiency and communication reliability is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial automation control technology, specifically to a conflict coordination and arbitration method, device, and medium for a carrier listening bus. Background Technology

[0002] In the fields of power and industrial control, data acquisition and control devices typically use the CAN bus as the communication bus for CPU modules and input / output modules. This provides a simple, reliable, and low-cost bus structure, enabling real-time, reliable, and flexible data communication. The CAN bus is a controller area network that uses a multi-master serial communication method. It allows for bus listening; when the bus is idle, all units can begin sending messages, and the unit that accesses the bus first gains the right to send. When multiple units start sending simultaneously and conflicts occur, an arbitration mechanism using carrier sensing to avoid collisions is employed, allowing the higher-priority unit to gain the right to send. This arbitration mechanism allows any device on the bus to have a chance to gain control when the communication load is light.

[0003] However, as the system grows larger, the number of connected units increases, and the communication content becomes more complex, the communication load will become heavier. Since high-priority units can always obtain the right to send, low-priority units will always be in a waiting state, and their communication frame transmission will be blocked, reducing communication efficiency. If the communication content of high-priority and low-priority units has a sequential coupling relationship, it will cause communication lock-up, and in severe cases, it will cause system crash. Summary of the Invention

[0004] The purpose of this invention is to provide a method, device, and medium for conflict coordination and arbitration of a carrier listening bus in order to solve at least one of the above-mentioned technical problems.

[0005] In a first aspect, the present invention provides a conflict coordination and arbitration method for a carrier sense bus, applied to an automated control system; the automated control system includes multiple communication units, and communication data between the multiple communication units is transmitted through a target bus; the target bus is a bus based on a carrier sense conflict avoidance arbitration mechanism; each communication unit is configured with an allow-to-transmit flag, the allow-to-transmit flag including true and false; each communication unit is configured with a priority value; the method includes: step S102, determining whether the allow-to-transmit flag of the target communication unit is true; if yes, then executing step S108 to send a communication frame to the target bus; if no, then executing step S104; step S104, entering a waiting process, and during the waiting process... Listen to the target bus; Step S106, determine whether the waiting time exceeds the preset waiting time; if yes, proceed to step S102; if no, and the target bus is idle, set the allow-to-send flag of the target communication unit to true, and execute step S108; Step S108, arbitrate the communication frame based on the priority setting of the target communication unit and the carrier sensing conflict avoidance arbitration mechanism to determine whether the target communication unit has obtained the right to send; Step S110, determine whether the target communication unit has obtained the right to send; if no, proceed to step S102; if yes, complete the transmission of the communication frame through the target bus, and set the allow-to-send flag of the target communication unit to false.

[0006] Furthermore, the preset waiting time is the task scheduling cycle time.

[0007] Furthermore, it also includes: obtaining the idle duty cycle of the target bus and the priority value of the target communication unit; and determining the preset waiting time based on the idle duty cycle and the priority value.

[0008] Furthermore, each communication unit is set with an exemption waiting count; step S102 also includes: if the number of times the allowed transmission flag of the target communication unit is continuously determined to be false exceeds the exemption waiting count, then the waiting process is skipped and a communication frame is sent directly to the target bus.

[0009] Furthermore, each communication unit is set with an exemption waiting count; the priority setting includes high priority and low priority; step S102 further includes: determining whether the priority setting of the target communication unit is high priority; if so, and the number of times the allowed transmission flag of the target communication unit is continuously determined to be false exceeds the exemption waiting count, then skip the waiting process and directly send a communication frame to the target bus.

[0010] Further, step S108 includes: if multiple communication units simultaneously send communication frames to the target bus, the communication unit with the higher priority value among the multiple communication units obtains the sending permission, while the communication unit with the lower priority value does not obtain the sending permission.

[0011] In a second aspect, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in the first aspect.

[0012] Thirdly, the present invention also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method described in the first aspect.

[0013] This invention provides a conflict coordination and arbitration method, device, and medium for a carrier sense bus. Based on the existing carrier sense bus conflict arbitration, a coordination mechanism is added. This mechanism can adaptively select the transmitting unit according to the communication load. Under low communication load, the priority communication function of the original carrier sense bus conflict arbitration mechanism is retained. Under high communication load, it allows lower priority units to transmit first, avoiding communication blockage by lower priority units. A valid setting mechanism for the transmission flag is designed to ensure communication reliability. An exemption mechanism is added to effectively balance the transmission efficiency of high priority units under high communication load, achieving a balance between communication efficiency and communication reliability. This invention alleviates the technical problem of reduced communication efficiency caused by communication frame transmission blockage in existing technologies. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0015] Figure 1 A flowchart of a conflict coordination and arbitration method for a carrier sensing bus provided in an embodiment of the present invention;

[0016] Figure 2 A schematic diagram of an automated control system provided in an embodiment of the present invention;

[0017] Figure 3 A flowchart illustrating the application of a first carrier sensing bus conflict coordination and arbitration method provided in an embodiment of the present invention;

[0018] Figure 4A flowchart illustrating the application of the second carrier sensing bus conflict coordination and arbitration method provided in this embodiment of the invention;

[0019] Figure 5 The flowchart illustrates the application of the third carrier sensing bus conflict coordination and arbitration method provided in this embodiment of the invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0021] Example 1

[0022] Figure 1 This is a flowchart of a conflict coordination and arbitration method for a carrier sensing bus according to an embodiment of the present invention, which is applied to an automated control system. Figure 2 This is a schematic diagram of an automated control system provided according to an embodiment of the present invention. Figure 2 As shown, the automated control system includes multiple communication units, namely Unit1, Unit2, ..., Unitn; communication data between the multiple communication units is transmitted through a target bus; the target bus is a bus based on a carrier sense collision avoidance arbitration mechanism; each communication unit is set with a transmit permission flag, which includes true and false; where "true" indicates that the communication unit is allowed to immediately transmit a communication frame, and "false" indicates that the communication unit is not allowed to immediately transmit a communication frame. Each communication unit is also set with a priority value.

[0023] like Figure 1 As shown, the method provided in this embodiment of the invention specifically includes the following steps:

[0024] Step S102: Determine whether the transmit permission flag of the target communication unit is true; if yes, proceed to step S108; if no, proceed to step S104.

[0025] Step S104: Enter the waiting process and listen to the target bus during the waiting process.

[0026] Step S106: Determine whether the waiting time exceeds the preset waiting time; if yes, proceed to step S102; if no, and the target bus is in an idle state, set the transmit permission flag of the target communication unit to true, and execute step S108.

[0027] Step S108: Arbitrate the communication frame based on the priority setting of the target communication unit and the carrier sensing conflict avoidance arbitration mechanism to determine whether the target communication unit has obtained the right to send.

[0028] Specifically, when the target bus is idle, the target communication unit directly obtains the right to send; if multiple communication units send communication frames to the target bus at the same time, the communication unit with the higher priority value among the multiple communication units obtains the right to send, and the communication unit with the lower priority value does not obtain the right to send.

[0029] Step S110: Determine whether the target communication unit has obtained the right to send; if not, proceed to step S102; if yes, complete the transmission of the communication frame through the target bus and set the target communication unit's permission to send flag to false.

[0030] Preferably, in this embodiment of the invention, the preset waiting time is the task scheduling cycle time. This can reduce the waiting time of high-priority communication units.

[0031] In some optional embodiments provided by the present invention, the preset waiting time of each communication unit can be adaptively adjusted, including:

[0032] Obtain the idle duty cycle of the target bus and the priority setting of the target communication unit;

[0033] The preset waiting time is determined based on the idle duty cycle and priority setting.

[0034] Specifically, each communication unit sets its own priority value Pr. In step S102, when the transmit permission flag of the target communication unit is false, the idle duty cycle Ratio of the target bus is monitored, and then the preset waiting time Δt is calculated and set according to the formula Δt = f(Ratio, Pr). Optionally, in this embodiment of the invention, the larger the idle duty cycle Ratio of the target bus, the smaller the preset waiting time Δt; the smaller the priority value Pr, the higher the priority, and the smaller the preset waiting time Δt.

[0035] In some optional embodiments provided by the present invention, the preset waiting time can be calculated using the following formula:

[0036]

[0037] Where T is the task scheduling tick time, Max(Pr1,Pr2,...,Pr) n ) represents the maximum value of the priority settings, Pr1, Pr2, ..., Pr n Assign priority values ​​to the various communication units respectively.

[0038] In some optional embodiments provided by the present invention, each communication unit is configured with an exemption waiting count; step S102 further includes:

[0039] If the number of times the target communication unit's transmit permission flag is continuously determined to be false exceeds the exemption waiting limit, the waiting process is skipped and the communication frame is sent directly to the target bus.

[0040] Specifically, each communication unit sets its own exemption waiting count WaitNum. Preferably, the higher the priority value of the communication unit, the smaller the exemption waiting count. In step S102, if it is determined that the allow transmission flag of the target communication unit is false, it is then determined whether the number of consecutive false transmission flags of the target communication unit exceeds the exemption waiting count WaitNum. If so, it no longer waits and directly sends a communication frame to the target bus.

[0041] In some optional embodiments provided by the present invention, the priority setting includes high priority and low priority; step S102 further includes:

[0042] Determine whether the priority setting of the target communication unit is high priority;

[0043] If so, and the number of times the target communication unit's allow-to-send flag is continuously determined to be false exceeds the exemption waiting count, then the waiting process is skipped and the communication frame is sent directly to the target bus.

[0044] Specifically, each communication unit sets its own priority value Level and its own exemption wait count WaitNum. Optionally, Level can be set to two levels, high and low. A high-priority communication unit, after determining that its allow-to-transmit flag is false, and then determining that the number of consecutive false flags exceeds the exemption wait count WaitNum, will no longer wait and will directly send a communication frame to the target bus.

[0045] This invention provides a conflict coordination and arbitration method for a carrier sense bus. Based on the existing carrier sense bus conflict arbitration, a coordination mechanism is added. This mechanism can adaptively select the transmitting unit according to the communication load. Under low communication load, the priority communication function of the original carrier sense conflict arbitration mechanism can be retained. Under high communication load, it allows waiting for low-priority units to transmit first, avoiding communication blockage by low-priority units. A valid setting mechanism for the transmission flag is designed to ensure communication reliability. An exemption mechanism is added to effectively balance the transmission efficiency of high-priority units under high communication load, achieving an organic unity of communication efficiency and reliability. This alleviates the technical problem in the prior art where communication frame transmission blockage leads to reduced communication efficiency.

[0046] Example 2

[0047] Figure 3 This is an application flowchart of the first carrier sensing bus conflict coordination and arbitration method provided by an embodiment of the present invention. Figure 3 As shown, each unit controls the sending process through its own AllowSendFlag, where "true" means immediate sending is allowed and "false" means immediate sending is not allowed. The process includes the following steps:

[0048] Determine the status of the AllowSendFlag flag for this unit:

[0049] 1.1) When the AllowSendFlag flag of this unit is "true", jump to step 2 and immediately send a communication frame to the bus;

[0050] 1.2) When the AllowSendFlag of this unit is "false", wait for 1 task scheduling cycle and then jump to step 1; during the waiting period, listen to the bus. If the bus is idle, set the AllowSendFlag of this unit to "true" and jump to step 2 to immediately send a communication frame to the bus.

[0051] While attempting to send a communication frame to the bus, the monitoring unit determines whether it has obtained bus transmission privileges.

[0052] 2.1) If sending permission is not obtained, pause the sending process and proceed to step 1;

[0053] 2.2) When the sending permission is obtained, after the communication frame is sent, the AllowSendFlag flag of this unit is set to "false".

[0054] This embodiment can be applied to devices in which each unit uses a task-schedulable operating system.

[0055] Example 3

[0056] Figure 4 This is an application flowchart of the second carrier sensing bus conflict coordination and arbitration method provided by an embodiment of the present invention. Figure 4 As shown, each unit controls the transmission process through its own AllowSendFlag, where "true" means immediate transmission is allowed and "false" means immediate transmission is not allowed. Each unit sets its own priority value Pr, including the following steps:

[0057] Determine the status of the AllowSendFlag flag for this unit:

[0058] 1.1) When the AllowSendFlag flag of this unit is "true", jump to step 2 and immediately send a communication frame to the bus;

[0059] 1.2) When the AllowSendFlag of this unit is "false", calculate the bus idle duty cycle Ratio, and then calculate the waiting time Δt using Ratio and priority setting Pr. After waiting for Δt time or a fixed time, jump to step 1; during the waiting period, listen to the bus. If the bus is idle, set the AllowSendFlag of this unit to "true", jump to step 2, and immediately send a communication frame to the bus.

[0060] While attempting to send a communication frame to the bus, the monitoring unit determines whether it has obtained bus transmission privileges.

[0061] 2.1) If sending permission is not obtained, pause the sending process and jump to step 1.

[0062] 2.2) When the sending permission is obtained, after the communication frame is sent, the AllowSendFlag flag of this unit is set to "false".

[0063] This embodiment can be applied to devices with or without an operating system unit.

[0064] Example 4

[0065] Figure 5 This is an application flowchart of the third carrier sensing bus conflict coordination and arbitration method provided by an embodiment of the present invention. Figure 5 As shown, each unit controls the sending process through the AllowSendFlag flag, where "True" allows immediate sending and "False" disallows immediate sending. Each unit sets a Level value to represent its priority level, with "High" indicating high priority and "Low" indicating low priority. Each unit also sets a Δt value to represent the waiting time and a WaitNum value to represent the number of waiver waits. The process includes the following steps:

[0066] Determine the status of the AllowSendFlag flag for this unit:

[0067] 1.1) When the AllowSendFlag flag of this unit is "true", jump to step 2 and immediately send a communication frame to the bus;

[0068] 1.2) When the AllowSendFlag of this unit is "false", determine the priority level setting of this unit:

[0069] 1.2.1) When the priority level of this unit is "high", determine whether the number of times the allow-to-send flag AllowSendFlag of this unit is "false" exceeds WaitNum. If it does, jump to step 2 and immediately send a communication frame to the bus; if it does not exceed the limit, wait for Δt and then jump to step 1. During the waiting period, listen to the bus. If the bus is idle, set the allow-to-send flag AllowSendFlag of this unit to "true", jump to step 2, and immediately send a communication frame to the bus.

[0070] 1.2.2) When the priority level of this unit is "low", wait for Δt and then jump to step 1; during the waiting period, listen to the bus. If the bus is idle, set the allowSendFlag of this unit to "true", jump to step 2, and immediately send a communication frame to the bus.

[0071] While attempting to send a communication frame to the bus, the monitoring unit determines whether it has obtained bus transmission privileges.

[0072] 2.1) If sending permission is not obtained, pause the sending process and proceed to step 1;

[0073] 2.2) When the sending permission is obtained, after the communication frame is sent, the AllowSendFlag flag of this unit is set to "false".

[0074] This embodiment can be applied to devices that have bare-metal systems and master-slave units.

[0075] As described above, the embodiments of the present invention provide a conflict coordination and arbitration method for a carrier sense bus, which has the following technical effects compared with the prior art:

[0076] 1) When the communication load is low, the bus is relatively idle. It is easy to detect that the bus is idle during the waiting time. The transmit flag can be set to valid in time. Each unit can achieve priority communication through the original carrier sensing conflict arbitration mechanism of the bus.

[0077] 2) A coordination mechanism is adopted. Under heavy communication load, after a high-priority unit has sent once, it will coordinate and wait to allow a low-priority unit to send first. Units that have not sent still achieve priority communication according to the carrier sense conflict arbitration mechanism. After all the units waiting in the queue have completed their transmission, the transmission permission flag of all units can be effectively set through one bus idle time to achieve communication reliability.

[0078] 3) By adopting an exemption mechanism, the transmission efficiency of high-priority units can be effectively taken into account under heavy communication load, so as to achieve an organic balance between communication efficiency and communication reliability.

[0079] This invention also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described in embodiments one to four above.

[0080] This invention also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the methods described in embodiments one through four.

[0081] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0082] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A conflict coordination and arbitration method for a carrier sensing bus, characterized in that, It is applied to an automated control system; the automated control system includes multiple communication units, and the communication data between the multiple communication units is transmitted through a target bus; the target bus is a bus based on a carrier sense collision avoidance arbitration mechanism; Each communication unit is configured with a transmit permission flag, which includes true and false flags. Each communication unit is assigned a priority value; the method includes: Step S102: Determine whether the transmit permission flag of the target communication unit is true; if yes, proceed to step S108; if no, proceed to step S104. Step S104: Enter the waiting process and monitor the target bus during the waiting process; Step S106: Determine whether the waiting time exceeds the preset waiting time; if yes, proceed to step S102; if no, and the target bus is in an idle state, set the allow transmission flag of the target communication unit to true, and execute step S108. Step S108: Arbitrate the communication frame based on the priority setting of the target communication unit and the carrier sensing conflict avoidance arbitration mechanism to determine whether the target communication unit has obtained the right to send. Step S110: Determine whether the target communication unit has obtained sending permission; if not, proceed to step S102; if yes, complete the transmission of the communication frame through the target bus and set the sending permission flag of the target communication unit to false.

2. The method according to claim 1, characterized in that: The preset waiting time is the task scheduling cycle time.

3. The method according to claim 1, characterized in that: Also includes: Obtain the idle duty cycle of the target bus and the priority setting of the target communication unit; The preset waiting time is determined based on the idle duty cycle and the priority setting.

4. The method according to claim 1, characterized in that: Each communication unit is configured with a separate number of exemption wait times; step S102 further includes: If the number of times the allowed transmission flag of the target communication unit is determined to be false exceeds the number of exemption waiting times, the waiting process is skipped and a communication frame is sent directly to the target bus.

5. The method according to claim 1, characterized in that: Each communication unit is configured with an exemption waiting count; the priority setting includes high priority and low priority; step S102 further includes: Determine whether the priority setting of the target communication unit is high priority; If so, and the number of times the allowed transmission flag of the target communication unit is determined to be false exceeds the number of exemption waiting times, then the waiting process is skipped and a communication frame is sent directly to the target bus.

6. The method according to claim 1, characterized in that: Step S108 includes: If multiple communication units simultaneously send communication frames to the target bus, the communication unit with the higher priority value among the multiple communication units will obtain the sending permission, while the communication unit with the lower priority value will not obtain the sending permission.

7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • High-speed bus system based on an MLVDS interface and implementation method

    CN106603358A

  • Bus arbitration method, device, storage medium and bus arbiter

    CN108228510A