Message processing method and device, nonvolatile storage medium and electronic equipment
By using a preset access control table and rule management pool in the UPF network element, the target rules can be quickly determined, which solves the problems of low forwarding plane performance and low PDR matching efficiency of UPF software, and achieves efficient packet processing, meeting the high bandwidth and low latency requirements of 5G customized network services.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM INTELLIGENT NETWORK TECHNOLOGY CO LTD
- Filing Date
- 2023-08-16
- Publication Date
- 2026-07-07
AI Technical Summary
Existing UPF software forwarding plane implementation methods have low performance and scalability, data packet distribution technology depends on specific hardware, and PDR matching efficiency is low, which cannot meet the needs of 5G customized network services.
By obtaining the target message flow tuple information of the message to be processed, and utilizing the preset access control list and preset rule management pool, the target rule can be quickly determined, reducing multiple rule matchings and achieving efficient message processing.
It improves the matching efficiency of Message Detection Rules (PDR) and meets the high bandwidth, low latency and low jitter requirements of 5G customized network services.
Smart Images

Figure CN117061634B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communications, and more specifically, to a message processing method, apparatus, non-volatile storage medium, and electronic device. Background Technology
[0002] With the development of 5G customized network services, further segmentation of industry services is a major trend. Current UPF software forwarding plane implementation methods suffer from low performance and scalability. Data packet distribution technology relies on specific hardware, has a limited number of configurable rules, only supports single-time distribution during NIC packet reception, exhibits poor scalability, and involves repeated PDR matching for the same data stream, resulting in low matching efficiency.
[0003] There is currently no effective solution to the problem of low PDR matching efficiency. Summary of the Invention
[0004] This invention provides a message processing method, apparatus, non-volatile storage medium, and electronic device to at least solve the technical problem of low matching efficiency of existing message detection rule (PDR).
[0005] According to one aspect of the present invention, a message processing method is provided, comprising: acquiring a message to be processed, wherein the message to be processed carries target message flow tuple information; analyzing the message to be processed by invoking a preset access control table, and determining a preset group matching the target message flow tuple information as a target group, wherein the preset access control table includes: a plurality of preset groups, and preset message flow tuple information corresponding to each preset group, each preset group being used to record at least one preset rule identifier; if the target group exists in the preset access control table, determining a preset instruction corresponding to the target group as a target instruction from a preset instruction set, wherein... In this process, the preset instruction set includes multiple preset instructions, each preset instruction corresponding to a preset group. Each preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index. The preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool. The target instruction is invoked to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The message to be processed is processed based on at least one target rule.
[0006] Optionally, analyzing the message to be processed by calling a preset access control table to determine the preset group that matches the target message flow tuple information as the target group includes: calling the preset access control table to identify the target message flow tuple information in the message to be processed, wherein the target message flow tuple information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID), wherein the 5-tuple includes: source Internet Protocol (IP) address, destination Internet Protocol (IP) address, source port, destination port, and transport layer protocol number; converting the target message flow tuple information into a target key value, wherein the target key value includes at least: the tunnel endpoint identifier (TEID), the destination Internet Protocol (IP) address, and the source Internet Protocol (IP) address; querying the target group in the preset access control table based on the target key value, wherein the preset access control table pre-records the correspondence between the preset groups and the preset key values.
[0007] Optionally, converting the target packet flow tuple information into a target key value includes: determining the transmission direction and packet detection information (PDI) of the packet to be processed based on the target packet flow tuple information, wherein the transmission direction includes an uplink direction and a downlink direction; when the transmission direction is the uplink direction, the packet detection information PDI carries a full tunnel endpoint identifier (F-TEID); when the transmission direction is the downlink direction, the packet detection information PDI carries a user internet protocol address (UE IP); generating the target key value based on the transmission direction and the packet detection information, wherein when the transmission direction is the uplink direction, the target key value adds an invalid UE IP identifier after the F-TEID; when the transmission direction is the downlink direction, the target key value adds an invalid F-TEID identifier to the UE IP.
[0008] Optionally, invoking the target instruction to obtain at least one target rule from the preset rule management pool includes: obtaining a preset table index corresponding to each preset rule identifier in the target group as a target table index; invoking the target instruction to determine a preset rule index corresponding to each target table index as a target rule index; and obtaining the preset rule associated with the preset rule identifier from the preset rule management pool according to the target rule index as the target rule.
[0009] Optionally, before acquiring the message to be processed, the method further includes: acquiring the Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF); identifying the session type of the PFCP session, wherein the session type includes: a first type indicating the creation of a session and a second type indicating the deletion of a session; and managing preset instructions in the preset instruction set according to the session type.
[0010] Optionally, when the session type is the first type, managing the preset instructions in the preset instruction set according to the session type includes: managing the Packet Switching Control Protocol (PFCP) session through the preset rule management pool; determining at least one preset rule indicated by the PFCP session and the preset rule index corresponding to the preset rule; recording at least one preset rule identifier indicated by the PFCP session, the preset table index corresponding to the preset rule identifier, and a preset key value as a matching condition for the preset rule identifier through the preset access control table; and establishing an association between the preset table index and the preset table index based on the association between the preset rule and the preset rule identifier through the preset instructions.
[0011] Optionally, recording the preset key value indicated by the Packet Switching Control Protocol (PFCP) session as a matching condition for the preset rule identifier through the preset access control table includes: traversing the Packet Inspection Rules (PDRs) in the PFCP session, wherein the PDRs are used to record at least one preset rule and an associated preset rule identifier; identifying the Packet Inspection Information (PDI) in the PDRs, wherein the PDIs are used to match the preset rule identifier, and the PDIs carry the User Internet Protocol Address (UE) IP or the Full Tunnel Endpoint Identifier (F-TEID); determining the preset key value matching the preset rule identifier based on the PDIs, wherein the preset key value includes at least: the Tunnel Endpoint Identifier (TEID), the Destination Internet Protocol (IP) address, and the Source Internet Protocol (IP) address. If the PDI carries the User Internet Protocol Address (UE) IP, the Tunnel Endpoint Identifier (TEID) and the Destination Internet Protocol (IP) address are invalid identifiers. The IP determines the source Internet Protocol IP address. If the Packet Inspection Information (PDI) carries the Full Tunnel Endpoint Identifier (F-TEID), the Tunnel Endpoint Identifier (TEID) and the destination Internet Protocol IP address are determined based on the Full Tunnel Endpoint Identifier (F-TEID). The source Internet Protocol IP address is an invalid identifier.
[0012] Optionally, when the session type is the second type, managing the preset instructions in the preset instruction set according to the session type includes: identifying at least one preset rule of the Packet Switching Control Protocol (PFCP) session indication in the preset access control table as a preset group; determining the preset instruction corresponding to the preset group in the preset instruction set; deleting the corresponding preset rule in the preset rule management pool according to the preset rule index recorded in the preset instruction; deleting the corresponding preset rule identifier in the preset access control table according to the preset table index recorded in the preset instruction; and deleting the preset instruction used to represent the correspondence between the preset rule index and the preset table index.
[0013] According to another aspect of the present invention, a message processing apparatus is also provided, comprising: an acquisition module, configured to acquire a message to be processed, wherein the message to be processed carries target message flow tuple information; an analysis module, configured to call a preset access control table to analyze the message to be processed and determine a preset group matching the target message flow tuple information as a target group, wherein the preset access control table includes: a plurality of preset groups and a preset message flow tuple corresponding to each preset group, each preset group being used to record at least one preset rule identifier; and a determination module, configured to determine, in a preset instruction set, if the target group exists in the preset access control table. The preset instruction corresponding to the target group is a target instruction, wherein the preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index, the preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool; the invocation module is used to invoke the target instruction to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group; the processing module is used to process the message to be processed based on at least one target rule.
[0014] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium being used to store a program, wherein the program controls the device where the non-volatile storage medium is located to execute the above-described message processing method during runtime.
[0015] According to another aspect of the present invention, an electronic device is also provided, including: a memory and a processor, the processor being configured to run a program stored in the processor, wherein the program executes the above-described message processing method when it runs.
[0016] In this embodiment of the invention, a message to be processed is obtained, wherein the message to be processed carries: target message flow tuple information; a preset access control table is invoked to analyze the message to be processed, and a preset group matching the target message flow tuple information is determined as the target group, wherein the preset access control table includes: multiple preset groups, and preset message flow tuple information corresponding to each preset group, each preset group is used to record at least one preset rule identifier; if a target group exists in the preset access control table, a preset instruction corresponding to the target group is determined as the target instruction from a preset instruction set, wherein the preset instruction set includes multiple preset instructions, each preset instruction corresponds to the preset group, and each preset instruction is used to record at least one preset table index and At least one preset rule index is established, with the preset table index indicating the location of the preset rule identifier in the preset access control table and the preset rule index indicating the location of the preset rule associated with the preset rule identifier in the preset rule management pool. A target instruction is invoked to retrieve at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The packet to be processed is then processed based on at least one target rule. This allows the preset instruction to quickly determine the target rule used for processing the packet to be processed, eliminating the need for multiple rule matches using Packet Detection Rule (PDR), thus improving the efficiency of rule matching and solving the problem of low matching efficiency in existing Packet Detection Rule (PDR) systems. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0018] Figure 1 This is a flowchart of a message processing method according to an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram illustrating an optimized UPF forwarding efficiency according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of an architecture for optimizing UPF forwarding efficiency according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram illustrating the execution of a session management process by a session management module according to an embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram illustrating the flow table lookup process performed by a flow table lookup module according to an embodiment of the present invention;
[0023] Figure 6This is a schematic diagram of a message processing apparatus according to an embodiment of the present invention;
[0024] Figure 7 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] According to an embodiment of the present invention, a message processing method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0028] Figure 1 This is a flowchart of a message processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0029] Step S102: Obtain the message to be processed, wherein the message to be processed carries: target message stream tuple information;
[0030] Step S104: Call the preset access control table to analyze the message to be processed, and determine the preset group that matches the target message flow tuple information as the target group. The preset access control table includes: multiple preset groups and preset message flow tuple information corresponding to each preset group. Each preset group is used to record at least one preset rule identifier.
[0031] Step S106: If a target group exists in the preset access control table, determine the preset instruction corresponding to the target group as the target instruction in the preset instruction set. The preset instruction set includes multiple preset instructions, each preset instruction corresponds to the preset group, and each preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index. The preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool.
[0032] Step S108: Invoke the target instruction to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group;
[0033] Step S110: Process the message to be processed based on at least one target rule.
[0034] In this embodiment of the invention, a message to be processed is obtained, wherein the message to be processed carries: target message flow tuple information; a preset access control table is invoked to analyze the message to be processed, and a preset group matching the target message flow tuple information is determined as the target group, wherein the preset access control table includes: multiple preset groups, and preset message flow tuple information corresponding to each preset group, each preset group is used to record at least one preset rule identifier; if a target group exists in the preset access control table, a preset instruction corresponding to the target group is determined as the target instruction from a preset instruction set, wherein the preset instruction set includes multiple preset instructions, each preset instruction corresponds to the preset group, and each preset instruction is used to record at least one preset table index and At least one preset rule index is established, with the preset table index indicating the location of the preset rule identifier in the preset access control table and the preset rule index indicating the location of the preset rule associated with the preset rule identifier in the preset rule management pool. A target instruction is invoked to retrieve at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The packet to be processed is then processed based on at least one target rule. This allows the preset instruction to quickly determine the target rule used for processing the packet to be processed, eliminating the need for multiple rule matches using Packet Detection Rule (PDR), thus improving the efficiency of rule matching and solving the problem of low matching efficiency in existing Packet Detection Rule (PDR) systems.
[0035] The above message processing method can be executed in the User Plane Function (UPF) network element. This UPF network element can obtain the Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF) and process the received messages according to the preset rules configured in the PFCP session.
[0036] In step S102 above, the target message stream tuple information can be determined based on the quintuple of the message to be processed.
[0037] For example, the target message flow tuple includes: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID). The 5-tuple includes: the source Internet Protocol (IP) address, the destination Internet Protocol (IP) address, the source port, the destination port, and the transport layer protocol number.
[0038] In step S104 above, the preset access control list can be an ACL matching list, which consists of a series of rules (and judgment statements that describe the matching conditions of the packets). These conditions are usually called 5-tuples, which are the source address, destination address, source port, destination port, port number, etc. of the packet.
[0039] It should be noted that since the target message flow tuple information can be determined based on the five-tuple of the message to be processed, the target message flow tuple can be used as the matching condition of the preset access control list. This enables the purpose of analyzing the message to be processed using the preset access control list. Furthermore, based on the target message flow tuple information of the message to be processed, the matching target group can be determined in the preset access control list, and the preset rule indicated in the target group can be used as the target rule for processing the message to be processed.
[0040] In step S104 above, the preset access control table can record multiple preset rule identifiers, each of which represents a preset rule that needs to be used in the message processing process.
[0041] In step S104 above, the multiple preset rule identifiers recorded in the preset access control table can be divided into multiple preset groups, and each preset group records multiple preset rule identifiers.
[0042] Optionally, each preset group records multiple preset rule identifiers to represent multiple preset rule combinations for processing the message to be processed. Therefore, in the preset access control table, corresponding preset message flow tuple information can be set for each preset group as the matching condition for each preset group.
[0043] In step S104 above, each preset group is pre-configured with a corresponding preset instruction, and each preset instruction can obtain the corresponding preset rule according to multiple preset rule identifiers in the corresponding preset group.
[0044] Optionally, preset groups and preset instructions can be related by session ID, and then, if the target group is determined, the target instruction can be determined based on the session ID.
[0045] In step S106 above, the preset instruction set includes multiple preset instructions. Each preset instruction is based on the preset table index and the preset rule index, and can establish the association between the preset rule identifier and the preset rule in the preset access control table and the preset rule management pool.
[0046] In step S106 above, the preset rule management pool can manage multiple preset rules, and the preset rules managed by the preset rule management pool can be used to process the message to be processed.
[0047] It should be noted that existing technologies utilize Packet Detection Rule (PDR) matching to select the target rule for processing a packet. This is achieved by recording a preset rule identifier in the PDR and using multiple preset rules recorded in the Packet Switching Control Protocol (PFCP) session. During rule selection, if multiple rules are required for processing a packet, multiple matching operations are necessary. In contrast, this application manages preset rule identifiers through a preset access control list, manages preset rules through a preset rule management pool, and establishes preset rule identifiers and rules through preset instructions. Therefore, rule matching only needs to be performed once during the establishment of the preset instruction. Subsequent processing using preset rules allows direct invocation of the required preset rule as the target rule for packet processing, eliminating the need for multiple rule matching operations and improving rule matching efficiency.
[0048] As an optional embodiment, analyzing the packet to be processed by calling a preset access control table and determining the preset packet that matches the target packet flow tuple information as the target packet includes: calling the preset access control table to identify the target packet flow tuple information in the packet to be processed, wherein the target packet flow tuple information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID), wherein the 5-tuple includes: source Internet Protocol (IP) address, destination Internet Protocol (IP) address, source port, destination port, and transport layer protocol number; converting the target packet flow tuple information into a target key value, wherein the target key value includes at least: the tunnel endpoint identifier (TEID), the destination Internet Protocol (IP) address, and the source Internet Protocol (IP) address; and querying the target packet in the preset access control table based on the target key value, wherein the preset access control table pre-records the correspondence between preset packets and preset key values.
[0049] In the above embodiments of the present invention, a preset key value can be configured in the preset access control table as the matching condition for each preset packet. Each preset key value can be determined based on the preset packet meta-flow group information of the preset message. Each preset message has unique preset packet flow group information, and each preset packet flow group information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID). The 5-tuple includes: source Internet Protocol (IP) address, destination Internet Protocol (IP) address, source port, destination port, and transport layer protocol number. Therefore, in the process of the preset access control table determining the target packet based on the target packet flow group information of the message to be processed, the target packet flow group information can be processed first to convert the target packet flow group information into a target key value, and then the target packet corresponding to the target key value can be determined from the preset access control table, thereby achieving the purpose of determining the target packet in the preset access control table.
[0050] As an optional embodiment, converting target packet flow tuple information into target key value includes: determining the transmission direction and packet detection information (PDI) of the packet to be processed based on the target packet flow tuple information, wherein the transmission direction includes uplink and downlink; when the transmission direction is uplink, the packet detection information PDI carries the full tunnel endpoint identifier (F-TEID); when the transmission direction is downlink, the packet detection information PDI carries the user's Internet Protocol address (UEIP); generating target key value based on the transmission direction and packet detection information, wherein when the transmission direction is uplink, the target key value is to add an invalid UEIP identifier after the full tunnel endpoint identifier (F-TEID); when the transmission direction is downlink, the target key value is to add an invalid F-TEID identifier after the user's Internet Protocol address (UEIP).
[0051] In the above embodiments of the present invention, during the processing of messages to be processed, uplink messages and downlink messages have different message processing methods. Since the target message stream tuple information of the message to be processed carries information such as a 5-tuple, the transmission direction and message detection information (PDI) of the message to be processed can be determined based on the target message stream tuple information. Then, based on the transmission direction and message detection information (PDI) of the message to be processed, a target key value for querying the target rule identifier in a preset access control table can be generated.
[0052] As an optional embodiment, invoking a target instruction to obtain at least one target rule from a preset rule management pool includes: obtaining a preset table index corresponding to each preset rule identifier in the target group as a target table index; invoking a target instruction to determine a preset rule index corresponding to each target table index as a target rule index; and obtaining a preset rule associated with a preset rule identifier from the preset rule management pool according to the target rule index as a target rule.
[0053] In the above embodiments of the present invention, the target instruction establishes an association between the target rule identifier and the target rule based on the target table index of the target rule identifier and the target rule index of the target rule. After determining the target group, the target instruction indicated by the target group can obtain the target rule associated with the preset rule identifier from the preset rule management pool, thereby achieving the technical effect of obtaining the target rule from the preset rule management pool.
[0054] As an optional embodiment, before acquiring the message to be processed, the method further includes: acquiring the Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF); identifying the session type of the PFCP session, wherein the session type includes: a first type indicating the creation of a session and a second type indicating the deletion of a session; and managing preset instructions in a preset instruction set according to the session type.
[0055] In the above embodiments of the present invention, the User Plane Function (UPF) network element can manage the Packet Switching Control Protocol (PFCP) sessions issued by the Session Management Function (SMF). The management methods include deleting rules and creating rules. Deleting a rule requires deleting a preset rule identifier from the preset access control table, deleting the preset rule from the preset rule pool, and deleting the preset instruction associated with the preset rule identifier and the preset rule. Creating a rule requires creating a preset rule identifier from the preset access control table, creating a preset rule from the preset rule pool, and creating the preset instruction associated with the preset rule identifier and the preset rule. Therefore, the management of PFCP session indication rules can be completed by managing the preset instructions in the preset instruction set.
[0056] As an optional embodiment, when the session type is the first type, the preset instructions in the preset instruction set managed according to the session type include: managing the Packet Switching Control Protocol (PFCP) session through a preset rule management pool, determining at least one preset rule indicating the PFCP session, and a preset rule index corresponding to the preset rule; recording at least one preset rule identifier indicating the PFCP session, a preset table index corresponding to the preset rule identifier, and a preset key value as a matching condition for the preset rule identifier through a preset access control table; and establishing an association relationship between preset table indexes based on the association relationship between the preset rules and the preset rule identifiers through preset instructions.
[0057] In the above embodiments of the present invention, when the Packet Switching Control Protocol (PFCP) session indicates the creation of a session, at least one preset rule indicated by the PFCP session can be managed through a preset rule management pool, and a preset rule index for each preset rule can be returned. At least one preset rule identifier indicated by the PFCP session can be recorded through a preset access control table, and a preset table index for each preset rule identifier can be returned. Then, a new preset instruction is established. Based on the association relationship between the preset rule and the preset rule identifier, the association relationship between the preset rule index and the preset table index is established, and the preset packet where the preset rule identifier associated with the preset instruction is located is used as the matching condition for the preset instruction. Thus, the addition of preset rules and preset rule identifiers is realized by establishing preset instructions.
[0058] As an optional embodiment, recording the preset key value indicated by the Packet Switching Control Protocol (PFCP) session as a matching condition for the preset rule identifier through a preset access control table includes: traversing the Packet Inspection Rules (PDRs) in the PFCP session, wherein the PDRs are used to record at least one preset rule and an associated preset rule identifier; identifying the Packet Inspection Information (PDI) in the PDRs, wherein the PDIs are used to match the preset rule identifier, and the PDIs carry the User Internet Protocol Address (UE) IP address or the full Tunnel Endpoint Identifier (F-TEID); determining the preset key value matching the preset rule identifier based on the PDIs, wherein the preset key value includes at least: the Tunnel Endpoint Identifier (TEID), the destination UE IP address, and the source UE IP address. If the PDI carries the User Internet Protocol Address (UE) IP address, the Tunnel Endpoint Identifier (TEID) and the destination UE IP address are invalid identifiers. The IP address determines the source Internet Protocol IP address. If the Packet Inspection Information (PDI) carries the Full Tunnel Endpoint Identifier (F-TEID), the Tunnel Endpoint Identifier (TEID) and the destination Internet Protocol IP address are determined based on the F-TEID. The source Internet Protocol IP address is an invalid identifier.
[0059] In the above embodiments of the present invention, during the process of establishing a preset access control table according to the Packet Switching Control Protocol (PFCP) session, the PFCP session records at least one preset rule and an associated preset rule identifier through the Packet Detection Rule (PDR). The preset rule identifier is mainly recorded in the Packet Detection Information (PDI) of the Packet Detection Rule (PDR). In order to improve the matching efficiency of determining the preset rule identifier during the process of setting the preset access control table, a corresponding preset key value can be established for each preset rule identifier as a matching condition. Therefore, a preset key value for each preset rule identifier can be established based on the Packet Detection Information (PDI) of each preset rule identifier, thereby realizing the recording of the preset access control table.
[0060] As an optional embodiment, when the session type is the second type, managing the preset instructions in the preset instruction set according to the session type includes: identifying at least one preset rule of the Packet Switching Control Protocol (PFCP) session indication in the preset access control table; determining the preset instruction corresponding to the preset group in the preset instruction set; deleting the corresponding preset rule in the preset rule management pool according to the preset rule index recorded in the preset instruction; deleting the corresponding preset rule identifier in the preset access control table according to the preset table index recorded in the preset instruction; and deleting the preset instruction used to represent the correspondence between the preset rule index and the preset table index.
[0061] In the above embodiments of the present invention, when the Packet Switching Control Protocol (PFCP) session is a deletion instruction session, a preset group indicating the deletion operation can be determined in the preset access control table, a preset instruction corresponding to the preset group can be determined, and then a preset rule identifier can be deleted in the preset access control table according to the preset table index in the preset instruction, and a preset rule can be deleted in the preset rule management pool according to the preset rule index in the preset instruction. Finally, after both the preset rule identifier and the preset rule have been deleted, the preset instruction can be deleted from the preset instruction set to complete the deletion of the preset instruction.
[0062] This invention also provides a preferred embodiment, which offers a scheme to optimize UPF forwarding efficiency. This scheme utilizes the VPP ACL plugin to issue fast forwarding table entries for various packet characteristics -> forwarding rules, reducing the number of PDR matching operations specified in the protocol. Simultaneously, it leverages the efficient query algorithm of the ACL plugin to accelerate the matching of 5G data traffic for PDU sessions, effectively improving data forwarding efficiency and latency. This highly efficient software lookup forwarding method effectively improves the forwarding efficiency and latency of 5G data to meet the specific requirements of segmented services for 5G characteristics such as high bandwidth, low latency, and low jitter.
[0063] Figure 2 This is a schematic diagram illustrating an optimized UPF forwarding efficiency according to an embodiment of the present invention, as shown below. Figure 2As shown, after receiving the message packet, the VPP ACL (Access Control List) is invoked using the ACL_flow_tuple_lookup command to classify a specific flow using a five-tuple (source IP address, destination IP address, source port number, destination port number, protocol) and 13 / 14 flag bits and TEID (Tunnel Endpoint Identifier); then, the target rule is selected from the Pool of PFCP rules (i.e., the preset rule management pool) according to the preset rule index using the ACL_flow_tuple_entry command.
[0064] It's important to note that ACL (Access Control List) is a mechanism for network traffic control and filtering, using defined rules to determine whether network packets are allowed to pass. In ACL_flow_tuple_lookup, VPP (Vector Packet Processing) is used as the network packet processing engine. ACL rules are used to classify network packets, matching them against predefined rules using a five-tuple of information (source IP address, destination IP address, source port number, destination port number, and protocol). Furthermore, 13 / 14 flag bits and TEID information are considered for further refinement of the classification.
[0065] Optionally, once a network packet successfully matches an ACL rule, the packet can be processed according to the action defined by the rule (equivalent to a preset rule), such as allowing it to pass, dropping it, or redirecting it.
[0066] Alternatively, by using ACL_flow_tuple_lookup, fine-grained control and classification of specific flows can be achieved to meet network traffic management and security requirements.
[0067] It's important to note that `ACL_flow_tuple_entry` is a data structure used to record tuple information from the ACL matching table. `ACL_flow_tuple_entry` contains key information such as the source IP address, destination IP address, source port number, destination port number, and transport protocol. This information is used to match and filter network traffic to determine whether to allow or deny the traffic through the ACL.
[0068] It's important to note that ACL_flow_tuple_entry is typically used by network devices (such as firewalls and routers) to enforce network security policies. When network traffic passes through a device, the device examines the tuple information of the traffic and compares it with predefined ACL rules. If an ACL rule matches, the device decides whether to allow or deny the traffic based on the rule's settings.
[0069] It's important to note that the purpose of ACL_flow_tuple_entry is to provide an efficient way to organize and compare ACL rules in order to enhance network security and restrict unnecessary network access. By defining appropriate ACL rules and using ACL_flow_tuple_entry for matching, network administrators can better control network traffic and protect the network from potential threats.
[0070] Figure 3 This is a schematic diagram of an optimized UPF forwarding efficiency implementation architecture according to an embodiment of the present invention, such as... Figure 3 As shown, it includes: a session management module, a flow table lookup module, and an ACL plugin module.
[0071] Optionally, the session management module is used to receive session information issued by the session management function SMF and create a preset rule index corresponding to each preset rule in the Packet Switching Control Protocol (PFCP) session in the preset rule management pool.
[0072] Optionally, the session management module is also used to call the ACL plugin interface of the ACL plugin module to convert session information into ACL tuple information for insertion / deletion of ACL matching tables.
[0073] Optionally, the flow table lookup module is used to call the ACL plugin interface of the ACL plugin module, query the ACL matching table, and receive the query results returned by the ACL plugin module to obtain the corresponding flow information (equivalent to the target instruction) and the corresponding PFCP rule index (equivalent to the preset rule index).
[0074] Figure 4 This is a schematic diagram illustrating the execution of a session management process by a session management module according to an embodiment of the present invention, such as... Figure 4 As shown, the execution steps are as follows:
[0075] S40, received SMF's PFCP session message;
[0076] S41 performs different processing depending on the message type. Specifically, if the message type indicates that a session is created, S421 is executed, and if the message type indicates that a session is deleted, S431 is executed.
[0077] S421, Parse session PFCP rule related information
[0078] S422, create session-related rule data structures (PDR, FAR, QER, BAR, URR) in the PFCP rule management pool (i.e., the preset rule management pool), and return the preset rule index corresponding to each preset rule.
[0079] S423, iterate through all PDRs in the session, use the UE IP / F-TEID related information as ACL matching rules, insert them into the ACL matching table with the session ID as the group, and return the corresponding preset table index.
[0080] S424, create a new ACL_tuples_flow (i.e., a default instruction) and associate it with the default rule indexes of all PFCP rules and the default table indexes of the ACL matching table.
[0081] S431, based on the session seid, find all ACL_tuples_flow under the corresponding group, which is equivalent to determining all preset instructions used to associate preset rules and preset rule identifiers in this group.
[0082] S432, iterate through all found ACL_tuples_flow.
[0083] S433, delete all session-related rule data structures related to ACL_tuples_flow, which is equivalent to deleting the relevant preset rules in the preset rule management pool.
[0084] S434, delete the ACL matching entry corresponding to ACL_tuples_flow, and delete the corresponding preset rule identifier in the preset access control table.
[0085] S435, delete ACL_tuples_flow.
[0086] S44, End Process.
[0087] Figure 5 This is a schematic diagram illustrating the flow table lookup process executed by a flow table lookup module according to an embodiment of the present invention, as shown below. Figure 5 As shown, the execution steps are as follows:
[0088] S51, packet enters, obtain packet flow tuple information (source IP + destination IP + source port + destination port + protocol number + protocol flag + TEID), and generate corresponding ACL matching table query key.
[0089] S52, depending on the uplink and downlink direction of the message, the uplink direction uses the UE IP to look up the PDU session, and the downlink direction uses the F-TEID to look up the PDU session.
[0090] S53: Using the constructed message information key value, call the ACL plugin's ACL match query interface to query the group containing the session ID in the ACL match table. If the query fails, discard the message and end the process; if the query succeeds, proceed to S54.
[0091] S54: Obtain all PFCP rule indices from ACL_tuples_flow, find all PFCP rule data structures, create a session, and simultaneously create a flow corresponding to this session.
[0092] S55 processes the message according to all the relevant PFCP rules obtained.
[0093] The embodiments of the present invention establish a high-efficiency and fast forwarding table entry based on the ACL matching algorithm, which can reduce the number of PDR matching in the protocol-defined process, making the entire forwarding process very smooth, with low latency and low jitter. The PFCP rule allocation management pool (i.e., the preset rule management pool) is used to allocate PFCP rule data structures. For packet processing, only the corresponding preset rule index needs to be obtained, which facilitates unified management, saves memory usage, and improves system operating efficiency. Lightweight deployment and maintenance eliminates the need for additional network elements, reducing existing network maintenance costs. Customized enhancement functions can be implemented based on this solution in the future. Furthermore, this solution is implemented in software, decoupled from special hardware, and can be modified multiple times as needed, without being limited by hardware capabilities.
[0094] As an optional example, after a 5G user goes online, the SMF sends a PFCP session creation message to the UPF. First, it parses the session's PFCP rule information. Then, it creates session-related rule data structures (PDR, FAR, QER, BAR, URR) in the PFCP rule management pool (i.e., the preset rule management pool) and returns the corresponding preset rule indexes for each preset rule. It iterates through all PDRs in the session, using the UE IP / F-TEID information as ACL matching rules, inserting them into the ACL matching table grouped by session ID, returning the corresponding table index, and creating a new ACL_tuples_flow (i.e., creating a preset command). Finally, it associates the preset rule indexes of all PFCP rules with the preset table indexes of the ACL matching table.
[0095] For example, if an uplink forwarding PDR carries an F-TEID of (teid: 2 + IPv4 address: 3.3.3.2) in its PDI, then (teid: 2 + IPv4 address: 3.3.3.2 + UE IP null) will be used as the key value to insert into the ACL matching table.
[0096] For example, if a downlink forwarding PDR carries the UE IP as (IPv4 address: 6.6.6.2) in its PDI, then (teid: null + IPv4 address: null + UE IP 6.6.6.2) will be used as the key value to insert into the ACL matching table.
[0097] As an optional example, upon receiving a user traffic packet, the session is searched based on the uplink and downlink direction of the packet. After obtaining the session ID, the ACL matching table is queried in the group corresponding to the session ID using key packet information (such as target packet flow tuple information).
[0098] For example, an uplink packet with a GTPU tunnel F-TEID of (teid: 2 + IPv4 address: 3.3.3.2) can be converted into an ACL key-value data structure and matched against an ACL matching table. The table lookup result will yield the corresponding flow information (i.e., the target instruction), thereby obtaining the session PFCP related rules (i.e., the target rules) for subsequent packet processing.
[0099] According to an embodiment of the present invention, a message processing apparatus embodiment is also provided. It should be noted that the message processing apparatus can be used to execute the message processing method in the embodiment of the present invention, and the message processing method in the embodiment of the present invention can be executed in the message processing apparatus.
[0100] Figure 6 This is a schematic diagram of a message processing apparatus according to an embodiment of the present invention, such as... Figure 6As shown, the device may include: an acquisition module 61, used to acquire a message to be processed, wherein the message to be processed carries target message flow tuple information; an analysis module 63, used to call a preset access control table to analyze the message to be processed, and determine a preset group that matches the target message flow tuple information as a target group, wherein the preset access control table includes: multiple preset groups, and preset message flow tuple information corresponding to each preset group, each preset group being used to record at least one preset rule identifier; and a determination module 65, used to determine, in the case that a target group exists in the preset access control table, a preset instruction corresponding to the target group as a target instruction from a preset instruction set. In the preset instruction set, there are multiple preset instructions, each preset instruction corresponding to the preset group. Each preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index. The preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool. The calling module 67 is used to call the target instruction to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The processing module 69 is used to process the message to be processed based on at least one target rule.
[0101] It should be noted that the acquisition module 61 in this embodiment can be used to execute step S102 in this application embodiment, the analysis module 63 in this embodiment can be used to execute step S104 in this application embodiment, the determination module 65 in this embodiment can be used to execute step S106 in this application embodiment, the calling module 67 in this embodiment can be used to execute step S108 in this application embodiment, and the processing module 69 in this embodiment can be used to execute step S110 in this application embodiment. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.
[0102] In this embodiment of the invention, a message to be processed is obtained, wherein the message to be processed carries: target message flow tuple information; a preset access control table is invoked to analyze the message to be processed, and a preset group matching the target message flow tuple information is determined as the target group, wherein the preset access control table includes: multiple preset groups, and preset message flow tuple information corresponding to each preset group, each preset group is used to record at least one preset rule identifier; if a target group exists in the preset access control table, a preset instruction corresponding to the target group is determined as the target instruction from a preset instruction set, wherein the preset instruction set includes multiple preset instructions, each preset instruction corresponds to the preset group, and each preset instruction is used to record at least one preset table index and At least one preset rule index is established, with the preset table index indicating the location of the preset rule identifier in the preset access control table and the preset rule index indicating the location of the preset rule associated with the preset rule identifier in the preset rule management pool. A target instruction is invoked to retrieve at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The packet to be processed is then processed based on at least one target rule. This allows the preset instruction to quickly determine the target rule used for processing the packet to be processed, eliminating the need for multiple rule matches using Packet Detection Rule (PDR), thus improving the efficiency of rule matching and solving the problem of low matching efficiency in existing Packet Detection Rule (PDR) systems.
[0103] As an optional embodiment, the analysis module includes: a first invocation unit, used to invoke a preset access control table to identify target packet flow tuple information in the packet to be processed, wherein the target packet flow tuple information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID), wherein the 5-tuple includes: source Internet Protocol (IP) address, destination Internet Protocol (IP) address, source port, destination port, and transport layer protocol number; a conversion unit, used to convert the target packet flow tuple information into a target key value, wherein the target key value includes at least: tunnel endpoint identifier (TEID), destination Internet Protocol (IP) address, and source Internet Protocol (IP) address; and a lookup unit, used to query the target packet in the preset access control table based on the target key value, wherein the preset access control table pre-records the correspondence between preset packets and preset key values.
[0104] As an optional embodiment, the conversion unit includes: a determining unit, configured to determine the transmission direction and packet detection information (PDI) of the packet to be processed based on the target packet flow tuple information, wherein the transmission direction includes uplink and downlink, and when the transmission direction is uplink, the packet detection information PDI carries the full tunnel endpoint identifier (F-TEID), and when the transmission direction is downlink, the packet detection information PDI carries the user's Internet Protocol address (UE IP); and a generating unit, configured to generate a target key value based on the transmission direction and the packet detection information, wherein when the transmission direction is uplink, the target key value is to add an invalid identifier for the user's Internet Protocol address (UE IP) after the full tunnel endpoint identifier (F-TEID), and when the transmission direction is downlink, the target key value is to add an invalid identifier for the full tunnel endpoint identifier (F-TEID) to the user's Internet Protocol address (UE IP).
[0105] As an optional embodiment, the calling module includes: a first acquisition unit, used to acquire the preset table index corresponding to each preset rule identifier in the target group as the target table index; a second calling unit, used to call the target instruction to determine the preset rule index corresponding to each target table index as the target rule index; and a second acquisition unit, used to acquire the preset rule associated with the preset rule identifier as the target rule in the preset rule management pool according to the target rule index.
[0106] As an optional embodiment, the apparatus further includes: an acquisition submodule, configured to acquire a Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF) before acquiring a message to be processed; an identification submodule, configured to identify the session type of the PFCP session, wherein the session type includes: a first type indicating the creation of a session and a second type indicating the deletion of a session; and a management submodule, configured to manage preset instructions in a preset instruction set according to the session type.
[0107] As an optional embodiment, the management submodule includes: a first determining subunit, used to manage the Packet Switching Control Protocol (PFCP) session through a preset rule management pool when the session type is a first type, determining at least one preset rule indicating the PFCP session and a preset rule index corresponding to the preset rule; a recording subunit, used to record at least one preset rule identifier indicating the PFCP session, a preset table index corresponding to the preset rule identifier, and a preset key value as a matching condition for the preset rule identifier through a preset access control table; and an establishing subunit, used to establish the association relationship between the preset table index and the preset table index according to the association relationship between the preset rule and the preset rule identifier through preset instructions.
[0108] As an optional embodiment, the recording subunit includes: a traversal subunit for traversing the Packet Switching Control Protocol (PFCP) session's Packet Detection Rules (PDRs), wherein the PDRs record at least one preset rule and an associated preset rule identifier; a first identification subunit for identifying Packet Detection Information (PDI) in the PDRs, wherein the PDIs match the preset rule identifiers, and the PDIs carry either the User Internet Protocol Address (UE IP) or the Full Tunnel Endpoint Identifier (F-TEID); and a second determination subunit for determining a preset key value matching the preset rule identifier based on the PDIs, wherein the preset key value includes at least: the Tunnel Endpoint Identifier (TEID), the Destination Internet Protocol (IP) address, and the Source Internet Protocol (IP) address. If the PDI carries the User Internet Protocol Address (UE IP), the Tunnel Endpoint Identifier (TEID) and the Destination Internet Protocol (IP) address are invalid identifiers. The IP address determines the source Internet Protocol IP address. If the Packet Inspection Information (PDI) carries the Full Tunnel Endpoint Identifier (F-TEID), the Tunnel Endpoint Identifier (TEID) and the destination Internet Protocol IP address are determined based on the F-TEID. The source Internet Protocol IP address is an invalid identifier.
[0109] As an optional embodiment, the management submodule includes: a second identification subunit, used to identify a preset packet in a preset access control table for at least one preset rule of a Packet Switching Control Protocol (PFCP) session indication when the session type is a second type; a third determination subunit, used to determine a preset instruction corresponding to the preset packet in a preset instruction set; a first deletion subunit, used to delete the corresponding preset rule in a preset rule management pool according to the preset rule index recorded in the preset instruction; a second deletion subunit, used to delete the corresponding preset rule identifier in a preset access control table according to the preset table index recorded in the preset instruction; and a third deletion subunit, used to delete the preset instruction used to represent the correspondence between the preset rule index and the preset table index.
[0110] Embodiments of the present invention can provide a computer terminal, which can be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the computer terminal can also be replaced by a mobile terminal or other terminal device.
[0111] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0112] In this embodiment, the computer terminal described above can execute the program code for the following steps in the message processing method: obtaining a message to be processed, wherein the message to be processed carries: target message flow tuple information; calling a preset access control table to analyze the message to be processed, and determining a preset group that matches the target message flow tuple information as the target group, wherein the preset access control table includes: multiple preset groups, and preset message flow tuple information corresponding to each preset group, each preset group being used to record at least one preset rule identifier; if a target group exists in the preset access control table, determining the preset metaflow group corresponding to the target group in the preset metaflow group set. The target metaflow group is defined as follows: the preset instruction set includes multiple preset instructions, each preset instruction corresponding to a preset group; each preset metaflow group records the correspondence between at least one preset table index and at least one preset rule index; the preset table index indicates the position of the preset rule identifier in the preset access control table; and the preset rule index indicates the position of the preset rule associated with the preset rule identifier in the preset rule management pool. The target metaflow group is invoked to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The message to be processed is then processed based on at least one target rule.
[0113] Optionally, Figure 7 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 7 As shown, the computer terminal 70 may include one or more (only one is shown in the figure) processors 72 and memory 74.
[0114] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the message processing method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned message processing method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal 70 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0115] The processor can invoke information and application programs stored in memory via a transmission device to perform the following steps: acquiring a message to be processed, wherein the message to be processed carries target message flow tuple information; analyzing the message to be processed by invoking a preset access control table, determining a preset group matching the target message flow tuple information as the target group, wherein the preset access control table includes multiple preset groups and preset message flow tuple information corresponding to each preset group, each preset group being used to record at least one preset rule identifier; if a target group exists in the preset access control table, determining a preset instruction corresponding to the target group as the target instruction from a preset instruction set, wherein the preset instruction set includes multiple preset instructions, each preset instruction corresponding to the preset group, each preset instruction being used to record the correspondence between at least one preset table index and at least one preset rule index, the preset table index being used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index being used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool; invoking the target instruction to acquire at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group; and processing the message to be processed based on at least one target rule.
[0116] Optionally, the processor may also execute program code that performs the following steps: calling a preset access control table to identify the target packet flow tuple information in the message to be processed, wherein the target packet flow tuple information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID), wherein the 5-tuple includes: the source Internet Protocol (IP) address, the destination Internet Protocol (IP) address, the source port, the destination port, and the transport layer protocol number; converting the target packet flow tuple information into a target key value, wherein the target key value includes at least: the tunnel endpoint identifier (TEID), the destination Internet Protocol (IP) address, and the source Internet Protocol (IP) address; querying the target packet in the preset access control table based on the target key value, wherein the preset access control table pre-records the correspondence between preset packets and preset key values.
[0117] Optionally, the processor may also execute program code for the following steps: determining the transmission direction and packet detection information (PDI) of the packet to be processed based on the target packet flow tuple information, wherein the transmission direction includes uplink and downlink; when the transmission direction is uplink, the packet detection information PDI carries the full tunnel endpoint identifier (F-TEID); when the transmission direction is downlink, the packet detection information PDI carries the user's Internet Protocol address (UE IP); generating a target key value based on the transmission direction and packet detection information, wherein when the transmission direction is uplink, the target key value is to add an invalid identifier for the user's Internet Protocol address (UE IP) after the full tunnel endpoint identifier (F-TEID); when the transmission direction is downlink, the target key value is to add an invalid identifier for the full tunnel endpoint identifier (F-TEID) to the user's Internet Protocol address (UE IP).
[0118] Optionally, the processor may also execute program code that performs the following steps: obtains the preset table index corresponding to each preset rule identifier in the target group as the target table index; calls the target instruction to determine the preset rule index corresponding to each target table index as the target rule index; and obtains the preset rule associated with the preset rule identifier in the preset rule management pool according to the target rule index as the target rule.
[0119] Optionally, the processor may also execute program code that performs the following steps: before acquiring the message to be processed, acquire the Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF); identify the session type of the PFCP session, wherein the session type includes: a first type indicating the creation of a session and a second type indicating the deletion of a session; and manage preset instructions in the preset instruction set according to the session type.
[0120] Optionally, the processor may also execute program code with the following steps: when the session type is type 1, manage the Packet Switching Control Protocol (PFCP) session through a preset rule management pool, determine at least one preset rule indicated by the PFCP session, and the preset rule index corresponding to the preset rule; record at least one preset rule identifier indicated by the PFCP session, the preset table index corresponding to the preset rule identifier, and the preset key value as the matching condition of the preset rule identifier through a preset access control table; and establish the association relationship between the preset table index and the preset table index according to the association relationship between the preset rule and the preset rule identifier through a preset instruction.
[0121] Optionally, the processor may also execute program code for the following steps: traversing Packet Inspection Rules (PDRs) in a Packet Switching Control Protocol (PFCP) session, wherein the PDRs record at least one preset rule and an associated preset rule identifier; identifying Packet Inspection Information (PDI) in the PDRs, wherein the PDIs match the preset rule identifiers, and the PDIs carry either the User Internet Protocol (UE) IP address or the Full Tunnel Endpoint Identifier (F-TEID); determining a preset key value matching the preset rule identifier based on the PDIs, wherein the preset key value includes at least: the Tunnel Endpoint Identifier (TEID), the Destination Internet Protocol (IP) address, and the Source Internet Protocol (IP) address; if the PDI carries the UE IP address, the TEID and the Destination IP address are invalid identifiers; determining the Source IP address based on the UE IP address; if the PDI carries the F-TEID, determining the TEID and the Destination IP address based on the F-TEID, and the Source IP address is invalid identifiers.
[0122] Optionally, the processor may also execute program code that performs the following steps: when the session type is type two, identify a preset packet in a preset access control table for at least one preset rule indicated by a Packet Switching Control Protocol (PFCP) session; determine a preset instruction corresponding to the preset packet in a preset instruction set; delete the corresponding preset rule in a preset rule management pool according to the preset rule index recorded in the preset instruction; delete the corresponding preset rule identifier in a preset access control table according to the preset table index recorded in the preset instruction; and delete the preset instruction used to represent the correspondence between the preset rule index and the preset table index.
[0123] This invention provides a message processing scheme. It involves acquiring a message to be processed, which carries target message flow tuple information; analyzing the message by calling a preset access control table to determine a preset group matching the target message flow tuple information as the target group; the preset access control table includes multiple preset groups and preset message flow tuple information corresponding to each preset group, with each preset group recording at least one preset rule identifier; if a target group exists in the preset access control table, a preset instruction corresponding to the target group is determined from a preset instruction set as the target instruction; the preset instruction set includes multiple preset instructions, each preset instruction corresponding to the preset group, and each preset instruction recording at least one preset table index and at least one preset rule identifier. The preset rule indexes correspond to each other. The preset table index indicates the location of the preset rule identifier in the preset access control table, and the preset rule index indicates the location of the preset rule associated with the preset rule identifier in the preset rule management pool. The target instruction is invoked to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group. The packet to be processed is processed based on at least one target rule. Thus, the preset instruction can quickly determine the target rule used to process the packet to be processed without using the Packet Detection Rule (PDR) for multiple rule matchings, thereby improving the technical effect of rule matching efficiency and solving the technical problem of low matching efficiency of the existing Packet Detection Rule (PDR).
[0124] Those skilled in the art will understand that Figure 7 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 7 This does not limit the structure of the aforementioned electronic device. For example, the computer terminal 70 may also include components that are more advanced than those described above. Figure 7 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 7 The different configurations shown.
[0125] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0126] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the message processing method provided in the above embodiments.
[0127] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0128] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a message to be processed, wherein the message to be processed carries: target message flow tuple information; calling a preset access control table to analyze the message to be processed, and determining a preset group that matches the target message flow tuple information as the target group, wherein the preset access control table includes: multiple preset groups, and preset message flow tuple information corresponding to each preset group, each preset group being used to record at least one preset rule identifier; if a target group exists in the preset access control table, determining the preset instruction set corresponding to the target group. Let the instruction be the target instruction, wherein the preset instruction set includes multiple preset instructions, each preset instruction corresponds to the preset group, and each preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index. The preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool; the target instruction is invoked to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group; the message to be processed is processed based on at least one target rule.
[0129] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: calling a preset access control table to identify target packet flow tuple information in the packet to be processed, wherein the target packet flow tuple information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID), wherein the 5-tuple includes: source Internet Protocol (IP) address, destination Internet Protocol (IP) address, source port, destination port, and transport layer protocol number; converting the target packet flow tuple information into a target key value, wherein the target key value includes at least: tunnel endpoint identifier (TEID), destination Internet Protocol (IP) address, and source Internet Protocol (IP) address; querying the target packet in the preset access control table based on the target key value, wherein the preset access control table pre-records the correspondence between preset packets and preset key values.
[0130] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the transmission direction and packet detection information (PDI) of the packet to be processed based on the target packet flow tuple information, wherein the transmission direction includes uplink and downlink; when the transmission direction is uplink, the packet detection information PDI carries the full tunnel endpoint identifier (F-TEID); when the transmission direction is downlink, the packet detection information PDI carries the user's Internet Protocol address (UE IP); generating a target key value based on the transmission direction and the packet detection information, wherein when the transmission direction is uplink, the target key value is to add an invalid identifier for the user's Internet Protocol address (UE IP) after the full tunnel endpoint identifier (F-TEID); when the transmission direction is downlink, the target key value is to add an invalid identifier for the full tunnel endpoint identifier (F-TEID) to the user's Internet Protocol address (UE IP).
[0131] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining the preset table index corresponding to each preset rule identifier in the target group as the target table index; calling the target instruction to determine the preset rule index corresponding to each target table index as the target rule index; and obtaining the preset rule associated with the preset rule identifier in the preset rule management pool according to the target rule index as the target rule.
[0132] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: before acquiring the message to be processed, acquiring the Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF); identifying the session type of the PFCP session, wherein the session type includes: a first type indicating the creation of a session and a second type indicating the deletion of a session; and managing preset instructions in a preset instruction set according to the session type.
[0133] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when the session type is a first type, managing the Packet Switching Control Protocol (PFCP) session through a preset rule management pool, determining at least one preset rule indicated by the PFCP session, and a preset rule index corresponding to the preset rule; recording at least one preset rule identifier indicated by the PFCP session, a preset table index corresponding to the preset rule identifier, and a preset key value as a matching condition for the preset rule identifier through a preset access control table; and establishing an association relationship between preset table indexes based on the association relationship between the preset rule and the preset rule identifier through a preset instruction.
[0134] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: traversing the Packet Inspection Rules (PDRs) in the Packet Switching Control Protocol (PFCP) session, wherein the PDRs record at least one preset rule and an associated preset rule identifier; identifying the Packet Inspection Information (PDI) in the PDRs, wherein the PDIs match the preset rule identifiers, and the PDIs carry the User Internet Protocol Address (UE) IP address or the Full Tunnel Endpoint Identifier (F-TEID); determining a preset key value matching the preset rule identifier based on the PDIs, wherein the preset key value includes at least: the Tunnel Endpoint Identifier (TEID), the Destination Internet Protocol (IP) address, and the Source Internet Protocol (IP) address; in the case where the PDIs carry the User Internet Protocol Address (UE) IP address, the Tunnel Endpoint Identifier (TEID) and the Destination Internet Protocol (IP) address are invalid identifiers; and determining the Preset Key Value matching the Preset Rule Identifier based on the User Internet Protocol Address (UE) IP address. The IP address determines the source Internet Protocol IP address. If the Packet Inspection Information (PDI) carries the Full Tunnel Endpoint Identifier (F-TEID), the Tunnel Endpoint Identifier (TEID) and the destination Internet Protocol IP address are determined based on the F-TEID. The source Internet Protocol IP address is an invalid identifier.
[0135] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when the session type is the second type, identifying a preset packet in a preset access control table for at least one preset rule indicated by a Packet Switching Control Protocol (PFCP) session; determining a preset instruction corresponding to the preset packet in a preset instruction set; deleting the corresponding preset rule in a preset rule management pool according to the preset rule index recorded in the preset instruction; deleting the corresponding preset rule identifier in the preset access control table according to the preset table index recorded in the preset instruction; and deleting the preset instruction used to represent the correspondence between the preset rule index and the preset table index.
[0136] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0137] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0138] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0141] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0142] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A message processing method, characterized in that, include: Obtain the message to be processed, wherein the message to be processed carries: target message stream tuple information; The message to be processed is analyzed by calling a preset access control table to determine the preset group that matches the target message flow tuple information as the target group. The preset access control table includes: multiple preset groups and preset message flow tuple information corresponding to each preset group. Each preset group is used to record at least one preset rule identifier. If the target group exists in the preset access control table, a preset instruction corresponding to the target group is determined as the target instruction in the preset instruction set. The preset instruction set includes multiple preset instructions, each preset instruction corresponds to the preset group, and each preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index. The preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool. Invoke the target instruction to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group; The message to be processed is processed based on at least one target rule.
2. The method according to claim 1, characterized in that, The process involves analyzing the pending message using a preset access control list to determine a preset group that matches the target message flow tuple information as the target group, including: The preset access control table is invoked to identify the target packet flow tuple information in the message to be processed. The target packet flow tuple information includes at least: a 5-tuple, a protocol flag, and a tunnel endpoint identifier (TEID). The 5-tuple includes: source Internet Protocol IP address, destination Internet Protocol IP address, source port, destination port, and transport layer protocol number. The target packet flow tuple information is converted into a target key value, wherein the target key value includes at least: Tunnel Endpoint Identifier (TEID), Destination Internet Protocol (IP) address, and Source Internet Protocol (IP) address; Based on the target key value, the target group is queried in the preset access control table, wherein the preset access control table pre-records the correspondence between the preset group and the preset key value.
3. The method according to claim 2, characterized in that, Converting the target message stream tuple information into a target key value includes: The transmission direction and packet detection information (PDI) of the packet to be processed are determined based on the target packet flow tuple information. The transmission direction includes uplink and downlink. When the transmission direction is uplink, the packet detection information PDI carries the full tunnel endpoint identifier (F-TEID). When the transmission direction is downlink, the packet detection information PDI carries the user's Internet Protocol address (UE IP). The target key value is generated based on the transmission direction and the message detection information. When the transmission direction is the uplink direction, the target key value is to add the invalid identifier of the user's Internet Protocol address (UE IP) after the full tunnel endpoint identifier (F-TEID). When the transmission direction is the downlink direction, the target key value is to add the invalid identifier of the full tunnel endpoint identifier (F-TEID) to the user's Internet Protocol address (UE IP).
4. The method according to claim 1, characterized in that, Invoking the target instruction to obtain at least one target rule from the preset rule management pool includes: Each preset rule identifier in the target group corresponds to a preset table index, which is then determined as the target table index. The target instruction is invoked to determine the preset rule index corresponding to each target table index as the target rule index; According to the target rule index, the preset rule associated with the preset rule identifier is obtained from the preset rule management pool as the target rule.
5. The method according to claim 1, characterized in that, Before acquiring the message to be processed, the method further includes: Obtain the Packet Switching Control Protocol (PFCP) session issued by the Session Management Function (SMF); Identify the session type of the Packet Switching Control Protocol (PFCP) session, wherein the session type includes: a first type indicating the creation of a session and a second type indicating the deletion of a session; Manage the preset instructions in the preset instruction set according to the session type.
6. The method according to claim 5, characterized in that, When the session type is the first type, managing the preset instructions in the preset instruction set according to the session type includes: The Packet Switching Control Protocol (PFCP) session is managed through the preset rule management pool, and at least one preset rule indicated by the PFCP session is determined, along with the preset rule index corresponding to the preset rule. The preset access control table records at least one preset rule identifier of the Packet Switching Control Protocol (PFCP) session indication, the preset table index corresponding to the preset rule identifier, and the preset key value as the matching condition of the preset rule identifier; The preset instructions establish the association between the preset table index and the preset table index based on the preset rules and the association relationship between the preset rule identifiers.
7. The method according to claim 5, characterized in that, The preset key values that record the Packet Switching Control Protocol (PFCP) session indication in the preset access control table as matching conditions for the preset rules include: Traverse the Packet Detection Rules (PDRs) in the Packet Switching Control Protocol (PFCP) session, wherein the PDRs are used to record at least one preset rule and an associated preset rule identifier; Identify the Packet Detection Information (PDI) in the Packet Detection Rule (PDR), wherein the Packet Detection Information (PDI) is used to match the preset rule identifier, and the Packet Detection Information (PDI) carries the User Internet Protocol Address (UE IP) or the Full Tunnel Endpoint Identifier (F-TEID). Based on the Packet Inspection Information (PDI), a preset key value matching the preset rule identifier is determined. The preset key value includes at least: Tunnel Endpoint Identifier (TEID), Destination Internet Protocol (IP) address, and Source Internet Protocol (IP) address. When the Packet Inspection Information (PDI) carries the User Internet Protocol (UE) address, the Tunnel Endpoint Identifier (TEID) and the Destination IP address are invalid identifiers. The Source IP address is determined based on the User Internet Protocol (UE) address. When the Packet Inspection Information (PDI) carries the Full Tunnel Endpoint Identifier (F-TEID), the Tunnel Endpoint Identifier (TEID) and the Destination IP address are determined based on the Full Tunnel Endpoint Identifier (F-TEID), and the Source IP address is an invalid identifier.
8. The method according to claim 5, characterized in that, When the session type is the second type, managing the preset instructions in the preset instruction set according to the session type includes: Identify at least one preset packet in the preset access control table that is indicated by the Packet Switching Control Protocol (PFCP) session indication; Determine the preset instruction corresponding to the preset group from the preset instruction set; According to the preset rule index recorded in the preset instruction, delete the corresponding preset rule in the preset rule management pool; According to the preset table index recorded in the preset instruction, delete the corresponding preset rule identifier in the preset access control table; Delete the preset instruction used to represent the correspondence between the preset rule index and the preset table index.
9. A message processing apparatus, characterized in that, include: The acquisition module is used to acquire the message to be processed, wherein the message to be processed carries: target message stream tuple information; The analysis module is used to call a preset access control table to analyze the message to be processed, and determine the preset group that matches the target message flow tuple information as the target group. The preset access control table includes: multiple preset groups and preset message flow tuple information corresponding to each preset group. Each preset group is used to record at least one preset rule identifier. The determination module is used to determine, when the target group exists in the preset access control table, a preset instruction corresponding to the target group in the preset instruction set as the target instruction, wherein the preset instruction is used to record the correspondence between at least one preset table index and at least one preset rule index, the preset table index is used to indicate the position of the preset rule identifier in the preset access control table, and the preset rule index is used to indicate the position of the preset rule associated with the preset rule identifier in the preset rule management pool; The calling module is used to call the target instruction to obtain at least one target rule from the preset rule management pool, wherein the target rule is associated with the preset rule identifier in the target group; The processing module is used to process the message to be processed based on at least one target rule.
10. A non-volatile storage medium, characterized in that, The non-volatile storage medium is used to store a program, wherein, when the program is running, it controls the device where the non-volatile storage medium is located to execute the message processing method according to any one of claims 1 to 8.
11. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, performs the message processing method according to any one of claims 1 to 8.