Data caching method and apparatus, and storage medium

By detecting port utilization in the routing forwarding device and caching low-priority data packets to the caching device, the problem of low-priority data being dropped due to limited router cache capacity is solved, and stable data forwarding is achieved.

CN116545963BActive Publication Date: 2026-08-04CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2023-05-29
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

When the network is congested, the limited buffer capacity of the router causes low-priority service data to be dropped because it cannot be forwarded in time. Existing QoS mechanisms cannot effectively solve the problem of caching low-priority data.

Method used

The routing and forwarding device detects the port utilization rate to determine the target port that is higher than the threshold, and sends low-priority data packets to the caching device for caching. The caching device's capacity is utilized until the port utilization rate drops to the second threshold before returning the data packets.

Benefits of technology

Effective caching of low-priority data avoids data loss due to limited cache capacity, improving the reliability of data forwarding and network stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116545963B_ABST
    Figure CN116545963B_ABST
Patent Text Reader

Abstract

The application provides a data caching method and device and a storage medium, relates to the technical field of communication, and can perform data caching. The method comprises the following steps: determining whether a target port with a link utilization rate exceeding a first preset threshold exists in a routing forwarding device; if the target port exists, determining a difference value between the first preset threshold and the link utilization rate of the target port, obtaining a difference quantity of target data packets from the target port, and the target data packet is a data packet with the lowest priority in the target port; and sending the target data packet to a caching device. The application is used in a data caching process.
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 in particular to a data caching method, apparatus and storage medium. Background Technology

[0002] Currently, Quality of Service (QoS) mechanisms prioritize data in the network. When link congestion occurs, routers prioritize forwarding high-priority service data, while low-priority service data is temporarily stored in the router's cache. However, due to the limited cache capacity of routers, low-priority service data is often dropped if it is not forwarded for an extended period. Therefore, how to cache low-priority service data to reduce packet loss rate when link congestion occurs has become an urgent technical problem to be solved. Summary of the Invention

[0003] This application provides a data caching method, apparatus, and storage medium capable of caching data.

[0004] To achieve the above objectives, this application adopts the following technical solution:

[0005] In a first aspect, this application provides a data caching method applied to a routing and forwarding device, wherein the routing and forwarding device is connected to a caching device, and the caching device is used to cache data packets. The method includes: determining whether there is a target port in the routing and forwarding device whose link utilization exceeds a first preset threshold; if there is a target port, determining the difference between the first preset threshold and the link utilization of the target port; obtaining a target data packet of the difference number from the target port, wherein the target data packet is the lowest priority data packet in the target port; and sending the target data packet to the caching device.

[0006] In conjunction with the first aspect described above, in one possible implementation, after sending the target data packet to the caching device, the method further includes: receiving first indication information sent by the caching device; the first indication information is used to indicate that the caching device has received and cached the target data packet; detecting whether the link utilization of the target port is less than or equal to a second preset threshold; if the link utilization of the target port is less than or equal to the second preset threshold, sending second indication information to the caching device; the second indication information is used to request the return of the target data packet; receiving the target data packet sent by the caching device; and forwarding the target data packet according to the forwarding table.

[0007] In conjunction with the first aspect mentioned above, in one possible implementation, the first preset threshold is a first preset threshold determined based on the historical traffic data and historical congestion records of the target port.

[0008] In conjunction with the first aspect mentioned above, in one possible implementation, the second preset threshold is less than or equal to the first preset threshold minus the difference.

[0009] Secondly, this application provides a data caching method applied to a caching device. The caching device is used to cache data packets and is connected to a routing and forwarding device. The method includes: receiving and caching target data packets sent by the routing and forwarding device to a target port; wherein the target port is a port in the routing and forwarding device whose link utilization exceeds a first preset threshold; the target data packets are a preset number of data packets with the lowest priority in the target port; and the preset number is the difference between the first preset threshold and the link utilization of the target port.

[0010] In conjunction with the second aspect above, in one possible implementation, after receiving and caching the target data packet sent by the routing forwarding device, the method further includes: sending a first indication message to the routing forwarding device; the first indication message being used to indicate that the caching device has received and cached the target data packet; receiving a second indication message sent by the routing forwarding device; the second indication message being used to request the return of the target data packet; and in response to the second indication message, sending the target data packet to the routing forwarding device.

[0011] In conjunction with the second aspect above, in one possible implementation, after receiving and buffering the target data packet sent by the routing forwarding device, the method further includes: determining the destination node of the target data packet; sending third indication information to the destination node; the third indication information is used to instruct the destination node to stop sending retransmission information to the source node of the target data packet.

[0012] Thirdly, this application provides a data caching device applied to a routing and forwarding device. The routing and forwarding device is connected to the caching device, which is used to cache data packets. The device includes: a processing unit and a communication unit; the processing unit is used to determine whether there is a target port in the routing and forwarding device whose link utilization exceeds a first preset threshold; the processing unit is also used to determine the difference between the first preset threshold and the link utilization of the target port if a target port exists; the processing unit is also used to obtain the target data packets of the difference number from the target port, wherein the target data packets are the lowest priority data packets in the target port; and the communication unit is used to send the target data packets to the caching device.

[0013] In conjunction with the third aspect above, in one possible implementation, the processing unit is further configured to: instruct the communication unit to receive first indication information sent by the caching device; the first indication information is used to characterize that the caching device has received and cached the target data packet; detect whether the link utilization of the target port is less than or equal to a second preset threshold; if the link utilization of the target port is less than or equal to the second preset threshold, instruct the communication unit to send second indication information to the caching device; the second indication information is used to request the return of the target data packet; instruct the communication unit to receive the target data packet sent by the caching device; and forward the target data packet according to the forwarding table.

[0014] Fourthly, this application provides a data caching device applied to a caching device. The caching device is used to cache data packets and is connected to a routing and forwarding device. The device includes: a processing unit and a communication unit; the communication unit is used to receive target data packets sent by the routing and forwarding device to a target port; the processing unit is used to cache the target data packets; wherein, the target port is a port in the routing and forwarding device whose link utilization exceeds a first preset threshold; the target data packets are a preset number of the lowest priority data packets in the target port; the preset number is the difference between the first preset threshold and the link utilization of the target port.

[0015] In conjunction with the fourth aspect above, in one possible implementation, the processing unit is further configured to: instruct the communication unit to send a first indication information to the routing and forwarding device; the first indication information is used to indicate that the caching device has received and cached the target data packet; instruct the communication unit to receive a second indication information sent by the routing and forwarding device; the second indication information is used to request the return of the target data packet; and in response to the second indication information, instruct the communication unit to send the target data packet to the routing and forwarding device.

[0016] In conjunction with the fourth aspect above, in one possible implementation, the processing unit is further configured to: determine the destination node of the target data packet; instruct the communication unit to send third instruction information to the destination node; the third instruction information is used to instruct the destination node to stop sending retransmission information to the source node of the target data packet.

[0017] Fifthly, this application provides a data caching device, which includes a processor and a memory; wherein the memory is used to store computer execution instructions, and when the data caching device is running, the processor executes the computer execution instructions stored in the memory to cause the data caching device to perform the data caching method as described in the first aspect and any possible implementation thereof.

[0018] In a sixth aspect, this application provides a data caching device, which includes a processor and a memory; wherein the memory is used to store computer execution instructions, and when the data caching device is running, the processor executes the computer execution instructions stored in the memory to cause the data caching device to perform the data caching method as described in the second aspect and any possible implementation of the second aspect.

[0019] In a seventh aspect, this application provides a computer-readable storage medium storing instructions that, when executed by a processor of a data caching device, enable the data caching device to perform the data caching method described in the first aspect and any possible implementation thereof.

[0020] Eighthly, this application provides a computer-readable storage medium storing instructions that, when executed by a processor of a data caching device, enable the data caching device to perform the data caching method described in either the second aspect or any possible implementation thereof.

[0021] Ninthly, this application provides a computer program product containing instructions that, when run on a data caching device, cause the data caching device to perform the data caching method as described in the first aspect and any possible implementation thereof.

[0022] In a tenth aspect, this application provides a computer program product containing instructions that, when run on a data caching device, cause the data caching device to perform the data caching method as described in the second aspect and any possible implementation thereof.

[0023] In one aspect, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the data caching method as described in the first aspect and any possible implementation thereof.

[0024] In a twelfth aspect, this application provides a chip including a processor and a communication interface coupled to the processor. The processor is used to run computer programs or instructions to implement the data caching method described in the second aspect and any possible implementation thereof.

[0025] Specifically, the chip provided in this application embodiment also includes a memory for storing computer programs or instructions.

[0026] In this application, the name of the aforementioned data caching device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear under other names. As long as the function of each device or functional module is similar to that of this application, it falls within the scope of the claims of this application and its equivalents.

[0027] These or other aspects of this application will become more readily apparent in the following description.

[0028] The technical solution provided in this application offers at least the following advantages: The routing and forwarding device determines whether there is a target port in the device whose link utilization exceeds a first preset threshold. If such a target port exists, the routing and forwarding device determines the difference between the first preset threshold and the current link utilization of the target port. Based on this determined difference, the routing and forwarding device selects the data packet with the lowest priority among the target ports as the target data packet. The routing and forwarding device then sends this target data packet to a caching device for caching. In this way, by setting a preset threshold for port link utilization and sending a number of low-priority data packets exceeding the preset threshold to the caching device when the port link utilization exceeds the preset threshold, low-priority service data packets can be stored in the caching device when congestion occurs. This solves the technical problem of low-priority service data being discarded due to limited caching capacity of the routing caching device. Attached Figure Description

[0029] Figure 1 A schematic diagram of a data caching system provided in an embodiment of this application;

[0030] Figure 2 A schematic diagram of the hardware structure of a data caching device provided in an embodiment of this application;

[0031] Figure 3 A flowchart illustrating a data caching method provided in this application embodiment;

[0032] Figure 4 This is another flowchart illustrating a data caching method provided in an embodiment of this application;

[0033] Figure 5 This is another flowchart illustrating a data caching method provided in an embodiment of this application;

[0034] Figure 6 A schematic diagram of a data caching device applied to a routing and forwarding device provided in an embodiment of this application;

[0035] Figure 7 This is a schematic diagram of a data caching device applied to a caching device, provided as an embodiment of this application. Detailed Implementation

[0036] The data caching method, apparatus, and storage medium provided in this application embodiment are described in detail below with reference to the accompanying drawings.

[0037] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0038] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.

[0039] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0040] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0041] In related technologies, Internet Protocol (IP) metropolitan area networks (MANs) that interconnect networks carry a variety of services, including video, voice, data, Next Generation Network (NGN), Internet Protocol Television (IPTV), and Third Generation (3G) mobile communications. However, the open architecture of traditional IP networks cannot meet the needs of current networks with multiple services. For example, voice and video services have high requirements for network latency and jitter, while data services have high network traffic demands. Traditional IP MANs typically use high bandwidth to meet the needs of multiple services, but this also leads to a decrease in network bandwidth utilization. Therefore, traditional IP MANs cannot meet the current network development demands for high traffic and multiple services.

[0042] Currently, in wired bearer networks, a Quality of Service (QoS) network mechanism is provided to meet the demands of network development for high traffic and multiple services. In the QoS network mechanism, different types of services are classified according to their priority. For example, a specific proportion bit, such as 101, is added to the service data packet to represent the priority of that service data packet.

[0043] However, while the QoS network mechanism classifies service data packets, it cannot solve the problem of network congestion. For example, if the maximum transmission rate of data packets at the destination port is 10Gbps, and two 8Gbps data packets are simultaneously input to the destination port, the destination data port will experience link congestion because it cannot meet the 16Gbps transmission requirement. In this case, the network forwarding device, based on the QoS network forwarding mechanism, prioritizes the forwarding of high-priority service data packets, while high-priority service data packets are temporarily stored in the network forwarding device. However, the buffer capacity of the network forwarding device is limited, which means that when the network forwarding device reaches its capacity limit, low-priority service data packets will be dropped by the network forwarding device. Therefore, how to buffer low-priority service data to reduce packet loss rate when link congestion occurs has become an urgent technical problem to be solved.

[0044] To address the aforementioned technical problems, this application provides a data caching method. In this method, a routing forwarding device determines whether there is a target port in the routing forwarding device whose link utilization exceeds a first preset threshold. If a target port with link utilization exceeding the first preset threshold exists, the routing forwarding device determines the difference between the first preset threshold and the current link utilization of the target port. Based on the determined difference, the routing forwarding device selects the data packets with the lowest priority from the target port as the target data packets. The routing forwarding device then sends this target data packet to a caching device for caching. In this way, by setting a preset threshold for port link utilization and sending a number of low-priority data packets exceeding the preset threshold to the caching device when the port link utilization exceeds the preset threshold, low-priority service data packets can be stored in the caching device when congestion occurs. This solves the technical problem of low-priority service data being discarded due to limited caching capacity of the routing caching device.

[0045] The data caching method provided in this application embodiment can be applied to, for example, Figure 1 In the data caching system 10, as described above. Figure 1As shown, the data caching system 10 includes: routing forwarding device 101, routing forwarding device 102, routing forwarding device 103, routing forwarding device 104, and caching device 105. The data storage system can determine the specific routing forwarding device connected to the caching device based on historical traffic data and historical congestion records forwarded by the routing forwarding devices. It should be noted that the caching device can be connected to multiple routing forwarding devices.

[0046] The routing and forwarding device determines whether any ports in the forwarding network have a link utilization exceeding a first preset threshold. If a target port has a link utilization exceeding the first preset threshold, the routing and forwarding device determines the difference between the first preset threshold and the current link utilization of the target port. Based on this determined difference, the routing and forwarding device selects the data packet with the lowest priority among the target ports as the target data packet. The routing and forwarding device then sends this target data packet to a caching device for caching. After receiving and caching the target data packet sent by the routing and forwarding device, the caching device sends a first indication message indicating that the target data packet has been received and cached. Simultaneously, the caching device sends a third indication message to the destination node of the target data packet, instructing the destination node to stop sending a request to retransmit the target data packet to the source node. When the routing and forwarding device detects that the link utilization of the target port meets a second preset threshold, the routing and forwarding device sends a second indication message to the target port requesting the return of the target data packet. The caching device returns the target data packet to the routing and forwarding device based on the received second indication message. After receiving the target data packet sent by the caching device, the routing and forwarding device forwards the target data packet according to the forwarding table.

[0047] Figure 2 This is a schematic diagram of the structure of a data caching device provided in an embodiment of this application, which can be applied to, for example... Figure 1 In the data caching system shown, there are routing forwarding devices 101 to 104 or caching device 105. For example... Figure 2 As shown, the data caching device 200 includes at least one processor 201, a communication line 202, and at least one communication interface 204, and may also include a memory 203. The processor 201, memory 203, and communication interface 204 are connected via the communication line 202.

[0048] The processor 201 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0049] Communication line 202 may include a path for transmitting information between the aforementioned components.

[0050] The communication interface 204 is used to communicate with other devices or communication networks. It can use any transceiver-like device, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0051] The memory 203 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of including or storing desired program code having the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0052] In one possible design, the memory 203 can exist independently of the processor 201, meaning the memory 203 can be an external memory of the processor 201. In this case, the memory 203 can be connected to the processor 201 via the communication line 202 to store execution instructions or application code, and its execution is controlled by the processor 201 to implement the space measurement determination method provided in the following embodiments of this application. In another possible design, the memory 203 can also be integrated with the processor 201, meaning the memory 203 can be an internal memory of the processor 201. For example, the memory 203 can be a cache, which can be used to temporarily store some data and instruction information.

[0053] As one possible implementation, processor 201 may include one or more CPUs, for example Figure 2 CPU0 and CPU1 in the example. Alternatively, the data cache device 200 may include multiple processors, such as... Figure 2 The processors 201 and 207 are included. Alternatively, the data cache device 200 may also include an output device 205 and an input device 206.

[0054] Through the above description of the implementation methods, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the network node can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, modules, and network nodes described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0055] Figure 3 The data caching method provided in this application embodiment can be applied to, for example... Figure 1 In the data caching system shown, such as Figure 3 As shown, the data caching method provided in this application embodiment can be implemented through the following steps 301 to 304.

[0056] Step 301: The routing forwarding device determines whether there are target ports in the routing forwarding device whose link utilization exceeds the first preset threshold.

[0057] In one possible implementation, the routing and forwarding device inputs historical traffic data and historical congestion records from all its ports into a traffic prediction model to determine the traffic prediction result for each port. Based on the prediction results from the traffic prediction model, the routing and forwarding device sets a first preset threshold for each port. The routing and forwarding device then continuously monitors all its ports to detect whether there are any target ports whose link utilization exceeds the first preset threshold.

[0058] In one example, the prediction result for a port includes a first preset threshold for that port. Specifically, the routing and forwarding device inputs historical traffic data and historical congestion records for its n ports into a traffic prediction model. The traffic prediction model outputs predicted first preset thresholds for the n ports, T1…T2…Tn, where i is a positive integer.

[0059] It should be noted that the first preset threshold for the link utilization of all ports of the routing and forwarding device can also be set to a uniform first preset threshold as needed, and this application does not limit this.

[0060] Step 302: If a target port exists, the routing and forwarding device determines the difference between the first preset threshold and the link utilization of the target port.

[0061] In one possible implementation, if the routing and forwarding device detects a target port whose link utilization exceeds a first preset threshold, the routing and forwarding device determines the difference between the current link utilization of the target port and the first preset threshold based on the current link utilization of the target port and the first preset threshold of the target port.

[0062] In one example, if the first preset threshold for the link utilization of the target port is 70%, and the routing device detects that the current link utilization of the target port is 80%, then the routing device determines, based on the first preset threshold for the target port and the current link utilization, that the number of data packets exceeding the first preset threshold for the target port accounts for 10% of the total number of data packets on the target port.

[0063] Step 303: The routing and forwarding device obtains the target data packets with the difference in number from the target port.

[0064] Among them, the target data packet is the lowest priority data packet in the target port.

[0065] In one possible implementation, the routing and forwarding device sorts all data packets currently waiting to be forwarded at the target port according to their priority based on the difference between the link utilization of the target port and the target port, using a QoS mechanism. The routing and forwarding device then caches the data packet with the lowest priority (based on the difference in priority between the two target ports) as the target data packet.

[0066] In one example, QoS uses a bubble sort algorithm to sort data packets to be forwarded on the target port based on their priority. For instance, the outer loop iterates from 1 to n-1, while the inner loop starts from the position after the current element in the outer loop. It compares these elements with the outer loop elements, swapping packets if they are out of order. By comparing and swapping with adjacent elements, the lowest priority data packet is moved to the front of the queue. For example, if the first preset threshold for link utilization on the target port is 70%, and the current link utilization is 80%, the QoS mechanism uses bubble sort to sort 80% of the current target port's data packets. The routing and forwarding device then selects the top 10% of the data packets as the target data packets based on the sorting results.

[0067] It should be noted that the target data packet includes, but is not limited to, the following information: the data packet with the lowest priority in terms of difference in quantity, the identifier of the routing and forwarding device, the IP address of the routing and forwarding device, timestamps, etc.

[0068] Step 304: The routing and forwarding device sends the target data packet to the caching device. Correspondingly, the caching device receives the target data packet sent by the routing and forwarding device.

[0069] In one possible implementation, the routing forwarding device sends the target data packet obtained in step 303 to the caching device for caching. When the caching device receives the target data packet, it saves information based on the information in the target data packet, including but not limited to, the data packet with the lowest priority based on the difference in quantity, the identifier of the routing forwarding device, the IP address of the routing forwarding device, and the timestamp of receiving the target data packet.

[0070] Optionally, the routing and forwarding device is configured with a dedicated port and connected to the caching device via a leased line. The routing and forwarding device upgrades its switching module engine and Forward Information Database (FIB). When there are no ports on the routing and forwarding device experiencing link congestion, the switching module in the routing and forwarding device forwards service data based on the FIB table. When there are ports on the routing and forwarding device experiencing link congestion, the switching module in the routing and forwarding device forwards low-priority service data packets that meet the required difference in priority to the caching device via the leased line.

[0071] The above scheme provides at least the following benefits: The routing and forwarding device determines whether there are target ports in the routing and forwarding device whose link utilization exceeds a first preset threshold. If there are target ports whose link utilization exceeds the first preset threshold, the routing and forwarding device determines the difference between the first preset threshold and the current link utilization of the target port. Based on the determined difference, the routing and forwarding device selects the data packets with the lowest priority from the target port as the target data packets. The routing and forwarding device sends this target data packet to the caching device for caching. In this way, by setting a preset threshold for port link utilization and sending a number of low-priority data packets exceeding the preset threshold to the caching device when the port link utilization exceeds the preset threshold, the routing and forwarding device can store low-priority service data packets in the caching device when congestion occurs, solving the technical problem of low-priority service data being discarded due to limited caching capacity of the routing caching device.

[0072] Combination Figure 3 ,like Figure 4 As shown, after the caching device receives the target data packet sent by the routing and forwarding device in step 304, the steps 401-405 are also included.

[0073] Step 401: The caching device sends a first indication message to the routing and forwarding device. Correspondingly, the routing and forwarding device receives the first indication message sent by the caching device.

[0074] The first indication information is used to indicate that the caching device has received and cached the target data packet.

[0075] In one possible implementation, after receiving the target data packet, the caching device saves information such as the data packet with the lowest priority based on the difference in the number of packets, the identifier of the routing device, the IP address of the routing device, and the timestamp. After completing the caching of the target data packet, the caching device sends first indication information to the routing device. This first indication information includes, but is not limited to, the location information of the target data packet stored in the caching device.

[0076] Step 402: The routing and forwarding device detects whether the link utilization of the target port is less than or equal to the second preset threshold.

[0077] Optionally, the second preset threshold is less than or equal to the first preset threshold minus the aforementioned difference. The second preset threshold is set such that when the routing forwarding device receives the target data packet returned by the caching device, the link utilization of the target port is less than or equal to the first preset threshold of the target port.

[0078] In one possible implementation, after the routing and forwarding device sends the target data packet with the lowest priority based on the difference in the number of data packets at the target port to the caching device, the routing and forwarding device forwards the service data packets at the target port according to their priority. Simultaneously, the routing and forwarding device continuously monitors whether the link utilization of the target port is less than or equal to a first preset threshold minus the difference.

[0079] In one example, if the first preset threshold for the link utilization of the target port is 65%, and the difference between the link utilization when the target port is congested and the first preset threshold is 10%, then the second preset threshold should be less than or equal to 65% minus 10%, that is, the second preset threshold should be less than or equal to 55%.

[0080] Step 403: If the link utilization of the target port is less than or equal to the second preset threshold, the routing and forwarding device sends a second indication message to the caching device. Correspondingly, the caching device receives the second indication message sent by the routing and forwarding device.

[0081] The second instruction information is used to request the return of the target data packet;

[0082] In one possible implementation, if the routing and forwarding device detects that the link utilization of the target port is less than or equal to a second preset threshold, the routing and forwarding device sends a second indication message to the caching device, requesting the return of the target data packet. The second indication message includes, but is not limited to, the location information of the target data packet stored in the caching device, a timestamp, the identifier of the routing and forwarding device, the IP address of the routing and forwarding device, and other information.

[0083] Step 404: In response to the second indication information, the caching device sends a target data packet to the routing and forwarding device. Accordingly, the routing and forwarding device receives the target data packet sent by the caching device.

[0084] In one possible implementation, after receiving the second indication information from the routing forwarding device, the caching device, based on the location information of the target data packet stored in the caching device, the timestamp, the identifier of the routing forwarding device, the IP address of the routing forwarding device, and other information in the second indication information, sends the target data packet back to the routing forwarding device. Correspondingly, after receiving the target data packet from the routing forwarding device, the routing forwarding device transmits the lowest priority data packet (with the difference in number) from the target data packet to the corresponding target port.

[0085] Step 405: The routing and forwarding device forwards the target data packet according to the forwarding table.

[0086] In one possible implementation, after receiving the target data packet from the caching device, the routing and forwarding device sends the target data packet to the target port. The target port then forwards the target data packet according to the forwarding path in the FBI table.

[0087] The above scheme provides at least the following beneficial effects: After receiving and storing the target data packet, the caching device sends a first indication message to the routing and forwarding device. Upon receiving the first indication message, the routing and forwarding device continuously monitors whether the link utilization of the target port is less than or equal to a second preset threshold. When the routing and forwarding device detects that the link utilization of the target port is less than or equal to the second preset threshold, it sends a second indication message to the caching device. Upon receiving the second indication message, the caching device returns the target data packet to the routing and forwarding device. Upon receiving the target data packet, the routing and forwarding device transmits the target data packet to the target port and forwards it according to the forwarding table. Thus, when the routing and forwarding device detects that the link utilization of the target port meets the second preset threshold, it requests the return of the target data packet from the caching device and forwards the target data packet according to the forwarding table. This ensures that low-priority data packets can be stored and forwarded even when port congestion occurs.

[0088] Combination Figure 4 ,like Figure 5 As shown, after the caching device receives and caches the target data packet, it also includes the following steps 501-502.

[0089] Step 501: The cache device determines the destination node of the target data packet.

[0090] In one possible implementation, after the caching device receives and caches the target data packet, it obtains the destination node IP address of the lowest priority data packet with the lowest difference in the target data packet.

[0091] Step 502: The cache device sends a third instruction message to the destination node.

[0092] The third instruction message is used to instruct the destination node to stop sending retransmission information to the source node of the target data packet.

[0093] In one possible implementation, the caching device sends a third indication message to the destination node of the target device, instructing the destination node to stop sending retransmission request messages for the target data packet to the source node of the target data packet. Correspondingly, upon receiving the third indication message, the destination node determines that the target data packet is currently stored in the caching device, and then stops sending retransmission request messages for the target data packet to the source node of the target data packet.

[0094] The above scheme offers at least the following benefits: After receiving and caching the target data packet, the caching device obtains the IP address of the target node. Based on the obtained IP address, the caching device sends a third instruction to the target node, instructing it to stop sending retransmission requests to the source node. In this way, by sending the third instruction to the destination node, the caching device ensures information synchronization between the source and destination nodes, preventing the destination node from frequently sending retransmission requests to the source node.

[0095] The data caching device involved in the embodiments of this application, as well as the functions of each device in the data caching device and the interaction between the devices, have been described in detail above.

[0096] As can be seen, the above mainly describes the technical solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0097] This application embodiment can divide the data caching device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0098] This application provides a data caching device for executing the method required by any device in the aforementioned data caching system. This data caching device may be the data caching device described in this application, or a module within a data caching device; it may also be a chip within a data caching device, or other devices for executing data caching methods; this application does not limit the specific device used.

[0099] like Figure 6The diagram shown is a structural schematic of a data caching device applied to a routing and forwarding device according to an embodiment of this application. The data caching device includes a processing unit 601 and a communication unit 602.

[0100] Processing unit 601 is used to determine whether there is a target port in the routing and forwarding device whose link utilization exceeds a first preset threshold; processing unit 601 is also used to determine the difference between the first preset threshold and the link utilization of the target port if a target port exists; processing unit 601 is also used to obtain the target data packets of the difference number from the target port, wherein the target data packets are the lowest priority data packets in the target port; communication unit 602 is used to send the target data packets to the buffer device.

[0101] Optionally, the processing unit 601 is further configured to: instruct the communication unit 602 to receive first indication information sent by the caching device; the first indication information is used to indicate that the caching device has received and cached the target data packet; detect whether the link utilization of the target port is less than or equal to a second preset threshold; if the link utilization of the target port is less than or equal to the second preset threshold, instruct the communication unit 602 to send second indication information to the caching device; the second indication information is used to request the return of the target data packet; instruct the communication unit 602 to receive the target data packet sent by the caching device; and forward the target data packet according to the forwarding table.

[0102] like Figure 7 The diagram shown is a structural schematic of a data caching device applied to a caching device according to an embodiment of this application. The data caching device includes a processing unit 701 and a communication unit 702.

[0103] The communication unit 702 is used to receive target data packets sent by the routing and forwarding device to the target port; the processing unit 701 is used to buffer the target data packets; wherein, the target port is a port in the routing and forwarding device whose link utilization exceeds a first preset threshold; the target data packets are a preset number of data packets with the lowest priority in the target port; the preset number is the difference between the first preset threshold and the link utilization of the target port.

[0104] Optionally, the processing unit 701 is configured to: instruct the communication unit 702 to send a first indication information to the routing and forwarding device; the first indication information is used to indicate that the caching device has received and cached the target data packet; instruct the communication unit 702 to receive a second indication information sent by the routing and forwarding device; the second indication information is used to request the return of the target data packet; and in response to the second indication information, instruct the communication unit 702 to send the target data packet to the routing and forwarding device.

[0105] Optionally, the processing unit 701 is further configured to: determine the destination node of the target data packet; instruct the communication unit 702 to send third instruction information to the destination node; the third instruction information is used to instruct the destination node to stop sending retransmission information to the source node of the target data packet.

[0106] This application provides a data caching device for executing the method required by any device in the aforementioned data caching system. This data caching device may be the data caching device described in this application, or a module within a data caching device; it may also be a chip within a data caching device, or other devices for executing data caching methods; this application does not limit the specific device used.

[0107] This application also provides a computer-readable storage medium storing instructions. When a computer executes these instructions, the computer performs each step of the method flow shown in the above-described method embodiments.

[0108] Embodiments of this application provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the data caching method described in the above method embodiments.

[0109] Embodiments of this application provide a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run computer programs or instructions to implement the data caching method as described in the above method embodiments.

[0110] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0111] Since the apparatus, device, computer-readable storage medium, and computer program product in the embodiments of this application can be applied to the above methods, the technical effects that can be obtained can also be referred to the above method embodiments. The embodiments of this application will not be repeated here.

[0112] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data caching method, characterized by, The method, applied to a routing and forwarding device connected to a caching device via a leased line, wherein the caching device is used to cache data packets, includes: Determine whether there are target ports in the routing and forwarding device whose link utilization exceeds a first preset threshold; If the target port exists, then determine the difference between the first preset threshold and the link utilization of the target port; The target data packet that obtains the number of differences from the target port; the target data packet includes: the lowest priority data packet in the target port obtained after sorting all data packets currently waiting to be forwarded by the target port according to priority based on the Quality of Service (QoS) mechanism, the identifier of the routing and forwarding device, the IP address of the routing and forwarding device, and the timestamp; Send the target data packet to the cache device; The system receives a first indication message sent by the caching device; the first indication message indicates that the caching device has received and cached the target data packet; at the same time, the caching device sends a third indication message to the destination node of the target data packet, the third indication message instructing the destination node to stop sending a request message to retransmit the target data packet to the source node of the target data packet; Detect whether the link utilization of the target port is less than or equal to a second preset threshold; the second preset threshold is less than or equal to the first preset threshold minus the difference. If the link utilization of the target port is less than or equal to the second preset threshold, then a second indication information is sent to the caching device; the second indication information is used to request the return of the target data packet; the second indication information includes: the location information of the target data packet stored in the caching device, the timestamp, the identifier of the routing forwarding device, and the IP address of the routing forwarding device; Receive the target data packet sent by the cache device; The target data packet is forwarded according to the forwarding table.

2. The method of claim 1, wherein, The first preset threshold is determined based on the historical traffic data and historical congestion records of the target port.

3. A data caching method, characterized by, The method, applied to a caching device used to cache data packets, wherein the caching device is connected to a routing and forwarding device via a leased line, includes: Receive and cache the target data packets sent by the routing and forwarding device to the target port; Wherein, the target port is the port in the routing and forwarding device whose link utilization exceeds a first preset threshold; the target data packet includes: a preset number of the lowest priority data packets in the target port obtained by sorting all data packets currently waiting to be forwarded on the target port according to priority based on the Quality of Service (QoS) mechanism, the identifier of the routing and forwarding device, the IP address of the routing and forwarding device, and a timestamp; the preset number is the difference between the first preset threshold and the link utilization of the target port; Send a first indication message to the routing and forwarding device; the first indication message is used to indicate that the caching device has received and cached the target data packet; Determine the destination node of the target data packet; Send a third indication message to the destination node; the third indication message is used to instruct the destination node to stop sending retransmission information to the source node of the target data packet; The system receives a second indication message sent by the routing forwarding device. The second indication message requests the return of the target data packet. The second indication message includes: the location information of the target data packet stored in the cache device, a timestamp, the identifier of the routing forwarding device, and the IP address of the routing forwarding device. The second indication message is sent by the routing forwarding device to the cache device when the link utilization of the target port is less than or equal to a second preset threshold. The second preset threshold is less than or equal to the first preset threshold minus the difference. In response to the second indication information, the target data packet is sent to the routing and forwarding device.

4. A data buffer device for implementing the data buffer method of claim 1, characterized by, An apparatus for use in a routing and forwarding device, wherein the routing and forwarding device is connected to a caching device, the caching device being used to cache data packets, the apparatus comprising: a processing unit and a communication unit; The processing unit is used to determine whether there is a target port in the routing and forwarding device whose link utilization exceeds a first preset threshold; The processing unit is further configured to determine, if the target port exists, the difference between the first preset threshold and the link utilization of the target port; The processing unit is further configured to obtain a target data packet containing the number of differences from the target port, the target data packet including the lowest priority data packet in the target port; The communication unit is used to send the target data packet to the cache device.

5. A data buffer device for implementing the data buffer method of claim 3, characterized by An apparatus for use in a caching device for caching data packets, wherein the caching device is connected to a routing and forwarding device, the apparatus comprising: a processing unit and a communication unit; The communication unit is used to receive target data packets sent by the routing and forwarding device to the target port; the processing unit is used to buffer the target data packets. Wherein, the target port is the port in the routing and forwarding device whose link utilization exceeds a first preset threshold; the target data packet includes a preset number of the lowest priority data packets in the target port; the preset number is the number of differences between the first preset threshold and the link utilization of the target port.

6. A data cache apparatus, characterized by include: A processor and a communication interface; the communication interface is coupled to the processor, the processor being used to run computer programs or instructions to implement the data caching method as described in any one of claims 1-3.

7. A computer-readable storage medium having stored therein instructions, the computer-readable storage medium comprising: When the computer executes the instruction, the computer performs the data caching method as described in any one of claims 1-3.