Data processing method and device, nonvolatile storage medium and electronic equipment

By setting up two flow tables in a programmable protocol independent packet processor switch, the problem of degradation of forwarding efficiency caused by storage capacity limitations when processing large-scale session traffic is solved, and the effects of low forwarding delay and high throughput are achieved.

CN120111014APending Publication Date: 2025-06-06CHINA TELECOM CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510280216.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

When the user-plane function entity based on the programmable protocol-independent packet processor switch handles large-scale session traffic, the forwarding efficiency decreases due to storage capacity limitations, which increases the processing delay of data packets and reduces the throughput of UPF.

Method used

A data processing method is adopted to set up two flow tables in a programmable protocol-independent packet processor switch: the first flow table (soft flow table) stores all table entries related to the user-side function session, and the second flow table (hard flow table) stores some hotspot table entries. Look for matching target table entries in the second flow table, execute the target action if found, and search and execute the action in the first flow table if not found.

Benefits of technology

By intelligently allocating flow table entries, the utilization rate of switch hardware resources is improved, low forwarding delay and high throughput are ensured, and the problem of degradation of forwarding efficiency caused by storage capacity limitation is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120111014A_ABST
    Figure CN120111014A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, a nonvolatile storage medium and electronic equipment. The method comprises the following steps: a programmable protocol independent packet processor switch receives packet data; a target table item matched with a preset field in the grouped data is searched in a second flow table, and the target table item comprises a target key value and a target action corresponding to the target key value; under the condition that the target table item is found in the second flow table, executing a target action; and under the condition that the target table item is not searched in the second flow table, searching the target table item matched with the preset field in the grouped data in the first flow table, and under the condition that the target table item is searched in the first flow table, executing the target action. The technical problem that when a user plane function entity based on a programmable protocol independent packet processor switch processes large-scale session traffic, the forwarding efficiency is reduced due to storage capacity limitation in the programmable protocol independent packet processor switch is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information network and exchange technology, and in particular, to a data processing method and device, a non-volatile storage medium, and an electronic device. Background Art

[0002] The popularity of the fifth-generation mobile communication network has promoted the innovation of the User Plane Function (UPF), aiming to provide higher-speed and low-latency data transmission services. As a key component of the 5G core network, UPF is responsible for operations such as routing, forwarding, and policy execution of user data packets. Its performance is directly related to the user experience and overall efficiency of the network. In order to achieve high-performance processing of UPF, programmable hardware platforms such as Programming Protocol-independent Packet Processors (P4) switches have been widely used. Such devices allow the processing logic of the data plane to be customized through the P4 language, significantly improving the flexibility and processing rate of the hardware.

[0003] However, the core hardware of the P4 switch, the P4 chip, has limited on-chip storage capacity, which has become a bottleneck restricting UPF from processing large-scale session traffic. In UPF devices, the flow table is the basis for packet processing and forwarding, and its storage and query efficiency has a crucial impact on forwarding latency and throughput. When the number of sessions surges, a large number of flow table entries need to be stored and quickly queried, but the storage capacity of the P4 chip cannot meet this demand, resulting in a decrease in hardware forwarding efficiency, increased packet processing latency, and reduced UPF throughput.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The present application provides a data processing method and device, a non-volatile storage medium, and an electronic device to at least solve the technical problem that when a user plane functional entity based on a programmable protocol-independent packet processor switch processes large-scale session traffic, the forwarding efficiency is reduced due to the storage capacity limitation in the programmable protocol-independent packet processor switch.

[0006] According to one aspect of the present application, a data processing method is provided, including: a programmable protocol-independent packet processor switch receives packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items in all table items; searching the second flow table for a target table item that matches a preset field in the packet data, wherein the target table item includes a target key value and a target action corresponding to the target key value; if the target table item is found in the second flow table, executing the target action; if the target table item is not found in the second flow table, searching the first flow table for a target table item that matches the preset field in the packet data, and if the target table item is found in the first flow table, executing the target action.

[0007] Optionally, when the target table entry is found in the first flow table, after executing the target action, the method also includes: when there is no table entry consistent with the target table entry in the packet arrival queue, adding the target table entry to the end of the packet arrival queue, wherein the packet arrival queue is used to cache the target table entry when the target table entry is not found in the second flow table; when there is a table entry consistent with the target table entry in the packet arrival queue, discarding the first table entry in the arrival status queue and moving the target table entry from the packet arrival queue to the end of the arrival status queue, wherein the arrival status queue is used to identify the target table entry and add the target table entry to the second flow table; deleting the first table entry in the arrival status queue in the second flow table, and adding the target table entry in the second flow table.

[0008] Optionally, after adding the target table entry in the second flow table, the target action is performed by the following method: receiving return packet data sent by the user plane functional entity, wherein the return packet data is data of the packet data forwarded to the programmable protocol-independent packet processor switch when the user plane functional entity finds the target table entry in the first flow table; searching the second flow table for a target table entry that matches a preset field in the return packet data, and executing the target action included in the target table entry.

[0009] Optionally, when there is no entry consistent with the target entry in the packet arrival queue, the target action is performed by the following method: receiving the target entry sent by the user plane functional entity, adding the target entry to the end of the packet arrival queue; and processing the packet data based on the target action in the target entry.

[0010] Optionally, the method also includes: when preset conditions are met, generating pre-configured table entries based on historical traffic data within a preset historical period, and adding the pre-configured table entries to a second flow table, wherein the preset conditions include: the maximum number of concurrent connections supported by the user plane functional entity is greater than a first preset threshold and / or the increase ratio of the traffic data forwarded by the user plane functional entity per unit time is greater than a second preset threshold and / or the packet loss rate of the traffic data forwarded by the user plane functional entity is greater than a third preset threshold.

[0011] Optionally, preconfigured table items are generated based on historical traffic data within a preset historical time period, including: identifying different session flows in the historical traffic data based on quintuple information of the historical traffic data, wherein the quintuple information includes: source IP address, destination IP address, source port information, destination port information and protocol type information; determining network traffic data for each session flow, wherein the network traffic data includes at least one of the following: total data packet capacity, average data packet capacity and data packet arrival frequency; performing feature extraction on the network traffic data to obtain target features, using the target features to train a prediction model, and obtaining a trained prediction model when a preset stop condition is met; applying the trained prediction model to predict hotspot session flows within a preset time period in the future, and determining preconfigured table items based on the hotspot session flows.

[0012] Optionally, the target table entry is searched in the first flow table or the second flow table by the following method, including: parsing the header field of the packet data to obtain the packet characteristics; traversing the table entries in the flow table until the target table entry matching the packet characteristics is found.

[0013] According to another aspect of the present application, a data processing device is also provided, including: a receiving module, used to instruct a programmable protocol-independent packet processor switch to receive packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items of all table items; a search module, used to search for a target table item matching a preset field in the packet data in the second flow table, wherein the target table item includes a target key value and a target action corresponding to the target key value; a first execution module, used to execute the target action when the target table item is found in the second flow table; a second execution module, used to search for a target table item matching a preset field in the packet data in the first flow table when the target table item is not found in the second flow table, and execute the target action when the target table item is found in the first flow table.

[0014] According to another aspect of the present application, a non-volatile storage medium is provided, the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the above data processing method.

[0015] According to another aspect of the present application, an electronic device is provided, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the above data processing method is executed when the program is run.

[0016] According to yet another aspect of the present application, a computer program is provided, wherein the above data processing method is implemented when the computer program is executed by a processor.

[0017] According to another aspect of the present application, a computer program product is provided, which includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above data processing method is implemented.

[0018] In the present application, a programmable protocol-independent packet processor switch is used to receive packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items in all the table items; a target table item matching a preset field in the packet data is searched in the second flow table, wherein the target table item includes a target key value and a target action corresponding to the target key value; when the target table item is found in the second flow table, the target action is executed; when the target table item is not found in the second flow table, a target table item matching a preset field in the packet data is searched in the first flow table, and when the target table item is found in the first flow table, the target action is executed, so as to achieve the purpose of improving the effective utilization rate of the switch hardware resources, thereby achieving the technical effect of ensuring low forwarding delay and high throughput, and further solving the technical problem that the forwarding efficiency of the user plane function entity based on the programmable protocol-independent packet processor switch is reduced due to the storage capacity limitation in the programmable protocol-independent packet processor switch when processing large-scale session traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a flow chart of a data processing method according to an embodiment of the present application;

[0021] Figure 2 It is a flow chart of a method for caching and scheduling a user plane functional entity flow table based on P4 according to an embodiment of the present application;

[0022] Figure 3 It is a structural diagram of a matching table division and classification storage method according to an embodiment of the present application;

[0023] Figure 4 This is a flow chart of looking up a table to obtain a matching entry when a user plane packet arrives according to an embodiment of the present application;

[0024] Figure 5 is a flow chart of a table lookup method according to an embodiment of the present application;

[0025] Figure 6 is a flowchart of a PAQ and ASQ updating method according to an embodiment of the present application;

[0026] Figure 7 is a flowchart of another method for caching and scheduling a user plane functional entity flow table based on P4 according to an embodiment of the present application;

[0027] Figure 8 is a numerical analysis result diagram of a capacity gain according to an embodiment of the present application;

[0028] Fig. 9 is a structural diagram of a data processing device according to an embodiment of the present application;

[0029] Fig.10 It is a hardware structure block diagram of a computer terminal according to a data processing method of an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] The P4 switch is a switch module designed with a P4 chip, and its storage capacity is limited by the storage capacity of the P4 chip. The related technology "Performance study of P4 programmable devices: Flow scalability and rule update responsiveness" gives the actual storage capacity of different dedicated chips for P4 implementation through actual measurements, and points out that the actual storage capacity cannot reach the theoretical limit. The article points out that when a smart network card is used to implement a P4 switch, the actual storage capacity is 48,000 entries. The open source platform used in this article has an actual storage capacity of no more than 4,000 entries when implementing a P4 switch. The above research shows that the storage capacity of the P4 switch is limited by the hardware chip and cannot meet the large-capacity session service requirements of UPF.

[0033] Related technology 1 "CacheP4: Abehavior-level caching mechanism for P4" (ACMSIGCOMM Conference Posters and Demos, Angeles CA, USA, 2017: 108-110) proposes a behavior-level P4 cache strategy, which is to add a feature-behavior cache table in front of the original matching table. The table stores session flow features and a set of corresponding actions. This set of actions is called behavior. The method proposed in this paper makes it unnecessary for groups belonging to the same session flow to repeatedly query the matching pipeline, which can reduce the packet processing delay. However, this method adds a new table based on the original matching table, does not consider the storage capacity limitation of the P4 processor, and does not consider the table item scheduling problem of the hard flow table and the soft flow table when the number of table items exceeds the P4 storage upper limit.

[0034] Related technology 2 "P4LRU: Towards an LRU cache entirely in programmable data plane" (ACM SIGCOMM 2023, New York, USA, 2023: 967-980) proposes an LRU (Least Recently Used) cache method suitable for the P4 matching pipeline. Different from the traditional LRU method, this method stores n pairs of key-value pairs separately, and adds a cache state matrix to map the correspondence between keywords and values. The cache state matrix of the proposed method requires n tables with a size of n factorial, and does not consider the table scheduling problem of hard flow table and soft flow table when the number of table entries exceeds the P4 storage upper limit.

[0035] Related technology 3 "X-Plane: A High-Throughput Large-Capacity 5G UPF" (ACM MobiCom'23, New York, NY, USA, 2023: 1-14) proposes a data plane architecture that combines a dedicated programmable chip ASIC and an external dynamic random access memory (DRAM), as well as a fast packet forwarding method. The proposed method assumes that the same session flow packets execute the same PDR (Packet Detection Rule), and constructs a fast table through the result of querying the slow table by the first packet of the session flow. Subsequent packets only need to query the fast table for forwarding, which can reduce the forwarding delay. However, this method stores both the slow table and the fast table in the external DRAM. Each table query requires the packet to be processed by the DRAM and the query result is returned to the ASIC, resulting in low forwarding efficiency.

[0036] Related technology 4 (patent number CN118368244A) discloses a software-defined switch flow table optimization management method. The method generates a flow table according to a control strategy by a network controller, and uses wildcards and flow table entries with similar matching conditions. The software-defined switch receives flow table entries through the TCAM table, and the network controller calculates the optimal timeout time for the current flow table entry. After the optimal timeout time, the software-defined switch deletes the current flow table entry of the TCAM table, and the TCAM table creates the next incoming flow table entry. This invention uses a timeout mechanism to manage the OpenFlow flow table, and does not involve the table item scheduling problem of the hard flow table and soft flow table of the P4 switch.

[0037] Related technology 5 (patent number CN118174925A) discloses a fast matching method based on an LRU timeout flow table. This method defines a timeout linked list pointer based on the last survival time of the flow. After receiving a data packet, the flow is searched or created in the flow table based on the information of the data packet, and the last survival time and timeout linked list of the flow are updated or created. It is determined that the flow table capacity has reached the upper limit or the flow information has timed out, and the timed out flow is checked and deleted from the tail of the timeout linked list, and the current flow is matched in turn. Based on the matching results, the behavior permission information of the flow is recorded in the flow table, which effectively improves the efficiency of the matching algorithm. This invention does not involve the table item scheduling problem of the hard flow table and the soft flow table of the P4 switch.

[0038] Related technology 6 (patent number CN118018480A) discloses a differentiated storage method for large-scale SDN flow tables that supports rule dependencies. This method comprehensively considers the activity and placement cost of flow rules, takes TCAM storage yield as the evaluation criterion, and, under the premise of limited TCAM capacity, prioritizes flow rules with high storage yields and their dependent rule sets to be placed in TCAM, and the remaining flow rules are placed in SRAM. A differentiated storage method for large-scale SDN flow tables that supports rule dependencies is also designed, and TCAM flow rules must be stored together with their rule dependency sets to avoid packet forwarding semantic errors. This invention manages flow table storage for the total activity of TCAM, and does not involve the table item scheduling problem of the hard flow table and soft flow table of the P4 switch.

[0039] Related technology 7 (patent number CN117896334A) discloses a flow table compression method, system, electronic device and medium based on traffic prediction. The method determines the flow table usage rate of each switch, and takes the switch whose flow table usage rate exceeds the alarm threshold as the target switch. When the flow table usage rate of the target switch exceeds the compression threshold, the traffic prediction result of the flow table item is determined according to the data flow statistical information, and the data flow statistical information and the traffic prediction result are processed to obtain a state data set. The state data set is input into the DRL model for calculation to obtain a target action set, and the target compression strategy is determined according to the target action set, and the flow table of the target switch is compressed according to the target compression strategy. This invention compresses flow table items based on traffic prediction, and does not involve the table item scheduling problem of the hard flow table and soft flow table of the P4 switch.

[0040] In response to the cache problem of the internal matching table of P4, Related Technology 1 and Related Technology 2 designed P4 cache strategies based on behavior and LRU algorithms respectively, but neither involved the partition storage problem of the P4 matching table, as well as the table item scheduling problem of the hard flow table and the soft flow table. In response to the storage capacity limitation of the dedicated chip ASIC, Related Technology 3 designed a DRAM-based flow table storage method, but did not involve the P4 chip, as well as the partition storage and table item scheduling problems of the matching table therein.

[0041] Related technologies 4, 5 and 6 respectively manage flow table storage and optimize storage space by setting optimal timeout time, timeout linked list and compression table entries, but the above methods are not designed for P4 matching table, and do not involve the partition storage of flow table, as well as the table entry scheduling of hard flow table and soft flow table. Related technology 7 combines TCAM and SRAM for differentiated storage, but does not involve the partition storage of P4 matching table, as well as the table entry scheduling of hard flow table and soft flow table.

[0042] In summary, the related technology cannot solve the following technical problems: when the number of sessions increases sharply, a large number of flow table entries need to be stored and quickly queried, but the storage capacity of the P4 chip cannot meet this demand, resulting in a decrease in hardware forwarding efficiency, increased data packet processing delay, and reduced UPF throughput. In order to solve this problem, the present application provides a related solution in the embodiment, which is described in detail below.

[0043] According to an embodiment of the present application, a method embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0044] Figure 1 is a flow chart of a data processing method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0045] Step S102, the programmable protocol-independent packet processor switch receives packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items of all table items.

[0046] In the above step S102, the P4 switch serves as the processing core of the network data plane and receives packet data from the network layer. These data may come from different network sources, including but not limited to user devices, other user plane functional entities, other switches, and network edge devices. The P4 switch is connected to the user plane functional entity and is responsible for the processing tasks of the data plane. The user plane functional entity stores a first flow table (i.e., a soft flow table), which contains all table items related to the user plane functional entity session and covers all possible packet processing rules. The P4 switch stores a second flow table (i.e., a hard flow table), whose capacity is limited by the on-chip storage of the P4 chip, but contains some high-frequency use items extracted from the first flow table, i.e., hotspot items.

[0047] Step S104: searching the second flow table for a target table entry that matches a preset field in the packet data, wherein the target table entry includes a target key value and a target action corresponding to the target key value.

[0048] In the above step S104, when the packet data arrives at the P4 switch, the preset fields of its header, such as the source IP address, the destination IP address, the transport layer protocol (such as TCP / UDP), etc., are parsed and used to find the target table entry in the second flow table. The preset fields constitute the target key value, which is used to find in the MAT (match-action table). The target table entry contains the target key value and the target action corresponding to the key value. The target action defines the operation that the P4 switch should perform on the packet when the corresponding packet is matched, such as forwarding to a specific port, modifying the packet header, applying QoS policy, etc.

[0049] Step S106: When the target entry is found in the second flow table, execute the target action.

[0050] In the above step S106, if a target table entry matching the preset field of the packet data is found in the second flow table, it means that the processing rule of the packet has been pre-cached in the hardware, and there is no need for the operating system of the user plane functional entity to intervene. The P4 switch will directly execute the target action defined in the target table entry. This step is completed at the hardware level, making full use of the high-speed processing capability of the P4 switch and greatly reducing the delay of packet processing.

[0051] Step S108, if the target entry is not found in the second flow table, the target entry matching the preset field in the packet data is searched in the first flow table, and if the target entry is found in the first flow table, the target action is executed.

[0052] In the above step S108, when the preset field of the packet data does not match any key value in the second flow table, that is, the hard flow table is not hit, the P4 switch will communicate with the operating system of the user plane functional entity through the PI (P4 runtime implementation interface) to request to query the first flow table (soft flow table). After receiving the query request from the P4 switch, the operating system of the user plane functional entity will use the preset field of the packet data to search for matching entries in the first flow table. Since the capacity of the first flow table is not limited by hardware, any matching entry for packet data can be found here. Once a matching target entry is found in the first flow table, the target action is executed, and according to the hotspot entry update policy, it is determined whether the entry needs to be added to the second flow table to optimize the subsequent processing of the same or similar packets.

[0053] Taking actual network traffic as an example, imagine that in a 5G customized network scenario, the user plane functional entity needs to process tens of thousands of session flows. Assume that the storage capacity of the second flow table is 48,000 entries, and the actual storage capacity of the first flow table can reach 300,000 to 500,000 entries. After adopting the method of this application, the P4 switch can quickly process more than 99% of the hotspot session traffic, and the remaining traffic is handled by the UPF operating system by querying the first flow table and performing corresponding actions. This strategy significantly reduces the bottleneck of hardware storage while maintaining high forwarding performance and low latency.

[0054] According to the above steps, by intelligently allocating the flow table entries of the user plane functional entities between hardware and software, the method of the present application can significantly improve the efficiency of packet processing, especially when processing large-scale session traffic. The second flow table at the hardware stores hotspot entries, which can quickly process high-frequency packets, while the first flow table at the software serves as a backup to ensure that all packets are processed correctly, even if they appear for the first time or are used less frequently. This mechanism not only optimizes the forwarding rate, but also ensures the stability and reliability of the system, providing a solid foundation for high-performance data plane processing in 5G networks.

[0055] The following Figure 1 The steps shown are exemplary and explanatory.

[0056] According to some optional embodiments of the present application, when the target table entry is found in the first flow table, after executing the target action, the following steps may also be executed: when there is no table entry consistent with the target table entry in the packet arrival queue, the target table entry is added to the end of the packet arrival queue, wherein the packet arrival queue is used to cache the target table entry when the target table entry is not found in the second flow table; when there is a table entry consistent with the target table entry in the packet arrival queue, the first table entry in the arrival status queue is discarded, and the target table entry is moved from the packet arrival queue to the end of the arrival status queue, wherein the arrival status queue is used to identify the target table entry, and add the target table entry to the second flow table; the first table entry in the arrival status queue is deleted in the second flow table, and the target table entry is added to the second flow table.

[0057] In the above embodiment, when the P4 switch does not find a target table item that matches the preset field in the packet data in the second flow table, the table item will be identified as a potential hotspot table item. At this time, if there is no table item consistent with the target table item in the packet arrival queue (Packet Arriving Queue, PAQ), it means that this is the first time to encounter the table item, so it needs to be cached in the PAQ so that it can be judged whether it should be promoted to the arrival state queue (Arriving State Queue, ASQ) according to its frequency of use later. If the target table item is detected in the PAQ, this indicates that the same table item appears again, that is, the table item is a hotspot table item. At this time, in order to optimize the storage resources in the second flow table, the target table item needs to be promoted from the PAQ to the ASQ so that the table item can be added to the second flow table later. At the same time, in order to maintain the space of the ASQ, the first table item in the ASQ, that is, the table item that has not been used for the longest time, needs to be discarded.

[0058] When a new entry is added to the ASQ, that is, the target entry is moved from the PAQ to the end of the ASQ queue, this indicates that the usage frequency of the entry has increased, and it has become a hot entry and needs to be updated to the second flow table. At the same time, in order to maintain a certain storage space in the second flow table, it is necessary to delete the current first entry in the ASQ, that is, the entry that has not been used for the longest time, and delete the corresponding entry in the second flow table.

[0059] In this way, hotspot entries can be quickly identified and promoted to the second flow table, reducing the latency of subsequent packet processing while keeping the storage capacity of the second flow table within a reasonable range, avoiding unnecessary waste of resources. This strategy effectively balances hardware performance and software flexibility, providing an efficient and reliable flow table management mechanism for UPF devices in 5G networks.

[0060] According to some other optional embodiments of the present application, after adding a target table entry in the second flow table, the target action is performed by the following method: receiving return packet data sent by the user plane functional entity, wherein the return packet data is data of the packet data forwarded to the programmable protocol-independent packet processor switch when the user plane functional entity finds the target table entry in the first flow table; searching the second flow table for a target table entry that matches a preset field in the return packet data, and executing the target action included in the target table entry.

[0061] In the above embodiment, when the P4 switch receives the packet data returned by the operating system of the user plane functional entity, it will parse the header field of the data again and use the preset field to find a matching target table entry in the updated second flow table. Since the target table entry has been added to the second flow table, this search process will successfully find a match, so that the target action can be performed directly at the hardware level. Once a target table entry that matches the returned packet data is found in the second flow table, the P4 switch will directly execute the target action defined in the table entry. These actions may include, but are not limited to, forwarding the packet data to the intended destination, modifying the header information of the packet data to adapt to the network policy, applying specific traffic management policies, etc., depending on the business requirements and network policies of the user plane functional entity session flow.

[0062] In some optional embodiments of the present application, when there is no table entry consistent with the target table entry in the packet arrival queue, the target action is performed by the following method: receiving the target table entry sent by the user plane functional entity, adding the target table entry to the end of the packet arrival queue; and processing the packet data based on the target action in the target table entry.

[0063] In the above embodiment, when the P4 switch fails to find a target table item that matches the preset field of the packet data in the second flow table, it will transfer the packet data to the user plane functional entity for processing. The operating system of the user plane functional entity will find the matching target table item according to the rules in the first flow table (soft flow table), and return the detailed information of the target table item, including the target key value and the target action, to the P4 switch. After receiving the target table item returned by the user plane functional entity, the P4 switch checks whether the target table item already exists in the PAQ. If there is no table item consistent with the target table item in the PAQ, then the P4 switch adds the target table item to the end of the PAQ. This operation follows the first-in-first-out principle, that is, the newly arrived table item is placed at the end of the queue, and the earliest arrived table item is placed at the front of the queue. Subsequently, the P4 switch performs corresponding processing operations on the packet data according to the target action in the target table item, which may include but is not limited to data forwarding, data packet header modification, or QoS policy applied to the packet. The execution of the target action will be completed at the hardware level of the P4 switch to ensure the efficiency and timeliness of data processing.

[0064] As some optional embodiments of the present application, the data processing method also includes the following steps: when preset conditions are met, pre-configured table items are generated according to historical traffic data within a preset historical period, and the pre-configured table items are added to the second flow table, wherein the preset conditions include: the maximum number of concurrent connections supported by the user plane functional entity is greater than a first preset threshold and / or the increase ratio of the traffic data forwarded by the user plane functional entity per unit time is greater than a second preset threshold and / or the packet loss rate of the traffic data forwarded by the user plane functional entity is greater than a third preset threshold.

[0065] In the above embodiment, in order to ensure the efficient processing capability of the user plane functional entity in the face of large-scale concurrent connections and traffic growth, a pre-configured table item generation strategy based on historical traffic data analysis is proposed. This strategy is activated when specific preset conditions are met, and aims to dynamically optimize the second flow table (hard flow table), that is, the flow table stored inside the P4 switch, to improve the response speed of hardware processing and reduce the packet loss rate. The following are the detailed implementation steps of this mechanism.

[0066] The check of preset conditions is the core trigger point of this strategy, which includes the following three main indicators: The maximum number of concurrent connections supported by UPF exceeds the first preset threshold: This indicates that UPF is facing high-load connection pressure and needs to further optimize the flow table configuration to improve processing efficiency. The increase rate of traffic data per unit time exceeds the second preset threshold: This reflects the traffic burst situation. The generation of pre-configured table items will help to deal with burst traffic and ensure the smoothness of data forwarding. The packet loss rate of traffic data forwarded by UPF exceeds the third preset threshold: A high packet loss rate usually means that there are problems with flow table management and hardware processing efficiency, and it is necessary to adjust it by adding pre-configured table items to reduce the packet loss rate. When any one or more of the above preset conditions are met, the historical traffic data within the preset historical time period is analyzed, the frequently occurring traffic patterns are identified, and the corresponding pre-configured table items are generated. Pre-configured table items are flow table items constructed in advance based on historical data to predict the traffic characteristics that may appear in the future, aiming to reduce the processing delay and packet loss rate of future data packets.

[0067] Based on the generated pre-configured entries, the UPF operating system sends an update instruction to the P4 switch through the PI interface, which contains the key value and action of the new entry. After receiving the instruction, the P4 switch checks the current remaining capacity of the second flow table to ensure that there is enough space to add the pre-configured entries. If the capacity of the second flow table is full, it is necessary to first delete the least recently used entries from the second flow table based on the freshness of the entries in the ASQ to make room for the pre-configured entries. The pre-configured entries are added to the second flow table to complete the storage and preparation of the pre-configured entries at the hardware level to cope with the upcoming traffic peak.

[0068] The above mechanism can significantly improve the processing efficiency of UPF in high concurrency and traffic burst situations by dynamically analyzing historical traffic data, generating pre-configured table entries and adding them to the hard flow table of the P4 switch. The generation and addition process of pre-configured table entries, based on the current load situation and historical traffic characteristics of UPF, effectively alleviates the bottleneck of hardware storage, optimizes the use of hardware resources, and reduces the delay and packet loss rate during data forwarding, thereby improving the stability of the entire 5G network architecture and user service quality.

[0069] Preferably, generating pre-configured table items based on historical traffic data within a preset historical time period can be achieved by the following method: based on the quintuple information of the historical traffic data, identifying different session flows in the historical traffic data, wherein the quintuple information includes: source IP address, destination IP address, source port information, destination port information and protocol type information; determining the network traffic data of each session flow, wherein the network traffic data includes at least one of the following: total data packet capacity, average data packet capacity and data packet arrival frequency; performing feature extraction on the network traffic data to obtain target features, using the target features to train a prediction model, and obtaining a trained prediction model when a preset stop condition is met; applying the trained prediction model to predict hotspot session flows within a preset time period in the future, and determining the pre-configured table items based on the hotspot session flows.

[0070] Specifically, based on the five-tuple information of historical traffic data (source IP address, destination IP address, source port information, destination port information and protocol type information), the UPF operating system can identify different session flows in historical traffic data. The five-tuple is an identifier used to uniquely identify a session in network communication. By analyzing the five-tuple information, it is possible to identify which session flows are active within a specific historical period.

[0071] For each identified session flow, its network traffic data is further analyzed. The network traffic data includes but is not limited to indicators such as total packet capacity, average packet capacity, and packet arrival frequency. These data reflect the activity level and data transmission characteristics of the session flow, which are crucial to understanding the usage pattern of the session flow.

[0072] Feature extraction is performed on network traffic data to obtain feature indicators for prediction, such as packet arrival frequency, average packet size, etc. These features will be used to train the prediction model to facilitate the prediction of future hotspot session flows. The model training process must be completed when the preset stop conditions are met. For example, when the model's prediction error is lower than a certain threshold, or the training rounds reach a set value, the model training stops. At this time, the model is considered to have been trained and can be used to predict future traffic.

[0073] The trained prediction model is used to predict future network traffic data, with a special focus on hot session flows within a preset time period in the future. Hot session flows refer to sessions with large data traffic and high packet arrival frequency within a specific time period. Such session flows have a significant impact on network performance. Therefore, pre-configuring their table entries can significantly improve the processing speed and efficiency of the P4 switch.

[0074] Based on the prediction results, the UPF operating system will determine which session flow entries need to be pre-configured. These pre-configured entries contain matching rules and actions related to hot session flows, which will be added to the second flow table (hard flow table) before the predicted future traffic peak to ensure that the P4 switch can directly process these hot session flows without querying the first flow table (soft flow table) in the UPF operating system, thereby significantly reducing processing delay and packet loss rate.

[0075] Assume that in a certain 5G customized network scenario, UPF receives conversation flows from multiple sources and destinations, which contain a large amount of data transmission. The UPF operating system collects traffic data in the past 24 hours (preset historical duration) and identifies specific conversation flows based on quintuple information. By analyzing the traffic data of these conversation flows, features such as packet arrival frequency and average packet size are extracted, and these features are used to train the prediction model. The model is trained until its prediction error is less than 1% (preset stop condition).

[0076] The prediction model successfully predicts the hot session flows that will appear in the next hour (preset time in the future). These hot session flows are characterized by high frequency of packet arrival and high data transmission volume. Based on the prediction results, the UPF operating system determines the pre-configured table entries related to these hot session flows and adds them to the second flow table of the P4 switch through the PI interface.

[0077] Through this mechanism, the P4 switch can prepare and optimize its hardware resources in advance to cope with the upcoming high-traffic sessions. The generation and addition of pre-configured table entries enable the P4 switch to quickly process hotspot session flows directly at the hardware level, significantly reducing latency and improving data processing throughput and network stability. This intelligent prediction and pre-configuration strategy provides an advanced and effective solution for data plane processing in the 5G network architecture, helping to improve the efficiency of large-scale data transmission and user experience.

[0078] As other optional embodiments of the present application, the target table entry is searched in the first flow table or the second flow table by the following method, including: parsing the header field of the packet data to obtain the packet characteristics; traversing the table items in the flow table until the target table entry matching the packet characteristics is found.

[0079] Specifically, the P4 switch or UPF operating system constructs a key value based on the header field. The key value is a two-tuple that specifies the packet header field used for matching and the matching method. Based on the obtained key value, all table entries are queried. Each table entry must contain key and action attributes, which are paired according to the key value. Determine whether there is a corresponding table entry. If so, obtain the action corresponding to the key. Otherwise, end the process directly.

[0080] Figure 2 is a flow chart of a method for caching and scheduling a user plane functional entity flow table based on P4 according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0081] Step S201, the operating system initializes table A, table B, PAQ, and ASQ.

[0082] Figure 3 is a structural diagram of a matching table partitioning and classification storage method according to an embodiment of the present application, Figure 3 The structure of the P4-based UPF device includes a UPF operating system ( Figure 3 No. 1), P4 switch ( Figure 3 2), and the interactive interface cmd between the UPF operating system and the P4 switch ( Figure 3 No. 3).

[0083] The UPF operating system performs the UPF control plane function and provides the necessary network information and forwarding table entries for the data plane to forward packets. The P4 switch performs the UPF data plane function and implements packet processing and forwarding logic. The cmd interface corresponds to the P4-runtime Implementation interface (PI), which is the information exchange interface between the UPF operating system and the P4 switch. The storage of the UPF flow table is divided into A table ( Figure 3 4), also known as the soft flow table, and the B table ( Figure 3 5), also known as the hard flow table. The UPF operating system stores table A, which contains all the entries of the UPF session; the P4 switch stores table B, which only contains hotspot entries. Table B is a subset of table A. In tables A and B, each entry contains two necessary attributes: key (K) and action (A). The method of using key and action is: first build a key based on the packet header, use the key value to find the corresponding action in the table and execute it.

[0084] Initialize two management queues, namely the packet arrival queue PAQ and the arrival status queue ASQ. PAQ caches the matching entries of the packets that do not hit the B table, and ASQ caches the matching entries of the packets that hit the B table and the entries moved in from PAQ. Both are configured with the same capacity.

[0085] Step S202: User plane grouping triggers updating of table A and table B.

[0086] Figure 4 is a flow chart of looking up a table to obtain a matching entry when a user plane packet arrives according to an embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:

[0087] Step S401, first receiving an input packet, where the input packet is a packet sent by other switches.

[0088] Step S402, the P4 switch parses the input packet header field and queries the B table entry.

[0089] Figure 5 is a flow chart of a table lookup method according to an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:

[0090] Step S501, receiving an input packet, where the input packet is a packet received by a P4 switch or a UPF operating system.

[0091] Step S502, the P4 switch or UPF operating system constructs a key value according to the header field. The key value is a two-tuple that specifies the packet header field used for matching and the matching method.

[0092] Step S503: query all entries according to the key obtained in step S502. Each entry must contain key and action attributes, and pair them according to the key value.

[0093] Step S504, determine whether there is a corresponding entry, if so, go to step S505, otherwise the process ends directly.

[0094] Step S505, obtaining the action corresponding to the key.

[0095] Step S403, determine whether a matching entry is found in table B, that is, whether it is a hit. If it is a hit, go to step S404; otherwise, go to step S406.

[0096] Step S404: Obtain a matching entry.

[0097] Step S405, updating the ASQ according to the matching entry obtained in step S404, and the specific updating method is shown in step S203.

[0098] In step S406, the P4 switch transfers the packet to the UPF operating system, which parses the packet header and queries table A in the same manner as in step S402.

[0099] Step S407, updating the PAQ and ASQ according to the matching entries obtained in step S406, and the specific updating method is shown in step S203.

[0100] Step S203: the operating system updates the PAQ and ASQ.

[0101] According to the source of the matching entry in step S202 (obtained from table B or table A), the update method of the management queues PAQ and ASQ is as follows:

[0102] Step S2031, if the matching entry is obtained by querying the B table, only the ASQ is updated, and the update rule is to move the matching entry to the end of the ASQ queue.

[0103] Step S2032: If the matching entry is obtained by querying Table A, the PAQ and ASQ update method is as follows: Figure 6 As shown, Figure 6 : is a flowchart of a PAQ and ASQ updating method according to an embodiment of the present application, the method comprising the following steps:

[0104] Step S601, the input table item is a matching table item obtained by querying table A;

[0105] Step S602, determine whether the entry is an existing entry in the PAQ, if so, go to step S603, otherwise go to step S605;

[0106] Step S603, first discard the entry at the head of the ASQ queue, and then move the entry from the PAQ to the tail of the ASQ queue;

[0107] Step S604, triggering the B table to be updated, the update rule is to delete the discarded table items in the ASQ from the B table, and add the newly added table items in the ASQ to the B table;

[0108] Step S605: add the entry to the end of the PAQ queue.

[0109] Figure 7 FIG. 1 is a flowchart of another method for caching and scheduling a user plane functional entity flow table based on P4 according to an embodiment of the present application. Figure 7 As shown, the method comprises the following steps:

[0110] Step S701: the receiving object of this step is a packet sent by the switch, and the subsequent steps are the specific forwarding process of the packet.

[0111] Step S702, the processing object of this step is the input packet of step S701, and the P4 switch queries the B table according to the packet header. The specific table query process is that the P4 switch constructs a key value according to the packet header field, and searches the B table for an entry with the same key value according to the key value. A standard MAT table entry must contain key and action attributes, and other optional attributes such as size, default_action, counters, and const entries are optional. The key attribute is a pair of tuples that specify the packet field and matching method used for matching. The action attribute describes how to process the packet header field and metadata, which is the intermediate data generated during the execution of the P4 program. The result of this step is to obtain the action value of the matching table entry, or no matching table entry is found.

[0112] Step S703, the function of this step is to generate different processing branches according to the result of step S702. If a matching entry is found in table B, it is a "hit", then go to step S704; otherwise, it is a "miss", then go to step S706. The table query result ("hit" or "miss") determines whether the subsequent forwarding process of the incoming packet is directly executed by the P4 switch or needs to be transferred to the UPF operating system for processing to obtain the forwarding port address.

[0113] Step S704: After the P4 switch finds the matching entry, it obtains the corresponding action and directly forwards the current packet. This step is hardware direct forwarding, with fast processing speed and low forwarding delay.

[0114] Step S705, after forwarding is completed, the ASQ needs to be updated. The update rule is to move the matching table entry of the packet forwarded by step S704 in the ASQ to the end of the queue. ASQ essentially manages the freshness of the table entries. The management objects are all the table entries in the B table and the table entries moved in from the PAQ. The management rule is to move the most recently used table entry in the B table to the end of the queue, so that the table entry that has not been used for the longest time will be moved to the head of the queue. In addition, the situation where a table entry in the PAQ is moved into the ASQ will occur in the step S708 branch. At this time, the ASQ will first discard the table entry at the head of the queue and then add the new table entry.

[0115] Step S706, the UPF operating system parses the packet header and queries table A. Since table A contains all entries of the UPF session flow, this step will be able to find a matching entry and obtain the corresponding action. The table query method is the same as step S702.

[0116] Step S707, determine whether the matching entry obtained in step S706 is already in the PAQ queue, if so, go to step S708, otherwise go to step S712. PAQ reflects the frequency of use of the entry, it manages all the matching entries obtained by the grouping transferred to the UPF operating system for processing, and the management rules adopt the first-in-first-out and duplicate removal principles. Specifically, the newly arrived entry is placed at the end of the PAQ queue according to the first-in-first-out principle. If the entry is an existing entry in the PAQ (that is, it appears twice or more), the entry is moved to the ASQ.

[0117] Step S708: When the entry in step S707 is an existing entry in the PAQ, the entry is moved from the PAQ to the ASQ by first discarding the entry at the head of the ASQ queue, then moving the entry to the tail of the ASQ queue, and at the same time discarding the entry in the PAQ.

[0118] Step S709: This step is used to trigger the update of the B-table entries according to the ASQ change state. The update rule is to delete the entries discarded by the ASQ from the B-table and replace them with the entries added to the ASQ. As long as a new entry is added to the ASQ, the B-table will be triggered to be updated.

[0119] In step S710, the UPF operating system returns the packet to the P4 switch. There is no need to return the forwarding port here because the forwarding table entry corresponding to the packet has been updated in table B. In addition, it should be noted that the UPF operating system cannot directly forward the packet and still needs to forward the packet to the P4 switch for processing. Therefore, the forwarding delay of step S706 branch is higher than that of step S704 branch.

[0120] Step S711, the P4 switch forwards the return packet, which can be divided into two cases:

[0121] 1. For the packet transmitted from step S710, the P4 switch searches the B table again for forwarding because a new matching entry has been added to the B table.

[0122] 2. The packet transmitted from step S713 is directly forwarded by the P4 switch according to the returned forwarding port value.

[0123] Step S712: If the newly arrived entry is not an existing entry in the PAQ, only the PAQ is updated, and there is no need to update the ASQ. The update rule is to add the entry to the end of the PAQ queue.

[0124] Step S713: This step is for the case where the matching entry of the input packet is not in the B table and the entry does not meet the conditions for joining the B table. At this time, the UPF operating system needs to return the packet and the forwarding port value to the P4 switch at the same time, and the P4 switch will forward it later.

[0125] The capacity of the B table designed in this application is limited by the hardware capacity of the P4 switch. After adopting the technical solution of this application, the capacity is expanded to the capacity of the A table designed by the present invention. The B table designed in this application is stored in the P4 chip, using the longest prefix matching, and the actual storage capacity is 48,000 entries. The A table designed in this application is stored in the operating system user space. The actual storage capacity of a typical Internet backbone router reaches 300,000 to 500,000 entries. The specific capacity gain is calculated as follows:

[0126] Assume that the capacity of table A is R A , that is, the total number of UPF session entries is R A , table B capacity is R B Therefore, the probability that the incoming packet hits table B is The probability of missing table B is 1-P h .

[0127] The packet that hits the B table is forwarded by the P4 switch, which includes three steps: (1) constructing a key based on the packet header or metadata; (2) querying the B table based on the key to obtain the action corresponding to the key; (3) executing the corresponding action. The processing time of the above steps is the packet forwarding delay of the P4 switch, denoted as t p The packets that do not hit the B table are first queried by the UPF operating system in the A table, and then returned to the P4 switch for forwarding. The forwarding delay is t u . Normally, t p <t u Therefore, the average forwarding delay expression can be obtained as:

[0128]

[0129] Transforming the above formula yields:

[0130]

[0131] Then the average forwarding delay in the formula is and UPF operating system forwarding delay t u Both are represented by t p The relationship of t u =c 2 t p , where c1 and c2 are constants. The above formula can be rewritten as:

[0132]

[0133] The capacity gain generated by the method described in this application is defined as the ratio of the capacity of meter A to the capacity of meter B. The capacity gain expression is:

[0134]

[0135] The above formula shows that the capacity gain is related to c1 and c2.

[0136] Figure 8 is a numerical analysis result diagram of a capacity gain according to an embodiment of the present application, combined with Figure 8 And the capacity gain expression, we can get the following characteristics of K changing with c1 and c2:

[0137] When c1=1, the capacity gain K=1, which means that when the requirement When it is the same as tp, no capacity gain can be obtained;

[0138] When c1=c2, the capacity gain K=∞, which means that when the requirement When tu is the same, the capacity gain can reach infinity;

[0139] When c1≠c2 and c1>1, corresponding to different values ​​of c1 and c2, the obtained capacity gain is shown in Table 1.

[0140] Figure 8 The numerical calculation results are shown in the following table:

[0141]

[0142]

[0143] Fig. 9 is a structural diagram of a data processing device according to an embodiment of the present application, such as Fig. 9 As shown, the device comprises:

[0144] The receiving module 92 is used to instruct the programmable protocol-independent packet processor switch to receive packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, and the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, and the second flow table includes some table items of all table items.

[0145] The search module 94 is used to search the second flow table for a target table entry that matches a preset field in the packet data, wherein the target table entry includes a target key value and a target action corresponding to the target key value.

[0146] The first execution module 96 is used to execute a target action when a target entry is found in the second flow table.

[0147] The second execution module 98 is used to search for a target entry matching a preset field in the packet data in the first flow table if the target entry is not found in the second flow table, and to execute a target action if the target entry is found in the first flow table.

[0148] Optionally, when the target table entry is found in the first flow table, after executing the target action, the following steps are also included: when there is no table entry consistent with the target table entry in the packet arrival queue, the target table entry is added to the end of the packet arrival queue, wherein the packet arrival queue is used to cache the target table entry when the target table entry is not found in the second flow table; when there is a table entry consistent with the target table entry in the packet arrival queue, the first table entry in the arrival status queue is discarded, and the target table entry is moved from the packet arrival queue to the end of the arrival status queue, wherein the arrival status queue is used to identify the target table entry and add the target table entry to the second flow table; the first table entry in the arrival status queue is deleted from the second flow table, and the target table entry is added to the second flow table.

[0149] Optionally, after adding the target table entry in the second flow table, the target action is performed by the following method: receiving return packet data sent by the user plane functional entity, wherein the return packet data is data of the packet data forwarded to the programmable protocol-independent packet processor switch when the user plane functional entity finds the target table entry in the first flow table; searching the second flow table for a target table entry that matches a preset field in the return packet data, and executing the target action included in the target table entry.

[0150] Optionally, when there is no entry consistent with the target entry in the packet arrival queue, the target action is performed by the following method: receiving the target entry sent by the user plane functional entity, adding the target entry to the end of the packet arrival queue; and processing the packet data based on the target action in the target entry.

[0151] Optionally, the data processing device is also used to perform the following steps: when preset conditions are met, generate pre-configured table items based on historical traffic data within a preset historical period, and add the pre-configured table items to the second flow table, wherein the preset conditions include: the maximum number of concurrent connections supported by the user plane functional entity is greater than a first preset threshold and / or the increase ratio of the traffic data forwarded by the user plane functional entity per unit time is greater than a second preset threshold and / or the packet loss rate of the traffic data forwarded by the user plane functional entity is greater than a third preset threshold.

[0152] Optionally, preconfigured table items are generated based on historical traffic data within a preset historical time period, including: identifying different session flows in the historical traffic data based on quintuple information of the historical traffic data, wherein the quintuple information includes: source IP address, destination IP address, source port information, destination port information and protocol type information; determining network traffic data for each session flow, wherein the network traffic data includes at least one of the following: total data packet capacity, average data packet capacity and data packet arrival frequency; performing feature extraction on the network traffic data to obtain target features, using the target features to train a prediction model, and obtaining a trained prediction model when a preset stop condition is met; applying the trained prediction model to predict hotspot session flows within a preset time period in the future, and determining preconfigured table items based on the hotspot session flows.

[0153] Optionally, the target table entry is searched in the first flow table or the second flow table by the following method: parsing the header field of the packet data to obtain the packet characteristics; traversing the table entries in the flow table until the target table entry matching the packet characteristics is found.

[0154] It should be noted that the above Fig. 9 The modules in the embodiment may be program modules (e.g., a set of program instructions for implementing a specific function) or hardware modules. For the latter, they may be expressed in the following forms, but are not limited thereto: the expression form of the above modules is a processor, or the functions of the above modules are implemented by a processor.

[0155] It should be noted that Fig. 9 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0156] Fig.10 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a data processing method. Fig.10 As shown, the computer terminal 100 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission module 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.10 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.10More or fewer components as shown, or with Fig.10 Different configurations are shown.

[0157] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 100. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0158] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the data processing method in the embodiment of the present application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, the above-mentioned data processing method is realized. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the computer terminal 100 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0159] The transmission module 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 100. In one example, the transmission module 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 1006 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0160] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 100 .

[0161] It should be noted that, in some optional embodiments, the above Fig.10The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Fig.10 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.

[0162] It should be noted that Fig.10 The computer terminal shown is used to execute Figure 1 The data processing method shown, therefore the relevant explanations in the execution method of the above command are also applicable to the electronic device and will not be repeated here.

[0163] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the above data processing method.

[0164] A program for executing the following functions in a non-volatile storage medium: a programmable protocol-independent packet processor switch receives packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items in all table items; searching the second flow table for a target table item that matches a preset field in the packet data, wherein the target table item includes a target key value and a target action corresponding to the target key value; when the target table item is found in the second flow table, executing the target action; when the target table item is not found in the second flow table, searching the first flow table for a target table item that matches the preset field in the packet data, and when the target table item is found in the first flow table, executing the target action.

[0165] An embodiment of the present application further provides an electronic device, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the above data processing method is executed when the program is run.

[0166] The processor is used to run a program that performs the following functions: a programmable protocol-independent packet processor switch receives packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items in all table items; searching the second flow table for a target table item that matches a preset field in the packet data, wherein the target table item includes a target key value and a target action corresponding to the target key value; if the target table item is found in the second flow table, executing the target action; if the target table item is not found in the second flow table, searching the first flow table for a target table item that matches the preset field in the packet data, and if the target table item is found in the first flow table, executing the target action.

[0167] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0168] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0169] In the above-mentioned embodiments of the present application, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0170] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0171] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0172] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0173] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0174] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data processing method, characterized in that: include: The programmable protocol-independent packet processor switch receives packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, the user plane function entity stores a first flow table, the first flow table includes all table items related to the user plane function session, and the programmable protocol-independent packet processor switch stores a second flow table, the second flow table includes some table items of the all table items; Searching the second flow table for a target table entry that matches a preset field in the packet data, wherein the target table entry includes a target key value and a target action corresponding to the target key value; When the target entry is found in the second flow table, executing the target action; If the target entry is not found in the second flow table, the first flow table is searched for a target entry matching a preset field in the packet data, and if the target entry is found in the first flow table, the target action is executed.

2. The method according to claim 1, characterized in that When the target entry is found in the first flow table, after executing the target action, the method further includes: If there is no entry consistent with the target entry in the packet arrival queue, add the target entry to the tail of the packet arrival queue, wherein the packet arrival queue is used to cache the target entry if the target entry is not found in the second flow table; If there is an entry consistent with the target entry in the packet arrival queue, discard the first entry in the arrival status queue, and move the target entry from the packet arrival queue to the end of the arrival status queue, wherein the arrival status queue is used to identify the target entry and add the target entry to the second flow table; The first table entry in the arrival status queue is deleted in the second flow table, and the target table entry is added in the second flow table.

3. The method according to claim 2, characterized in that After adding the target entry in the second flow table, the target action is executed by the following method: receiving return packet data sent by a user plane function entity, wherein the return packet data is data for forwarding the packet data to the programmable protocol-independent packet processor switch when the user plane function entity finds the target table entry in the first flow table; The target table entry matching the preset field in the returned packet data is searched in the second flow table, and the target action included in the target table entry is executed.

4. The method according to claim 2, characterized in that: When there is no entry consistent with the target entry in the packet arrival queue, the target action is performed by the following method: receiving a target table entry sent by a user plane function entity, and adding the target table entry to the tail of a packet arrival queue; The packet data is processed based on the target action in the target table entry.

5. The method according to claim 2, characterized in that: The method also includes: when preset conditions are met, generating a pre-configured table entry based on historical traffic data within a preset historical time period, and adding the pre-configured table entry to the second flow table, wherein the preset conditions include: the maximum number of concurrent connections supported by the user plane functional entity is greater than a first preset threshold and / or the increase ratio of the traffic data forwarded by the user plane functional entity per unit time is greater than a second preset threshold and / or the packet loss rate of the traffic data forwarded by the user plane functional entity is greater than a third preset threshold.

6. The method according to claim 5, characterized in that Generate pre-configured table entries based on historical traffic data within a preset historical period, including: Based on the five-tuple information of the historical traffic data, identifying different session flows in the historical traffic data, wherein the five-tuple information includes: source IP address, destination IP address, source port information, destination port information and protocol type information; determining network traffic data for each session flow, wherein the network traffic data includes at least one of: total packet capacity, average packet capacity, and packet arrival frequency; Extracting features from the network traffic data to obtain target features, using the target features to train a prediction model, and obtaining a trained prediction model when a preset stop condition is met; The trained prediction model is applied to predict the hotspot session flow within a preset time period in the future, and the preconfigured table items are determined according to the hotspot session flow.

7. The method according to claim 1, characterized in that Searching for the target entry in the first flow table or the second flow table by the following method includes: Parsing the header field of the packet data to obtain packet characteristics; The table entries in the flow table are traversed until the target table entry matching the packet feature is found.

8. A data processing device, characterized in that: include: A receiving module, configured to instruct a programmable protocol-independent packet processor switch to receive packet data, wherein the programmable protocol-independent packet processor switch is connected to a user plane function entity, a first flow table is stored in the user plane function entity, the first flow table includes all table items related to the user plane function session, and a second flow table is stored in the programmable protocol-independent packet processor switch, the second flow table includes some table items of the all table items; A search module, configured to search the second flow table for a target table entry that matches a preset field in the packet data, wherein the target table entry includes a target key value and a target action corresponding to the target key value; A first execution module, configured to execute the target action when the target table entry is found in the second flow table; The second execution module is used to search for a target table entry matching a preset field in the packet data in the first flow table if the target table entry is not found in the second flow table, and to execute the target action if the target table entry is found in the first flow table.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the data processing method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the data processing method according to any one of claims 1 to 7 when running.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Flow table compression method and system based on flow prediction, electronic equipment and medium

    CN117896334A