Data forwarding method and device for adaptive switching of forwarding modes

文档序号:1956716 发布日期:2021-12-10 浏览:7次 中文

阅读说明:本技术 一种转发方式自适应切换的数据转发方法及装置 (Data forwarding method and device for adaptive switching of forwarding modes ) 是由 李龙威 谢鹏 曹丽剑 房亮 谈树峰 陈彬 于 2021-11-12 设计创作,主要内容包括:本发明提供一种转发方式自适应切换的数据转发方法及装置,涉及通信网络设备技术领域。所述方法包括:接收待转发数据,并根据待转发数据获取目标发送端口;根据目标发送端口的速率以及待转发数据的接收端口的速率,确定待转发数据的转发方式;其中,转发方式包括:直接转发、存储转发;根据确定后的转发方式,通过目标发送端口对待转发数据进行转发。本发明同时具备存储转发和直接转发的优势,能够根据待转发数据实现转发方式的动态识别切换,从而能够灵活地适应各种工作场景,弥补了存储转发和直接转发的不足;而且,在复杂的应用场景下,不需要使用多个不同的交换机来满足复杂场景下的多种指标需求,有效降低了设备成本。(The invention provides a data forwarding method and device for adaptive switching of forwarding modes, and relates to the technical field of communication network equipment. The method comprises the following steps: receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded; determining a forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded; the forwarding mode comprises the following steps: direct forwarding, store forwarding; and forwarding the data to be forwarded through the target sending port according to the determined forwarding mode. The invention has the advantages of both store-and-forward and direct-forward, and can realize dynamic identification switching of forwarding modes according to data to be forwarded, thereby flexibly adapting to various working scenes and making up the defects of store-and-forward and direct-forward; in addition, under a complex application scene, a plurality of different switches are not needed to meet the requirements of various indexes under the complex scene, and the equipment cost is effectively reduced.)

1. A data forwarding method for adaptive switching of forwarding modes is characterized by comprising the following steps:

receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded;

determining a forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded; wherein, the forwarding mode comprises: direct forwarding, store forwarding;

and forwarding the data to be forwarded through the target sending port according to the determined forwarding mode.

2. The data forwarding method of claim 1, wherein determining the forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded comprises:

and determining the forwarding mode of the data to be forwarded by comparing the speed of the target sending port with the speed of the receiving port of the data to be forwarded.

3. The data forwarding method of adaptive switching of forwarding modes according to claim 1, further comprising applying for a storage address and routing information from a routing management module after receiving the data to be forwarded, and determining the target sending port according to the routing information; the routing management module is used for managing storage addresses and routing information; the storage address is used for storing the data to be forwarded.

4. The data forwarding method of claim 3, wherein forwarding the data to be forwarded through the target transmission port comprises:

determining the forwarding time of the data to be forwarded according to the determined forwarding mode;

according to the forwarding time, the storage address and the port information of the target sending port are sent to a forwarding module;

according to the port information, the storage address is sent to the target sending port through the forwarding module, and the data to be forwarded is read through the target sending port and then forwarded;

under the condition that the determined forwarding mode is direct forwarding, determining the forwarding time of the data to be forwarded according to the time for starting storage of the data to be forwarded;

and under the condition that the determined forwarding mode is store-and-forward, determining the forwarding time of the data to be forwarded according to the stored data amount of the data to be forwarded.

5. The data forwarding method of adaptive switching of forwarding modes according to claim 4, wherein determining the forwarding time of the data to be forwarded according to the amount of stored data of the data to be forwarded comprises:

determining the forwarding time of the data to be forwarded according to the time when the stored data volume of the data to be forwarded reaches a preset threshold value; and the preset threshold is obtained according to the speed of the target sending port and the speed of the receiving port of the data to be forwarded.

6. The data forwarding method of adaptive switching of forwarding modes according to claim 4, wherein determining the forwarding time of the data to be forwarded according to the amount of stored data of the data to be forwarded comprises:

and determining the forwarding time of the data to be forwarded according to the time for completely storing the data to be forwarded.

7. A data forwarding apparatus for adaptively switching forwarding modes, comprising:

the data receiving module is used for receiving the data to be forwarded and acquiring a target sending port according to the data to be forwarded;

a forwarding mode determining module, configured to determine a forwarding mode of the data to be forwarded according to a rate of the target sending port and a rate of the receiving port of the data to be forwarded; wherein, the forwarding mode comprises: direct forwarding, store forwarding;

and the data sending module is used for forwarding the data to be forwarded through the target sending port according to the forwarding mode determined by the forwarding mode determining module.

8. An electronic device comprising a memory, a processor and a computer program stored on said memory and executable on said processor, characterized in that said processor implements the steps of the data forwarding method for adaptive switching of forwarding manners as claimed in any one of claims 1 to 6 when executing said program.

9. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, performs the steps of the data forwarding method for forwarding mode adaptive switching according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, wherein the computer program when executed by a processor implements the steps of the data forwarding method for adaptive switching of forwarding manners according to any one of claims 1 to 6.

Technical Field

The present invention relates to the field of communications network technologies, and in particular, to a data forwarding method and apparatus for adaptively switching forwarding modes.

Background

With the rapid development of cloud computing and virtualization technologies and the convergence of data center services, higher requirements are put forward on the performance, function, reliability and the like of the switch. The switch has two realization modes of store-and-forward and direct-and-forward at present, the store-and-forward switch receives a frame of data completely, then carries out CRC check to check whether the data is correct, if the data is correct, then forwards the data, if the data is incorrect, the data frame is discarded, the delay of data forwarding is larger, and the store-and-forward mode cannot be applied to a scene with strict forwarding time; the direct forwarding switch receives the data frame and then directly forwards the data frame to the destination port without buffering and checking, so that the forwarding delay is obviously reduced.

In order to adapt to complex application scenarios, the existing network is usually a hybrid network and needs to have the capability of store-and-forward and direct-forward at the same time, however, in the prior art, the self-adaptive switching between the store-and-forward and direct-forward modes cannot be realized through one switch, so that the existing network cannot flexibly adapt to various different working scenarios; in addition, in a complex application scenario, multiple different switches are needed in the prior art to meet different data forwarding requirements, and the equipment cost is high. Therefore, a data forwarding method and apparatus for adaptively switching forwarding modes are needed.

Disclosure of Invention

The invention provides a data forwarding method and device for forwarding mode self-adaptive switching, which are used for solving the defect that the data forwarding mode self-adaptive switching cannot be carried out in the prior art and realizing automatic identification switching of store forwarding and direct forwarding.

The invention provides a data forwarding method for self-adaptive switching of forwarding modes, which comprises the following steps:

receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded;

determining a forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded; wherein, the forwarding mode comprises: direct forwarding, store forwarding;

and forwarding the data to be forwarded through the target sending port according to the determined forwarding mode.

According to the data forwarding method with the self-adaptive switching of the forwarding modes, the step of determining the forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded comprises the following steps:

and determining the forwarding mode of the data to be forwarded by comparing the speed of the target sending port with the speed of the receiving port of the data to be forwarded.

According to the data forwarding method of the self-adaptive switching of the forwarding mode, after the data to be forwarded is received, the data forwarding method further comprises the steps of applying for a storage address and routing information to a routing management module, and determining the target sending port according to the routing information; the routing management module is used for managing storage addresses and routing information; the storage address is used for storing the data to be forwarded.

According to the data forwarding method of the self-adaptive switching of the forwarding mode provided by the invention, the forwarding of the data to be forwarded through the target sending port comprises the following steps:

determining the forwarding time of the data to be forwarded according to the determined forwarding mode;

according to the forwarding time, the storage address and the port information of the target sending port are sent to a forwarding module;

according to the port information, the storage address is sent to the target sending port through the forwarding module, and the data to be forwarded is read through the target sending port and then forwarded;

under the condition that the determined forwarding mode is direct forwarding, determining the forwarding time of the data to be forwarded according to the time for starting storage of the data to be forwarded;

and under the condition that the determined forwarding mode is store-and-forward, determining the forwarding time of the data to be forwarded according to the stored data amount of the data to be forwarded.

According to the data forwarding method with the self-adaptive switching of the forwarding modes, the step of determining the forwarding time of the data to be forwarded according to the stored data volume of the data to be forwarded comprises the following steps:

determining the forwarding time of the data to be forwarded according to the time when the stored data volume of the data to be forwarded reaches a preset threshold value; and the preset threshold is obtained according to the speed of the target sending port and the speed of the receiving port of the data to be forwarded.

According to the data forwarding method with the self-adaptive switching of the forwarding modes, the step of determining the forwarding time of the data to be forwarded according to the stored data volume of the data to be forwarded comprises the following steps:

and determining the forwarding time of the data to be forwarded according to the time for completely storing the data to be forwarded.

The invention also provides a data forwarding device for adaptively switching forwarding modes, which comprises:

the data receiving module is used for receiving the data to be forwarded and acquiring a target sending port according to the data to be forwarded;

a forwarding mode determining module, configured to determine a forwarding mode of the data to be forwarded according to a rate of the target sending port and a rate of the receiving port of the data to be forwarded; wherein, the forwarding mode comprises: direct forwarding, store forwarding;

and the data sending module is used for forwarding the data to be forwarded through the target sending port according to the forwarding mode determined by the forwarding mode determining module.

The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the data forwarding method for adaptively switching the forwarding modes.

The present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the data forwarding method of the forwarding mode adaptive switching as described in any of the above.

The present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the data forwarding method for adaptive switching of forwarding modes as described in any of the above.

According to the data forwarding method and device with the self-adaptive switching of the forwarding modes, the target sending port is obtained according to the data to be forwarded, the forwarding mode of the data to be forwarded is determined according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded, and the data to be forwarded is forwarded through the target sending port according to the determined forwarding mode, so that the data forwarding method and device have the advantages of storing forwarding and direct forwarding at the same time, the dynamic identification switching of the forwarding modes can be realized according to the data to be forwarded, various working scenes can be flexibly adapted, and the defects of storing forwarding and direct forwarding are overcome; in addition, under a complex application scene, a plurality of different switches are not needed to meet the requirements of various indexes under the complex scene, and the equipment cost is effectively reduced.

Drawings

In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.

Fig. 1 is one of the flow diagrams of a data forwarding method for adaptive switching of forwarding modes according to the present invention;

FIG. 2 is a schematic diagram of the architecture of a FC switch provided by the present invention;

fig. 3 is a second schematic flow chart of the data forwarding method with adaptive switching of forwarding modes according to the present invention;

fig. 4 is a schematic structural diagram of a data forwarding apparatus with adaptive switching of forwarding modes according to the present invention;

fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The following describes a data forwarding method for adaptive switching of forwarding modes according to the present invention with reference to fig. 1 to fig. 3, where as shown in fig. 1, the method includes:

s100, receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded;

in this step, the method for obtaining the target sending port according to the data to be forwarded includes:

when data to be forwarded is input, extracting target ID information in a frame header of the data to be forwarded, applying for a storage address and routing information to a routing management module according to the target ID information, and determining a target sending port according to the routing information; after applying for the storage address, storing the data to be forwarded into a storage module according to the storage address; the route management module is used for managing the storage address and the route information.

S200, determining a forwarding mode of the data to be forwarded according to the rate of a target sending port and the rate of a receiving port of the data to be forwarded; the forwarding mode comprises the following steps: direct forwarding, store forwarding;

in this step, determining a forwarding manner of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded includes:

and determining the forwarding mode of the data to be forwarded by comparing the speed of the target sending port with the speed of the receiving port of the data to be forwarded. The method for determining the forwarding mode may be set according to actual requirements, for example, when the rate of the receiving port is greater than or equal to the rate of the target sending port, a direct forwarding mode is adopted, and when the rate of the receiving port is less than the rate of the target sending port, a store-and-forward mode is adopted. Therefore, under the condition that ports with different rates exist in the network, data forwarding between ports with the same rate or between ports with high rate and low rate is directly forwarded, and the delay performance of forwarding is ensured; for the forwarding from a low-speed port to a high-speed port, the continuity of forwarding data at an output port is ensured by adopting a storage forwarding mode; moreover, through the self-adaptive switching of the forwarding mode, different switches are not needed to meet the requirements of various indexes in a complex scene, and the application cost of the equipment is reduced.

Taking the port rate support of 1/2/4 Gbps as an example, the method for determining the forwarding mode of the present invention is described, and the determination results of the forwarding mode at different port rates are shown in table 1.

TABLE 1

As can be seen from table 1, in the existing hybrid network composed of coaxial (maximum rate 1 Gbps) and optical fiber (maximum rate 4Gbps), it can be ensured that transmission between optical fiber ports is directly forwarded, thereby ensuring transmission efficiency of FC (fiber Channel, optical fiber interface) messages; meanwhile, the transmission from the coaxial interface to the optical fiber interface is stored and forwarded, so that the accuracy of data transmission between the coaxial interface and the optical fiber interface is ensured.

And S300, forwarding the data to be forwarded through the target sending port according to the determined forwarding mode.

In this step, the method for forwarding the data to be forwarded through the target sending port includes:

s301, determining the forwarding time of the data to be forwarded according to the determined forwarding mode;

s302, according to the forwarding time, the storage address and the port information of the target sending port are sent to a forwarding module;

s303, according to the port information, the storage address is sent to a target sending port through a forwarding module, and the data to be forwarded is read through the target sending port and then the forwarding of the data to be forwarded is completed;

under the condition that the determined forwarding mode is direct forwarding, the forwarding time is the time for starting to store the data to be forwarded; the method comprises the steps that when received data to be forwarded are written into a storage module, the applied storage address and port information of a target sending port are sent to a forwarding module, the storage address information is transmitted to the target sending port through the forwarding module, the target sending port reads the data to be forwarded from the storage module according to the storage address, and the forwarding of the data to be forwarded is completed. By the mode, the data to be forwarded is ensured to be written into the storage module, namely, the data can be read and forwarded by the target sending port, and the requirement of direct forwarding is met.

And under the condition that the determined forwarding mode is store-and-forward, the forwarding time is determined according to the stored data volume of the data to be forwarded. The implementation method for determining the forwarding time of the data to be forwarded according to the received data amount of the data to be forwarded may be set according to actual needs, for example: determining the forwarding time of the data to be forwarded according to the time when the stored data volume of the data to be forwarded reaches a preset threshold value; the preset threshold is obtained according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded. Another example is: and determining the forwarding time of the data to be forwarded according to the time for completely storing the data to be forwarded.

In this embodiment, a product operation is performed on a ratio of the rate of the target transmission port to a sum of the rates of the reception port and the target transmission port and a maximum frame length of the data to be forwarded to obtain the preset threshold, as shown in formula (1):

T=L*Vo/(Vi+Vo) (1)

wherein, T is a preset threshold value, L is the maximum frame length of the data to be forwarded, and ViFor receiving the rate of the port, VoThe rate of the destination transmit port. That is, the time when the length of data written into the memory module reaches T, where T is an integer multiple of 4 bytes, is determined as the forwarding time. Taking the port rate support of 1/2/4 Gbps as an example, the method for determining the preset threshold value of the present invention is described, and the preset threshold values calculated by equation (1) for different port rates are shown in table 2.

TABLE 2

The calculation results of the preset threshold values in table 2 are all integer multiples of 4 bytes.

The forwarding time of the data to be forwarded is determined through the preset threshold, and the delay of data forwarding can be reduced to the greatest extent on the premise of meeting the data transmission continuity of the sending port.

And S304, after the data to be forwarded is forwarded, repeating the steps from S100 to S300, and forwarding the next frame data.

The following describes in detail a data forwarding method for adaptive switching of forwarding schemes according to the present invention, taking an FC switch as an example. The architecture of the FC switch is shown in fig. 2, and includes a receiving port, a sending port, a Data storage module (Data _ sw), a Route management module (Route _ management), and a forwarding module (H _ crossbar); wherein, the receiving port comprises an input module (FC 2P, physical layer of FC protocol) and an input management module (S _ IPPM), and the transmitting port comprises an output module (FC 2P) and an output management module (S _ OPPM).

In the working process of the FC switch, receiving data from a switch input interface through FC2P, converting the data into a data STREAM of an AXI-STREAM interface, and transmitting the data STREAM to S _ IPPM; s _ IPPM extracts destination ID information in a frame header, applies for a storage address (ADDR _ REQ) and routing information of a current FC frame in Data _ sw to Route _ management according to the destination ID information, determines a target sending port according to the routing information, and writes received Data into the Data _ sw according to the storage address; the S _ IPPM also sends Header information (Header _ msg) to the H _ crossbar, and sends the Header information to the S _ OPPM of the sending port according to the port information of the target sending port through the exchange function of the H _ crossbar, wherein the Header information comprises the applied storage address; the S _ OPPM reads Data in the Data _ sw according to the storage address, converts the read Data from the Data STREAM of the AXI-STREAM interface into the Data STREAM of the standard interface, and then sends the Data out from the FC2P of the sending port; after the S _ OPPM reading is completed, a signal (ADDR _ release) for releasing the memory address is sent to the Route _ management, so that the occupied memory space can be applied again.

Based on the FC switch in fig. 2, the implementation of the data forwarding method for adaptive switching of forwarding modes according to the present invention is shown in fig. 3, and includes:

s401, electrifying the switch, configuring the speed of all ports of the switch to corresponding ports, and configuring the speed tables of all ports to S _ IPPM of all ports;

s402, configuring the routing information into Route _ management;

s403, judging whether an FC frame is input into the current receiving port, if so, executing a step S404, otherwise, keeping the current receiving port in a waiting state, and repeating the step S403;

s404, receiving an FC frame through FC2P of a current receiving port, converting the FC frame into a data STREAM of an AXI-STREAM interface, and sending the data STREAM to an S _ IPPM; s _ IPPM extracts destination ID information in a frame header, applies for a storage address (ADDR _ REQ) and routing information of a current FC frame in Data _ sw to Route _ management according to the destination ID information, and determines a target sending port of the current FC frame according to the routing information;

s405, after the S _ IPPM obtains a target sending port, determining a forwarding mode according to the table 1 according to the rate values of the current receiving port and the target sending port, if the forwarding mode is direct forwarding, jumping to a step S406, and if the forwarding mode is store forwarding, jumping to a step S407;

s406, the current mode is a direct forwarding mode, FC frame Data is written into Data _ sw through S _ IPPM according to an applied storage address, in order to ensure that Data can be directly forwarded, the applied storage address and port information of a target sending port are sent to H _ crossbar, the H _ crossbar forwards the storage address to S _ OPPM of a corresponding port according to the port information of the target sending port, the S _ OPPM reads the FC frame cached in the Data _ sw according to the storage address, and the FC frame Data is sent out through FC2P of the target sending port; after the S _ OPPM is read, sending a signal (ADDR _ release) for releasing the storage address to Route _ management, so that the occupied storage space can be applied again, and repeating step S403 to forward the next FC frame; because the reading of the S _ OPPM in the target sending port and the writing of the S _ IPPM in the receiving port are carried out simultaneously, no time is wasted, and the requirement of direct forwarding is met;

s407, currently, in a store-and-forward mode, writing FC frame Data into a Data _ sw through an S _ IPPM according to an applied storage address, in order to reduce delay and ensure Data continuity of store-and-forward, when the Data volume written into the Data _ sw reaches a threshold value or Data writing is finished, sending the applied storage address and port information of a target sending port to an H _ crossbar, forwarding the storage address to an S _ OPPM of a corresponding port according to the port information of the target sending port by the H _ crossbar, reading an FC frame cached in a Data _ sw module according to the storage address by the S _ OPPM, and sending the FC frame Data out through an FC2P of the target sending port; after the S _ OPPM is read, sending a signal (ADDR _ release) for releasing the storage address to Route _ management, so that the occupied storage space can be applied again, and repeating step S403 to forward the next FC frame; for example, a port 0 (rate: 1 Gbps) performs store-and-forward to a port 1 (rate: 4Gbps), the length of the FC frame is 2112 bytes, and when the FC frame is written into 1692 (four fifths of 2112 and increased to an integral multiple of 4), the applied storage address and the port information of the target transmission port are sent to H _ crossbar, thereby effectively reducing the forward delay on the premise of ensuring the continuity of data forwarding.

The following describes the data forwarding apparatus with adaptive switching of forwarding manners provided by the present invention with reference to fig. 4, and the data forwarding apparatus with adaptive switching of forwarding manners described below and the data forwarding method with adaptive switching of forwarding manners described above may be referred to correspondingly.

As shown in fig. 4, the data forwarding apparatus for adaptively switching forwarding modes includes a data receiving module 401, a forwarding mode determining module 402, and a data sending module 403, which are connected in sequence; wherein the content of the first and second substances,

the data receiving module 401 is configured to receive data to be forwarded and obtain a target sending port according to the data to be forwarded;

a forwarding mode determining module 402, configured to determine a forwarding mode of the data to be forwarded according to a rate of the target sending port and a rate of the receiving port of the data to be forwarded; the forwarding mode comprises the following steps: direct forwarding, store forwarding; preferably, the forwarding mode determining module 402 determines the forwarding mode of the data to be forwarded by comparing the rate of the target sending port with the rate of the receiving port of the data to be forwarded;

a data sending module 403, configured to forward the data to be forwarded through the target sending port according to the forwarding manner determined by the forwarding manner determining module 402.

Optionally, the system further comprises a storage module and a routing management module; the storage module is used for storing data to be forwarded; the route management module is used for managing the storage address and the route information; after receiving the data to be forwarded, the data receiving module 401 applies for a storage address and routing information from the routing management module, determines a target sending port according to the routing information, and stores the received data to be forwarded in the storage module according to the storage address.

Optionally, the data sending module 403 includes a forwarding time determining module and a forwarding module, where the forwarding time determining module is configured to determine a forwarding time of the data to be forwarded according to a forwarding manner; the forwarding module is used for receiving the storage address and the port information of the target sending port and sending the storage address of the data to be forwarded to the target sending port according to the port information of the target sending port; the forwarding time determining module determines the forwarding time of the data to be forwarded according to the determined forwarding mode, and sends the storage address and the port information of the target sending port to the forwarding module through the data receiving module 401 according to the forwarding time, and the forwarding module sends the storage address to the target sending port according to the port information, and completes the forwarding of the data to be forwarded after reading the data to be forwarded stored in the storage module through the target sending port.

Under the condition that the determined forwarding mode is direct forwarding, the forwarding time determining module determines the forwarding time of the data to be forwarded according to the time for starting storage of the data to be forwarded; when the determined forwarding mode is store-and-forward, the forwarding time determining module determines the forwarding time of the data to be forwarded according to the stored data amount of the data to be forwarded, for example, determines the forwarding time of the data to be forwarded according to the time when the stored data amount of the data to be forwarded reaches a preset threshold; the preset threshold value is obtained according to the speed of a target sending port and the speed of a receiving port of data to be forwarded; for another example, the forwarding time of the data to be forwarded is determined according to the time when the data to be forwarded is completely stored.

Fig. 5 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 5: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. Processor 810 may invoke logic instructions in memory 830 to perform a data forwarding method for forwarding mode adaptive handoff, the method comprising: receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded;

determining a forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded; the forwarding mode comprises the following steps: direct forwarding, store forwarding;

and forwarding the data to be forwarded through the target sending port according to the determined forwarding mode.

In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

In another aspect, the present invention further provides a computer program product, where the computer program product includes a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, a computer is capable of executing the data forwarding method for forwarding mode adaptive switching provided by the above methods, where the method includes: receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded;

determining a forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded; the forwarding mode comprises the following steps: direct forwarding, store forwarding;

and forwarding the data to be forwarded through the target sending port according to the determined forwarding mode.

In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing a data forwarding method for adaptively switching a forwarding manner provided by the methods described above, the method comprising: receiving data to be forwarded, and acquiring a target sending port according to the data to be forwarded;

determining a forwarding mode of the data to be forwarded according to the rate of the target sending port and the rate of the receiving port of the data to be forwarded; the forwarding mode comprises the following steps: direct forwarding, store forwarding;

and forwarding the data to be forwarded through the target sending port according to the determined forwarding mode.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于二进制人工藻类机理的Massive MIMO信道估计方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!