A method, apparatus, storage medium, and computer device for adjusting interface resources.

By detecting packet loss in the internal communication links of network security devices and dynamically adjusting the interface working mode to optimize interface resource configuration, the network congestion problem is solved, and communication continuity and rapid recovery are achieved under high load conditions.

CN122316902APending Publication Date: 2026-06-30HANGZHOU DPTECH TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU DPTECH TECH
Filing Date
2026-03-13
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

With increased interface density, existing network security devices are prone to network congestion due to limited interface resources, which affects the continuity of network communication.

Method used

By detecting packet loss in the internal communication link, collecting communication quality parameters, adjusting the interface working mode to optimize interface resource configuration, ensuring that the number of data packet sending interfaces matches the network congestion situation, and dynamically adjusting the interface working mode to reduce packet loss.

Benefits of technology

In the event of link congestion, maximize the continuity of communication, reduce packet loss in both sending and receiving directions, and improve the speed at which network communication recovers to normal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122316902A_ABST
    Figure CN122316902A_ABST
Patent Text Reader

Abstract

This application provides an interface resource adjustment method, apparatus, storage medium, and computer device. The method includes: when packet loss is detected in any communication interface of any internal communication link between a central processing unit (CPU) and a communication chip, collecting first communication quality parameters of each internal communication link according to a preset collection period; determining whether to adjust the interface operating mode based on the first communication quality parameters corresponding to each internal communication link collected in at least one period and resource adjustment conditions; the interface operating mode is used to indicate the on / off state of the communication interface in the direction of data packet transmission and reception; if so, determining a first target ratio of the first communication interface on the CPU dedicated to data packet transmission according to the first communication quality parameters; and adjusting the interface operating mode of each first communication interface according to the first target ratio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically, to an interface resource adjustment method, apparatus, storage medium, and computer device. Background Technology

[0002] Driven by the digital wave, network technologies such as the Internet of Things (IoT), 5G communication, and artificial intelligence are developing rapidly. Internet devices, as the carriers of these technologies, make network communication between different devices a crucial means of information transmission. In network communication, different internet devices act as different network nodes. To ensure communication security, various network security devices are often used to manage network packets at each node. A common architecture for network security devices is a combination of a Central Processing Unit (CPU) and a Field Programmable Gate Array (FPGA) / Switch Chip (SW). In this architecture, the network security device can receive packets from external network nodes or forward packets to external network nodes through an external panel interface on the FPGA / Switch Chip; simultaneously, it can achieve packet forwarding between the FPGA / SW through an internal link between the CPU and the FPGA / Switch Chip.

[0003] However, with the accelerated deployment of various network and application infrastructures, the number of network nodes connected to network security devices will increase, and the interface density of these devices will also rise. As interface density increases, to ensure communication efficiency between different network communication nodes, it is necessary to guarantee sufficient interface resources for each interface (especially internal interfaces) to forward data packets. However, the existing methods of providing interface resources are prone to causing network congestion due to limited interface resources, thus affecting the continuity of network communication. Summary of the Invention

[0004] In view of this, this application provides an interface resource adjustment method, apparatus, storage medium, and computer device to achieve timely adjustment of interface resources and reduce the impact of interface congestion on network communication continuity.

[0005] Specifically, this application is implemented through the following technical solution: In a first aspect, embodiments of this application provide a method for adjusting interface resources, including: If packet loss is detected at any communication interface in any internal communication link between the central processing unit (CPU) and the communication chip, the first communication quality parameter of each internal communication link is collected according to a preset collection period; the first communication quality parameter includes at least the packet loss information and data packet transmission and reception rate corresponding to each communication interface of the internal communication link. Based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one cycle, it is determined whether to adjust the interface working mode; the interface working mode is used to indicate the on / off state of the function of the communication interface in the direction of data packet transmission and reception. If so, then based on the first communication quality parameter, determine the first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU; Adjust the interface working mode of each of the first communication interfaces according to the first target ratio.

[0006] Secondly, embodiments of this application also provide an interface resource adjustment device, comprising: The acquisition module is used to acquire first communication quality parameters of each internal communication link according to a preset acquisition period when packet loss is detected at any communication interface in any internal communication link between the central processing unit (CPU) and the communication chip; the first communication quality parameters include at least packet loss information and data packet transmission and reception rate corresponding to each communication interface in the internal communication link. The first determining module is used to determine whether to adjust the interface working mode based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one period; the interface working mode is used to indicate the on / off state of the communication interface in the direction of data packet transmission and reception. The second determining module is used to determine, if so, a first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU, based on the first communication quality parameter; The adjustment module is used to adjust the interface working mode of each of the first communication interfaces according to the first target ratio.

[0007] Thirdly, an optional implementation of this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the first aspect described above.

[0008] Fourthly, an optional implementation of this application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the first aspect described above.

[0009] The interface resource adjustment method, apparatus, storage medium, and computer device provided in this application, when packet loss is detected at any communication interface in any internal communication link, can accurately determine whether there is a need to adjust the interface working mode by collecting first communication quality parameters of each internal communication link in at least one cycle and using the first communication quality parameters and resource adjustment conditions. In other words, it can accurately determine whether there is a need to adjust interface resources due to interface congestion. If so, the first communication quality parameters can accurately determine a first target proportion of first communication interfaces dedicated to data packet transmission that matches the current network congestion situation. Then, by adjusting the interface working mode of the first communication interfaces in the internal communication link according to the first target proportion, the number of first communication interfaces dedicated to data packet transmission within the CPU can be increased in a timely manner, thereby changing the interface quantity ratio in the transmit and receive directions of the internal communication link and achieving timely adjustment of interface resources. Thus, by timely adjusting the number of first communication interfaces dedicated to data packet transmission, it is possible to maximize communication continuity under link congestion while minimizing packet loss in the transmit and receive directions, thereby improving the speed of network communication recovery.

[0010] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the architecture of a network security device shown in an exemplary embodiment of this application; Figure 2 This is a flowchart illustrating an exemplary embodiment of the present application of an interface resource adjustment method; Figure 3 This is a flowchart illustrating another interface resource adjustment method according to an exemplary embodiment of this application; Figure 4 This is a schematic diagram illustrating an interface resource adjustment device according to an exemplary embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device shown in an exemplary embodiment of this application. Detailed Implementation

[0012] 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 denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0013] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0014] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0015] Research has revealed that as the deployment of IPv6 protocols at the network infrastructure and application levels continues, not only are the interconnectivity and interoperability between network nodes improving, but this also indicates that more network communication nodes will need to connect simultaneously. Faced with this trend, network security devices face a critical challenge in ensuring uninterrupted operation in high-traffic network environments. Currently, some common network security devices typically employ a "CPU + FPGA / switch chip" architecture. This architecture, while meeting interface density requirements, also leverages the communication between the FPGA / switch chip and the CPU, as well as the CPU's logic processing capabilities, to relay data packets between the FPGA / switch chip and the CPU, process them on the CPU, and utilize the FPGA / switch chip for packet forwarding, effectively balancing interface density requirements with data processing performance. For example... Figure 1 The diagram shown is an architectural schematic of a network security device provided in an embodiment of this application. A, B, C, D and E are external panel interfaces for communication between the FPGA / SW and external network nodes, and F, G, H and I are internal interfaces between the CPU and the FPGA / SW. The channels formed by F and H and the channels formed by G and I can be referred to as internal communication links between the CPU and the FPGA / SW, respectively.

[0016] In a CPU+FPGA / switch chip hardware system architecture, the internal communication link between the FPGA / switch chip and the CPU has a significant bandwidth advantage, and its design capacity is often higher than that of external panel interfaces. This architecture primarily serves two key functions: firstly, it centrally processes traffic from various external panel interfaces uploaded to the CPU by the FPGA / switch chip; secondly, it supports the CPU in sending data packets to designated external panel interfaces via this internal communication link. However, during packet processing based on this architecture, the internal communication link used by the CPU for packet sending and the internal communication link used by the FPGA / switch chip to forward packets to the CPU may be the same, leading to congestion in the CPU's packet sending direction. Continuous traffic load on the internal communication link in this situation will exacerbate the risk of packet loss. For example, in... Figure 1 In the process, panel interface A receives data packets at a rate of 1Gbps. The FPGA / SW uploads the data packets to the CPU for processing via the F=H internal communication link. After processing, the CPU sends the processing result and the packets back to the FPGA / SW at the same rate via the H=F internal communication link. At this time, the channel resources of the F=H internal communication link are close to saturation (e.g., the physical bandwidth is exhausted). If other data packets received by the FPGA / SW are sent via the F=H internal communication link, the FPGA / SW may drop packets due to insufficient packet buffers.

[0017] Currently, to minimize packet loss at interfaces, network security devices with a sufficient number of external and internal interfaces are typically selected based on the network communication scenario. Each external and internal interface is configured to operate in full-duplex mode to ensure bidirectional transmission and reception, guaranteeing normal network communication. While this approach ensures normal communication under uniform traffic conditions, it can easily lead to interfaces concentrating on a single internal communication link when traffic is unevenly distributed or increased. This can cause already strained interfaces to experience even greater packet loss due to the additional packets on their corresponding internal communication links, ultimately resulting in communication congestion. Therefore, a method that can dynamically adjust interface resources in real time is urgently needed to ensure the continuity of network communication.

[0018] Based on the above research, this application provides an interface resource adjustment method, apparatus, storage medium, and computer device. When packet loss is detected at any communication interface in any internal communication link, by collecting first communication quality parameters of each internal communication link over at least one cycle, and using these first communication quality parameters and resource adjustment conditions, it can accurately determine whether there is a need to adjust the interface operating mode, i.e., whether there is a need to adjust interface resources due to interface congestion. If so, the first communication quality parameters can accurately determine a first target proportion of first communication interfaces dedicated to data packet transmission that matches the current network congestion situation. Then, by adjusting the interface operating mode of the first communication interfaces in the internal communication links according to the first target proportion, the number of first communication interfaces dedicated to data packet transmission within the CPU can be increased in a timely manner, thereby changing the interface quantity ratio in the transmit and receive directions of the internal communication links and achieving timely adjustment of interface resources. Thus, by timely adjusting the number of first communication interfaces dedicated to data packet transmission, it is possible to maximize communication continuity under link congestion while minimizing packet loss in the transmit and receive directions, thereby improving the speed of network communication recovery.

[0019] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this application below should be considered as the inventor's contributions to this application.

[0020] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0021] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0022] To facilitate understanding of this embodiment, a detailed description of the interface resource adjustment method disclosed in this application embodiment will be provided first. The execution subject of the interface resource adjustment method provided in this application embodiment is generally a terminal device or other processing device with certain computing capabilities. The terminal device can be a user equipment (UE), mobile device, terminal, personal digital assistant device (PDA), handheld device, computer device, network security device, etc. In some possible implementations, the interface resource adjustment method can be implemented by the processor calling computer-readable instructions stored in the memory.

[0023] The following uses a network security device as an example to illustrate the interface resource adjustment method provided in this application embodiment.

[0024] like Figure 2 The flowchart shown is a method for adjusting interface resources according to an embodiment of this application, which may include the following steps: S201: When packet loss is detected at any communication interface in any internal communication link between the central processing unit (CPU) and the communication chip, the first communication quality parameters of each internal communication link are collected according to a preset collection period; the first communication quality parameters include at least the packet loss information and data packet transmission and reception rate corresponding to each communication interface in the internal communication link.

[0025] Here, network security equipment can be network devices designed based on a CPU + communication chip architecture. The communication chip is used for packet processing and forwarding, and can specifically be an FPGA or a switch chip (SW). Typically, data packets from external network nodes are transmitted to the communication chip via an external panel interface. If the communication chip can directly process the data packets, it can send the processing results and / or the data packets out through the external panel interface. If the communication chip cannot process the data packets, it can select one of the multiple internal communication links communicating with the CPU to forward the data packets to the CPU for processing. After processing, the CPU can feed back the processing results and / or the data packets to the communication chip through an internal communication link, and then the communication chip will send the processing results and / or data packets sent by the CPU out through the external panel interface.

[0026] An internal communication link can serve as a data transmission channel between the CPU and the communication chip. Each internal communication link may include two communication interfaces (for ease of description, this application may define the two communication interfaces in an internal communication link as internal interfaces), one of which is located on the CPU and the other on the communication chip. For example, in Figure 1 In this context, the internal communication link between the CPU and the FPGA / SW may include an FH communication link and a GI communication link. This application does not specifically limit the number of internal communication links between the CPU and the communication chip.

[0027] The duration of the preset acquisition period is set based on experience, and this application embodiment does not impose a specific limitation. For example, the preset acquisition period can be 30 seconds, 1 minute, etc. The first communication quality parameter is used to characterize the transmission and reception quality of the internal communication link when sending and receiving data packets. One internal communication link corresponds to one first communication quality parameter in one preset acquisition period. Specifically, for any internal communication link, the first communication quality parameter of the internal communication link can include the packet loss information and data packet transmission and reception rate corresponding to each communication interface in the internal communication link. The packet loss information can include, but is not limited to, the packet loss acceleration, packet loss rate, packet loss count, etc. of the communication interface. The data packet transmission and reception rate can specifically include the data packet sending rate (TX) and data packet receiving rate (RX) of the communication interface. The data packet transmission and reception rate is used to reflect the data transmission rate of the panel interface. The level of the interface rate characterizes the level of data transmission capability of the interface. For example, the interface rate of a certain panel interface can be 1000Mb / s.

[0028] Optionally, the first communication quality parameter may also include overall packet loss information and overall transmit / receive rate corresponding to the internal communication link. The overall packet loss information can be determined based on the packet loss information of the two internal interfaces under the internal communication link; the overall transmit / receive rate can be determined based on the packet loss transmission / receive rate of the two internal interfaces under the internal communication link.

[0029] In practical implementation, in the initial state, all internal interfaces in the network security device operate in full-duplex mode, meaning each internal interface simultaneously performs both data packet transmission and reception functions. During the operation of the network security device, with the interface detection thread enabled, it can detect whether packet loss occurs at each internal interface under each internal communication link in the network security device according to a preset detection cycle. The interface detection thread can be a preset connection link detection thread, which has the functions of detecting packet loss at internal interfaces, collecting communication quality parameters of each internal interface, dynamically adjusting interface resources, and adjusting the number of interfaces in the logical link transmission and reception directions as proposed in this application. The default state of the interface detection thread is enabled. Administrators can actively set the on / off state of the interface detection thread and the on / off state of the function to adjust the number of interfaces in the logical link transmission and reception directions through the thread control page and / or thread control commands. It is understood that if packet loss occurs at any internal interface in any internal communication link, this packet loss can occur in the data packet transmission direction and / or in the data packet reception direction.

[0030] Furthermore, if no packet loss occurs at any of the internal interfaces, the system can continue waiting for the next detection cycle. If packet loss is detected at at least one internal interface in any cycle, global detection can be triggered if the function to adjust the number of interfaces in the logical link's send / receive direction is enabled. At this time, the interface detection thread can collect the first communication quality parameters of each internal communication link according to a preset collection cycle. The number of collections can be one or more. For example, the first communication quality parameters of each internal communication link can be collected for three cycles according to a preset collection cycle.

[0031] Understandably, before packet loss is detected at an internal interface, the interface detection thread in this application can collect only the partial information of whether packet loss occurs at each internal interface in each preset collection period. After packet loss is detected at an internal interface, the thread can collect the global information of the first communication quality parameter of each internal interface.

[0032] S202: Based on the first communication quality parameters and resource adjustment conditions corresponding to each internal communication link collected in at least one cycle, determine whether to adjust the interface working mode; the interface working mode is used to indicate the on / off state of the communication interface in the direction of data packet transmission and reception.

[0033] Here, the resource adjustment condition refers to the conditions that indicate adjustments to the interface resources of the internal interface. Since the amount of interface resources is related to the interface's operating mode, the resource adjustment condition can also be understood as the conditions that indicate adjustments to the interface's operating mode. For example, the resource adjustment condition can be determined based on the number of times the first communication quality parameter needs to be collected. For instance, when collecting the first communication quality parameter only once, the resource adjustment condition can include a first condition regarding packet loss information and a second condition regarding the packet transmission and reception rate. The first condition can be, for example, that at least one of the packet loss acceleration, packet loss rate, and packet loss count of the internal interface is not zero. The second condition can be that the packet transmission rate and / or packet reception rate reaches a preset rate, which can be determined based on the maximum received communication bandwidth. When collecting the first communication quality parameter multiple times, the first condition can be, for example, that in each collection period, at least one of the packet loss acceleration, packet loss rate, and packet loss count of at least one internal interface is not zero. The second condition can be that in each collection period, at least one of the packet transmission rate and / or packet reception rate of at least one internal interface reaches a preset rate.

[0034] Interface operating modes indicate the on / off state of the communication interface's functionality in both the data packet transmission and reception directions. Specifically, interface operating modes can include full-duplex mode, transmit-only mode, and receive-only mode. Full-duplex mode allows the internal interface to be used for both data packet transmission and reception, enabling it to send and receive data packets. Transmit-only mode allows the internal interface to be used only for sending data packets, with its transmission function enabled and reception function disabled. Receive-only mode allows the internal interface to be used only for receiving data packets, with its transmission function disabled and reception function enabled.

[0035] In practical implementation, if only the first communication quality parameters corresponding to each internal communication link are collected in one cycle—that is, if the first communication quality parameters are collected only once for each internal communication link after triggering global detection—then for each internal communication link, it can be determined whether the resource adjustment conditions are met based on the collected first communication quality parameters. Then, based on the number of internal communication links that meet the resource adjustment conditions, it can be determined whether the interface operating mode needs to be adjusted. For example, if it is determined that the first communication quality parameters of at least one internal communication link meet the resource adjustment conditions, then it can be determined that the interface operating mode needs to be adjusted. If the first communication quality parameters of all internal communication links do not meet the resource adjustment conditions, then it can be determined that the interface operating mode does not need to be adjusted.

[0036] Having collected the first communication quality parameters for each internal communication link across multiple periods, for each internal communication link, it can be determined whether the internal communication link meets the resource adjustment conditions across multiple collection periods based on the communication quality parameters of that internal communication link across multiple collection periods. Then, based on the number of internal communication links that meet the resource adjustment conditions across multiple periods, it is determined whether to adjust the interface operating mode. For example, if it is determined that at least one internal communication link meets the resource adjustment conditions across multiple periods, it can be determined that the interface operating mode needs to be adjusted; otherwise, it can be determined that the interface operating mode does not need to be adjusted.

[0037] S203: If so, then determine the first target proportion of the first communication interface dedicated to data packet transmission among the various first communication interfaces on the CPU according to the first communication quality parameter.

[0038] It should be noted that the interface resource adjustment method of this application can be applied to the resource adjustment of internal interfaces. The first communication interface can be an internal interface located on the CPU in an internal communication link. The first communication interface is dedicated to data packet transmission, that is, the first communication interface in transmit-only mode. The first target ratio is used to indicate the proportion of the first communication interface that needs to be adjusted to transmit-only mode.

[0039] In practical implementation, when it is determined that the interface operating mode needs to be adjusted, the packet loss level and predicted packet loss probability of each internal communication link can be determined based on the latest collected first communication quality parameters for each internal communication link. The packet loss level indicates the severity of packet loss in the internal communication link; the more severe the packet loss, the higher the first target proportion. The predicted packet loss probability indicates the likelihood of future packet loss in the internal communication link. For example, the interface detection thread can call a probability prediction model to determine the predicted packet loss probability of each internal communication link based on the latest collected first communication quality parameters. Then, based on the total number of first communication interfaces on the CPU, the number of interfaces currently in transmit-only mode, the packet loss level of each internal communication link, and the predicted packet loss probability, the first target proportion of the first communication interfaces dedicated to data packet transmission can be determined.

[0040] For example, a first initial ratio can be determined based on the packet loss level and predicted packet loss probability of each internal communication link. A second initial ratio can be determined based on the number of interfaces currently in transmit-only mode and the total number of first communication interfaces. A first target ratio can then be determined based on the first and second initial ratios.

[0041] Alternatively, the first target ratio can be determined based on the number of internal communication links that trigger resource adjustment conditions and the first communication quality parameter. For example, if the number of links is less than a preset number, and both the packet loss level and the packet loss prediction probability reflected by the first communication quality parameter are less than the corresponding preset thresholds, the preset ratio can be used as the first target ratio, or the ratio of the preset number n to the total number of the first communication interfaces can be used as the first target ratio. If the number of links is not less than the preset number, and at least one of the packet loss level and the packet loss prediction probability reflected by the first communication quality parameter is not less than the corresponding preset threshold, the first target ratio can be determined using the aforementioned first initial ratio and second initial ratio.

[0042] Alternatively, the first target ratio can be determined based on the packet loss information of each communication interface where packet loss occurs and the differences in transmission and reception rates.

[0043] Understandably, information such as the rules for determining the first target ratio, the rules for determining whether to adjust the interface working mode, and the target value can be distributed to network security devices through Access Control Lists (ACLs) policies.

[0044] S204: Adjust the interface working mode of each first communication interface according to the first target ratio.

[0045] In practice, the target number of first communication interfaces that need to be set to transmit-only mode can be determined according to the first target ratio and the total number of first communication interfaces. Then, the target number of first communication interfaces can be selected from the various first communication interfaces set on the CPU, and the interface operating mode of these interfaces can be modified to transmit-only mode. Understandably, after a certain first communication interface is modified to transmit-only mode, the interface operating mode of the internal interfaces of the chip that are in the same internal communication link as that first communication interface will be automatically modified to receive-only mode.

[0046] Optionally, after determining the target number, the target number of first communication interfaces can be selected from each first communication interface based on the packet loss level and predicted packet loss probability of each internal communication link. For example, for each internal communication link, the maximum value between its packet loss level and predicted packet loss probability can be used as the sorting value for that internal communication link. Then, the internal communication links are sorted in descending order of sorting value, and the first communication interfaces on the internal communication links whose sorting order is less than or equal to the target number are selected as the first communication interfaces that need to be set to transmit-only mode.

[0047] Thus, this application provides an interface control method based on dynamic reconfiguration of communication quality parameters of internal communication links. When a packet loss event is detected in the internal communication link, the method dynamically reconstructs the interface number ratio of the Ethernet channel in the transmit and receive directions by monitoring the packet loss information and bidirectional transmit and receive rates of the internal interfaces in real time. This achieves adaptive adjustment of the working mode of the internal interfaces and maximizes the guarantee of communication continuity under link congestion.

[0048] In one embodiment, the resource adjustment conditions may include persistent packet loss in at least one internal communication link and the packet transmission and reception rates of at least one internal communication link consistently reaching a data transmission and reception throughput threshold. The data transmission and reception throughput threshold is the packet sending rate threshold and the packet receiving rate threshold, which can be determined based on the bandwidth capacity of the internal interfaces in the internal communication links. S202 described above can be implemented according to the following steps: S202-1: Based on the packet loss information collected for each internal communication link in at least one period, determine whether there is continuous packet loss in at least one internal communication link.

[0049] In practical implementation, after triggering global detection, if only one period needs to be collected, for each internal communication link, it can be determined whether the link is experiencing continuous packet loss based on the packet loss information of that link during that period. For example, if the packet loss information of that link during that period shows at least one of the following: packet loss count greater than 0, packet loss acceleration greater than 0, and packet loss rate greater than 0, then it can be determined that the link is experiencing continuous packet loss. If the packet loss information of that link during that period does not show any of the following, then it can be determined that the link is not experiencing continuous packet loss. Here, a packet loss count greater than 0 can include a packet loss count greater than 0 for any internal interface in the internal communication link and / or an overall packet loss count greater than 0 for the internal communication link. A packet loss acceleration greater than 0 can include a packet loss acceleration greater than 0 for any internal interface in the internal communication link and / or an overall packet loss acceleration greater than 0 for the internal communication link. A packet loss rate greater than 0 can include a packet loss rate greater than 0 for any internal interface in the internal communication link and / or an overall packet loss rate greater than 0 for the internal communication link.

[0050] Optionally, after triggering global detection, if multiple periods need to be collected, for each internal communication link, the change in packet loss information in each period can be used to determine whether the internal communication link is experiencing continuous packet loss. For example, for any internal communication link, if it satisfies at least one of the following: "the packet loss count collected over multiple consecutive periods is continuously increasing; the packet loss acceleration collected over multiple consecutive periods is continuously not decreasing or not becoming 0; the packet loss rate collected over multiple consecutive periods is continuously not decreasing or is always greater than 0," then it can be determined that the internal communication link is experiencing continuous packet loss. Conversely, if none of the above conditions are met, then it can be determined that the internal communication link is not experiencing packet loss. Specifically, "the packet loss count collected over multiple consecutive periods is continuously increasing" can mean that the packet loss count of any internal interface in the internal communication link is continuously increasing and / or the overall packet loss count of the internal communication link is continuously increasing. The packet loss acceleration collected over multiple consecutive cycles has not decreased or has not become 0. Specifically, this could mean that the packet loss acceleration of any internal interface in the internal communication link has not decreased or has not become 0, and / or that the overall packet loss acceleration of the internal communication link has not decreased or has not become 0. Similarly, the packet loss rate collected over multiple consecutive cycles has not decreased or has been greater than 0. Specifically, this could mean that the packet loss rate of any internal interface in the internal communication link has not decreased or has been greater than 0, and / or that the overall packet loss rate of the internal communication link has not decreased or has been greater than 0.

[0051] Furthermore, the number of primary target communication links experiencing continuous packet loss among multiple internal communication links can be determined using the first communication quality parameters of each internal communication interface. If this number is greater than 0, it can be determined that at least one internal communication link is experiencing continuous packet loss; if this number is equal to 0, it can be determined that no internal communication link is experiencing continuous packet loss.

[0052] S202-2: Based on the data packet transmission and reception rates of each internal communication link collected in at least one cycle, determine whether at least one internal communication link reaches the data transmission and reception throughput threshold.

[0053] In practical implementation, after triggering global detection, if only one period needs to be collected, for each internal communication link, it can be determined whether the link has reached the data transmission throughput threshold based on the data packet transmission and reception rate of that link in that period. For example, if the data packet transmission rate of the link in that period reaches the data packet transmission rate threshold and / or the data packet reception rate reaches the data packet reception rate threshold, then the link can be determined to have reached the data transmission throughput threshold. If the data packet transmission rate of the link in that period does not reach the data packet transmission rate threshold and the data packet reception rate does not reach the data packet reception rate threshold, then the link can be determined not to have reached the data transmission throughput threshold. The data packet transmission rate reaching the data packet transmission rate threshold can include the data packet transmission rate of any internal interface in the internal communication link reaching the data packet transmission rate threshold and / or the overall data packet transmission rate of the internal communication link reaching the data packet transmission rate threshold. The data packet reception rate reaching the data packet reception threshold can also include the data packet reception rate of any internal interface in the internal communication link reaching the data packet reception rate threshold and / or the overall data packet reception rate of the internal communication link reaching the data packet reception rate threshold.

[0054] Optionally, after triggering global detection, if multiple periods need to be collected, for each internal communication link, it can be determined whether the internal communication link has reached the data transmission throughput threshold based on the changes in the data packet transmission and reception rate of the internal communication link in each period. For example, for any internal communication link, if the internal communication link meets at least one of the following conditions: "the data packet transmission rate collected in multiple consecutive periods continuously reaches the data packet transmission rate threshold," "the data packet reception rate collected in multiple consecutive periods continuously reaches the data packet reception rate threshold," or "there are internal communication links in multiple periods where the data packet transmission / reception rate reaches the data packet transmission / reception rate threshold," then it can be determined that the internal communication link has reached the data transmission throughput threshold. Conversely, if none of the above conditions are met, then it can be determined that the internal communication link has not reached the data transmission throughput threshold. Specifically, "the data packet transmission rate collected in multiple consecutive periods continuously reaches the data packet transmission rate threshold" can mean that after the data packet transmission rate collected in any period reaches the data packet transmission rate threshold, the data packet transmission rate threshold collected in subsequent periods after that period continues to reach the data packet transmission rate threshold. For example, if the data packet transmission and reception rates are continuously collected over three cycles, and the data packet transmission rate collected in the first cycle reaches the data packet transmission rate threshold, then if the data packet transmission rates collected in the second and third cycles also reach the data packet transmission rate threshold, it can be determined that the internal communication link has reached the data transmission and reception throughput threshold. If the data packet transmission rates collected in the second and third cycles do not reach the data packet transmission rate threshold, it can be determined that the internal communication link has not reached the data transmission and reception throughput threshold. If the data packet transmission rate collected in the second cycle does not reach the data packet transmission rate threshold, but the data packet transmission rate collected in the third cycle does not reach the data packet transmission rate threshold, it can be determined that the internal communication link has reached the data transmission and reception throughput threshold. If the data packet transmission rate collected in the first cycle does not reach the data packet transmission rate threshold, but the data packet transmission rates collected in the second and third cycles both reach the data packet transmission rate threshold, it can be determined that the internal communication link has reached the data transmission and reception throughput threshold.

[0055] Similarly, the data packet reception rate collected in multiple consecutive cycles continuously reaches the data packet reception rate threshold. Specifically, after the data packet reception rate collected in any cycle reaches the data packet reception rate threshold, the data packet reception rate threshold collected in subsequent cycles after that cycle will continue to reach the data packet reception rate threshold.

[0056] In cases where internal communication links with data packet transmission / reception rates reaching the data packet transmission / reception rate threshold exist in multiple cycles, this can include situations where the internal communication links with data packet transmission / reception rates reaching the data packet transmission / reception rate threshold are all the same, or situations where the internal communication links with data packet transmission / reception rates reaching the data packet transmission / reception rate threshold exist in different cycles.

[0057] Understandably, the data packet transmission rate collected over multiple consecutive cycles consistently reaches the data packet transmission rate threshold. Specifically, this can mean that the data packet transmission rate of any internal interface in the internal communication link consistently reaches the data packet transmission rate threshold and / or the overall data packet transmission rate of the internal communication link consistently reaches the data packet transmission rate threshold. Similarly, the data packet reception rate collected over multiple consecutive cycles consistently reaches the data packet reception rate threshold. Specifically, this can mean that the data packet reception rate of any internal interface in the internal communication link consistently reaches the data packet reception rate threshold and / or the overall data packet reception rate of the internal communication link consistently reaches the data packet reception rate threshold.

[0058] Furthermore, the first communication quality parameters of each internal communication interface can be used to determine the number of second target communication links among multiple internal communication links where the data packet transmission rate reaches the data transmission throughput threshold. If this number is greater than 0, it can be determined that at least one internal communication link has reached the data transmission throughput threshold; if this number is equal to 0, it can be determined that no internal communication link has reached the data transmission throughput threshold.

[0059] S202-3: If at least one internal communication link experiences continuous packet loss and at least one internal communication link reaches the data transmission and reception throughput threshold, trigger the resource adjustment condition and determine the interface working mode to be adjusted.

[0060] In practice, if at least one first target communication link and at least one second target communication link exist, regardless of whether the first and second target communication links are the same, the resource adjustment condition can be triggered, determining that the interface operating mode needs to be adjusted. Conversely, if neither a first target communication link nor a second target communication link exists, the resource adjustment condition cannot be triggered, determining that the interface operating mode does not need to be adjusted.

[0061] For example, when it is detected that the transmission direction of the internal communication link simultaneously meets the data packet transmission and reception rate reaching the data transmission and reception throughput threshold (i.e., the internal communication link is experiencing overbandwidth), and persistent packet loss occurs, it can be determined that the resource adjustment conditions are triggered, and the interface operating mode needs to be adjusted. The transmission direction of the internal communication link can include the transmission direction from the CPU to the FPGA / SW in the internal communication link between the CPU and the FPGA / SW, or the transmission direction from the FPGA / SW to the CPU in the internal communication link between the FPGA / SW and the CPU.

[0062] In one embodiment, S203 described above can be implemented according to the following steps: S203-1: Determine the packet loss level of each communication interface based on the packet loss information corresponding to each communication interface.

[0063] In practice, for each communication interface in each internal communication link, the packet loss degree of the communication interface can be obtained by weighting and summing the packet loss acceleration, packet loss count and packet loss rate collected in the most recent period according to the weighting weights set for packet loss acceleration, packet loss count and packet loss rate respectively.

[0064] S203-2: Determine the ratio of the transmission and reception rates of each communication interface based on the data packet transmission and reception rates of each communication interface.

[0065] In practice, for each communication interface in each internal communication link, the ratio between the data packet sending rate and the data packet receiving rate of the communication interface can be determined based on the data packet sending and receiving rate of the communication interface collected in the most recent period, and this ratio can be used as the corresponding sending and receiving rate ratio of the communication interface.

[0066] S203-3: Based on the condition that the difference between the number of first communication interfaces under the first target ratio and the total number of first communication interfaces is not less than the target value, determine the first target ratio of the first communication interfaces dedicated to data packet transmission according to the packet loss degree and the ratio of transmission and reception rates.

[0067] Here, the target value indicates the maximum number of adjustments to the ratio of the first communication interface, that is, the maximum number of adjustments to the interface resources. The target value can be a preset value, or it can be determined based on the first communication quality parameters of the internal communication link when it is first determined that the interface transmit / receive ratio needs to be adjusted.

[0068] The reason for limiting the difference between the number of first communication interfaces under the target ratio and the total number of first communication interfaces to no less than the target value is to avoid the situation where packet loss still occurs after the first adjustment and subsequent adjustments are needed. This would result in insufficient number of first communication interfaces remaining in full-duplex mode after the first adjustment, leading to insufficient first communication interfaces for adjustment in transmit-only mode during subsequent adjustments.

[0069] The number of first communication interfaces under the first target ratio can be determined by multiplying the total number of first communication interfaces by the first target ratio.

[0070] In practical implementation, when adjusting interface resources for the first time, that is, when it is first determined that the interface working mode needs to be adjusted, the first target ratio of the first communication interfaces dedicated to data packet transmission can be determined based on the condition that the difference between the number of first communication interfaces under the first target ratio and the total number of first communication interfaces is not less than the target value. This is done according to the relationship between the packet loss rate of each communication interface and the preset rate, as well as the relationship between the transmit / receive rate ratio and the preset transmit / receive rate ratio. For example, the number of communication interfaces with a packet loss rate greater than the preset rate and the number of communication interfaces with a transmit / receive rate ratio greater than the preset transmit / receive rate ratio can be determined. The first target ratio is then determined based on the sum of these two numbers, the aforementioned constraints, and the total number of first communication interfaces.

[0071] Understandably, when adjusting interface resources for the first time, i.e., when it is determined that the interface working mode needs to be adjusted for the first time, the above constraints can be ignored. Instead, a new primary target ratio can be determined based on the packet loss level and the transmit / receive rate ratio. After each adjustment, the number of adjustments can be reset to zero. The adjustment can be considered complete when, after adjusting the transmit / receive interface ratio, any communication link no longer experiences packet loss; or when the number of adjustments reaches the target value.

[0072] For example, this application adds a function to dynamically adjust the number of interfaces in the logical link's transmit and receive directions within the link detection thread. When packet loss is detected in the receive or transmit direction of the internal communication link between the CPU and the FPGA / Switch, this thread will perform multiple sampling detections to obtain packet loss information and data packet transmission / reception rates for all communication interfaces in all internal communication links. If, based on the packet loss information and data packet transmission / reception rates, it is determined that at least one communication interface is experiencing continuous packet loss, a dynamic adjustment mechanism for the number of interfaces in the transmit and receive directions of the internal communication link is triggered. The adjustment strategy can, for example, dynamically allocate the number of interfaces in the receive and transmit directions on the CPU based on the data packet transmission / reception rate and the degree of packet loss of each communication interface under packet loss conditions. For instance, n first communication interfaces can be configured as transmit-only modes, dedicated to CPU packet transmission, avoiding conflicts with the internal packet transmission of the FPGA / SW.

[0073] In one embodiment, to further ensure that packet loss in each internal communication link can be mitigated in a timely manner after the interface transmit / receive ratio is adjusted, this application further provides an adjustment detection and cyclic adjustment mechanism. Specifically, after executing S204, the adjustment detection and cyclic adjustment mechanism can be implemented according to the following steps A1~A4: A1: Re-collect the second communication quality parameters of each internal communication link according to the preset collection period and preset collection number.

[0074] Here, the preset number of sampling times indicates the number of consecutive global detection cycles required after each adjustment of the interface working mode of each first communication interface. For example, the preset number of sampling times can be 3 times, 5 times, etc.

[0075] The second communication quality parameter is the communication quality parameter that is re-collected for each internal communication link in each preset acquisition period after adjusting the interface working mode of each first communication interface. For any internal communication link, the number of second communication quality parameters collected is consistent with the preset acquisition number.

[0076] The second communication quality parameter may include at least the packet loss information and data packet transmission / reception rate for each communication interface in the internal communication link. Optionally, the second communication quality parameter may also include the overall packet loss information and overall transmission / reception rate for the internal communication link.

[0077] Taking a preset collection count of 3 as an example, after executing S204, for each internal communication link, the second communication quality parameter corresponding to each internal communication link can be re-collected in 3 new cycles according to the preset collection cycle.

[0078] A2: Based on the second communication quality parameter, determine whether any internal communication link experiences continuous packet loss in each newly acquired period.

[0079] Here, the new collection cycle is the various cycles that match the preset number of collections.

[0080] In practice, for any given internal communication link, the presence of continuous packet loss can be determined by analyzing the changes in packet loss information in the second communication quality parameter of that internal communication link during each new acquisition period. For example, for any given internal communication link, if it satisfies at least one of the following conditions: "the packet loss count keeps increasing during multiple consecutive acquisition periods," "the packet loss acceleration keeps not decreasing or keeps not becoming 0 during multiple consecutive acquisition periods," or "the packet loss rate keeps not decreasing or keeps being greater than 0 during multiple consecutive acquisition periods," then it can be determined that the internal communication link is experiencing continuous packet loss. Conversely, if none of the above conditions are met, then it can be determined that the internal communication link is not experiencing packet loss.

[0081] If no internal communication link experiences continuous packet loss in any of the newly collected cycles, it can be determined that communication on each internal communication link has returned to normal, and the adjustment of the interface transmit / receive ratio can be completed, maintaining the current interface transmit / receive ratio.

[0082] A3: If so, then if the number of times the working mode of the first communication interface has been adjusted has not reached the target value, the second target ratio of the first communication interface dedicated to data packet transmission in each first communication interface shall be determined according to the second communication quality parameter and the target ratio determined last time.

[0083] Here, the "adjusted count" indicates the number of times the operating mode of the first communication interface on the CPU has been adjusted. Each time the transmit / receive ratio of the first communication interface is adjusted, the adjusted count is incremented by 1. After each adjustment, the count can be reset to zero.

[0084] In practice, after the last adjustment of the interface working mode, if any internal communication link still experiences continuous packet loss in each newly collected cycle, the latest statistical count of adjustments can be obtained. It is then determined whether the number of adjustments exceeds the target value. If so, the adjustment can be considered complete. If not, based on the second communication quality parameters collected most recently for each internal communication link, a second target ratio for the first communication interface dedicated to data packet transmission can be determined again, building upon the previously determined target ratio. This second target ratio is typically greater than the previously determined target ratio. Regarding the previously determined target ratio, if the previous adjustment was the first adjustment, then that target ratio is the first target ratio; otherwise, it is the previously determined second target ratio.

[0085] For example, during the initial adjustment, the interface operating mode of each first communication interface can be adjusted according to the first target ratio. Then, after the initial adjustment, it can be determined, using A1~A2 as described above, whether any internal communication link still experiences continuous packet loss after the initial adjustment. If so, it can be determined that a second adjustment is needed. Therefore, based on the second communication quality parameters most recently collected for each internal communication link, the second target ratio corresponding to the second adjustment can be determined on the basis of the first target ratio determined initially.

[0086] A4: Adjust the working mode of each first communication interface according to the second target ratio, and return to the step of re-collecting the second communication quality parameters of each internal communication link according to the preset collection cycle and preset collection number, until no continuous packet loss occurs in any internal communication link in each newly collected cycle or the number of times the working mode of the first communication interface has been adjusted reaches the target value.

[0087] In practice, after determining the second target ratio, the target number of first communication interfaces that need to be set to transmit-only mode can be determined based on the second target ratio and the total number of first communication interfaces. Then, the target number of first communication interfaces can be selected from the various first communication interfaces set on the CPU, and the interface working mode of these interfaces can be modified to transmit-only mode. Then, the above A1 can be executed again until no continuous packet loss occurs in any of the newly collected cycles of any internal communication link, indicating that the currently adjusted interface transmit / receive ratio can guarantee normal communication, and thus the adjustment can be determined to be completed. Alternatively, the above A1 can be executed again until the number of times the working mode of the first communication interface has been adjusted reaches the target value, indicating that the interface transmit / receive ratio of the first communication interface has been adjusted to the target value number of times, but the packet loss problem of the internal communication link still cannot be solved. At this time, the adjustment can be directly determined to be completed and an abnormal alarm message can be generated so that the operation and maintenance personnel can manually adjust the resources of each internal communication link according to the abnormal alarm message.

[0088] In this way, by supporting multiple dynamic adjustments to the interface transmit / receive ratio, this application can gradually optimize the load of the internal communication link, thereby reducing packet loss, restoring normal communication of each internal interface, and ensuring efficient forwarding of data packets.

[0089] In one embodiment, the above target value can be determined according to the following steps B1~B3: B1: Based on the packet loss information of each communication interface in the recently collected first communication quality parameters, determine each first target interface that has packet loss and the first number of first target interfaces.

[0090] In specific implementation, when it is determined that the interface working mode needs to be adjusted based on the first communication quality parameter, that is, when it is determined for the first time that the interface working mode needs to be adjusted, the interface with packet loss can be identified from each communication interface based on the packet loss information in the most recently collected first communication quality parameter of each internal communication link and taken as the first target interface. At the same time, the number of the first target interfaces can be determined and taken as the first quantity.

[0091] B2: Based on the differences in data packet transmission and reception rates of each communication interface in the most recently collected first communication quality parameters, determine the order of differences for each communication interface in descending order of differences.

[0092] Here, rate difference is used to characterize the difference between the data packet sending rate and the data packet receiving rate of the communication interface.

[0093] In practice, when it is initially determined that the interface operating mode needs to be adjusted, the data packet transmission and reception rate of each communication interface can be determined based on the first communication quality parameter collected in the most recent data acquisition for each internal communication link. For each communication interface, the rate difference of each communication interface can be determined based on the data packet transmission and reception rate. Then, according to the rate difference from largest to smallest, the communication interfaces are sorted to obtain the rate difference ranking order of each communication interface.

[0094] B3: Determine the target value based on the number of second target interfaces and the first target interface, whose difference sorting order is less than or equal to the first number.

[0095] In practice, communication interfaces whose difference ranking is less than or equal to the first number can be designated as the second target interfaces. Then, the target value can be determined based on the overlap between the first and second target interfaces and the total number of first communication interfaces.

[0096] For example, the target value can be determined based on the number of overlapping interfaces between the first and second target interfaces. Alternatively, the target value can be obtained by weighting the packet loss count and rate difference for each first target interface and each second target interface using the weights corresponding to the packet loss count and rate difference. Alternatively, the target value can be determined by identifying all non-overlapping interfaces between the first and second target interfaces and then using the number of non-overlapping interfaces / packet loss count / rate difference.

[0097] In one embodiment, after executing S204, the data packet can also be sent according to the following steps C1 and C2: C1: When there are data packets to be sent to the communication chip from the CPU, determine whether there is a first usable communication interface with remaining transmission and reception capacity from the second communication interfaces dedicated to data packet transmission among the first communication interfaces, based on the latest data packet transmission and reception rate collected by each second communication interface.

[0098] Here, the second communication interface is the first communication interface configured in send-only mode. The most recently collected data packet transmission and reception rate is the data packet transmission and reception rate most recently collected for the second communication interface. Having remaining transmission and reception throughput capacity indicates that the data bandwidth of the second communication interface is not fully utilized.

[0099] In practical implementation, after readjusting the transmit / receive interface ratio according to the first target ratio / second target ratio, most messages may need to be retransmitted via internal communication links, and the principle of "prioritizing communication interfaces in transmit-only mode" can be followed during transmission. Therefore, when the CPU has data packets to be sent to the communication chip, it is possible to determine whether there is a first usable communication interface with remaining transmit / receive throughput capacity from among the various second communication interfaces included in the CPU, based on the data packet transmit / receive rate of each second communication interface and the data transmit / receive throughput threshold of each second communication interface.

[0100] If so, the first available communication interface can be used to send the data packet to the communication chip. If not, it indicates that all the second communication interfaces have been exhausted, and the following C2 can be executed.

[0101] Alternatively, if a data packet exists to be sent to the communication chip, the network security device can use the five-tuple of the data packet to determine the interface to be used from the first communication interfaces. Then, it determines whether the interface to be used is a second communication interface in transmit-only mode. If so, the data packet can be directly sent to the communication chip using that second communication interface. If not, it can determine whether there is a first usable communication interface with remaining transmit / receive throughput capacity based on the latest data packet transmission and reception rates collected from each of the second communication interfaces. If so, the data packet can be sent to the communication chip using the first usable communication interface; otherwise, proceed to step C2 below.

[0102] C2: If not, select a second usable communication interface with remaining transmit / receive throughput from the third communication interfaces other than the second communication interface among the first communication interfaces, and use the internal communication link corresponding to the second usable communication interface to send the data packet to be sent to the communication chip.

[0103] Here, the third communication interface can be the communication interface in full-duplex mode of the first communication interface.

[0104] In practical implementation, if no first usable communication interface exists, it indicates that the second communication interface used for packet transmission by the CPU has been exhausted. In this case, one of the third communication interfaces in full-duplex mode can be selected for data packet transmission. Therefore, based on the data packet transmission and reception rate of each third communication interface and its data transmission and reception throughput threshold, a second usable communication interface with remaining transmission and reception throughput capacity can be determined. Then, using the internal communication link where the second usable communication interface is located, the data packet to be sent to the communication chip is transmitted to the communication chip.

[0105] Thus, this application sets some of the first communication interfaces to transmit-only mode, dedicating them solely to CPU packet transmission. When the CPU transmits data packets, most messages need to reselect a link, prioritizing the internal communication links that only transmit and do not receive (i.e., the transmit-only communication interfaces). This alleviates packet loss between the CPU and FPGA in the transmission direction. Furthermore, if the internal communication links selected in the transmission direction cannot meet the requirements (i.e., the transmit-only communication interfaces are exhausted), some full-duplex communication interfaces can be used for packet transmission.

[0106] In one embodiment, since multiple internal interfaces may be used for traffic input and output in a CPU+FPGA / Switch architecture, this application also proposes corresponding technical means to prevent communication abnormalities caused by internal interface failures (such as a down state). Specifically, a link aggregation control protocol can be used to dynamically aggregate various communication interfaces; in response to the failure of any communication interface, the data packets to be sent by the communication interface are sent using other non-failed communication interfaces that have the same interface working mode and are located in the same interface position; wherein, the interface position is used to indicate whether the communication interface is located in the CPU or in the communication chip.

[0107] For example, communication interfaces in various internal communication links can be aggregated dynamically. For instance, for... Figure 1 In this case, interfaces H, F, I, and G can be dynamically aggregated. If data packet 1 needs to be sent to the FPGA / Switch through interface H, but interface H fails, then if interface I and interface H are in the same operating mode, interface I can be used to send data packet 1 to the FPGA / Switch.

[0108] like Figure 3 The flowchart shown is another interface resource adjustment method provided in this application embodiment, which may include the following steps: S301: According to the preset collection cycle, detect whether there is packet loss in any internal interface of each internal communication link.

[0109] If yes, then execute S302 below; if no, then wait until the next preset acquisition cycle is reached to acquire data again.

[0110] S302: If so, then collect the first communication quality parameters of each internal communication link according to the preset collection cycle.

[0111] S303: Determine whether the resource adjustment condition is triggered based on the first communication quality parameter.

[0112] The resource adjustment conditions may include the existence of continuous packet loss in at least one internal communication link and the existence of at least one internal communication link reaching the data transmission and reception throughput threshold.

[0113] If not, then it can be determined that there is no need to adjust the transmit / receive interface ratio on the CPU, and the process returns to execute S301 above. If yes, then the processes S304 to S309 below can be executed.

[0114] S304: Determine the first target ratio of the first communication interface on the CPU dedicated to data packet transmission based on the first communication quality parameter.

[0115] S305: Adjust the interface working mode of each first communication interface according to the first target ratio.

[0116] S306: Re-collect the second communication quality parameters of each internal communication link according to the preset collection cycle and preset collection number.

[0117] S307: Based on the second communication quality parameter, determine whether any internal communication link experiences continuous packet loss in each newly acquired period.

[0118] If yes, then execute S308 below; if no, then maintain the current send / receive ratio and return to execute S301.

[0119] S308: If so, if the number of times the working mode of the first communication interface has been adjusted has not reached the target value, determine the second target proportion of the first communication interfaces dedicated to data packet transmission in each first communication interface.

[0120] S309: Adjust the working mode of each first communication interface according to the second target ratio, and return to the step of re-collecting the second communication quality parameters of each internal communication link according to the preset collection cycle and preset collection number, until no continuous packet loss occurs in any internal communication link in each newly collected cycle or the number of times the working mode of the first communication interface has been adjusted reaches the target value.

[0121] For the specific implementation process of S301 to S309 above, please refer to the description of the above embodiments, which will not be repeated here.

[0122] In this way, by sensing traffic changes in real time (i.e., whether packet loss exists and whether the data transmission and reception throughput threshold has been reached), this application dynamically optimizes the resource allocation of internal interfaces, which can improve the utilization rate of internal communication links while ensuring the continuity of communication services. When optimizing resource allocation, based on the real-time monitoring of the differences in transmission and reception rates and the degree of packet loss of each internal interface, the resource reallocation in the transmission and reception directions of the internal interface links is performed, which can minimize packet loss in the transmission and reception directions.

[0123] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0124] Based on the same inventive concept, this application also provides an interface resource adjustment device corresponding to the interface resource adjustment method. Since the principle of the device in this application is similar to the interface resource adjustment method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0125] like Figure 4 The diagram shown is a schematic of an interface resource adjustment device provided in an embodiment of this application, comprising: The acquisition module 401 is used to acquire first communication quality parameters of each internal communication link according to a preset acquisition period when packet loss is detected at any communication interface in any internal communication link between the central processing unit (CPU) and the communication chip; the first communication quality parameters include at least packet loss information and data packet transmission and reception rate corresponding to each communication interface in the internal communication link. The first determining module 402 is used to determine whether to adjust the interface working mode based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one period; the interface working mode is used to indicate the on / off state of the communication interface in the direction of data packet transmission and reception. The second determining module 403 is used to determine, if so, a first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU, based on the first communication quality parameter; The adjustment module 404 is used to adjust the interface working mode of each of the first communication interfaces according to the first target ratio.

[0126] In one possible implementation, the first determining module 402, when determining whether to adjust the interface working mode based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one period, is configured to: Based on the packet loss information collected in at least one period for each of the internal communication links, determine whether there is continuous packet loss in at least one internal communication link. Based on the data packet transmission and reception rates of each of the internal communication links collected in at least one period, determine whether at least one internal communication link reaches the data transmission and reception throughput threshold. If at least one internal communication link experiences continuous packet loss and at least one internal communication link reaches its data transmission and reception throughput threshold, the resource adjustment condition is triggered to determine the interface working mode.

[0127] In one possible implementation, the second determining module 403, when determining the first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU based on the first communication quality parameter, is configured to: Based on the packet loss information corresponding to each of the communication interfaces, determine the packet loss level of each communication interface; Based on the data packet transmission and reception rate corresponding to each of the communication interfaces, determine the transmission and reception rate ratio corresponding to each of the communication interfaces. The first target ratio of the first communication interfaces dedicated to data packet transmission is determined based on the condition that the difference between the number of first communication interfaces under the first target ratio and the total number of first communication interfaces is not less than the target value, according to the packet loss level and the transmit / receive rate ratio.

[0128] In one possible implementation, the device further includes a loop module 405, which, after adjusting the interface operating modes of each of the first communication interfaces according to the first target ratio, is used to: According to the preset collection cycle and preset collection number, the second communication quality parameters of each internal communication link are re-collected; Based on the second communication quality parameter, determine whether any internal communication link experiences continuous packet loss in each newly acquired period; If so, then if the number of times the working mode of the first communication interface has been adjusted has not reached the target value, the second target ratio of the first communication interface dedicated to data packet transmission in each first communication interface shall be determined according to the second communication quality parameter and the target ratio determined last time. According to the second target ratio, adjust the working mode of each of the first communication interfaces, and return to the step of re-collecting the second communication quality parameters of each of the internal communication links according to the preset collection cycle and preset collection number, until no continuous packet loss occurs in any of the newly collected cycles of any internal communication link or the number of times the working mode of the first communication interface has been adjusted reaches the target value.

[0129] In one possible implementation, the device further includes a third determining module 406, configured to determine the target value according to the following steps: Based on the packet loss information of each communication interface in the recently collected first communication quality parameters, determine each first target interface that has packet loss and the first number of first target interfaces; Based on the differences in data packet transmission and reception rates of each communication interface in the most recently collected first communication quality parameters, the order of differences for each communication interface is determined in descending order of differences. The target value is determined based on the number of second target interfaces whose difference sorting order is less than or equal to the first number, and the first target interface.

[0130] In one possible implementation, the device further includes a first transmitting module 407, which, after adjusting the interface operating modes of each of the first communication interfaces according to the first target ratio, is used for: When the CPU has data packets to be sent to the communication chip, it is determined from the second communication interfaces dedicated to data packet transmission among the first communication interfaces whether there is a first usable communication interface with remaining transmission and reception capacity, based on the latest data packet transmission and reception rate collected by each second communication interface. If not, then select a second usable communication interface with remaining transmit / receive throughput from the third communication interfaces other than the second communication interface among the first communication interfaces, and use the internal communication link corresponding to the second usable communication interface to send the data packet to be sent to the communication chip.

[0131] In one possible implementation, the device further includes a second transmitting module 408, configured to: The various communication interfaces are dynamically aggregated using a link aggregation control protocol; In response to a failure of any communication interface, the data packet to be sent using that communication interface is sent using another non-failed communication interface that has the same interface operating mode and is located in the same interface position; wherein, the interface position is used to indicate whether the communication interface is located in the CPU or in the communication chip.

[0132] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0133] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0134] Based on the same technical concept, embodiments of this application also provide a computer device. (Refer to...) Figure 5 The diagram shown is a structural schematic of a computer device provided in an embodiment of this application, comprising: The system comprises a processor 501, a memory 502, and a bus 503. The memory 502 stores machine-readable instructions executable by the processor 501. The processor 501 executes these machine-readable instructions, and when executed, performs the following steps: S201: Upon detecting packet loss at any communication interface in any internal communication link between the CPU and the communication chip, the processor collects first communication quality parameters for each internal communication link according to a preset collection period. The first communication quality parameters include at least packet loss information and data packet transmission / reception rates corresponding to each communication interface in the internal communication link. S202: Based on the first communication quality parameters collected in at least one period for each internal communication link and resource adjustment conditions, the processor determines whether to adjust the interface operating mode. The interface operating mode indicates the on / off state of the communication interface in the data packet transmission / reception direction. S203: If yes, based on the first communication quality parameters, the processor determines a first target proportion of the first communication interfaces on the CPU dedicated to data packet transmission. S204: The processor adjusts the interface operating mode of each first communication interface according to the first target proportion.

[0135] The aforementioned memory 502 includes a main memory 5021 and an external memory 5022. The main memory 5021, also known as internal memory, is used to temporarily store the computational data in the processor 501, as well as the data exchanged with external memory such as a hard disk 5022. The processor 501 exchanges data with the external memory 5022 through the main memory 5021. When the computer device is running, the processor 501 and the memory 502 communicate through the bus 503, so that the processor 501 executes the execution instructions mentioned in the above method embodiments.

[0136] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the interface resource adjustment method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0137] This application also provides a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the interface resource adjustment method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0138] The computer program product can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0139] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interface; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0140] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0141] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0142] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0143] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0144] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for adjusting interface resources, characterized in that, The method includes: If packet loss is detected at any communication interface in any internal communication link between the central processing unit (CPU) and the communication chip, the first communication quality parameter of each internal communication link is collected according to a preset collection period; the first communication quality parameter includes at least the packet loss information and data packet transmission and reception rate corresponding to each communication interface of the internal communication link. Based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one cycle, it is determined whether to adjust the interface working mode; the interface working mode is used to indicate the on / off state of the function of the communication interface in the direction of data packet transmission and reception. If so, then based on the first communication quality parameter, determine the first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU; Adjust the interface working mode of each of the first communication interfaces according to the first target ratio.

2. The method according to claim 1, characterized in that, The step of determining whether to adjust the interface working mode based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one period includes: Based on the packet loss information collected in at least one period for each of the internal communication links, determine whether there is continuous packet loss in at least one internal communication link. Based on the data packet transmission and reception rates of each of the internal communication links collected in at least one period, determine whether at least one internal communication link reaches the data transmission and reception throughput threshold. If at least one internal communication link experiences continuous packet loss and at least one internal communication link reaches its data transmission and reception throughput threshold, the resource adjustment condition is triggered to determine the interface working mode.

3. The method according to claim 1, characterized in that, The step of determining the first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU, based on the first communication quality parameter, includes: Based on the packet loss information corresponding to each of the communication interfaces, determine the packet loss level of each communication interface; Based on the data packet transmission and reception rate corresponding to each of the communication interfaces, determine the transmission and reception rate ratio corresponding to each of the communication interfaces. The first target ratio of the first communication interfaces dedicated to data packet transmission is determined based on the condition that the difference between the number of first communication interfaces under the first target ratio and the total number of first communication interfaces is not less than the target value, according to the packet loss level and the transmit / receive rate ratio.

4. The method according to claim 1, characterized in that, After adjusting the interface operating mode of each of the first communication interfaces according to the first target ratio, the method further includes: According to the preset collection cycle and preset collection number, the second communication quality parameters of each internal communication link are re-collected; Based on the second communication quality parameter, determine whether any internal communication link experiences continuous packet loss in each newly acquired period; If so, then if the number of times the working mode of the first communication interface has been adjusted has not reached the target value, the second target ratio of the first communication interface dedicated to data packet transmission in each first communication interface shall be determined according to the second communication quality parameter and the target ratio determined last time. According to the second target ratio, adjust the working mode of each of the first communication interfaces, and return to the step of re-collecting the second communication quality parameters of each of the internal communication links according to the preset collection cycle and preset collection number, until no continuous packet loss occurs in any of the newly collected cycles of any internal communication link or the number of times the working mode of the first communication interface has been adjusted reaches the target value.

5. The method according to claim 3, characterized in that, The target value is determined according to the following steps: Based on the packet loss information of each communication interface in the recently collected first communication quality parameters, determine each first target interface that has packet loss and the first number of first target interfaces; Based on the differences in data packet transmission and reception rates of each communication interface in the most recently collected first communication quality parameters, the order of differences for each communication interface is determined in descending order of differences. The target value is determined based on the number of second target interfaces whose difference sorting order is less than or equal to the first number, and the first target interface.

6. The method according to claim 1, characterized in that, After adjusting the interface operating mode of each of the first communication interfaces according to the first target ratio, the method further includes: When the CPU has data packets to be sent to the communication chip, it is determined from the second communication interfaces dedicated to data packet transmission among the first communication interfaces whether there is a first usable communication interface with remaining transmission and reception capacity, based on the latest data packet transmission and reception rate collected by each second communication interface. If not, then select a second usable communication interface with remaining transmit / receive throughput from the third communication interfaces other than the second communication interface among the first communication interfaces, and use the internal communication link corresponding to the second usable communication interface to send the data packet to be sent to the communication chip.

7. The method according to claim 1, characterized in that, The method further includes: The various communication interfaces are dynamically aggregated using a link aggregation control protocol; In response to a failure of any communication interface, the data packet to be sent using that communication interface is sent using another non-failed communication interface that has the same interface operating mode and is located in the same interface position; wherein, the interface position is used to indicate whether the communication interface is located in the CPU or in the communication chip.

8. An interface resource adjustment device, characterized in that, The device includes: The acquisition module is used to acquire first communication quality parameters of each internal communication link according to a preset acquisition period when packet loss is detected at any communication interface in any internal communication link between the central processing unit (CPU) and the communication chip; the first communication quality parameters include at least packet loss information and data packet transmission and reception rate corresponding to each communication interface in the internal communication link. The first determining module is used to determine whether to adjust the interface working mode based on the first communication quality parameters and resource adjustment conditions corresponding to each of the internal communication links collected in at least one period; the interface working mode is used to indicate the on / off state of the communication interface in the direction of data packet transmission and reception. The second determining module is used to determine, if so, a first target proportion of the first communication interfaces dedicated to data packet transmission among the various first communication interfaces located on the CPU, based on the first communication quality parameter; The adjustment module is used to adjust the interface working mode of each of the first communication interfaces according to the first target ratio.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the interface resource adjustment method as described in any one of claims 1 to 7.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the interface resource adjustment method as described in any one of claims 1 to 7.