Data stream forwarding method, device, electronic device and storage medium
By splitting the user plane network elements into small traffic and large traffic processing virtual network elements, and forwarding the data flow according to the scale level, the queue congestion problem of the user plane network element during traffic forwarding is solved, and the forwarding efficiency and time are improved. Ductility.
Patent Information
- Application Number
- CN202210361504.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-04-07
AI Technical Summary
In the existing technology, user plane network elements have problems such as elephant flows and mouse flows being congested in the forwarding queue and low forwarding efficiency when forwarding traffic, which cannot meet the low-latency forwarding requirements of large traffic flows of business data.
Use virtualization technology to split user plane network elements into small traffic processing virtual network elements and large traffic processing virtual network elements. By obtaining the total size value of the target data flow in the forwarding queue, it is judged whether it is less than the preset size value. If it is greater than or If equal, the flow detection algorithm is used to determine the scale level of each target data flow, and based on the level, the large traffic processing virtual network element or the small traffic processing virtual network element is used for forwarding.
It effectively avoids congestion of elephant flows and mouse flows in the forwarding queue, improves the forwarding efficiency of data flows, and meets the forwarding requirements of large traffic and low latency of business data.
Smart Images

Figure CN114710811B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, and in particular to a data stream forwarding method, device, electronic device and storage medium. Background Art
[0002] User plane network elements are used for routing and forwarding user service data, which is called traffic forwarding. With the development of fifth-generation mobile communication technology, the number and volume of service data are gradually increasing. Service data can be divided into small-volume and short-lifetime mouse flows (small flows) and large-volume and long-lifetime elephant flows (large flows) according to data size and life cycle. About 80% of service data in the network is mouse flows, and 10% is elephant flows.
[0003] In the prior art, when there are multiple concurrent traffic forwarding requirements, there are the following two methods. In the first method, the user-side network element forwards multiple flows in a time series. In the queue at the egress end, if there are too many elephant flows and the traffic forwarding queue is congested, the delay of the mouse flow queue behind the elephant flow will increase, and even cause the mouse flow of delay-sensitive services to lose packets. The second method is to identify the mouse flow and the elephant flow, so that the user-side network element gives priority to forwarding the mouse flow. If there are too many mouse flows and the traffic forwarding queue is congested, the elephant flow queue will be delayed, and the forwarding requirements of some business data with large traffic and low latency will not be met.
[0004] Therefore, in the prior art, when the user-plane network element forwards traffic, there are problems such as elephant flows and mouse flows being congested in the forwarding queue and low forwarding efficiency. Summary of the invention
[0005] The present application provides a data stream forwarding method, device, electronic device and storage medium, which are used to solve the problem of congestion of elephant flow and mouse flow in the forwarding queue and low forwarding efficiency during traffic forwarding.
[0006] According to a first aspect of the present application, a data stream forwarding method is provided, comprising:
[0007] Use virtualization technology to split user plane network elements into small traffic processing virtual network elements and large traffic processing virtual network elements;
[0008] Acquire a total size value of a target data flow in a forwarding queue, wherein the forwarding queue includes at least two target data flows;
[0009] Determining whether the total scale value is less than a first preset scale value;
[0010] If it is determined that the total scale value is greater than or equal to the first preset scale value, a flow detection algorithm is used to determine the scale level of each target data flow, and based on the scale level of each target data flow, each target data flow is determined to be forwarded using a large-flow processing virtual network element or a small-flow processing virtual network element.
[0011] According to a second aspect of the present application, a data stream forwarding device is provided, including:
[0012] A splitting module, used to split the user plane network element into a small traffic processing virtual network element and a large traffic processing virtual network element by using virtualization technology;
[0013] An acquisition module, used to acquire a total size value of a target data flow in a forwarding queue, wherein the forwarding queue includes at least one target data flow;
[0014] A judging module, used for judging whether the total scale value is less than a first preset scale value;
[0015] The determination module is used to use a flow detection algorithm to determine the scale level of each target data flow if it is determined that the total scale value is greater than or equal to the first preset scale value, and to determine whether each target data flow is forwarded using a large-flow processing virtual network element or a small-flow processing virtual network element according to the scale level of each target data flow.
[0016] According to a third aspect of the present application, there is provided an electronic device, comprising: a memory, a processor and a transceiver;
[0017] The memory, the processor and the transceiver circuit are interconnected;
[0018] The memory stores computer-executable instructions;
[0019] The transceiver is used for sending and receiving data;
[0020] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the first aspect.
[0021] According to a fourth aspect of the present application, a computer-readable storage medium storing computer-executable instructions is provided, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0022] The data stream forwarding method, device, electronic device and storage medium provided in the present application adopt virtualization technology to split the user-side network element into a small-traffic processing virtual network element and a large-traffic processing virtual network element; obtain the total scale value of the target data stream in the forwarding queue, and the forwarding queue includes at least two target data streams; determine whether the total scale value is less than a first preset scale value; if it is determined that the total scale value is greater than or equal to the first preset scale value, use a flow detection algorithm to determine the scale level of each target data stream, and determine whether each target data stream is forwarded using a large-traffic processing virtual network element or a small-traffic processing virtual network element according to the scale level of each target data stream. Since the total scale value of the target data flow in the forwarding queue is greater than or equal to the first preset scale value, if there are both elephant flows and mouse flows in the forwarding queue, the elephant flow and the mouse flow will be congested during forwarding, and the forwarding efficiency is low; if there is only mouse flow in the forwarding queue, then the elephant flow newly added to the forwarding queue will be congested with the mouse flow, resulting in a delay in the elephant flow queue newly added to the forwarding queue, low forwarding efficiency, and unable to meet the forwarding requirements of large traffic and low latency for some business data; if there is only elephant flow in the forwarding queue, then the mouse flow newly added to the forwarding queue will be congested with the elephant flow, resulting in possible packet loss of the mouse flow newly added to the forwarding queue, and low forwarding efficiency. Therefore, according to the scale level of each target data flow, it is determined whether each target data flow is forwarded by a large-traffic processing virtual network element or a small-traffic processing virtual network element. The large-traffic processing virtual network element and the small-traffic processing virtual network element can forward target data flows of different scale levels at the same time, which can avoid the increase in the queue delay of the elephant flow caused by the elephant flow being placed behind the mouse flow and the excessive mouse flow. At the same time, it can avoid the increase in the queue delay of the mouse flow caused by the mouse flow being placed behind the elephant flow and the elephant flow forwarding time being too long. Furthermore, it effectively avoids the problem of congestion of the elephant flow and the mouse flow in the forwarding queue, and improves the forwarding efficiency of the data flow. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] Figure 1 This is a network architecture diagram corresponding to an application scenario provided in an embodiment of the present application;
[0025] Figure 2 It is a schematic diagram of the flow of a data stream forwarding method provided according to the first embodiment of the present application;
[0026] Figure 3 It is a schematic diagram of the flow of a data stream forwarding method provided according to the second embodiment of the present application;
[0027] Figure 4 It is a schematic diagram of a data stream forwarding method according to the third embodiment of the present application;
[0028] Figure 5 It is a schematic diagram of a data stream forwarding method according to the fourth embodiment of the present application;
[0029] Figure 6 It is a schematic diagram of a data stream forwarding method according to the fifth embodiment of the present application;
[0030] Figure 7 It is a schematic diagram of a data stream forwarding method according to a sixth embodiment of the present application;
[0031] Figure 8 is a schematic diagram of the structure of a data stream forwarding device provided according to the ninth embodiment of the present application;
[0032] Fig. 9 This is a block diagram of an electronic device provided according to the tenth embodiment of the present application.
[0033] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0034] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as described in the appended claims.
[0035] First, the terms involved in this application are explained:
[0036] The user plane network element, namely the user plane function (UPF) network element, is an important part of the core network and is mainly responsible for the routing and forwarding (i.e. traffic forwarding) related functions of user plane data packets.
[0037] A data stream consists of multiple ordered data packets. During the transmission process, multiple data packets of a data stream may be divided into multiple transmissions.
[0038] PCI, peripheral component interconnection, that is, peripheral component expansion interface, PCI devices to devices plugged into the PCI interface.
[0039] In order to clearly understand the technical solution of the present application, the technical solution of the prior art is first introduced in detail.
[0040] With the development of fifth-generation mobile communication technology, the popularization of virtual reality technology, augmented reality technology and other technologies, the number and amount of user service data are gradually increasing. In order to ensure the user's network experience, the performance requirements for user-plane network elements are also getting higher and higher. User service data can be divided into mouse flows (small traffic) and elephant flows (large flows) according to the data volume and life cycle of the data flow. Mouse flows have a small amount of data and a short life cycle, while elephant flows have a large amount of data and a long life cycle.
[0041] In the prior art, when there is a need to forward multiple data streams concurrently, there are the following two methods.
[0042] In the first method, the user-side network element forwards data flows according to the trigger time of the forwarding requirements of multiple data flows, and gives priority to forwarding data flows with earlier trigger times. At this time, in the queue at the egress end, data flows with earlier trigger times are placed in front of the egress end queue. If there are too many elephant flows and they are placed in front of the mouse flows, the traffic forwarding queue will be congested, and the queue delay of the mouse flows behind the elephant flows will increase, which will not only reduce the forwarding efficiency, but may even cause packet loss of the mouse flows of delay-sensitive services.
[0043] The second method simultaneously identifies each data flow as a mouse flow or an elephant flow, so that the user-side network element gives priority to forwarding the mouse flow. At this time, if there are too many mouse flows, the traffic forwarding queue will also be congested, resulting in an increase in the queue delay of the elephant flow. It may not be able to meet the forwarding requirements of some business data with large traffic and low latency, and the forwarding efficiency is low.
[0044] At the same time, there are methods in the prior art to increase hardware configuration and improve network card performance through virtualization technology. When increasing the hardware configuration, an additional network processor card is configured to improve the forwarding bandwidth of the user-side network element from the hardware capability, which will increase the hardware cost of the user-side network element. Improving the forwarding performance of the network card through virtualization technology generally adopts single-root virtualization technology (i.e., single-root I / O virtualization) to directly mount the PCI device virtualized by the pass-through network card to the virtual machine to improve the data forwarding bandwidth. Increasing hardware configuration and improving network card performance through virtualization technology are both methods of improving forwarding efficiency by increasing forwarding bandwidth, and cannot solve the problem of congestion of elephant flows and mouse flows in the forwarding queue and low forwarding efficiency.
[0045] Therefore, in the prior art, when the user-plane network element forwards data flows, there are problems such as elephant flows and mouse flows being congested in the forwarding queue and low forwarding efficiency.
[0046] Therefore, in the face of the problems in the prior art, the inventors have found through creative research that the technical solution of the present application is proposed to solve the above problems in the prior art. In order to avoid the problem of congestion of elephant flows and mouse flows in the forwarding queue and low forwarding efficiency, it is necessary to use virtualization technology to split the user-side network element into a small traffic processing virtual network element and a large traffic processing virtual network element, and then determine whether it is necessary to forward the elephant flow and the mouse flow separately according to the total scale value of the data flow to be forwarded in the forwarding queue, so as to avoid the congestion of the elephant flow and the mouse flow in the forwarding queue, thereby improving the forwarding efficiency. Therefore, the inventors split the user-side network element into a small traffic processing virtual network element and a large traffic processing virtual network element by using virtualization technology; obtain the total scale value of the target data flow in the forwarding queue, and the forwarding queue includes at least two target data flows; determine whether the total scale value is less than the first preset scale value; if it is determined that the total scale value is greater than or equal to the first preset scale value, the flow detection algorithm is used to determine the scale level of each target data flow, and determine whether each target data flow is forwarded by a large traffic processing virtual network element or a small traffic processing virtual network element according to the scale level of each target data flow. Since the total scale value of the target data flow in the forwarding queue is greater than or equal to the first preset scale value, if there are both elephant flows and mouse flows in the forwarding queue, the elephant flow and the mouse flow will be congested during forwarding, and the forwarding efficiency is low; if there is only mouse flow in the forwarding queue, then the elephant flow newly added to the forwarding queue will be congested with the mouse flow, resulting in a delay in the elephant flow queue newly added to the forwarding queue, low forwarding efficiency, and unable to meet the forwarding requirements of large traffic and low latency for some business data; if there is only elephant flow in the forwarding queue, then the mouse flow newly added to the forwarding queue will be congested with the elephant flow, resulting in possible packet loss of the mouse flow newly added to the forwarding queue, and low forwarding efficiency. Therefore, according to the scale level of each target data flow, it is determined whether each target data flow is forwarded by a large-traffic processing virtual network element or a small-traffic processing virtual network element. The large-traffic processing virtual network element and the small-traffic processing virtual network element can forward target data flows of different scale levels at the same time, which can avoid the increase in the queue delay of the elephant flow caused by the elephant flow being placed behind the mouse flow and the excessive mouse flow. At the same time, it can avoid the increase in the queue delay of the mouse flow caused by the mouse flow being placed behind the elephant flow and the elephant flow forwarding time being too long. This effectively avoids the problem of congestion of the elephant flow and the mouse flow in the forwarding queue, and improves the forwarding efficiency of the data flow.
[0047] The data stream forwarding method, device, equipment and storage medium provided in this application are intended to solve the above technical problems in the prior art.
[0048] The following is an introduction to the network architecture of the data stream forwarding method provided in the embodiment of the present application.
[0049] Figure 1 is a network architecture diagram corresponding to an application scenario provided in an embodiment of the present application, such as Figure 1As shown, the network architecture corresponding to the data stream forwarding method provided in the embodiment of the present application includes: a terminal device 11, an electronic device 12, and a server 13.
[0050] The terminal device 11 triggers a data stream forwarding request and sends the target data stream to the electronic device 12 through the access network. The electronic device 12 stores the target data stream in a forwarding queue and forwards it, for example, forwarding it to the server 13 through the bearer network. Alternatively, the server 13 triggers a data stream forwarding request and sends the target data stream to the electronic device 12 through the bearer network. The electronic device 12 stores the target data stream in a forwarding queue and forwards it, for example, forwarding it to the terminal device 11 through the access network. The electronic device 12 may be a user plane network element device.
[0051] In one application scenario, virtualization technology is used to split the user-side network element into a small-traffic processing virtual network element and a large-traffic processing virtual network element. The user-side network element device receives the target data stream sent by the terminal device 11 and stores it in a forwarding queue. The electronic device 12 obtains the total scale value of the target data stream in the forwarding queue, and the forwarding queue includes at least two target data streams; determines whether the total scale value is less than the first preset scale value; if it is determined that the total scale value is greater than or equal to the first preset scale value, a flow detection algorithm is used to determine the scale level of each target data stream, and according to the scale level of each target data stream, it is determined that each target data stream is forwarded by a large-traffic processing virtual network element or a small-traffic processing virtual network element; each target data stream is forwarded by a large-traffic processing virtual network element or a small-traffic processing virtual network element to the server 13.
[0052] It should be noted that Figure 1 The network architecture shown can be applicable to different network standards, for example, it can be applicable to global system of mobile communication (GSM), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division synchronous code division multiple access (TD-SCDMA), long term evolution (LTE) system and 5G network standards. Optionally, the above communication system can be a system in the scenario of ultra-reliable and low latency communications (URLLC) transmission in a 5G communication system.
[0053] The above-mentioned terminal equipment can be a wireless terminal or a wired terminal. The wireless terminal can be a device that provides voice and / or other business data connectivity to users, a handheld device with wireless connection function, or other processing equipment connected to a wireless modem. The wireless terminal can communicate with one or more core network devices via a radio access network (Radio Access Network, referred to as RAN). The wireless terminal can be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal. For example, it can be a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device that exchanges language and / or data with the radio access network. For another example, the wireless terminal can also be a personal communication service (Personal Communication Service, referred to as PCS) phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, referred to as SIP) phone, a wireless local loop (Wireless Local Loop, referred to as WLL) station, a personal digital assistant (Personal Digital Assistant, referred to as PDA) and other devices. The wireless terminal may also be referred to as a system, a subscriber unit, a subscriber station, a mobile station, a mobile station, a remote station, a remote terminal, an access terminal, a user terminal, a user agent, a user device or user equipment, without limitation. Optionally, the terminal device may also be a smart watch, a tablet computer or other device.
[0054] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0055] Embodiment 1
[0056] Figure 2 is a flow chart of a data stream forwarding method provided according to the first embodiment of the present application, such as Figure 2 As shown, the execution subject of the present application is a data stream forwarding device, and the data stream forwarding device is located in an electronic device. The data stream forwarding method provided in this embodiment includes steps 201 to 204.
[0057] Step 201: Use virtualization technology to split the user plane network element into a small traffic processing virtual network element and a large traffic processing virtual network element.
[0058] In this embodiment, a single-root I / O virtualization technology can be used to split the user plane network element into a small traffic processing virtual network element and a large traffic processing virtual network element by means of a PCI device (peripheral component interconnect device) virtualized by a pass-through network card. In a form similar to that of a tenant, the bandwidth, virtual machine / container and other resources of the user plane network element are isolated and allocated to the small traffic processing virtual network element and the large traffic processing virtual network element. The proportion of the hardware resources of the user plane network element occupied by the small traffic processing virtual network element and the large traffic processing virtual network element can be preset. For example, it is preset that the small traffic processing virtual network element occupies 60% of the hardware resources of the user plane network element, and the large traffic processing virtual network element occupies 40% of the hardware resources of the user plane network element.
[0059] Step 202: Obtain a total size value of target data flows in a forwarding queue, where the forwarding queue includes at least two target data flows.
[0060] In this embodiment, since the forwarding queue is essentially a storage space, the total scale value of the target data flow in the forwarding queue can be obtained by directly obtaining the usage of the storage space. Alternatively, the total scale value of the target data flow in the forwarding queue can be obtained by sequentially determining the scale value of each target data flow and then summing the scale values of each target data flow.
[0061] Step 203: determine whether the total scale value is less than a first preset scale value.
[0062] Specifically, the total scale of the target data flow in the forwarding queue is compared with the first preset scale value to determine whether the total scale value is less than the first preset scale value. The first preset scale value needs to be less than the amount of data that the forwarding queue can accommodate, and can be a predetermined ratio of the amount of data that the forwarding queue can accommodate, such as 30%, 40%. The first preset scale value can be a scale value that the user plane network element or the small flow processing virtual network element of the user plane network element can forward within a preset time period.
[0063] Step 204, if it is determined that the total scale value is greater than or equal to the first preset scale value, a flow detection algorithm is used to determine the scale level of each target data flow, and based on the scale level of each target data flow, each target data flow is determined to be forwarded using a large traffic processing virtual network element or a small traffic processing virtual network element.
[0064] In this embodiment, the scale level of the target data stream includes at least a first scale level and a second scale level. The scale value (or data volume, flow) of each target data stream can be determined by a commonly used stream detection algorithm when receiving the data stream sent by the terminal device, and the scale level of each target data stream is determined according to the scale value of each target data stream. Exemplarily, the scale level of the target data stream whose scale value is less than the second preset scale value can be determined as the second scale level, and the scale level of the target data stream whose scale value is greater than the second preset scale value can be determined as the first scale level. In this embodiment, the scale level of each target data stream can also be determined by other methods, which are not limited in this embodiment.
[0065] In this embodiment, the target data flows of the same scale level can be determined to be forwarded by the same virtual network element. For example, the target data flow of the first scale level is determined to be forwarded by the large traffic processing virtual network element, and the target data flow of the second scale level is determined to be forwarded by the small traffic processing virtual network element. It can be understood that if the scale level of the target data flow includes a third scale level, the target data flow of the third scale level can be forwarded by the large traffic processing virtual network element or the small traffic processing virtual network element.
[0066] The data stream forwarding method provided in this embodiment adopts virtualization technology to split the user-side network element into a small-traffic processing virtual network element and a large-traffic processing virtual network element; obtain the total scale value of the target data stream in the forwarding queue, and the forwarding queue includes at least two target data streams; determine whether the total scale value is less than a first preset scale value; if it is determined that the total scale value is greater than or equal to the first preset scale value, use a flow detection algorithm to determine the scale level of each target data stream, and determine whether each target data stream is forwarded using a large-traffic processing virtual network element or a small-traffic processing virtual network element according to the scale level of each target data stream. Since the total scale value of the target data flow in the forwarding queue is greater than or equal to the first preset scale value, if there are both elephant flows and mouse flows in the forwarding queue, the elephant flow and the mouse flow will be congested during forwarding, and the forwarding efficiency is low; if there is only mouse flow in the forwarding queue, the elephant flow newly added to the forwarding queue will be congested with the mouse flow, resulting in a delay in the elephant flow queue newly added to the forwarding queue, low forwarding efficiency, and unable to meet the forwarding requirements of large traffic and low latency for some business data; if there is only elephant flow in the forwarding queue, the mouse flow newly added to the forwarding queue will be congested with the elephant flow, resulting in possible packet loss of the mouse flow newly added to the forwarding queue, and low forwarding efficiency. Therefore, according to the scale level of each target data flow, it is determined whether each target data flow is forwarded by a large-traffic processing virtual network element or a small-traffic processing virtual network element. The large-traffic processing virtual network element and the small-traffic processing virtual network element can forward target data flows of different scale levels at the same time. Therefore, it is possible to avoid the increase in the queue delay of the elephant flow caused by too many rat flows and the increase in the queue delay of the rat flow caused by too many elephant flows. Furthermore, it effectively avoids the problem of congestion of elephant flows and rat flows in the forwarding queue, thereby improving the forwarding efficiency of the data flow.
[0067] Embodiment 2
[0068] Figure 3 is a flow chart of a data stream forwarding method provided according to the second embodiment of the present application, such as Figure 3 As shown, the data stream forwarding method provided in this embodiment is based on the first embodiment, and refines the flow detection algorithm used in step 204 to determine the scale level of each target data stream, and includes steps 301 to 302.
[0069] Step 301, obtaining the corresponding IP address of each target data flow, where the corresponding IP address includes the source IP address and the destination IP address of the target data flow.
[0070] In this embodiment, since the target data stream is composed of at least one data packet, the source IP address of the target data stream is the source IP address of at least one data packet in the target data stream, and the destination IP address of the target data stream is the destination IP address of at least one data packet in the target data stream. It is understandable that when the target data stream includes multiple data packets, the source IP addresses of the multiple data packets are the same and the destination IP addresses are the same. The source IP address and the destination IP address can be obtained from the header of the data packet.
[0071] Step 302: Determine the scale level of each target data flow according to the corresponding IP address.
[0072] In this embodiment, the scale level of the target data stream may include at least a first scale level and a second scale level. Specifically, the byte length of each target data stream can be obtained, and then the target data streams with the same corresponding IP address are determined as the first target data stream group. The byte lengths of each target data stream in the first target data stream group are summed to determine the first scale value. The first scale value is input into a preset scale level determination algorithm, and the preset scale level determination algorithm is used to output the scale level corresponding to the first scale value, and the scale level corresponding to the first scale value is determined as the scale level of each target data stream in the first target data stream group. It can be understood that after the connection is established, the terminal device and the server may trigger the target data stream forwarding request more than once. Therefore, in the target data stream received by the electronic device, different target data streams may be received by different terminal devices and need to be forwarded to different servers. However, in the communication process between a terminal device and a server, any number of target data streams have the same destination IP address and source IP address. Therefore, the target data streams with the same corresponding IP address are determined as target data streams with the same scale level to avoid using different virtual network elements to forward multiple target data streams of the terminal device and the server in the same connection, resulting in a waste of hardware resources.
[0073] The preset scale level determination algorithm can determine the scale level corresponding to the first scale value by calculating the hardware resources required to forward the data of the first scale value within a predetermined time. Exemplarily, if the proportion of the user plane network element hardware resources required to forward the data of the first scale value within the predetermined time is less than 10%, the scale level corresponding to the first scale value is determined as the first scale level; if the proportion of the user plane network element hardware resources required to forward the data of the first scale value within the preset time is greater than or equal to 10%, the scale level corresponding to the first scale value is determined as the second scale level.
[0074] The data stream forwarding method provided in this embodiment obtains the corresponding IP address of each target data stream, and the corresponding IP address includes the source IP address and the destination IP address of the target data stream; the scale level of each target data stream is determined according to the corresponding IP address. Since the level of each target data stream is determined by the IP address corresponding to each target data stream, multiple target data streams in the same connection between the terminal device and the server can be determined as having the same scale level, and then forwarded using the same virtual network element, which can not only avoid the problem of congestion and low forwarding efficiency of elephant streams and mouse streams in the forwarding queue, but also avoid the waste of hardware resources.
[0075] Embodiment 3
[0076] Figure 4 is a flow chart of a data stream forwarding method provided according to the third embodiment of the present application. Figure 4 As shown, the data stream forwarding method provided in this embodiment refines step 302 on the basis of embodiment 2, and step 302 is refined to include step 401 to step 402.
[0077] Step 401: Input the corresponding IP address of each target data stream into a preset hash function, and use the hash function to output the hash index value mapped to the corresponding IP address.
[0078] In this embodiment, the preset hash function can index the IP address, map different IP addresses to different hash index values, and map the same IP address to the same hash index value.
[0079] Step 402: Determine the scale level of the target data stream according to the hash index value and the pre-built hash index table.
[0080] In this embodiment, the pre-constructed hash index table includes a hash index value and a scale level corresponding to the hash index value. The scale level corresponding to the hash index value is queried in the hash index table according to the hash index value, and the scale level corresponding to the hash index value is determined as the scale level of the target data stream. In this embodiment, the hash index table can be constructed by the electronic device according to the scale value of the target data stream when receiving the target data stream sent by the terminal device.
[0081] The data stream forwarding method provided in this embodiment inputs the corresponding IP address of each target data stream into a preset hash function, and uses the hash function to output the hash index value mapped to the corresponding IP address; and determines the scale level of the target data stream according to the hash index value and a pre-constructed hash index table. Since the pre-constructed hash index table already stores the scale level of each target data stream, the scale level of the target data stream can be quickly determined.
[0082] Embodiment 4
[0083] Figure 5 is a flow chart of a data stream forwarding method provided according to the fourth embodiment of the present application, such as Figure 5 As shown, the data stream forwarding method provided in this embodiment further includes steps 501 to 502 before step 402.
[0084] Step 501, obtaining the scale value of each target data flow.
[0085] In this embodiment, for a target data stream including only one data packet, the byte length of the data packet can be used as the scale value of the target data stream; for a target data stream including multiple data packets, the sum of the byte lengths of the multiple data packets can be used as the scale value of the target data stream.
[0086] Step 502: construct a hash index table according to the scale value of each target data flow and the corresponding IP address.
[0087] In the present embodiment, the hash index table includes a hash index value and a scale level corresponding to the hash index value. Different IP addresses are mapped to different hash index values through the same hash function. Here, the target data stream with the same corresponding IP address can be determined as a target data stream group, and the byte lengths of each target data stream in the target data stream group are summed to determine the data stream group scale value, and then determine the scale level of each target data stream in the data stream group. It can be understood that each target data stream in the target data stream group has the same scale level and the same corresponding IP address. The hash index value mapped to the IP address of the target data stream is matched with the scale level of the target data stream to form a hash index table. The hash index table can be constructed when the electronic device receives the target data stream sent by the terminal device.
[0088] The data stream forwarding method provided in this embodiment obtains the scale value of each target data stream; and constructs a hash index table according to the scale value of each target data stream and the corresponding IP address. Through the pre-constructed hash index table, the scale level of the target data stream can be queried according to the IP address of the target data stream, so that the scale level can be quickly determined, thereby improving the data stream forwarding speed.
[0089] Embodiment 5
[0090] Figure 6 is a flow chart of a data stream forwarding method provided according to the fifth embodiment of the present application. Figure 6 As shown, the data stream forwarding method provided in this embodiment refines step 502 on the basis of embodiment 4, and step 502 is refined to include steps 601 to 607.
[0091] Step 601, determining the hash index value to which the IP address is mapped according to a preset hash function.
[0092] In this embodiment, a preset hash function may be used to directly calculate the hash index value to which the IP address is mapped.
[0093] Step 602: determine the target data flows with the same corresponding IP address as a target data flow group.
[0094] Specifically, it may be determined in sequence whether each target data flow has the same corresponding IP address, and the target data flows with the same corresponding IP address are grouped into the same target data flow group.
[0095] Step 603: Acquire the category data stream to which each target data stream belongs, and the number of the category data stream is at least one.
[0096] In this embodiment, the type of data flow to which the target data flow belongs can be determined by the protocol number in the message information of each target data flow. It can be understood that the target data flows with the same protocol number belong to the same type of data flow.
[0097] Step 604: construct a counting array table according to the category data flow to which each target data flow in the target data flow group belongs and the scale value of each target data flow in the target data flow group, wherein the counting array table includes at least one category data flow and its scale value.
[0098] In this embodiment, for the target data streams in the same target data stream group, the scale values of the target data streams with the same category data stream are summed to determine the scale value of the category data stream in the target data stream group. The scale value of each category data stream in the target data stream group is matched with each category data stream to form a counting array table. One group of target data stream groups corresponds to one counting array table, and different target data stream groups correspond to different counting array tables.
[0099] Step 605: Determine the scale level of each target data flow group according to the counting array table.
[0100] Specifically, the scale value of each category of data flow in the counting array table can be compared with the second preset scale value. If the scale value of any category of data flow in the counting array table is greater than the second preset scale value, the scale level of the target data flow group corresponding to the counting array table is determined as a large flow. If the scale values of each category of data flow in the counting array table are all less than the second preset scale value, the scale values of each category of data flow in the counting array table can be summed to determine the scale value of the target data flow group, and then the scale value of the target data flow group is compared with the second preset scale value to determine the scale level of each target data flow group. If the scale value of the target data flow group is greater than the second preset scale value, the scale level of the target data flow group is determined as a large flow. If the scale value of the target data flow group is less than the second preset scale value, the scale level of the target data flow group is determined as a small flow. This embodiment can also determine the scale level of each target data flow according to the counting array table by other methods, and this embodiment is not limited to this.
[0101] Step 606: Determine the scale level of each target data stream group as the scale level of each target data stream in the target data stream group.
[0102] Specifically, the scale level of each target data flow in the target data flow group with a scale level of large flow is determined as a large flow, and the scale level of each target data flow in the target data flow group with a scale level of small flow is determined as a small flow.
[0103] Step 607: Match the hash index value mapped to the IP address with the scale level of each target data flow to construct a hash index table.
[0104] Specifically, the hash index value is matched with the scale level of the target data flow to form a hash index table. The hash index value is the hash index value to which the corresponding IP address of each target data flow is mapped. The scale level of the target data flow is the scale level determined in the above steps.
[0105] The data stream forwarding method provided by the present embodiment determines the hash index value mapped to the IP address according to a preset hash function; determines the target data streams with the same corresponding IP address as the target data stream group; obtains the category data stream to which each target data stream belongs, and the number of category data streams is at least one; constructs a counting array table according to the category data stream to which each target data stream in the target data stream group belongs and the scale value of each target data stream in the target data stream group, and the counting array table includes at least one category data stream and its scale value; determines the scale level of each target data stream group according to the counting array table; determines the scale level of each target data stream group as the scale level of each target data stream in the target data stream group; matches the hash index value mapped to the IP address with the scale level of each target data stream to construct a hash index table. Since the target data streams with the same corresponding IP address are determined as the target data stream group, after grouping, the scale level of each group of target data streams can be determined at the same time, which can improve the speed of determining the scale level of the target data stream. Determining the scale level of each target data flow according to the category data flow to which each target data flow in each target data flow group belongs can not only determine the scale level of the target data flow, but also determine the scale value of each category data flow in each group.
[0106] As an optional implementation, based on the fifth embodiment, step 604 is refined, and step 604 is refined to include steps 6041 to 6044.
[0107] Step 6041, determine in turn whether there is a category data flow to which each target data flow belongs in the counting array table.
[0108] Step 6042: If it is determined that the category data flow to which the target data flow belongs exists in the counting array table, the size value of the target data flow is summed with the size value of the category data flow to which it belongs, and the summed value is determined as the size value of the category data flow to which it belongs.
[0109] Step 6043: If it is determined that the category data flow corresponding to the target data flow does not exist in the counting array table, the category data flow to which the target data flow belongs is added to the counting array table, and the scale value of the target data flow is determined as the scale value of the category data flow to which it belongs.
[0110] Step 6044, matching each category of data stream with its scale value to construct a count array table.
[0111] In this embodiment, in the counting array table, the category data stream and the scale value of the category data stream are initially empty. In the process of constructing the counting array table, for any target data stream in the target data stream group, it is determined whether there is a category data stream to which it belongs in the counting array table. If it is determined that there is a category data stream to which it belongs, the scale value of the category data stream to which it belongs is obtained, and the scale value of the category data stream to which it belongs is summed with its scale value, and the summed value is used to update the scale value of the category data stream to which it belongs. If it is determined that there is no category data stream to which it belongs in the counting array table, a group of category data streams and their scale values will be added to the counting array table, and the newly added category data stream is the category data stream to which the target data stream belongs, and the scale value of the newly added category data stream is the scale value of the target data stream, so as to update the counting array table. Traverse all target data streams to obtain the category data streams to which each target data stream in the target data stream group belongs and the scale value of each category data stream. Match each category data stream with the scale value of each category data stream to form a counting array table.
[0112] The data stream forwarding method provided in this embodiment determines in sequence whether there is a category data stream to which each target data stream belongs in the counting array list; if it is determined that the category data stream to which the target data stream belongs exists in the counting array list, the scale value of the target data stream is summed with the scale value of the category data stream to which it belongs, and the summed value is determined as the scale value of the category data stream to which it belongs; if it is determined that the category data stream corresponding to the target data stream does not exist in the counting array list, the category data stream to which the target data stream belongs is added to the counting array list, and the scale value of the target data stream is determined as the scale value of the category data stream to which it belongs; each category data stream is matched with its scale value to construct a counting array table. Since the scale value of the target data stream is calculated based on the scale value of the category data stream to which it belongs, the scale value of the category data stream to which each target data stream in the same group of target data streams belongs can be determined, and the scale value of the target data stream in the target data stream group can be recorded in a classified manner, so that the size of the counting array table can be reduced when determining the scale value of the target data stream, saving storage resources.
[0113] Embodiment 6
[0114] Figure 7 is a flow chart of a data stream forwarding method provided according to the sixth embodiment of the present application. Figure 7 As shown, the data stream forwarding method provided in this embodiment refines step 605 on the basis of embodiment 5, and step 605 is refined to include steps 701 to 703.
[0115] Step 701: If the number of the category data flow in the counting array table is one, the scale value of the category data flow is determined as the level scale value of the target data flow.
[0116] Step 702: If there are multiple types of data flows in the counting array table, the sum of the scale values of the data flows of each type is determined as the level scale value of the target data flow.
[0117] Step 703: Determine the scale level of the target data flow according to the scale value of the target data flow.
[0118] In this embodiment, target data streams with the same level scale value can be determined at the same scale level, and then different scale levels can be determined according to different level scale values. Exemplarily, the forwarding queue includes the first, second and third target data streams. If the three target data streams have different level scale values, the scale level of the first target data stream can be determined as the first scale level, the scale level of the second target data stream can be determined as the second scale level, and the scale level of the third target data stream can be determined as the third scale. If the first target data stream and the second target data stream have the same level scale value, and the level scale value of the third target data stream is different from the level scale values of the first and second target data streams, the scale levels of the first target data stream and the second target data stream can be determined as the first scale level, and the scale level of the third target data stream can be determined as the second scale level.
[0119] The data stream forwarding method provided by this embodiment, if the number of the category data stream in the counting array list is one, the scale value of the category data stream is determined as the level scale value of the target data stream; if the number of the category data stream in the counting array list is multiple, the sum of the scale values of the category data streams is determined as the level scale value of the target data stream; the scale level of the target data stream is determined according to the level scale value of the target data stream. Since the level scale value of the target data stream is determined respectively according to different situations of the category data stream in the counting array list, the level scale value of the target data stream can be determined more quickly, and then the scale level of the target data stream can be determined more quickly.
[0120] As an optional implementation, based on the sixth embodiment, step 703 is refined, and step 703 is refined to include steps 7031 to 7033.
[0121] Step 7031, determining whether the level scale value is less than a second preset scale value.
[0122] In this embodiment, the second preset scale value is used to determine the scale level of the target data flow, and the second preset scale value may be a scale value that the user plane network element can forward within a predetermined time. Exemplarily, the scale level of the target data flow is a large flow or a small flow, and the second preset scale value is 1Mbps.
[0123] Step 7032: If it is determined that the level scale value is less than or equal to the second preset scale value, the scale level of the target data flow is determined to be a small flow.
[0124] Step 7033: If it is determined that the level scale value is greater than the second preset scale value, the scale level of the target data flow is determined to be a large flow.
[0125] Specifically, continuing to explain according to the above example, if the level scale value of the target data flow is 5Mbps, the level scale value of the target data flow is determined to be a large flow. If the level scale value of the target data flow is 1Mbps, the level scale value of the target data flow is determined to be a small flow.
[0126] The data stream forwarding method provided in this embodiment determines whether the level scale value is less than the second preset scale value; if it is determined that the level scale value is less than or equal to the second preset scale value, the scale level of the target data stream is determined to be a small stream; if it is determined that the level scale value is greater than the second preset scale value, the scale level of the target data stream is determined to be a large stream. Since the size relationship between the level scale value and the second preset scale value is directly compared, the scale level of the target data stream can be quickly determined.
[0127] Embodiment 7
[0128] The data stream forwarding method provided in this embodiment is based on any one of the above embodiments. The scale level of the target data stream is a large stream or a small stream. In step 204, the method is refined according to the scale level of each target data stream to determine whether each target data stream is forwarded using a large traffic processing virtual network element or a small traffic processing virtual network element. The refinement includes step 801.
[0129] Step 801 : Determine that a target data flow with a small scale level is forwarded by a small traffic processing virtual network element, and determine that a target data flow with a large scale level is forwarded by a large traffic processing virtual network element.
[0130] In this embodiment, the scale level of each target data flow can be determined as a large flow and a small flow by the method of step 7031 to step 7033. Specifically, a large flow processing virtual network element and a small flow processing virtual network element can be used to forward traffic at the same time, and the target data flow with a scale level of small flow in the forwarding queue is forwarded by the small flow processing virtual network element, and the target data flow with a scale level of large flow in the forwarding queue is forwarded by the large flow processing virtual network element.
[0131] Illustratively, the following Table 1 shows a comparison of the diversion delays of using the data stream forwarding method provided in this embodiment to forward traffic and using a conventional data stream forwarding method to forward traffic in a scenario. The diversion delay is the sum of the queue delay of each target data stream and the processing delay when the user plane network element forwards the target data stream. In this scenario, the forwarding queue includes 2 large streams and 100 small streams.
[0132] Table 1. Delay of traffic distribution in different data flow forwarding methods
[0133]
[0134] In Table 1, the diversion delay of the traditional data stream forwarding method is the average diversion delay of each target data stream. Among them, when the traditional data stream forwarding method is used for forwarding, the average diversion delay of the target data stream with a scale level of small stream is 18ms, the diversion delay of some small streams is greater than 25ms, and the average diversion delay of the target data stream with a scale level of large stream is 23ms. When the data stream forwarding method provided in this embodiment is used for forwarding, the average diversion delay of the target data stream with a scale level of small stream is 15ms, and the average diversion delay of the target data stream with a scale level of large stream is 20ms. Therefore, the data stream forwarding method provided in this embodiment can improve the forwarding efficiency of the user-side network element and avoid congestion of large and small streams in the forwarding queue.
[0135] The data stream forwarding method provided in this embodiment determines that the target data stream with a small scale level is forwarded by using a small traffic processing virtual network element, and determines that the target data stream with a large scale level is forwarded by using a large traffic processing virtual network element. Since the traffic processing virtual network element and the small flow processing virtual network element are used at the same time to forward the target data stream in the forwarding queue,
[0136] As an optional implementation manner, based on the seventh embodiment, before step 801, step 901 is further included.
[0137] Step 901: adjust the small traffic processing virtual network element and the large traffic processing virtual network element according to the scale level of each target data flow.
[0138] In this embodiment, the first resource ratio, the second resource ratio and the third resource ratio can be preset, and the first, second and third preset intervals corresponding to the first, second, third and fourth resource ratios can be preset. Exemplarily, the first resource ratio can be 40%, the second resource ratio can be 50%, the third resource ratio can be 60%, and the fourth resource ratio can be 70%. The number of target data flows with scale levels of large flows and small flows is calculated respectively, and it is determined that the number of target data flows with scale levels of small flows belongs to the first, second or preset interval. Exemplarily, the first preset interval can be 0 to 10,000, the second preset interval can be 100,000 to 1 million, and the third preset interval can be greater than 1 million. If it is determined that the number of target data flows with scale levels of small flows belongs to the first preset interval, the resource ratio of the small flow processing virtual network element can be adjusted to the first resource ratio. Correspondingly, the resource ratio of the large flow processing virtual network element can be: 100%-first resource ratio.
[0139] As an optional implementation, step 901 is refined, and step 901 is refined to include step 9011 to step 9011 to step 9013.
[0140] Step 9011, respectively obtain the large flow scale value and the small flow scale value of the target data flow with the scale level of large flow and small flow.
[0141] Specifically, the scale values of the target data flows with a scale level of large flow can be summed to obtain the large flow scale value of the target data flow, and the scale values of the target data flows with a scale level of small flow can be summed to obtain the small flow scale value of the target data flow.
[0142] Step 9012: Adjust the resource proportions of the large flow processing virtual network element and the small flow processing virtual network element according to the large flow scale value and the small flow scale value.
[0143] In this embodiment, the resource proportion of the large flow processing virtual network element can be adjusted to the proportion of the large flow scale value to the total scale value, and the resource proportion of the small flow processing virtual network element can be adjusted to the proportion of the small flow scale value to the total scale value.
[0144] The data stream forwarding method provided in this embodiment obtains the large stream scale value and the small stream scale value of the target data stream with the scale level of large stream and small stream respectively; determines whether the ratio of the large stream scale value to the total scale value is less than the preset ratio; if it is determined that the ratio of the large stream scale value to the total scale value is less than the preset ratio, adjusts the resource ratio of the large flow processing virtual network element and the small flow processing virtual network element. Since the resource ratio of the large flow processing virtual network element and the small flow processing virtual network element is adjusted, the utilization rate of the hardware resources can be improved, thereby improving the forwarding efficiency of the user plane network element.
[0145] Embodiment 8
[0146] The data stream forwarding method provided in this embodiment, based on any one of the above embodiments, further includes step 205.
[0147] Step 205: If it is determined that the total scale value is less than the first preset scale value, the target data flow is determined to be forwarded using a small traffic processing virtual network element.
[0148] In this embodiment, the first preset scale value is the scale value that the small flow processing virtual network element of the user plane network element can forward within a preset time period. If the total scale value of the target data flow in the forwarding queue is less than the first preset scale value, the small flow processing virtual network element can be used to forward the target data flow. Here, whether there is only mouse flow and no elephant flow in the forwarding queue, or there are both mouse flow and elephant flow, or there is only elephant flow and no mouse flow, since the small flow processing virtual network element can forward the data volume of the first preset scale value within the preset time period, that is, the small flow processing virtual network element can forward the target data flow in the forwarding queue within the preset time, even if the elephant flow and the mouse flow are mixed and forwarded, it will not cause the mouse flow packet loss and the elephant flow queue delay to increase, and there will be no problem of queue congestion of the elephant flow and the mouse flow. Therefore, only the small flow processing virtual network element can be used to forward the target data flow.
[0149] The data stream forwarding method provided in this embodiment determines that the target data stream is forwarded by using a small traffic processing virtual network element if it is determined that the total scale value is less than the first preset scale value. Since the small traffic processing virtual network element is used to forward the target data stream when the total scale value is less than the first preset scale value, queue congestion of elephant flows and mouse flows can be avoided and hardware resources can be saved.
[0150] Embodiment 9
[0151] Figure 8 is a schematic diagram of the structure of a data stream forwarding device provided according to the ninth embodiment of the present application, such as Figure 8 As shown, the data stream forwarding device provided in this embodiment is located in an electronic device. The data stream forwarding device 80 includes: a splitting module 81 , an acquisition module 82 , a judgment module 83 and a determination module 84 .
[0152] The splitting module 81 is used to split the user plane network element into a small traffic processing virtual network element and a large traffic processing virtual network element by using virtualization technology;
[0153] The acquisition module 82 is used to acquire a total size value of a target data flow in a forwarding queue, where the forwarding queue includes at least two target data flows;
[0154] The judging module 83 is used to judge whether the total scale value is less than a first preset scale value;
[0155] If it is determined that the total scale value is greater than or equal to the first preset scale value, the determination module 84 is used to use a flow detection algorithm to determine the scale level of each target data flow, and determine whether each target data flow should be forwarded using a large-flow processing virtual network element or a small-flow processing virtual network element according to the scale level of each target data flow.
[0156] The data stream forwarding device provided in this embodiment can execute the data stream forwarding method provided in the above-mentioned embodiment 1. The specific implementation method and principle are similar and will not be repeated here.
[0157] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically used to obtain the corresponding IP address of each target data stream, the corresponding IP address includes the source IP address and destination IP address of the target data stream; and determine the scale level of each target data stream according to the corresponding IP address.
[0158] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically used to input the corresponding IP address of each target data stream into a preset hash function, and use the hash function to output the hash index value mapped to the corresponding IP address; determine the scale level of the target data stream based on the hash index value and a pre-built hash index table.
[0159] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is further specifically used to obtain the scale value of each target data stream; and construct a hash index table according to the scale value of each target data stream and the corresponding IP address.
[0160] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically used to determine the hash index value mapped to the IP address according to a preset hash function; determine the target data streams with the same corresponding IP address as a target data stream group; obtain the category data stream to which each target data stream belongs, and the number of category data streams is at least one; construct a counting array table according to the category data stream to which each target data stream in the target data stream group belongs and the scale value of each target data stream in the target data stream group, the counting array table including at least one category data stream and its scale value; determine the scale level of each target data stream group according to the counting array table; determine the scale level of each target data stream group as the scale level of each target data stream in the target data stream group; match the hash index value mapped to the IP address with the scale level of each target data stream to construct a hash index table.
[0161] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically further used to determine in turn whether there is a category data stream to which each target data stream belongs in the counting array list; if it is determined that the category data stream to which the target data stream belongs exists in the counting array list, the scale value of the target data stream is summed with the scale value of the category data stream to which it belongs, and the summed value is determined as the scale value of the category data stream to which it belongs; if it is determined that there is no category data stream corresponding to the target data stream in the counting array list, the category data stream to which the target data stream belongs is added to the counting array list, and the scale value of the target data stream is determined as the scale value of the category data stream to which it belongs; each category data stream is matched with its scale value to construct a counting array table.
[0162] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically used to, if the number of category data streams in the counting array list is one, determine the scale value of the category data stream as the level scale value of the target data stream; if the number of category data streams in the counting array list is multiple, determine the sum of the scale values of each category data stream as the level scale value of the target data stream; and determine the scale level of the target data stream according to the level scale value of the target data stream.
[0163] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically used to determine whether the level scale value is less than a second preset scale value; if it is determined that the level scale value is less than or equal to the second preset scale value, the scale level of the target data flow is determined to be a small flow; if it is determined that the level scale value is greater than the second preset scale value, the scale level of the target data flow is determined to be a large flow.
[0164] Optionally, in the data stream forwarding device 80 provided in this embodiment, the determination module 84 is specifically used to determine the target data stream with a small scale level to be forwarded using a small traffic processing virtual network element, and to determine the target data stream with a large scale level to be forwarded using a large traffic processing virtual network element.
[0165] Optionally, the data stream forwarding device 80 provided in this embodiment further includes an adjustment module, and the adjustment module is used to adjust the small traffic processing virtual network element and the large traffic processing virtual network element according to the scale level of each target data stream.
[0166] Optionally, in the data stream forwarding device 80 provided in this embodiment, the adjustment module is specifically used to obtain the large flow scale value and the small flow scale value of the target data flow with scale levels of large flow and small flow, respectively; and adjust the resource ratios of the large flow processing virtual network element and the small flow processing virtual network element according to the large flow scale value and the small flow scale value.
[0167] Optionally, in the data stream forwarding device provided in this embodiment, if it is determined that the total scale value is less than the first preset scale value, the determination module 84 is further configured to determine that the target data stream is forwarded using a small traffic processing virtual network element.
[0168] The data stream forwarding device provided in this embodiment can execute the data stream forwarding method provided in any one of the above-mentioned embodiments 2 to 8. The specific implementation method and principle are similar and will not be described here.
[0169] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0170] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0171] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0172] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0173] Embodiment 10
[0174] Fig. 9 is a block diagram of an electronic device provided according to the tenth embodiment of the present application, such as Fig. 9 As shown, the electronic device 12 provided in this embodiment includes a memory 91 , a processor 92 and a transceiver 93 .
[0175] Among them, the memory 91, the processor 92 and the transceiver 93 are interconnected.
[0176] The memory 91 stores computer-executable instructions.
[0177] The transceiver 93 is used for sending and receiving data.
[0178] The processor 92 executes the computer-executable instructions stored in the memory 91 to implement the data stream forwarding method provided by any one of the above embodiments.
[0179] An embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the data stream forwarding method provided in any one of the above embodiments.
[0180] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not 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.
[0181] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0182] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0183] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
Claims
1. A data stream forwarding method, characterized in that: include: Use virtualization technology to split user plane network elements into small traffic processing virtual network elements and large traffic processing virtual network elements; Acquire a total size value of a target data flow in a forwarding queue, wherein the forwarding queue includes at least two target data flows; Determining whether the total scale value is less than a first preset scale value; If it is determined that the total scale value is greater than or equal to the first preset scale value, a flow detection algorithm is used to determine the scale level of each target data flow, and according to the scale level of each target data flow, each target data flow is determined to be forwarded by a large flow processing virtual network element or a small flow processing virtual network element; The flow detection algorithm is used to determine the scale level of each target data flow, including: Obtaining a corresponding IP address for each target data stream, wherein the corresponding IP address includes a source IP address and a destination IP address of the target data stream; Determine the scale level of each target data flow according to the corresponding IP address; Before determining the scale level of each target data flow according to the corresponding IP address, the method further includes: Get the scale value of each target data stream; Construct a hash index table based on the scale value of each target data flow and the corresponding IP address; The step of constructing a hash index table according to the scale value of each target data flow and the corresponding IP address includes: Determine the hash index value to which the IP address is mapped according to a preset hash function; Determine the target data flows having the same corresponding IP address as a target data flow group; Acquire a category data stream to which each target data stream belongs, where the number of the category data stream is at least one; Constructing a counting array table according to the category data flow to which each target data flow in the target data flow group belongs and the scale value of each target data flow in the target data flow group, wherein the counting array table includes at least one category data flow and its scale value; Determine the scale level of each target data stream group according to the counting array table; Determining the scale level of each target data stream group as the scale level of each target data stream in the target data stream group; Matching the hash index value mapped to the IP address with the scale level of each target data flow to construct a hash index table; The step of constructing a counting array table according to the category data stream to which each target data stream in the target data stream group belongs and the scale value of each target data stream in the target data stream group includes: Determine in sequence whether there is a category data flow to which each target data flow belongs in the counting array table; If it is determined that the category data flow to which the target data flow belongs exists in the counting array table, summing the size value of the target data flow and the size value of the category data flow to which it belongs, and determining the summed value as the size value of the category data flow to which it belongs; If it is determined that the category data flow corresponding to the target data flow does not exist in the counting array table, the category data flow to which the target data flow belongs is added to the counting array table, and the scale value of the target data flow is determined as the scale value of the category data flow to which it belongs; Each category data stream is matched with its scale value to construct the count array table.
2. The method according to claim 1, characterized in that Determining the scale level of each target data flow according to the corresponding IP address includes: Inputting the corresponding IP address of each target data stream into a preset hash function, and using the hash function to output the hash index value to which the corresponding IP address is mapped; The scale level of the target data stream is determined according to the hash index value and a pre-built hash index table.
3. The method according to claim 1, characterized in that Determining the scale level of each target data flow according to the counting array table includes: If the number of the category data stream in the counting array table is one, the scale value of the category data stream is determined as the level scale value of the target data stream; If there are multiple types of data flows in the counting array table, the sum of the scale values of the data flows of each type is determined as the level scale value of the target data flow; The scale level of the target data flow is determined according to the level scale value of the target data flow.
4. The method according to claim 3, characterized in that Determining the scale level of the target data stream according to the scale value of the target data stream includes: Determining whether the level scale value is less than a second preset scale value; If it is determined that the level scale value is less than or equal to the second preset scale value, determining the scale level of the target data flow is a small flow; If it is determined that the level scale value is greater than the second preset scale value, the scale level of the target data flow is determined to be a large flow.
5. The method according to claim 1, characterized in that The scale level of the target data flow is a large flow or a small flow, and each target data flow is determined to be forwarded by a large flow processing virtual network element or a small flow processing virtual network element according to the scale level of each target data flow, including: The target data flow with a small scale level is determined to be forwarded by a small traffic processing virtual network element, and the target data flow with a large scale level is determined to be forwarded by a large traffic processing virtual network element.
6. The method according to claim 5, characterized in that Before determining that the target data flow with a small scale level is forwarded by using a small traffic processing virtual network element or determining that the candidate data flow with a large scale level is forwarded by using a large traffic processing virtual network element, the method further includes: The small traffic processing virtual network element and the large traffic processing virtual network element are adjusted according to the scale level of each target data flow.
7. The method according to claim 6, characterized in that Adjusting the small traffic processing virtual network element and the large traffic processing virtual network element according to the scale level of each target data flow includes: Obtain a large flow scale value and a small flow scale value of a target data flow with a scale level of a large flow and a small flow respectively; The resource proportions of the large flow processing virtual network element and the small flow processing virtual network element are adjusted according to the large flow scale value and the small flow scale value.
8. The method according to claim 1, characterized in that Also includes: If it is determined that the total scale value is smaller than the first preset scale value, the target data flow is determined to be forwarded by using a small traffic processing virtual network element.
9. A traffic forwarding device, characterized in that: include: A splitting module, used to split the user plane network element into a small traffic processing virtual network element and a large traffic processing virtual network element by using virtualization technology; An acquisition module, used to acquire a total size value of a target data flow in a forwarding queue, wherein the forwarding queue includes at least two target data flows; A judging module, used for judging whether the total scale value is less than a first preset scale value; A determination module, if it is determined that the total scale value is greater than or equal to the first preset scale value, is used to determine the scale level of each target data flow by using a flow detection algorithm, and determine whether each target data flow is forwarded by using a large flow processing virtual network element or a small flow processing virtual network element according to the scale level of each target data flow; The determination module is specifically used to obtain the corresponding IP address of each target data flow, wherein the corresponding IP address includes the source IP address and the destination IP address of the target data flow; and determine the scale level of each target data flow according to the corresponding IP address; The determination module is further specifically used to obtain the scale value of each target data flow; construct a hash index table according to the scale value of each target data flow and the corresponding IP address; The determination module is further specifically used to determine the hash index value mapped to the IP address according to a preset hash function; determine the target data streams with the same corresponding IP address as a target data stream group; obtain the category data stream to which each target data stream belongs, and the number of the category data stream is at least one; construct a counting array table according to the category data stream to which each target data stream in the target data stream group belongs and the scale value of each target data stream in the target data stream group, and the counting array table includes at least one category data stream and its scale value; determine the scale level of each target data stream group according to the counting array table; determine the scale level of each target data stream group as the scale level of each target data stream in the target data stream group; match the hash index value mapped to the IP address with the scale level of each target data stream to construct the hash index table; The determination module is further specifically used to sequentially determine whether there is a category data flow to which each target data flow belongs in the counting array list; if it is determined that the category data flow to which the target data flow belongs exists in the counting array list, then summing the scale value of the target data flow and the scale value of the category data flow to which it belongs, and determining the summed value as the scale value of the category data flow to which it belongs; If it is determined that the category data flow corresponding to the target data flow does not exist in the counting array table, the category data flow to which the target data flow belongs is added to the counting array table, and the scale value of the target data flow is determined as the scale value of the category data flow to which it belongs; Each category data stream is matched with its scale value to construct the count array table.
10. An electronic device, characterized in that: include: Memory, processor, and transceiver; The memory, the processor and the transceiver circuit are interconnected; The memory stores computer-executable instructions; The transceiver is used for sending and receiving data; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
Network address sort-based bidirectional stream combining method
CN101741743A
High speed network data flow load balancing scheduling method based on field programmable gate array (FPGA)
CN103139093A
Network offloading method, device and system, and computer equipment
CN108282412A
Elephant data stream processing method and device, P4 switch and medium
CN108809826A
Data stream processing method and related equipment
CN110011935A
