A network card, data transmission system, method, computer equipment and storage medium
By introducing a shunt module into the network card, monitoring the cache occupancy and forwarding data when the threshold is reached, the problem of data discarding caused by the network card cache being full is solved, achieving data integrity and efficient use of network resources.
Patent Information
- Application Number
- CN202211138632.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-09-19
AI Technical Summary
When the existing network card has insufficient CPU resources, the data cache is full and discarded, which in turn leads to a waste of network resources.
Design a network card that includes a shunt module to monitor the cache occupancy. When the threshold is reached, the data flow is intercepted and forwarded to other devices through the shunt network port. When the cache is idle, the return data is obtained to avoid data loss and reduce retransmissions.
It effectively avoids data loss, reduces the waste of network resources, and improves the efficiency and integrity of data transmission.
Smart Images

Figure CN115550080B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a network card, a data transmission system, a method, a computer device and a storage medium. Background Art
[0002] A network card is a network component that works at the data link layer. It is an interface that connects computers and transmission media in the network. It not only realizes the physical connection and electrical signal matching between the local area network transmission media, but also involves the sending and receiving of frames, frame encapsulation and unpacking, media access control, data encoding and decoding, and data caching functions.
[0003] Currently, the data received by the network card is mainly processed by CPU resources. When the network card is not allocated enough CPU resources, the data that is not processed in time will be temporarily placed in the network card's cache, waiting for the CPU to provide enough resources to process the data in the network card cache. When more data is sent to the network card, causing the network card cache to be full, the network card will discard the newly sent data and then use the retransmission mechanism of the network protocol to retransmit it, resulting in a waste of network resources. Summary of the invention
[0004] Based on this, a network card, a data transmission system, a method and a storage medium are provided to improve the problem of network resource waste caused by data discard in the prior art.
[0005] In one aspect, a network card is provided, comprising:
[0006] The network card body includes a network port module, a data processing module and a cache module, wherein the data processing module is connected to the cache module by signal, the network port module includes a transmission network port and at least one shunt network port, and the shunt network port is used to shunt and return shunt data;
[0007] The diversion module is used to monitor the data flow between the transmission network port and the data processing module, and obtain the cache occupancy of the cache module, wherein when the cache occupancy is greater than or equal to a first cache threshold, the diversion module intercepts the data flow to obtain diversion data and forwards the diversion data through the diversion network port; or, when the cache occupancy is less than or equal to a second cache threshold, the diversion module obtains the returned diversion data through the diversion network port.
[0008] In one embodiment, the network card further includes a storage module for receiving diverted data forwarded from an adjacent network card, the storage module being signal-connected to the data processing module, wherein the adjacent network card is signal-connected to the network card body via the diverted network port.
[0009] In another aspect, a data transmission system is provided, comprising:
[0010] A first device includes a first network card, wherein the first network card includes a network port module, a data processing module and a cache module, wherein the data processing module is connected to the cache module by signal, and the network port module includes a transmission network port and at least one shunt network port; the first network card also includes a shunt module for monitoring a data flow between the transmission network port and the data processing module, and obtaining a cache occupancy of the cache module;
[0011] A second device is connected to the first device through the split network port;
[0012] Among them, when the cache occupancy is greater than or equal to the first cache threshold, the diversion module intercepts the data flow to obtain diversion data and forwards the diversion data to the second device through the diversion network port; or, when the cache occupancy is less than or equal to the second cache threshold, the diversion module obtains the diversion data stored in the second device through the diversion network port.
[0013] On the other hand, a data transmission method is provided, comprising:
[0014] Monitor the data flow of the first network card and obtain the cache occupancy of the first network card;
[0015] When the cache occupancy is greater than or equal to a first cache threshold, intercepting the data flow to obtain diverted data;
[0016] Forwarding the diverted data to a second device so that the second device can store and obtain the data to be recovered;
[0017] When the cache occupancy decreases to less than or equal to the second cache threshold, the to-be-reclaimed data returned by the second device is obtained.
[0018] In one embodiment, before forwarding the split data to the second device, the method further includes:
[0019] A diversion notification is sent, so that the second device can respond to the diversion notification and prepare to take over the resources.
[0020] In one embodiment, before obtaining the to-be-recovered data returned by the second device, the method further includes:
[0021] A return notification is sent, so that the second device responds to the return notification and returns the data to be recovered.
[0022] In one embodiment, when the cache occupancy is lower than the first cache threshold, the data stream is transparently transmitted to achieve data transmission of the first network card.
[0023] In one embodiment, obtaining the cache occupancy of the first network card includes:
[0024] Monitor the cache status of the first network card at the first monitoring frequency to determine whether the cache is occupied:
[0025] If so, the cache state of the first network card is monitored at a second monitoring frequency to obtain the cache occupancy, wherein the second monitoring frequency is greater than the first monitoring frequency.
[0026] A computer device is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the method are implemented when the processor executes the computer program.
[0027] A computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described are implemented.
[0028] The above-mentioned network card, data transmission system, method, computer equipment and storage medium monitor the data flow entering the network card through the diversion module to obtain the cache occupancy. When the cache occupancy is greater than or equal to the set first cache threshold, the diversion mechanism is started to intercept the data flow and forward it to the specific device connected to the diversion network port through the diversion network port. When the cache is reduced to the set second cache threshold, the returned diversion data is obtained, thereby avoiding data loss and eliminating the need for the sender to retransmit data, thereby reducing the waste of network resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 An application environment diagram in one embodiment;
[0030] Figure 2 A schematic diagram of the structure of a network card in an embodiment;
[0031] Figure 3 is a structural block diagram of a data transmission system in one embodiment;
[0032] Figure 4 A schematic diagram of a flow chart of a data transmission method in another embodiment;
[0033] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment.
[0034] Reference numerals: first device 100 , first network card 110 , second device 200 , second network card 210 , data processing module 111 , cache module 112 , transmission network port 113 , diversion network port 114 , diversion module 115 , storage module 116 . DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0036] The network card is the interface of the network device for data transmission. Taking the server as an example, the network card serves as a data channel, carrying the reception and transmission of data. Each correct reception of data will directly affect the server's collection and processing of data. When the network card is not allocated enough CPU resources, the data that is not processed in time will be temporarily placed in the network card's cache, waiting for the CPU to provide sufficient resources to process the data in the network card cache. However, if the data in the network card cache cannot be processed all the time, and more data is sent to the network card end at this time, causing the network card cache to be full, the network card will discard the newly sent data. In the prior art, after the data is discarded, the data will be retransmitted to ensure the integrity of the data by relying on the retransmission mechanism of the TCP / IP protocol. However, such processing also causes the same data to be sent more than twice, resulting in a waste of network resources.
[0037] The network card provided by the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the device 104 through the network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The device 104 may be implemented as an independent device or a device cluster consisting of multiple devices. For example, the device 104 is a server. The network card of the server is connected to the switch port to realize data transmission, and the network card realizes data transmission with the internal system of the server through the PCIE bus.
[0038] like Figure 2 As shown, the present application provides a network card, including:
[0039] The network card body includes a network port module, a data processing module 111 and a cache module 112 , wherein the data processing module 111 is signal-connected to the cache module 112 , and the network port module includes a transmission network port 113 and at least one diversion network port 114 .
[0040] It is understandable that the network card body is connected to the switch port through the transmission network port 113 to realize the uplink and downlink of data, and the data flow entering the network card from the switch is processed accordingly in the data processing module 111, which will not be described in detail here. When large-volume data transmission is performed, due to the limitation of processing capacity, part of the data flow begins to occupy the data cache.
[0041] The network card further includes a traffic distribution module 115 , which is used to monitor the data flow between the transmission network port 113 and the data processing module 111 , and obtain the cache occupancy of the cache module 112 .
[0042] By way of example, the diversion module 115 may be a diversion layer disposed inside the network card chip, which is connected between the transmission network port 113 and the data processing module 111. When the cache is not occupied, the data flow is transparently transmitted via the diversion module 115. When it is found that the network card cache module 112 is occupied by a certain value, the diversion mechanism can be started.
[0043] For example, when the cache occupancy is greater than or equal to the first cache threshold, the diversion module 115 intercepts the data flow to obtain the diversion data and forwards the diversion data through the diversion network port 114. The diversion network port 114 is used to connect to the second device for diversion, and the diversion data is temporarily stored through the second device. When the cache occupancy is reduced, the diversion data stored in the second device can be re-acquired to ensure the integrity of the data. For example, when the cache occupancy is less than or equal to the second cache threshold, the diversion module 115 obtains the returned diversion data through the diversion network port 114.
[0044] The first cache threshold and the second cache threshold can be set according to the actual operation of the network card. The following defines 50% cache occupancy as the first cache threshold and 0% cache occupancy as the second cache threshold for illustration.
[0045] A network card provided in the present application is provided with a diversion module 115, which can monitor the received data flow. When high data flow cannot be processed in time, the data flow is first forwarded to a designated second device, such as a server connected to the diversion network port 114, and the data is then returned when idle. This can effectively solve the problem of data loss on the server side, thereby avoiding data retransmission and reducing the waste of network resources.
[0046] In one embodiment, the network card further includes a storage module 116, the storage module 116 is signal-connected to the data processing module 111, and the storage module 116 is used to receive the diverted data forwarded from the adjacent network card.
[0047] It can be understood that the adjacent network card is connected to the network card body signal through the split network port 114 .
[0048] By way of example, the storage module 116 may be a memory connected to the outside of the network card, or may be a part of a device to which the network card is connected, such as an internal memory of a server to which the network card is connected. When the local network card receives diverted data transmitted by another server network card through the diversion network port 114, the local server may store the diverted data in its own specific storage area.
[0049] The network card of the above embodiment can be applied to multiple servers at the same time. When receiving data, each server can use the adjacent server connected to it through the diversion network port 114 as a diversion device, and can also be used as a diversion device for the adjacent server.
[0050] like Figure 3 As shown, in one embodiment, a data transmission system is provided, comprising
[0051] The first device 100, such as a local server, is used to receive a data stream from a switch. The local server includes a first network card 110. The first network card 110 includes a network port module, a data processing module 111 and a cache module 112. The data processing module 111 is connected to the cache module 112 by a signal. When a large amount of flow data occurs and cannot be processed in time, the cache module 112 is used to cache the data. The network port module includes a transmission network port 113 and at least one shunt network port 114. The switch is connected via the transmission network port 113. The data stream from the switch port enters the data processing module 111 via the transmission network port 113. The first network card 110 also includes a shunt module 115. The shunt module 115 is used to monitor the data flow between the transmission network port 113 and the data processing module 111, and obtain the cache occupancy of the cache module 112.
[0052] The data transmission system further includes at least one second device 200 , such as another server adjacent to the local server, and the adjacent server is connected to the first device 100 via the diversion network port 114 .
[0053] When the cache occupancy of the local server is greater than or equal to the first cache threshold, for example 50%, the diversion module 115 intercepts the data flow entering the first network card 110 of the local server to obtain diverted data, and forwards the diverted data to the adjacent server for storage through the diversion network port 114 without discarding it.
[0054] When the cache occupancy is less than or equal to the second cache threshold, for example, when the cache in the cache module 112 is cleared, the diversion module 115 obtains the diversion data stored in the adjacent server through the diversion network port 114 without the need for retransmission by the sender.
[0055] By adopting the data transmission system disclosed in the above embodiment, data traffic can be diverted and controlled inside the first network card 110. With the help of the diversion module 115 of the first network card 110, such as the diversion layer set in the chip of the first network card 110, data is diverted through the diversion network port 114. When the cache of the network card reaches a preset first cache threshold, the data flow is diverted in time to avoid packet loss.
[0056] In one embodiment, the neighboring server uses a second network card 210 with the same structure as the first network card 110 in the local server. The diversion network ports 114 of the first network card 110 and the second network card 210 are interconnected. The internal memories of the local server and the neighboring server are used as storage modules 116 of the corresponding network cards, so that both the local server and the neighboring server can be used as diversion devices.
[0057] As an example, when the local server receives high-traffic data, due to limited processing capacity, data traffic begins to occupy the cache of the first network card 110. When the cache occupancy of the cache module 112 of the first network card 110 reaches 50%, the diversion module 115 starts the diversion mechanism, intercepts the newly incoming data flow, and forwards it to the diversion network port 114 of the first network card 110, which is connected to the diversion interface of the second network card 210 of the neighboring server that receives the diverted data through a network cable. The neighboring server stores the diverted data in a specific area. When the cache of the first network card 110 of the local server is cleared, the diverted data transmitted back from the neighboring server is obtained to ensure the integrity of the data.
[0058] On the other hand, the local server can be used as a diversion device for the neighboring server. For example, when the neighboring server receives high-traffic data, the cache occupancy of the cache module 112 of its second network card 210 reaches 50%, and the diverted data can be forwarded to the local server for storage through the connected diversion network port 114. After its cache is cleared, the diverted data is obtained from the local server.
[0059] The above-mentioned data transmission system avoids data loss by adding a diversion module 115 in the network card. When the cache occupancy of the network card exceeds a certain limit value, the diversion module 115 starts the diversion mechanism and promptly forwards the data stream to the second device 200 connected to the diversion network port 114. When the cache is idle, the diversion data is obtained from the adjacent second device 200, thereby avoiding the loss of data packets. There is no need for the sender of the data to retransmit the data, thereby reducing the waste of network resources.
[0060] In one embodiment, in a data transmission system, when the diversion module 115 of the first network card 110 of the local server finds that the cache occupancy is greater than or equal to the first cache threshold 50%, it first sends a diversion notification to the neighboring server, and the neighboring server responds to the diversion notification and prepares to take over the resources; when the cache of the local server is cleared, the diversion module 115 of the first network card 110 sends a return notification to the neighboring server that takes over the diverted data. At this time, after receiving the return notification, the neighboring server returns the previously stored diversion data to the local server.
[0061] In one embodiment, the diversion module 115 initially monitors the cache status of the first network card 110 at a first monitoring frequency to determine whether the cache is occupied. When the cache is occupied, the cache status of the first network card 110 is monitored at a second monitoring frequency to obtain the cache occupancy, wherein the second monitoring frequency is greater than the first monitoring frequency to improve the diversion response speed.
[0062] The above-mentioned data transmission system and each module in the network card can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0063] like Figure 4 As shown, in one embodiment, a data transmission method is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0064] Step 401 : the traffic distribution module 115 in the first network card 110 of the local server monitors the data flow of the first network card 110 and obtains the buffer occupancy of the first network card 110 .
[0065] Exemplarily, the diversion module 115 is connected between the network port module and the data processing module 111 of the first network card 110. When the cache module 112 is not occupied or the cache occupancy is small, the diversion module 115 realizes data flow transmission between the network port module and the data processing module 111 in a transparent transmission manner.
[0066] In step 402, the diversion module 115 performs a threshold judgment on the cache occupancy. When the cache occupancy is greater than or equal to the first cache threshold, such as 50%, the diversion module 115 intercepts the data flow to obtain diverted data, and forwards the diverted data to the second device 200 for the second device 200 to store the data to be recycled.
[0067] It can be understood that the second device 200 has a storage module 116, which can receive and store forwarded diverted data, wherein the second device 200 can be a neighboring server adjacent to the local server and connected via a network cable, and the first network card 110 of the local server is provided with a diversion network port 114, and the diversion network port 114 is signal-connected to the diversion module 115, and the neighboring server achieves data connectivity with the local server through the diversion network port 114.
[0068] Step 403, when the cache occupancy of the first network card 110 of the local server is reduced to less than or equal to the second cache threshold, for example, when the cache of the first network card 110 is cleared, the diversion module 115 in the first network card 110 of the local server obtains the data to be recycled returned by the second device 200, and the diversion module 115 then passes it normally to the server upper layer protocol stack for processing.
[0069] In the above data transmission method, data is diverted through the diversion network port 114 with the help of the diversion module 115 of the network card. When the cache of the network card reaches the limit value, the data flow is diverted in time. After the cache is reduced, the diverted data is obtained from the second device 200 connected to it, avoiding data problems. There is no need for the data sender, such as the terminal, to retransmit the data, reducing the waste of network resources.
[0070] In another embodiment, the neighboring server uses the second network card 210 with the same structure as the local server for data transmission, and the diversion network ports 114 of the first network card 110 and the second network card 210 are interconnected to realize normal data flow. After the second network port obtains the diversion data of the first network card 110, the diversion module 115 of the second network port transparently transmits the diversion data transmitted so that the neighboring server can store it. When the neighboring server receives high-flow data, the diversion module 115 of the second network port of the neighboring server intercepts and diverts the data flow entering the second network card 210, and forwards the diversion data to the local server. The diversion module 115 of the first network card 110 of the local server transparently transmits the diversion data so that the local server can store the diversion data from the neighboring server.
[0071] In one embodiment, before forwarding the diverted data to the second device 200, the local server also includes the step of sending a diversion notification so that the second device 200 can respond to the diversion notification and prepare to take over resources, such as preparing a specific storage space.
[0072] On the other hand, before obtaining the data to be recovered sent back by the second device 200, the local server also includes the step of sending a return notification, so that the second device 200 responds to the return notification and sends back the data to be recovered.
[0073] In one embodiment, the diversion module 115 monitors the data flow in a variable frequency manner. When a data flow enters the first network card 110 on the local server, the diversion layer monitors the cache status of the first network card 110 at a smaller first monitoring frequency. When the data flow begins to occupy the network card cache, the diversion module 115 increases the monitoring frequency and monitors at a second monitoring frequency that is greater than the first monitoring frequency. This is beneficial to improving the response speed. When the cache occupancy reaches a threshold, the data flow is diverted in time.
[0074] The data transmission method provided by the present application avoids data loss by adding a diversion module 115, such as a diversion layer, inside the network card. The working principle is as follows: when a data stream enters the first network card 110 on the local server, the diversion layer monitors the data stream. When the data stream begins to occupy the cache of the first network card 110, the diversion layer increases the monitoring frequency. When it is found that the network card cache is occupied to a first cache threshold, such as 50%, the diversion mechanism is activated. A diversion notification is first sent to another server that receives the diverted data to prepare it to receive the diverted data. Then, the local server intercepts the newly incoming data stream and forwards it to the diversion interface. The diversion interface of the end server is connected to the diversion interface of the network card of another server that receives the diverted data through a network cable, and the data is stored in a specific area of the other server, waiting for the recovery instruction of the local server. When the cache of the local server is reduced to the second cache threshold, for example, it is cleared, the diversion layer of the first network card 110 of the local server will send a traffic return notification to the other server again. At this time, after receiving the traffic return notification, the other server will return the previously stored data to be returned to the diversion interface of the local server through the diversion interface of its own network card. The local diversion interface then sends the data to the diversion layer, which then passes it normally to the upper protocol stack for processing.
[0075] On the other hand, the local server and the neighboring server can use the same network card to receive and distribute data to each other or transmit data back to each other.
[0076] The data transmission method provided in the present application avoids data loss by timely diverting the data stream before the cache of the network card is almost full, eliminating the need for the data sender to retransmit the data, thereby reducing the waste of network resources.
[0077] It should be understood that although Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 4At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0078] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data transmission method is implemented.
[0079] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0080] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0081] Step A, monitoring the data flow of the first network card 110, and obtaining the cache occupancy of the first network card 110;
[0082] Step B, performing a threshold judgment on the cache occupancy, when the cache occupancy is greater than or equal to a first cache threshold, intercepting the data flow to obtain the diverted data, and forwarding the diverted data to the second device 200, so that the second device 200 can store the data to be recycled;
[0083] Step C: when the cache occupancy is reduced to less than or equal to the second cache threshold, the to-be-reclaimed data returned by the second device 200 is obtained.
[0084] The above-mentioned computer device makes a threshold judgment on the cache occupancy of the network card, and when the cache occupancy reaches a first cache threshold, intercepts and diverts the data flow entering the network card, thereby avoiding data being discarded due to cache fullness; after the cache occupancy of the first network card 110 drops to a second cache threshold, the integrity of the data is ensured by obtaining the data to be recycled returned by the second device 200.
[0085] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0086] When the processor finds that the cache occupancy of the first network card 110 is greater than or equal to the second cache threshold, a diversion notification is sent to the second device 200, so that the second device 200 can respond to the diversion notification and prepare to take over the resources, and then intercept the new incoming data stream and forward it to the diversion interface. The diversion interface is connected to the second device 200 via a network cable to enable the second device 200 to store the diverted data.
[0087] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0088] When the processor finds that the cache occupancy is reduced to less than or equal to the second cache threshold, a return notification is sent to the second device 200 so that the second device 200 can respond to the return notification. After receiving the return notification, the second device 200 returns the data to be recycled.
[0089] In one embodiment, the processor executes a computer program to transparently transmit the data flow entering the first network card 110 through the transmission network port 113 without performing any operation on the data flow when the cache occupancy of the first network card 110 is lower than the first cache threshold.
[0090] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0091] The shunt data forwarded from the adjacent network card is received through the shunt interface and stored in its own storage module 116 .
[0092] The above-mentioned computer device can use another device as a diversion device and forward its own diversion data to it when it receives high-flow data, or it can accept the diversion data from the diversion device when the diversion device receives high-flow data.
[0093] In one embodiment, when the processor executes a computer program, it monitors the cache status of the first network card 110 at a first monitoring frequency to determine whether the cache is occupied. If so, it monitors the cache status of the first network card 110 at a second monitoring frequency to obtain the cache occupancy, wherein the second monitoring frequency is greater than the first monitoring frequency to increase the diversion response speed.
[0094] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0095] Step A, determining the occupancy of the cache of the first network card 110, including monitoring the data flow of the first network card 110 and obtaining the cache occupancy of the first network card 110;
[0096] Step B, performing a threshold judgment on the cache occupancy, when the cache occupancy is greater than or equal to a first cache threshold, intercepting the data flow to obtain diverted data; forwarding the diverted data to the second device 200, so that the second device 200 stores the data to be recycled;
[0097] Step C: when the cache occupancy is reduced to less than or equal to the second cache threshold, the to-be-reclaimed data returned by the second device 200 is obtained.
[0098] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0099] Before forwarding the diverted data to the second device 200, a diversion notification is first sent to the second device 200, so that the second device 200 can respond to the diversion notification and prepare to take over resources, such as preparing a specific area to store the diverted data.
[0100] On the other hand, before obtaining the data to be recovered sent back by the second device 200, a return notification is first sent to the second device 200, so that the second device 200 responds to the return notification and sends back the data to be recovered.
[0101] It can be understood that when the buffer occupancy is lower than the first buffer threshold, the data flow is transparently transmitted.
[0102] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0103] Monitor the cache state of the first network card 110 at a first monitoring frequency to determine whether the cache is occupied:
[0104] If so, the cache state of the first network card 110 is monitored at a second monitoring frequency to obtain the cache occupancy, wherein the second monitoring frequency is greater than the first monitoring frequency.
[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0106] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A network card, characterized in that: include: The network card body includes a network port module, a data processing module and a cache module, wherein the data processing module is connected to the cache module by signal, the network port module includes a transmission network port and at least one shunt network port, and the shunt network port is used to shunt and return shunt data; A shunt module, used to monitor the data flow between the transmission network port and the data processing module, and obtain the cache occupancy of the cache module, wherein when the cache occupancy is greater than or equal to a first cache threshold, the shunt module intercepts the data flow to obtain shunt data and forwards the shunt data through the shunt network port; or, when the cache occupancy is less than or equal to a second cache threshold, the shunt module obtains the returned shunt data through the shunt network port; The network card also includes a storage module for receiving diverted data forwarded from an adjacent network card with the same structure, and the storage module is signal-connected to the data processing module, wherein the adjacent network card is signal-connected to the network card body through the diverted network port.
2. A data transmission system, characterized in that: include: A first device includes a first network card, wherein the first network card includes a network port module, a data processing module and a cache module, wherein the data processing module is signal-connected to the cache module, and the network port module includes a transmission network port and at least one shunt network port; the first network card also includes a shunt module for monitoring a data flow between the transmission network port and the data processing module, and obtaining a cache occupancy of the cache module; the first network card also includes a storage module for receiving shunt data forwarded from an adjacent network card, and the storage module is signal-connected to the data processing module; The second device comprises a second network card having the same structure as the first network card, and is connected to the shunt network port signal of the first device through the shunt network port of the second network card; Among them, when the cache occupancy is greater than or equal to the first cache threshold, the diversion module intercepts the data flow to obtain diversion data and forwards the diversion data to the second device through the diversion network port; or, when the cache occupancy is less than or equal to the second cache threshold, the diversion module obtains the diversion data stored in the second device through the diversion network port.
3. A data transmission method, characterized in that: include: Monitor the data flow of the first network card and obtain the cache occupancy of the first network card, wherein the first network card includes a network port module, a data processing module and a cache module, the data processing module is connected to the cache module by signal, and the network port module includes a transmission network port and at least one shunt network port; the first network card also includes a shunt module for monitoring the data flow between the transmission network port and the data processing module, and obtaining the cache occupancy of the cache module; the first network card also includes a storage module for receiving the shunt data forwarded from the adjacent network card, and the storage module is connected to the data processing module by signal; When the cache occupancy is greater than or equal to a first cache threshold, intercepting the data flow to obtain diverted data; Forwarding the diverted data to a second device so that the second device can store and obtain the data to be recovered, wherein the second device includes a second network card with the same structure as the first network card, and the diverted network port of the second network card is connected to the diverted network port of the first network card through a signal; When the cache occupancy decreases to less than or equal to the second cache threshold, the to-be-reclaimed data returned by the second device is obtained.
4. A data transmission method according to claim 3, characterized in that: Before forwarding the split data to the second device, the method further includes: A diversion notification is sent, so that the second device can respond to the diversion notification and prepare to take over the resources.
5. A data transmission method according to claim 3, characterized in that: Before obtaining the to-be-recovered data returned by the second device, the method further includes: A return notification is sent, so that the second device responds to the return notification and returns the data to be recovered.
6. A data transmission method according to claim 3, characterized in that: When the buffer occupancy is lower than the first buffer threshold, the data stream is transparently transmitted to achieve data transmission of the first network card.
7. A data transmission method according to claim 3, characterized in that: The obtaining of the cache occupancy of the first network card includes: Monitor the cache status of the first network card at the first monitoring frequency to determine whether the cache is occupied: If so, the cache state of the first network card is monitored at a second monitoring frequency to obtain the cache occupancy, wherein the second monitoring frequency is greater than the first monitoring frequency.
8. 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 computer program, the steps of the method according to any one of claims 3 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 3 to 7 are implemented.
