Method and device for sending data frame, equipment and storage medium
By using Access Control Lists (ACLs) to partition the ID values of data frames and dynamically adjusting the buffer queue in the switch, the problem of the inability to flexibly control the forwarding of data frames with multiple priority levels in the existing technology is solved, realizing the real-time transmission of important data and efficient control of the network system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN INOVANCE TECH CO LTD
- Filing Date
- 2024-10-22
- Publication Date
- 2026-04-24
AI Technical Summary
Existing switching technologies are difficult to flexibly control the forwarding of data frames with multiple priority levels in industrial networks, resulting in the loss or significant delay of critical communication data and failing to meet the traffic requirements of complex industrial networks.
By receiving the ID value of the data frame and classifying it according to the access control list (ACL), different send buffer queues are allocated. Combining the matching rules of frame rate and data rate, high-priority data frames are processed first, and the buffer space size is dynamically adjusted to ensure the real-time transmission of important data.
It effectively shortens the latency of important data frames passing through the switch, improves the real-time performance of the network system, provides personalized real-time guarantees for different service types, and reduces the impact on other data frames.
Smart Images

Figure CN121924094A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device and storage medium for transmitting data frames. Background Technology
[0002] In industrial networks, switches need to manage the data frames of the receiving and sending ports to prevent the loss of critical communication data or large fluctuations in latency caused by network storms or sudden traffic surges on a certain interface, thereby affecting the performance of industrial control systems.
[0003] Current common practices mainly include: one is to use time slots, and the other is to classify received frames into priority levels, assigning higher priority to more important data for transmission. Time slot switching requires all devices in the network to synchronize their clocks, and each device must receive, forward, and send high-priority frames within a specified time frame, making design and implementation difficult. The entire network only supports real-time and non-real-time frames, and cannot flexibly implement frame forwarding control with multiple priority levels. Furthermore, changes to the network topology require replanning the time slots of each device, limiting its scalability. Priority-based switching mechanisms only control forwarding based on priority, which cannot meet the increasingly complex traffic management needs of industrial networks. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, device, and storage medium for sending data frames, which effectively shortens the latency of important data frames passing through the switch and improves the real-time performance of network system control.
[0005] In a first aspect, embodiments of this application provide a method for sending data frames, including:
[0006] Receive a data frame; obtain the ID value of the data frame according to the Access Control List (ACL); write the data frame into the send buffer queue corresponding to the ID value.
[0007] In one embodiment, the method further includes the steps of: calculating the data rate, frame rate, ID frame interval, frame rate corresponding to ID, and data rate corresponding to ID of the receiving port based on the ID value and receiving port number of the data frame; and writing the data frame into the sending buffer queue corresponding to the ID value when the frame rate of the received data frame does not exceed the frame rate corresponding to the set matching rule according to the matching rule configured in the receiving port.
[0008] In one embodiment, obtaining the ID value of the data frame according to the access control list includes the steps of: extracting the corresponding byte or bit from the data frame according to the information configured in the access control list, comparing it with the value of the corresponding address in the access control list, and marking the data frame as the ID value of the access control list if the information extracted from the data frame is the same as all the information in the access control list.
[0009] In one embodiment, obtaining the ID value of the data frame according to the access control list specifically includes: if an ID value identical to that of the data frame is found in the access control list, then the ID corresponding to the data frame is determined according to the ID type in the access control list; if no ID value identical to that of the data frame is found in the access control list, then the ID corresponding to the data frame is determined to be the ID corresponding to a general type frame.
[0010] In one embodiment, it is checked whether the highest priority queue is empty; if it is not empty, the data frames of that queue are sent, and the highest priority queue is checked again; if it is empty, it jumps to the next priority queue and determines whether the current sending queue is empty; if it is empty, it jumps to the next lower priority queue; if it is not empty, the data frames of that queue are sent, and it returns to the process of checking whether the highest priority queue is empty until the data frames of all priority queues are sent.
[0011] Secondly, embodiments of this application also disclose a communication device, including:
[0012] The receiving unit is used to receive data frames;
[0013] The acquisition unit is used to acquire the ID value of the data frame according to the access control list (ACL);
[0014] The sending unit is used to write the data frame into the sending buffer queue corresponding to the ID value.
[0015] In one embodiment, the sending unit calculates the data rate, frame rate, ID frame interval, frame rate corresponding to ID, and data rate corresponding to ID of the receiving port based on the ID value and receiving port number of the data frame. According to the matching rules configured in the receiving port, when the frame rate of the received data frame does not exceed the frame rate corresponding to the set matching rule, the data frame is written into the sending buffer queue corresponding to the ID value.
[0016] In one embodiment, the acquisition unit extracts the position according to the information configured in the ACL, extracts the corresponding byte or bit from the data frame and compares it with the value of the corresponding address in the ACL. If the information extracted from the data frame is the same as all the information in the ACL, the data frame is marked as the ID value of the ACL.
[0017] Thirdly, embodiments of this application also disclose an electronic device, comprising: a processor; and a memory storing computer-readable instructions, which, when executed by the processor, implement the method as described in any one of the first aspects.
[0018] Fourthly, embodiments of this application also disclose a computer-readable storage medium storing computer program instructions that, when executed by a computer, cause the computer to perform the method according to any one of the first aspects.
[0019] This application effectively shortens the latency of important data frames passing through the switch, improves the real-time performance of network system control, and provides different switching priorities for different ports and different data frame types. While minimizing the impact on the transmission latency of other data frames, it can provide personalized real-time guarantees for different service types.
[0020] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit the embodiments of this application. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with those of this application and, together with the specification, serve to explain the principles of the embodiments of this application.
[0022] Figure 1 This is a flowchart of a data frame transmission method provided in an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of a data frame transmission device provided in an embodiment of this application;
[0024] Figure 3 This is a schematic diagram of data frame transmission provided in the embodiments of this application;
[0025] Figure 4 This is a block diagram illustrating the frame queue management principle provided in the embodiments of this application;
[0026] Figure 5 This is a flowchart of the sending queue processing provided in the embodiments of this application;
[0027] Figure 6This is a control network topology diagram provided in the embodiments of this application;
[0028] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application;
[0029] Figure 8 This is a schematic diagram of a computer-readable program medium provided in an embodiment of this application. Detailed Implementation
[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0031] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the drawings represent functional entities and do not necessarily correspond to physically or logically independent entities.
[0032] The embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0033] Reference Figure 1 , Figure 1 The diagram shown is a flowchart of a data frame transmission method provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps:
[0034] Step S101: Receive data frames.
[0035] Step S102: Obtain the ID value of the data frame according to the Access Control List (ACL).
[0036] Specifically, based on the information extraction position configured in the ACL, the corresponding byte or bit at the corresponding position is extracted from the data frame and compared with the value of the corresponding address in the ACL. If the information extracted from the data frame is the same as all the information in the ACL, then the data frame is marked as the ID value of the ACL.
[0037] To illustrate this more clearly, by classifying received data frames, different data frames within the same receiving port are assigned different IDs, and the same type of data can be classified into different IDs on different receiving ports. This involves assigning different IDs to different data frames within the same receiving port, and assigning different or the same IDs to the same type of data on different receiving ports.
[0038] The receiving section performs network interface timing, data frame extraction, data frame length statistics, and CRC verification for each port. Based on the ACL rules configured for each port, it extracts one or more data fields from the received data frames. Different ports can be configured with different extraction locations. Based on the extracted field information and field location, it queries the ACL for the ID value of the data frame. Different types of data frames correspond to different ID values, while different data types can be configured with the same ID value. If configured with the same ID, they will be determined to be of the same type. Received data frame flow control, ID type exchange management, and transmitted data frame flow control are all based on the ID.
[0039] ACLs are managed by the system control unit. Different network ports can be configured with the same ACL or different ACLs depending on application requirements. If the extracted information does not match any entries in the ACL of that port, it is determined to be a generic data frame, and the ID corresponding to this data frame is the ID number corresponding to the generic type frame.
[0040] It should be noted that ACL rules are judgment statements describing packet matching conditions. ACL information can be one or more fields or bits in a packet. Matching one or more combinations of these ACL information results in different ID values. Filtering rules are configured for each ID within the ACL. The receive control unit of each port can calculate the data rate, frame interval between ID frames, and ID frame rate for each ID based on the ID values matched by the ACL. Each interface receive control unit, based on the flow control policy corresponding to that ID in the ACL table, selects one or more rules from the statistical data on the data rate, frame interval between ID frames, and ID frame rate of that ID, allowing it to pass or discard it. Allowed data frames are written to the buffer space corresponding to that ID. The switching lookup unit uses one or more lookup results from MAC, VLAN, and IP addresses as forwarding information.
[0041] Step S103: Write the data frame into the send buffer queue corresponding to the ID value.
[0042] In one embodiment, the data rate, frame rate, ID frame interval, frame rate corresponding to ID, and data rate corresponding to ID of the receiving port are statistically analyzed based on the ID value and receiving port number of the data frame. According to the matching rules configured in the receiving port, when the frame rate of the received data frame does not exceed the frame rate corresponding to the set matching rule, the data frame is written into the sending buffer queue corresponding to the ID value.
[0043] In one embodiment, different matching rules are assigned based on the data rate of each receiving port of the switch, the data rate corresponding to the data type ID, and the frame interval to transmit data frames.
[0044] In one embodiment, after each port retrieves forwarding information, it sends a forwarding request to the corresponding port based on the queried forwarding port. The sending port responds to the forwarding request based on the ID information and receiving port number in the forwarding request. When multiple priority IDs correspond to forwarding requests simultaneously, the higher priority forwarding requests are responded to first, and the lower priority forwarding requests are responded to later. For each type of ID for each sending port, a forwarding response rule can be set. When multiple receiving ports forward the same type of ID to a sending interface simultaneously, the forwarding requests of that type of ID from each port can be responded to in a round-robin fashion, or the forwarding requests of that type of ID from a specific receiving port can be responded to preferentially. This can be configured through software.
[0045] In one embodiment, the sending port manages the data frame based on the receiving port number and frame ID. Each sending port calculates traffic information for each receiving port based on the receiving port number and ID information of the data frame, such as the total data rate of the receiving port, the total frame rate of the receiving port, the frame rate for each ID of the receiving port, the data rate for each ID of the receiving port, and the frame interval for each ID of the receiving port. Each sending port selects one or more of the following five rules as matching rules according to the configured matching rules: total data rate, total frame rate, frame rate for each ID of the receiving port, data rate for each ID of the receiving port, and frame interval for each ID of the receiving port. When the actual traffic of each sending port is lower than the traffic specified in the rule, it is allowed to pass; when it exceeds the traffic specified in the rule, it is discarded. Data frames that are allowed to be forwarded are written to the buffer corresponding to the ID of the sending port.
[0046] To illustrate this more clearly, the module detects exchange information from the switching module and then evaluates that information. If the forwarding port number in the exchange information matches the logical port number of the current port, the data frame is read from the corresponding receive buffer. Simultaneously, the buffer management module calculates the frame rate for each port, the data rate for each port, and the frame rate, data rate, and frame interval for each ID.
[0047] To prevent excessive volume of one or more non-critical data types on a particular sending port from affecting the real-time performance of critical data, or to prevent data loss due to insufficient buffering of other data caused by excessive volume of one or more non-critical data types within a short period, different flow control policies can be formulated for each port based on its data type, traffic volume, and service type. When the traffic of a sending port exceeds its set port flow limit, data read from the receive buffer is discarded and not written to the sending queue. If the traffic does not exceed the sending flow limit corresponding to that ID of the sending port, the data frame is written to the corresponding buffer sending queue.
[0048] The flow control strategy for each sending port is based on the following information:
[0049] 1) The frame rate corresponding to the receiving port number;
[0050] 2) The data rate corresponding to the receiving port number;
[0051] 3) The number of data frames with a specific ID within a specified time period;
[0052] 4) The number of data bytes for a specific ID within a specified time interval;
[0053] 5) The interval between two data frames for a certain ID.
[0054] The traffic control strategy can select one or more of the above five parameters for forwarding traffic control.
[0055] In one embodiment, each data frame ID within a port is assigned its own queue priority and a different buffer size. The process involves checking if the highest priority queue is empty; if not, the data in that queue is sent as data frames, and the process checks if the highest priority queue is empty again; if empty, the process jumps to the next priority queue and checks if the current sending queue is empty; if empty, the process jumps to a lower priority queue; if not empty, the data frames in that queue are sent, and the process returns to checking if the highest priority queue is empty until all priority queues have sent their data.
[0056] For example, each port assigns its own queue priority to each data frame ID, and each queue corresponds to a different space size. Each port can assign the same priority to data frames with multiple IDs, and data with the same priority is cached in the same cache space. Higher-priority data is sent first. If multiple data frames with different IDs are assigned the same priority, they are sent according to the principle of "first written to the send cache space first." The processing steps are as follows:
[0057] 1) Check if the highest priority queue is empty. If it is not empty, send the data in the queue in data frames.
[0058] 2) Check again whether the highest priority queue is empty. If it is not empty, execute step 1) again. If it is empty, jump to the next priority queue.
[0059] 3) Determine if the current sending queue is empty. If it is empty, jump to a lower priority queue. If it is not empty, send the data frames of the queue and then jump back to steps 1) to 3) to repeat the process.
[0060] 4) After jumping to a lower priority level, check if the current sending queue is empty. If it is empty, jump to the lower priority queue. If it is not empty, send the data frame of the queue and jump back to steps 1) to 4) to repeat the process. This process is repeated to complete the data sending of all priority queues.
[0061] In summary, this application employs different strategies for sending and receiving on different interfaces. Each receiving port has an ACL rule matching unit. Received frames are first prioritized by the ACL rule matching unit, with different priorities corresponding to different flow control strategies. The sending port responds to forwarding requests to that port based on the priority of each ID and stores the frames in the corresponding sending buffer according to the frame ID priority. The sending port then performs sending control based on the sending rules according to the ID priority.
[0062] Within the same receiving port, different data frames are assigned different priority levels, each corresponding to a different ID. The same data can be assigned different priorities on different receiving ports. Each sending port uses one or more of the following as its transmission priority control strategy: the frame rate corresponding to the switch's receiving port number, the data rate, the number of data frames corresponding to the ID within a preset time period, the number of data bytes corresponding to the ID within a preset time interval, and the interval between two frames with a pre-selected ID. Different ports are assigned different matching rules. By employing different priority strategies for different sending interfaces, flexible control strategies on the sending side of different ports are adapted to ensure important data communication while maximizing the guarantee of other data transmission service needs.
[0063] Priority levels are assigned to data frame type IDs based on a priority strategy, and data frames with different priority levels are stored in different buffer spaces, reducing the latency of important data frames during switching. A buffer space strategy ensures that important data frames are not lost due to a full switch buffer, while also improving buffer space utilization. By statistically analyzing the data frame rates and data rates of different ports and types, the size of different priority spaces is dynamically adjusted to reduce the probability of data frame loss due to queue space limitations for certain data types.
[0064] This application effectively reduces the latency of important data frames passing through the switch, improving the real-time performance of network system control. Simultaneously, this application provides different switching priorities for different ports and different data frame types, offering personalized real-time guarantees for different service types while minimizing the impact on the transmission latency of other data frames.
[0065] Reference Figure 2 , Figure 2 The diagram shown is a schematic representation of a communication device provided in an embodiment of this application. Figure 2 As shown, the device includes:
[0066] The receiving unit 201 is used to receive data frames.
[0067] The acquisition unit 202 is used to acquire the ID value of the data frame according to the access control list (ACL).
[0068] The sending unit 203 is used to write the data frame into the sending buffer queue corresponding to the ID value.
[0069] Further, in one possible implementation, the acquisition unit 202 extracts the position according to the information configured in the ACL, extracts the corresponding byte or bit from the data frame and compares it with the value of the corresponding address in the ACL. If the information extracted from the data frame is the same as all the information in the ACL, then the data frame is marked as the ID value of the ACL.
[0070] Furthermore, in one possible implementation, the sending unit 203 calculates the data rate, frame rate, ID frame interval, frame rate corresponding to ID, and data rate corresponding to ID of the receiving port based on the ID value and receiving port number of the data frame. According to the matching rules configured in the receiving port, when the frame rate of the received data frame does not exceed the frame rate corresponding to the set matching rule, the data frame is written into the sending buffer queue corresponding to the ID value.
[0071] In one embodiment, the sending unit 203 is further configured to detect whether the highest priority queue is empty; if it is not empty, the data frames of the queue are sent and the highest priority queue is detected again; if it is empty, the process jumps to the next priority queue and determines whether the current sending queue is empty; if it is empty, the process jumps to a lower priority queue; if it is not empty, the data frames of the queue are sent and the process returns to detecting whether the highest priority queue is empty until the data frames of all priority queues are sent.
[0072] Reference Figure 3 , Figure 3 The diagram shown is another data frame transmission schematic provided in an embodiment of this application. Figure 3 As shown, it includes: a receiving processing unit, an exchanging processing unit, a transmitting processing unit, and a system control unit.
[0073] The receiving and processing unit consists of three parts: network port reception, received data frame information extraction, and received data frame classification.
[0074] The switching processing unit mainly consists of a table lookup part based on MAC, VLAN, and IP.
[0075] The sending section of the sending processing unit consists of two parts: buffer management and queue management.
[0076] The system control unit performs dynamic information management functions for the receiving processing unit, the switching processing unit, and the sending processing unit.
[0077] The network port receiving section completes the network interface timing, data frame extraction, data frame length statistics, and CRC check for each port.
[0078] The information extraction module extracts one or more data fields from the received data frames based on the extraction location configured by the system control unit and the ACL rules configured for each port. Different ports can be configured with different extraction locations.
[0079] The receiving frame classification unit queries the ACL for the ID value of the data frame based on the field information and field positions extracted by the receiving information extraction unit. Different types of data frames correspond to different ID values, while different data types can be configured with the same ID value. If configured with the same ID, they will be judged as the same type. Received data frame flow control, ID type exchange management, and transmitted data frame flow control are all based on the ID. The ACL is managed by the system control unit. Different network port ACLs can be configured with the same value or different values depending on application requirements. If the extracted information does not match any entries in the ACL of that port, it is judged as a general data frame, and the ID corresponding to this data frame is the ID number corresponding to the general type frame.
[0080] The switching processing unit performs a table lookup based on the destination MAC, VLAN, and IP address extracted by the received frame information extraction module. Based on the switching policy configured by the system control module, it selects one or more table lookup results based on MAC, VLAN, or IP as the forwarding port number and uses the ID as the priority queue corresponding to the sending port number.
[0081] The cache management module detects the exchange information from the exchange management module and evaluates it. If the forwarding port number in the exchange information matches the logical port number of the current port, the data frame is read from the corresponding receive buffer. While reading, the cache management module simultaneously calculates the frame rate, data rate, and frame interval for each port, as well as the frame rate, data rate, and frame interval for each ID. To prevent excessive amounts of one or more non-critical data from a particular sending port from affecting the real-time performance of critical data, or to prevent excessive amounts of one or more non-critical data from causing other data to be lost due to lack of buffering, each port can implement different traffic control policies based on its interface data type, traffic volume, and service type. When the traffic of a sending port exceeds its set port traffic limit, data read from the receive buffer is discarded and not written to the sending queue. If the traffic does not exceed the sending traffic corresponding to that ID of the sending port, the data is written to the corresponding sending queue.
[0082] The system control unit assigns a queue priority and a corresponding space size to each data frame ID within each port. Each port can assign the same priority to data frames with multiple IDs, and data with the same priority are cached in the same cache space. Higher priority data is sent first. If multiple data frames with different IDs are assigned the same priority, the queue management module sends them according to the principle of "first written to the transmission cache space, first sent".
[0083] Reference Figure 4 , Figure 4 The diagram shown is a block diagram illustrating the principle of queue management provided in an embodiment of this application. Figure 4 As shown:
[0084] Different interfaces employ different strategies for sending and receiving. Each receiving port has an ACL rule matching unit. Received frames are first prioritized by the ACL rule matching unit, with different priorities corresponding to different types. Each sending port controls transmission based on the frame ID and the sending port's rules. Different data frames within the same receiving port are divided into different priority levels, each corresponding to a different ID. The same data can be assigned different priorities on different receiving ports. Each sending port uses one or more of the following as its transmission priority control strategy: the corresponding frame rate, data rate, the number of data frames corresponding to the ID within a preset time period, the number of data bytes corresponding to the ID within a preset time interval, and the interval between two frames with a pre-selected ID. Different matching rules are assigned to different ports.
[0085] In other words, frames received on the same port are divided into different types, each with a different priority, and each priority is assigned a different ID. Frames of the same type can be assigned different priorities on different receiving ports, and different receiving ports use different rate limiting measurements for the same priority. Different sending ports use different priority strategies for the same ID.
[0086] Specifically, based on the ACL matching rules of the receiving port of the received data frame, the ID type is divided, namely ID type A, B, G...N. It can be understood that ID type A has the highest priority and N has the lowest priority. Then, through the switching management, the switching table is looked up based on the extracted destination MAC, VLAN, and IP address, and according to the configured switching policy, one or more table lookup results based on MAC, VLAN, and IP are selected as the forwarding port number, and the ID is used as the priority queue corresponding to the sending port number.
[0087] The flow control policy for each sending port is based on the following information:
[0088] 1) The frame rate corresponding to the receiving port number;
[0089] 2) The data rate corresponding to the receiving port number;
[0090] 3) The number of data frames with a specific ID within a specified time period;
[0091] 4) The number of data bytes for a specific ID within a specified time interval;
[0092] 5) The interval between two data frames for a certain ID;
[0093] Traffic control strategies can select one or more of the above five parameters for forwarding traffic control.
[0094] Reference Figure 5 , Figure 5 The diagram shown is a flowchart of the sending queue processing provided in an embodiment of this application. Figure 5 As shown:
[0095] Specifically, each port assigns its own queue priority to each data frame ID, and each queue corresponds to a different space size. Each port can assign the same priority to data frames with multiple IDs, and data with the same priority are cached in the same cache space. Higher priority data is sent first. If multiple data frames with different IDs are assigned the same priority, the queue management module sends them according to the principle of "first written to the send cache space, first sent".
[0096] That is, 1) check if the highest priority queue is empty, and if it is not empty, send the data of the queue in data frames;
[0097] 2) Check again whether the highest priority queue is empty. If it is not empty, execute step 1) again. If it is empty, jump to the next priority queue.
[0098] 3) Determine if the current sending queue is empty. If it is empty, jump to a lower priority queue. If it is not empty, send the data frames of the queue and then jump back to steps 1) to 3) to repeat the process.
[0099] 4) After jumping to a lower priority level, check if the current sending queue is empty. If it is empty, jump to the lower priority queue. If it is not empty, send the data frames of the queue and jump back to steps 1) to 4) to repeat the process.
[0100] Reference Figure 6 , Figure 6 The diagram shown is a control network topology provided in an embodiment of this application. Figure 6 As shown:
[0101] In industrial settings, high-real-time networks and ordinary networks are often mixed. A large number of broadcast frames, flood frames, multicast frames, ordinary network attack frames, and partial network attack frames on the ordinary network, as well as traffic overload on some devices within the high-real-time network due to equipment malfunctions, can all cause control anomalies. For example... Figure 6 The diagram shows a control network topology in an industrial site. High real-time control network A and high real-time control network B are connected to the external network through switch 1. If queue management is not performed on switches 2 and 3, network traffic from switch 1 will affect the real-time performance of control network A and control network B, or even prevent them from working altogether.
[0102] To reduce the impact of external networks on the internal control of network control network B, the priority of PDO data within control network B is set as follows: highest priority frame ID is set to 1, time synchronization frame value is set to 2, alarm frame ID is set to 3, broadcast frame ID is set to 5, and other frame IDs are set to 4. Switch 3's interface command frames are set to 3, ordinary network frames to 5, and broadcast frames to 6. Since the frame ID values of the control network incoming from the external network are relatively large, their priority is lower during internal switching within the control network, minimizing their impact on the latency of PDO data and time synchronization data transmission within the control network. To reduce the overhead of external network broadcast frames on the device protocol stack in the control network, rate limiting is applied to broadcast frames received on interface 1 of switch 3. This is achieved by setting the data frame traffic value with ID 6 on interface 1 via software settings or by setting the broadcast frame interval on interface 1. Ports 3 and 4 do not need to process external network broadcast frames, so the rate limiting for frames with ID 6 on the sending side of ports 3 and 4 is set to 0. Frames with ID 6 received by ports 3 and 4 and forwarded by the switch are directly discarded. Ports 3 and 4 do not need to process frames with ID 5 from the external network, but they do need to process all frames with ID 5 from the control network. Therefore, the rate limiting control for frames with ID 5 from port 1 is set to 0 on ports 3 and 4, and the rate limiting control for frames with ID 5 from port 2 is set to 100%. Based on the priority of their port IDs, frames with other IDs are forwarded to the inverter for processing on ports 3 and 4, thus implementing transmit queue management on ports 3 and 4. Other ports use a similar mechanism for transmit and receive, allowing for flexible adaptation to the diverse service requirements of different interfaces.
[0103] Furthermore, PLC2 in control network B needs to receive data frames from within network control network B, as well as data frames from external networks. Within switch 3, multiple interfaces may simultaneously send data to port 2 within a short period. Due to network anomalies or other device malfunctions, port 2's transmit buffer may overflow within a short time, or port 2 may be occupied by data from a specific port or ID type for a short period, causing normal service data from other interfaces or other IDs to be discarded, resulting in an anomaly in the entire control system. When a high frame rate or data rate on a particular port significantly impacts the control network, the frame rate or data rate of the receiving port can be selected as the port's transmit rate control strategy. For specific ports with high data rates for a particular ID type, the number of data frames of a certain ID type within a specified time period or the number of data bytes of a certain ID type within a specified time interval can be selected. The specified time period can be configured via software, such as 1ms, 10ms, 20ms, etc. The allowed number of bytes and frames can also be flexibly configured via software. When data of a certain type exceeding the set value is received from a port within the specified time, it is discarded, achieving flow control for a specific ID type from a particular port. For example, rate limiting can be set on the transmitting side of port 2 of switch 3 to transmit broadcast ID data from port 1, which can effectively reduce the impact of external network broadcast storms on PLC protocol overhead.
[0104] To reduce the processing complexity of switches and decrease the number of data frame classification levels, it's important to address the issue of multiple data frames within the same category, some longer and others shorter. Simply limiting the traffic or data volume of a specific frame ID is insufficient for effective rate limiting. A better approach is to simultaneously set two conditions: the number of frames passing within a specified time period and the number of data bytes for a specific ID within a specified time interval. This reduces the protocol overhead on external switching devices, improves the response speed to high-priority data, and enhances the overall system control performance. The specified time period can be flexibly configured via software, such as 1ms, 5ms, or 10ms. The frame and byte counts can also be appropriately set as needed.
[0105] The following reference Figure 7 To describe an electronic device 700 according to an embodiment of this application. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0106] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including storage unit 720 and processing unit 710).
[0107] The storage unit stores program code, which can be executed by the processing unit 710, causing the processing unit 710 to perform the steps of various exemplary embodiments according to the present application described in the "Embodiment Method" section above.
[0108] Storage unit 720 may include readable media in the form of volatile storage units, such as random access memory (RAM) 721 and / or cache storage unit 722, and may further include storage unit (ROM / FLASH) 723.
[0109] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0110] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0111] Electronic device 700 can also communicate with one or more external devices (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 700, and / or any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0112] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0113] According to the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of the embodiments of this application can also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the embodiments of this application described in the "Exemplary Methods" section above.
[0114] refer to Figure 8 As shown, a program product 800 for implementing the above-described method according to embodiments of this application is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of this application is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0115] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0116] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0117] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0118] Program code for performing the operations of the embodiments of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0119] Furthermore, the above figures are merely illustrative representations of the processes included in the methods of exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0120] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
[0121] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It should 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. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
Claims
1. A method for sending data frames, characterized in that, include: Receive data frames; Obtain the ID value of the data frame according to the access control list; Write the data frame into the send buffer queue corresponding to the ID value.
2. The method according to claim 1, characterized in that, It also includes the following steps: Based on the ID value and receiving port number of the data frame, the data rate, frame rate, ID frame interval, frame rate corresponding to ID, and data rate corresponding to ID of the receiving port are calculated. According to the matching rules configured in the receiving port, when the frame rate of the received data frame does not exceed the frame rate corresponding to the set matching rule, the data frame is written into the sending buffer queue corresponding to the ID value.
3. The method according to claim 1, characterized in that, The step of obtaining the ID value of the data frame according to the access control list includes the following steps: Based on the information extraction position configured in the access control list, the corresponding byte or bit at the corresponding position is extracted from the data frame and compared with the value of the corresponding address in the access control list. If the information extracted from the data frame is the same as all the information in the access control list, the data frame is marked as the ID value of the access control list.
4. The method according to claim 3, characterized in that, The step of obtaining the ID value of the data frame according to the access control list specifically includes: If the same ID value as the data frame is found in the access control list, then the ID corresponding to the data frame is determined according to the ID type in the access control list; If no ID value matching the data frame is found in the access control list, then the ID corresponding to the data frame is determined to be the ID corresponding to a general type frame.
5. The method according to any one of claims 1 to 4, characterized in that, It also includes the following steps: Check if the highest priority queue is empty; If it is not empty, then the data frames of the queue are sent, and the highest priority queue is checked again to see if it is empty; If it is empty, then jump to the next priority queue and check if the current sending queue is empty; If the queue is empty, proceed to the next lower priority queue. If the queue is not empty, the data frames for that queue are sent, and the process returns to checking if the highest priority queue is empty until all priority queues have sent their data frames.
6. A communication device, characterized in that, include: The receiving unit is used to receive data frames; The acquisition unit is used to acquire the ID value of the data frame according to the access control list (ACL); The sending unit is used to write the data frame into the sending buffer queue corresponding to the ID value.
7. The apparatus according to claim 6, characterized in that, The sending unit calculates the data rate, frame rate, ID frame interval, frame rate corresponding to ID, and data rate corresponding to ID of the receiving port based on the ID value and receiving port number of the data frame. According to the matching rules configured in the receiving port, when the frame rate of the received data frame does not exceed the frame rate corresponding to the set matching rule, the data frame is written into the sending buffer queue corresponding to the ID value.
8. The apparatus according to claim 6, characterized in that, The acquisition unit extracts the position according to the information configured in the ACL, extracts the corresponding byte or bit from the data frame and compares it with the value of the corresponding address in the ACL. If the information extracted from the data frame is the same as all the information in the ACL, the data frame is marked as the ID value of the ACL.
9. An electronic device, characterized in that, The electronic device includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, It stores computer program instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 5.