Service redirection method and device, network equipment and computer readable storage medium
By constructing the correspondence between user identification information and tunnel information in the 5G core network, determining the target user identification information of the current traffic, and executing corresponding redirection rules, the problem of low business redirection accuracy in the existing technology is solved, and higher business redirection accuracy and system stability are achieved.
Patent Information
- Application Number
- CN202411991631.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing user traceability association method based on the N2, N3, and N4 interfaces of the 5G core network has the problem of low service redirection accuracy.
By obtaining the current traffic carried based on the tunnel protocol, based on the correspondence between the pre-constructed user identification information and the tunnel information, the target user identification information of the current traffic is determined, and the pre-saved redirection rules are found and executed based on the identification information.
It improves the accuracy of business redirection and enhances the accuracy of determining redirection rules in the user dimension, thereby ensuring the stability of the system operation.
Smart Images

Figure CN119697083A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communication technology, and in particular to a service redirection method, apparatus, network equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of data communication, the application of DPI (Deep Packet Inspection) system in 5G core network is becoming increasingly important. It analyzes the content of all data packets transmitted through the network to identify, classify and manage network traffic. Now, there is a method and system for user traceability association based on the N2, N3 and N4 interfaces of the 5G core network. The association table between tunnel information and users is established based on the N4 interface, and the location relationship of users is extracted and supplemented based on the N2 interface. Finally, the association table is searched according to the tunnel identifier of the N3 service data to obtain the user's device identity. After the service data is labeled accordingly, the back-end data analysis system performs fine filtering and diversion on the 5G traffic.
[0003] However, the current user tracing and association method based on the 5G core network N2, N3, and N4 interfaces has the problem of low service redirection accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a service redirection method, apparatus, network device, computer-readable storage medium and computer program product that can improve the accuracy of service redirection in response to the above technical problems.
[0005] In a first aspect, the present application provides a service redirection method, which is applied to a network device, including:
[0006] Obtaining current traffic carried by a tunnel protocol and transmitted on a target interface; the target interface is an interface between an access network and a user plane function;
[0007] For the current traffic, based on the pre-established correspondence between the user identification information and the tunnel information, the target user identification information corresponding to the current traffic is determined; the correspondence is established based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function;
[0008] A pre-saved redirection rule is searched based on the target user identification information. If a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
[0009] In one embodiment, the method further comprises:
[0010] Receive first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on the first signaling parsing flowing through the first reference interface, and the second user tunnel information is obtained based on the second signaling parsing flowing through the second reference interface;
[0011] Based on the first user tunnel information and the second user tunnel information, user tunnel information is obtained; the user tunnel information includes user identification information and tunnel information;
[0012] A corresponding relationship between the user identification information and the tunnel information is constructed according to the user tunnel information, and the corresponding relationship is saved.
[0013] In one embodiment, the method further comprises:
[0014] Obtaining first type field information in the first signaling;
[0015] When the first type field information indicates that the process in which the first signaling is located is a signaling process for creating a session or a signaling process for updating a session, the first signaling is parsed to obtain the first user tunnel information.
[0016] In one embodiment, the method further comprises:
[0017] Obtaining second type field information in the second signaling;
[0018] When the second type field information represents that the process in which the second signaling is located is a PDU session management signaling process provided by the network slice management function or a signaling process provided by the access and mobility management function, the second signaling is parsed to obtain the second user tunnel information.
[0019] In an exemplary embodiment, constructing a correspondence between user identification information and tunnel information according to user tunnel information includes:
[0020] For each user tunnel information, obtaining user context information associated with the user tunnel information;
[0021] Parse the user tunnel information to obtain the corresponding user identification information and tunnel information;
[0022] Constructing a first hash table based on the user identification information, the tunnel information and the user context information, and constructing a second hash table based on the tunnel information and the user context information;
[0023] According to the first hash table and the second hash table, a corresponding relationship between the user identification information and the tunnel information is obtained.
[0024] In one of the embodiments, for the current traffic, based on the pre-built correspondence between the user identification information and the tunnel information, determining the target user identification information corresponding to the current traffic includes:
[0025] Get the current tunnel information of the current traffic;
[0026] Querying the second hash table based on the current tunnel information, and determining the target user context information corresponding to the current tunnel information from the second hash table;
[0027] The first hash table is searched according to the target user context information, and the user identification information corresponding to the target user context information determined in the first hash table is used as the target user identification information.
[0028] In one embodiment, the method further comprises:
[0029] receiving new first user tunnel information and / or new second user tunnel information;
[0030] Obtaining new user tunnel information based on the new first user tunnel information and / or the new second user tunnel information;
[0031] Parsing new user tunnel information to obtain new user identification information and new tunnel information;
[0032] Query the first hash table according to the new user identification information, and if the user context information corresponding to the new user identification information is not matched in the first hash table, add the new user context information corresponding to the new user identification information to the first hash table;
[0033] Continue to query the second hash table based on the new tunnel information;
[0034] If a hash value corresponding to the new tunnel information is matched in the second hash table, the corresponding hash value in the second hash table is updated based on the new user context information;
[0035] If the hash value corresponding to the new tunnel information is not matched in the second hash table, a new hash value corresponding to the new tunnel information is added to the second hash table based on the new user context information.
[0036] In an exemplary embodiment, the method further comprises:
[0037] Query the first hash table according to the new user identification information, if user context information corresponding to the new user identification information is matched in the first hash table, continue to query the second hash table based on the new tunnel information;
[0038] If the hash value corresponding to the new tunnel information is not matched in the second hash table, a new hash value corresponding to the new tunnel information is added to the second hash table based on the matched user context information.
[0039] In one embodiment, the method further comprises:
[0040] Receive initial redirection rules;
[0041] In the case that the initial redirection rule is not an unbinding redirection rule, the initial redirection rule is parsed to obtain user identification information and redirection URL information, and the redirection rule is compiled according to the user identification information and the redirection URL information, and the compiled redirection rule is saved.
[0042] In an exemplary embodiment, performing service redirection on current traffic based on a target redirection rule includes:
[0043] Send interference traffic to the gateway included in the original URL path of the current traffic, so that the subsequent traffic of the current traffic no longer flows into the gateway; the interference traffic carries the device address information of the next-hop gateway of the current gateway;
[0044] Upon receiving confirmation information returned by each gateway in response to the interference traffic included in the original URL path, a redirection message is generated according to the redirection URL information included in the target redirection rule;
[0045] Send a redirect message to the user equipment corresponding to the current traffic; the redirect message is used to instruct the user equipment to regenerate a service request and send the service request to the network device;
[0046] Receive business requests and reconfigure the URL path of the traffic corresponding to the business requests.
[0047] In a second aspect, the present application also provides a service redirection device, which is applied to a network device, including:
[0048] Obtaining current traffic carried by a tunnel protocol and transmitted on a target interface; the target interface is an interface between an access network and a user plane function;
[0049] For the current traffic, based on the pre-established correspondence between the user identification information and the tunnel information, the target user identification information corresponding to the current traffic is determined; the correspondence is established based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function;
[0050] A pre-saved redirection rule is searched based on the target user identification information. If a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
[0051] In a third aspect, the present application further provides a network device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0052] Obtaining current traffic carried by a tunnel protocol and transmitted on a target interface; the target interface is an interface between an access network and a user plane function;
[0053] For the current traffic, based on the pre-established correspondence between the user identification information and the tunnel information, the target user identification information corresponding to the current traffic is determined; the correspondence is established based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function;
[0054] A pre-saved redirection rule is searched based on the target user identification information. If a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
[0055] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0056] Obtaining current traffic carried by a tunnel protocol and transmitted on a target interface; the target interface is an interface between an access network and a user plane function;
[0057] For the current traffic, based on the pre-established correspondence between the user identification information and the tunnel information, the target user identification information corresponding to the current traffic is determined; the correspondence is established based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function;
[0058] A pre-saved redirection rule is searched based on the target user identification information. If a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
[0059] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0060] Obtaining current traffic carried by a tunnel protocol and transmitted on a target interface; the target interface is an interface between an access network and a user plane function;
[0061] For the current traffic, based on the pre-established correspondence between the user identification information and the tunnel information, the target user identification information corresponding to the current traffic is determined; the correspondence is established based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function;
[0062] A pre-saved redirection rule is searched based on the target user identification information. If a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
[0063] The above-mentioned service redirection method, device, network device, computer-readable storage medium and computer program product obtain the current traffic carried by the tunnel protocol and transmitted on the target interface as the interface between the access network and the user plane function, and determine the target user identification information corresponding to the current traffic based on the pre-constructed correspondence between the user identification information and the tunnel information for the current traffic, wherein the correspondence is constructed based on the message parsing results of the first reference interface as the interface between the user plane function and the control plane function, and the second reference interface as the interface between the access and mobility management function and the session management function, and search for the pre-saved redirection rule based on the target user identification information, and if the target redirection rule corresponding to the target user identification information is matched from the redirection rule, then the service redirection is performed on the current traffic based on the target redirection rule. By pre-constructing the correspondence between the user identification information and the tunnel information according to the message parsing results of the first reference interface and the first reference interface, the correlation rate between the current traffic flowing into the target interface and the user identification information can be improved, and the accuracy of determining the redirection rule in the user dimension can be improved, thereby improving the accuracy of service redirection and ensuring the operational stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0065] Figure 1 An application environment diagram of a service redirection method in an embodiment;
[0066] Figure 2 A schematic diagram of a flow chart of a service redirection method in an embodiment;
[0067] Figure 3 is a schematic diagram of a process of parsing a first signaling in an embodiment;
[0068] Figure 4 is a schematic diagram of a process of parsing a second signaling in an embodiment;
[0069] Figure 5 A schematic diagram of a flow chart of updating a hash table in another embodiment;
[0070] Figure 6 A schematic diagram of a process of compiling redirection rules in one embodiment;
[0071] Figure 7 is a flow chart of a service redirection method in another embodiment;
[0072] Figure 8 is a structural block diagram of a service redirection device in an embodiment;
[0073] Fig. 9 FIG. 4 is a diagram showing the internal structure of a network device in one embodiment. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0075] The service redirection method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the user equipment 102 can communicate with the network equipment 104, and the network equipment is integrated with multiple interfaces for data communication, wherein the target interface is carried by the tunnel protocol, which is the interface between the access network and the user plane function, the first reference interface is the interface between the user plane function and the control plane function, and the second reference interface is the interface between the access and mobility management function and the session management function. The corresponding relationship between the user identification information and the tunnel information can be constructed based on the message parsing results of the first reference interface and the second reference interface. The network device obtains the current traffic transmitted on the target interface, and for the current traffic, based on the pre-constructed corresponding relationship between the user identification information and the tunnel information, determines the target user identification information corresponding to the current traffic, and then searches for the pre-saved redirection rule based on the target user identification information. If the target redirection rule corresponding to the target user identification information is matched from the redirection rule, the current traffic is redirected based on the target redirection rule. Among them, the user equipment 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The network device 104 may be an information network device, equipment, Etc. Common network devices include: switches, routers, firewalls, , , , server, Card (NIC), ( )、 , , , wait.
[0076] In an exemplary embodiment, Figure 2 As shown, a business redirection method is provided, which is applied to Figure 1Take the network device in as an example to illustrate, assuming that the network where the current network device is located is a 5G core network, the target interface at this time is the N3 interface, the N3 interface corresponds to the interface between the access network and the user plane function, the first reference interface is the N4 interface, the N4 interface corresponds to the interface between the user plane function and the control plane function, the second reference interface is the N11 interface, the N11 interface corresponds to the interface between the access and mobility management function and the session function; including the following steps S201 to S203. Among them:
[0077] Step S201, obtaining current traffic carried on a tunnel protocol and transmitted on a target interface; the target interface is an interface between an access network and a user plane function.
[0078] Among them, tunneling protocol can be understood as a technology that encapsulates data packets in different protocol packets in the network. It is often used to implement various types of network connections. Common tunneling protocols include IPsec (used to provide security between IP networks, commonly used in VPN), L2TP (Layer 2 Tunneling Protocol, usually used in conjunction with IPsec to provide tunneling services for point-to-point connections), GRE (Generic Routing Encapsulation, used to encapsulate different types of protocols into IP packets, suitable for a variety of protocols, and does not provide encryption), MPLS (Multiprotocol Label Switching, using labels to achieve data packet forwarding, can also be used to establish tunnels), etc.
[0079] Exemplarily, the network device 104 captures all data packets transmitted on the N3 interface based on the tunnel protocol according to the pre-configured traffic monitoring function, and classifies the traffic according to the source and destination IP addresses, port numbers, protocol types, etc., to separate the current traffic that needs to be judged whether to perform service redirection. By classifying the captured data packets and determining the current traffic that needs to be associated with the user identification information, it is avoided to process multiple data packet traffic, thereby speeding up the directional speed of the service redirection of the N3 interface.
[0080] Step S202, for the current traffic, based on the pre-constructed correspondence between the user identification information and the tunnel information, determine the target user identification information corresponding to the current traffic; the correspondence is constructed based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is the interface between the user plane function and the control plane function, and the second reference interface is the interface between the access and mobility management function and the session management function.
[0081] Among them, user identification information can be understood as the user's identity code, which is used to distinguish different users. For example, IMSI (International Subscription Mobile Identity) is an identifier for user identification related to the SM card. The user plane function can be understood as the component in the network architecture that handles user data traffic (such as video, web pages, and audio, etc.), including data forwarding, traffic management, tunnel management, packet filtering, and billing; the control plane function can be understood as the component responsible for signaling and connection management, including session establishment and signaling management; the access and mobility management function is responsible for managing the mobility of user equipment (UE) to ensure that users can maintain continuous service connections in different network environments, including user access management, location tracking, session management, network switching management, and service quality management; the session management function is responsible for managing the establishment, maintenance, modification, and termination of user sessions.
[0082] In an exemplary embodiment, the network device 104 preliminarily constructs a correspondence between user identification information and tunnel information based on the message parsing results of the N4 interface and the N11 interface, and determines the target user identification information corresponding to the current flow based on the correspondence between the user identification information and the tunnel information constructed above for the current flow. By determining the target user identification information corresponding to the current flow based on the correspondence constructed based on the message parsing results of the N4 interface and the N11 interface, the accuracy of the target user identification information is improved, thereby improving the accuracy of the target redirection rule determined subsequently.
[0083] Step S203: searching for a pre-saved redirection rule based on the target user identification information, and if a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
[0084] The redirection rule can be understood as a user-dimension rule, which includes the user identification information of the user who currently initiates the service and the URL (Uniform Resource Locator) path after the corresponding traffic is changed.
[0085] Exemplarily, the network device 104 searches for a pre-saved redirection rule based on the target user identification information. If the target redirection rule corresponding to the target user identification information is matched from the redirection rule, the current traffic is redirected based on the target redirection rule, mainly sending TCP interference traffic to the gateway included in the original URL path, so that the gateway no longer receives subsequent traffic of the current traffic, which is considered to be interference success. After the interference is successful, the URL path is reconfigured; if the target redirection rule corresponding to the target user identification information is not matched from the redirection rule, the current traffic is not redirected, and the current traffic continues to flow according to the original URL path. By searching for redirection rules based on user identification information, the environmental adaptability of traffic control is enhanced, the problem of traffic transmission waste caused by untimely path updates is avoided, bandwidth is saved, and the stability of system operation is guaranteed.
[0086] In the above service redirection method, the current traffic transmitted on the target interface as the interface between the access network and the user plane function based on the tunnel protocol is obtained, and the target user identification information corresponding to the current traffic is determined based on the pre-constructed correspondence between the user identification information and the tunnel information for the current traffic, wherein the correspondence is constructed based on the message parsing results of the first reference interface as the interface between the user plane function and the control plane function, and the second reference interface as the interface between the access and mobility management function and the session management function, and the pre-saved redirection rule is searched based on the target user identification information, and if the target redirection rule corresponding to the target user identification information is matched from the redirection rule, the service redirection is performed on the current traffic based on the target redirection rule. By pre-constructing the correspondence between the user identification information and the tunnel information according to the message parsing results of the first reference interface and the first reference interface, the correlation rate between the current traffic flowing into the target interface and the user identification information can be improved, and the accuracy of determining the redirection rule in the user dimension can be improved, thereby improving the accuracy of service redirection and ensuring the operational stability of the system.
[0087] In one embodiment, the method also includes: receiving first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on the first signaling parsing flowing through the first reference interface, and the second user tunnel information is obtained based on the second signaling parsing flowing through the second reference interface; based on the first user tunnel information and the second user tunnel information, user tunnel information is obtained; the user tunnel information includes user identification information and tunnel information; a correspondence between the user identification information and the tunnel information is constructed according to the user tunnel information, and the correspondence is saved.
[0088] The tunnel information may be understood as all data, configuration, status and control information involved in the process of establishing and operating the tunnel, including the source address and destination address, tunnel protocol type and the like.
[0089] In an exemplary embodiment, when the first reference interface is the N4 interface and the second reference interface is the N11 interface, the network device 104 receives the first user tunnel information obtained by parsing the first signaling flowing through the N4 interface and the second user tunnel information obtained by parsing the second signaling flowing through the N11 interface, obtains the user tunnel information encapsulated with the user identification information and the tunnel information based on the first user tunnel information and the second user tunnel information, and finally constructs the corresponding relationship between the user identification information and the tunnel information according to the user tunnel information. The corresponding relationship between the user identification information and the tunnel information is constructed by synthesizing the parsing results of the messages flowing through the N4 interface and the N11 interface, thereby improving the accuracy of determining the corresponding relationship.
[0090] In one of the embodiments, the method also includes: obtaining first type field information in the first signaling; when the first type field information indicates that the process of the first signaling is a signaling process for creating a session or a signaling process for updating a session, parsing the first signaling to obtain first user tunnel information.
[0091] For example, Figure 3 As shown, the first signaling is the PFCP protocol traffic. The network device 104 first parses the PFCP protocol. Then, based on the first type field information in the parsed first signaling, when the first type field information indicates that the process in which the first signaling is located is a signaling process for establishing a session or a signaling process for updating a session, a process (proc) is created to extract the first user tunnel information in the parsed first signaling. When the process is aged (i.e., a specific message ends or times out), the first user tunnel information extracted at this time is used as the user tunnel information for subsequent use. By extracting the user tunnel information after judging the process, the availability and validity of the extracted user tunnel information are guaranteed, and the number of corresponding user tunnel information is maintained by creating an extraction process, thereby improving the generality of the determined corresponding relationship.
[0092] In an exemplary embodiment, the method also includes: obtaining second type field information in the second signaling; when the second type field information indicates that the process in which the second signaling is located is a PDU session management signaling process provided by a network slice management function or a signaling process provided by an access and mobility management function, parsing the second signaling to obtain second user tunnel information.
[0093] In an exemplary embodiment, Figure 4 As shown, the second signaling is HTTP2 protocol traffic. The network device 104 first parses the HTTP2 protocol, and then creates a process (proc) to extract the second user tunnel information in the parsed second signaling according to the second type field information in the parsed second signaling, when the second type field information indicates that the process in which the second signaling is located is the PDU session management (NSMFPDUSession) signaling process provided by the network slice management function or the signaling process provided by the access and mobility management function (NAMF-COMM). When the process is aged (i.e., a specific message ends or times out), the second user tunnel information extracted at this time is used as the user tunnel information for subsequent use. By extracting the user tunnel information after judging the process, the availability and validity of the extracted user tunnel information are guaranteed, and the number of corresponding user tunnel information is maintained by creating an extraction process, thereby improving the generality of the determined corresponding relationship.
[0094] In one embodiment, a correspondence between user identification information and tunnel information is constructed based on user tunnel information, including: for each user tunnel information, obtaining user context information associated with the user tunnel information; parsing the user tunnel information to obtain corresponding user identification information and tunnel information; constructing a first hash table based on the user identification information, tunnel information and user context information, and constructing a second hash table based on the tunnel information and the user context information; and obtaining a correspondence between the user identification information and the tunnel information based on the first hash table and the second hash table.
[0095] The user context information may be understood as other relevant information associated with the user identification information, such as relevant information used to describe the user, attribute information of the user, and the like.
[0096] Exemplarily, the network device 104 creates a first hash table: a hash table is created with user information (IMSI, IMEI, MSISDN) as a key, and the value information is the user context ue_ctx (i.e., user context information), and the user context contains all gtp_tunnels (GPRS Tunneling Protocol Tunnels) of the user, and gtp_tunnel contains the user's tunnel information key, which is organized in the form of an array; the network device 104 creates a second hash table: a hash table is created with tunnel information (IP TYPE, GNBIP, UPFIP and GNBTEID, UPFTEID) as a key, and the value information is gtp_tunnel, which contains the user context ue_ctx. By constructing the first hash table and the second hash table, the tunnel information can be updated in real time, thereby enhancing the accuracy of the correspondence between the user identification information and the tunnel information.
[0097] In one of the embodiments, for the current traffic, based on the pre-built correspondence between the user identification information and the tunnel information, the target user identification information corresponding to the current traffic is determined, including: obtaining the current tunnel information of the current traffic; querying the second hash table based on the current tunnel information, and determining the target user context information corresponding to the current tunnel information from the second hash table; querying the first hash table according to the target user context information, and using the user identification information corresponding to the target user context information determined from the first hash table as the target user identification information.
[0098] In an exemplary embodiment, the network device 104 obtains the current tunnel information of the current traffic, first queries the second hash table based on the current tunnel information, determines the target user context information corresponding to the current tunnel information from the second hash table, and then further searches the first hash table based on the target user context information, and uses the user identification information corresponding to the target user context determined from the first hash table as the target user identification information. If the target user context information corresponding to the current tunnel information is not determined from the second hash table, the process is directly terminated without being terminated. By first querying the second hash table and then the first hash table, the accuracy of the target user identification information finally determined is improved, and at the same time, if the query of the first hash table fails, the query is terminated in time to avoid consuming unnecessary query costs.
[0099] In one embodiment, the method also includes: receiving new first user tunnel information and / or new second user tunnel information; obtaining new user tunnel information based on the new first user tunnel information and / or the new second user tunnel information; parsing the new user tunnel information to obtain new user identification information and new tunnel information; querying the first hash table according to the new user identification information, if the user context information corresponding to the new user identification information is not matched from the first hash table, then adding new user context information corresponding to the new user identification information to the first hash table; continuing to query the second hash table based on the new tunnel information; if the hash value corresponding to the new tunnel information is matched from the second hash table, updating the corresponding hash value in the second hash table based on the new user context information; if the hash value corresponding to the new tunnel information is not matched from the second hash table, then adding a new hash value corresponding to the new tunnel information to the second hash table based on the new user context information.
[0100] Among them, the first hash table: creates a hash table with user information (IMSI, IMEI, MSISDN) as the key, and the value information is the user context ue_ctx (that is, user context information). The user context contains all gtp_tunnels of the user. The gtp_tunnel contains the user's tunnel information key, which is organized in the form of an array. The second hash table: creates a hash table with tunnel information (IP TYPE, GNBIP, UPFIP and GNBTEID, UPFTEID) as the key, and the value information is gtp_tunnel (that is, hash value), which contains the user context ue_ctx.
[0101] For example, Figure 5As shown, the network device 104 receives new first user tunnel information and / or new second user tunnel information, obtains new user tunnel information based on the new first user tunnel information and / or the new second user tunnel information, and parses the new user tunnel information to obtain new user identification information and new tunnel information. First, the first hash table is queried according to the new user identification information (i.e., ismi in the figure). If the user context information corresponding to the new user identification information (i.e., the user context ue_ctx in the figure) is not matched from the first hash table, the corresponding new user context information is created according to the new user identification information, and then the second hash table is queried based on the new tunnel information. If the gtp_tunnel corresponding to the new tunnel information is matched from the second hash table, the ue_ctx in the gtp_tunnel is updated, and the gtp_tunnel in the ue_ctx is updated to the new gtp_tunnel update. If the gtp_tunnel corresponding to the new tunnel information is not matched from the second hash table, a new gtp_tunnel is constructed based on the new tunnel information, the new gtp_tunnel is added to the created ue_ctx, and the ue_ctx is mounted to the gtp_tunnel. By dynamically creating and updating user context information based on new user identification information and tunnel information, the network can quickly adapt to user status changes. Appropriate actions (update or create) can be taken for different users and tunnel information, improving processing flexibility and response speed.
[0102] In an exemplary embodiment, the method also includes: querying the first hash table based on the new user identification information, if the user context information corresponding to the new user identification information is matched from the first hash table, continuing to query the second hash table based on the new tunnel information; if the hash value corresponding to the new tunnel information is not matched from the second hash table, then adding a new hash value corresponding to the new tunnel information in the second hash table based on the matched user context information.
[0103] For example, Figure 5As shown, the table in the figure updates another process. When the network device 104 queries the first hash table according to the new user identification information and matches the user context ue_ctx corresponding to the new user identification information from the first hash table, it continues to query the second hash table based on the new tunnel information. If the second gtp tunnel corresponding to the new tunnel information is not matched from the second hash table, a new gtp_tunnel is constructed based on the new tunnel information, and the new gtp_tunnel is mounted to the corresponding user context ue_ctx. At the same time, if the gtp_tunnel corresponding to the new tunnel information is also matched from the second hash table, it proves that the corresponding relationship between the user identification information and the tunnel information contained in the new user tunnel information currently received has been recorded, and there is no need to update the relevant content. The above-mentioned method ensures efficient management and updating of user context information, and can be dynamically adjusted according to actual needs. Through rapid matching and confirmation, if there are existing records, unnecessary update operations are avoided and the consumption of system resources is reduced.
[0104] In one of the embodiments, the method also includes: receiving an initial redirection rule; when the initial redirection rule is not an unbinding redirection rule, parsing the initial redirection rule to obtain user identification information and redirection URL information, and compiling the redirection rule based on the user identification information and redirection URL information, and saving the compiled redirection rule.
[0105] The redirection URL information can be understood as the unique positioning information stored on the network device of the node through which the traffic needs to flow.
[0106] In an exemplary embodiment, Figure 6 As shown, the network device 104 receives the initial redirection rule and determines whether the initial redirection rule is an unbinding redirection rule. If the initial redirection rule is not an unbinding redirection rule, the initial redirection rule is parsed to obtain user identification information and redirection URL information, and the redirection rule is compiled according to the user identification information and redirection URL information, and the compiled redirection rule is saved; if the initial redirection rule is an unbinding redirection rule, the redirection rule of a certain user (which can be the user specified by the initial redirection rule) is released, and the redirection rule is recompiled and saved. The redirection strategy can be adjusted according to real-time needs. By releasing unnecessary redirection rules, the redundant configuration and resource waste of the system can be effectively reduced, and the compiled and saved redirection rules can be quickly applied, thereby improving the management efficiency and performance of network resources.
[0107] In one embodiment, performing service redirection on current traffic based on a target redirection rule includes:
[0108] Send interference traffic to the gateway included in the original URL path of the current traffic, so that the subsequent traffic of the current traffic no longer flows into the gateway; the interference traffic carries the device address information of the next-hop gateway of the current gateway; when receiving the confirmation information returned by each gateway included in the original URL path in response to the interference traffic, generate a redirection message according to the redirection URL information included in the target redirection rule; send a redirection message to the user device corresponding to the current traffic; the redirection message is used to instruct the user device to regenerate a service request and send the service request to the network device; receive the service request, and reconfigure the URL path of the traffic corresponding to the service request.
[0109] The URL path can be understood as the route of the nodes through which the traffic flowing into the target interface needs to flow.
[0110] For example, when the network device matches the target redirection rule corresponding to the current traffic, the current traffic can be marked with a preset label, and the service redirection can be performed without immediate execution. The marked traffic can be first stored in the ready queue to wait for the network device 104 to process. When the queue status meets the processing conditions, the network device can process it first or select the service redirection task to be processed first according to the user level. By adding labels to the queue, the network device 104 is given buffer time to perform the service redirection operation. At the same time, the labeling makes it easy to distinguish it from other tasks that need to be processed, avoiding task conflict processing, thereby ensuring the stability of system operation.
[0111] The network device 104 sends interference traffic carrying the device address information of the next-hop gateway of the current gateway to the gateway included in the original URL path of the current traffic, so that the subsequent traffic of the current traffic no longer flows into the gateway and the interference traffic can be smoothly sent from the current gateway to the next-hop gateway. When receiving the confirmation information returned by each gateway included in the original path in response to the interference traffic, a redirection message is generated according to the redirection URL information included in the target redirection rule, and the redirection message is sent to the user device 102 corresponding to the current traffic. The user device 102 regenerates the service request under the instruction of the redirection message and sends the service request to the network device 104. The network device 104 reconfigures the URL path of the traffic corresponding to the service request according to the received service request. Through the above method, it is realized that by utilizing the interference traffic, the network device 104 can flexibly control the flow direction of the traffic, thereby optimizing the allocation of network resources, ensuring the effective use of bandwidth, and reducing the chance of network congestion and traffic conflicts. After receiving the redirection message, the user device 102 can quickly obtain the new service request address, maintain the continuity of user experience, and avoid request failures caused by path changes.
[0112] In an exemplary embodiment, Figure 7As shown, a specific implementation of a service redirection method is provided, which is as follows:
[0113] The network device is divided into a signaling unit, an execution unit and a control unit, and the service redirection method is implemented by information interaction between the units.
[0114] 1. Signaling unit:
[0115] The signaling analysis of the N4 and N11 interfaces is completed, and the user and tunnel information is encapsulated as binary data and sent to the execution unit.
[0116] 1.1、User tunnel information analysis and encapsulation:
[0117] The N4 interface is carried in the PFCP protocol, and the N11 interface is carried in the HTTP2 protocol. The signaling unit parses the N4 and N11 interfaces, that is, processes the PFCP protocol and the HTTP2 protocol, and obtains IMSI, IMEI, MSISDN, INTERFACE TYPE, GTP INFO (IP TYPE, GNBIP, UPFIP and GNBTEID, UPFTEID) from these two protocols. After parsing, the assembly format of the user tunnel information is encapsulated in accordance with TLV (type-length-value), as shown in the following table:
[0118]
[0119] User tunnel information is assembled in TLV format, and the three user code information is encapsulated separately. The specific TLV format description is shown in the figure above. GTP INFO includes all tunnel information in this field, and the tag value used is 4. The content inside is encapsulated according to a fixed length.
[0120] The user tunnel information of the N4 interface is mainly obtained from the session establishment and session modification processes, and mainly obtains the user tunnel information of the addition and modification processes of the N4 interface.
[0121] The user tunnel information of the N11 interface is mainly obtained from the nsmf-pdusession (signaling of user data session of network slice management function) process and the namf-comm (signaling of network access management function communication) process.
[0122] 1.2. User tunnel information update:
[0123] When the user's signaling information changes, for example, when the user's location changes, from one base station to another, the user tunnel information carried by the N4 interface and the N11 interface will be parsed by the signaling unit in real time and sent to the execution unit to update the user tunnel information. In this way, the traffic of the N3 interface in the 5G core network can also query the correct user identification information based on the updated user tunnel information.
[0124] 2. Execution unit:
[0125] The execution unit mainly completes the following functions:
[0126] 1) Receive user tunnel information from the signaling unit and store it in the user tunnel module;
[0127] 2) Receive redirection rules from the control unit and compile them into the rule module;
[0128] 3) Receive N3 traffic, perform user matching on N3 traffic, and match redirection rules on the traffic of matched users;
[0129] 4) Perform business redirection actions on the traffic that matches the redirection rules.
[0130] 2.1、User tunnel information reception and storage:
[0131] The execution unit receives the user tunnel information from the signaling unit and Figure 1 The user tunnel information is parsed in the format and a hash table of users and tunnels is created. To ensure that the hash table can be quickly updated when the user's base station changes, the hash table needs to be created with the following dimensions of key:
[0132] 1) Create a hash table with user identification information (IMSI, IMEI, MSISDN) as the key, and the value information is the user context ue_ctx. The user context contains all the gtp_tunnels of the user. The gtp_tunnel stores the user's tunnel information key, which is organized in the form of an array;
[0133] 2) Create a hash table with tunnel information (IP TYPE, GNBIP, UPFIP and GNBTEID, UPFTEID) as the key and value information as gtp_tunnel, which contains the user context ue_ctx.
[0134] The association between the above two hash tables is maintained by the user tunnel information contained in the user context ue_ctx. When receiving the user tunnel information, first query the hash table with the user identification information. If not found, then create a new hash table for the user and associate the tunnel information carried this time with the user context. If the gtp_tunnel is found using the tunnel information, then establish an association between the gtp_tunnel obtained from the tunnel information and the user context ue_ctx. Otherwise, create a gtp_tunnel with the tunnel information and add it to ue_ctx, and mount ue_ctx to gtp_tunnel.
[0135] 2.2. Receiving and compiling redirection rules:
[0136] The execution unit also needs to receive the redirection rule issued by the control unit. The redirection rule is based on the user dimension, such as IMSI / MSISDN / IMEI, and the rule contains the redirection URL. After receiving the redirection rule, the execution unit will compile the rule into the local rule module.
[0137] 2.3. User association and rule matching of N3 traffic:
[0138] The execution unit receives the N3 traffic from the 5G core network, queries the hash table in 1.2 through the GTP information on the outer layer of the traffic, and stores the queried user identification information in the current traffic. The traffic that matches the user identification information can go to the rule module to match the redirection rule, and the traffic that matches the redirection rule is marked with FLOW_NEED_REDIRECT_FLAG (traffic requires service redirection).
[0139] 2.4 Traffic redirection action execution:
[0140] The redirection module performs redirection based on whether the flow is marked with the FLOW_NEED_REDIRECT_FLAG flag. To complete the redirection action, the following functions need to be completed:
[0141] 1) Send TCP interference traffic to the gateway on the original URL path of the original traffic to ensure that the subsequent traffic of the original traffic no longer interacts;
[0142] 2) The destination MAC address of the TCP interference traffic sent is the MAC of the next-hop gateway of the interference port, ensuring that the interference packet can be successfully sent from the next-hop gateway to complete the interference function;
[0143] 3) Send redirect message. After sending the interference traffic, you need to send a redirect message according to the redirect URL contained in the issued rule to redirect the original traffic to the configured URL path.
[0144] Compared with the prior art, this application has the following advantages:
[0145] 1. The signaling unit is responsible for parsing the traffic of the N4 and N11 interfaces, extracting key user tunnel information such as IMSI, IMEI, MSISDN, etc., and sending this information to the execution unit to provide basic data for subsequent service redirection;
[0146] 2. The execution unit receives and stores the user tunnel information from the signaling unit, and combines it with the data plane traffic of the N3 interface to achieve accurate association with specific user traffic, providing accurate target positioning for the implementation of the service redirection strategy.
[0147] 3. The control unit issues redirection strategies for specific users and compiles these strategies into rule modules to ensure that the execution unit can effectively redirect user traffic according to these rules, thereby improving the management efficiency of the 5G core network.
[0148] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0149] Based on the same inventive concept, the embodiment of the present application also provides a service redirection device for implementing the service redirection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more service redirection device embodiments provided below can refer to the limitations on the service redirection method above, and will not be repeated here.
[0150] In an exemplary embodiment, Figure 8 As shown, a service redirection device is provided, comprising: a current traffic acquisition module 801, a target user identification information determination module 802 and a service redirection execution module 803, wherein:
[0151] The current traffic acquisition module 801 is used to acquire the current traffic carried by the tunnel protocol and transmitted on the target interface; the target interface is the interface between the access network and the user plane function;
[0152] The target user identification information determination module 802 is used to determine the target user identification information corresponding to the current traffic based on the pre-established correspondence between the user identification information and the tunnel information; the correspondence is established based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function;
[0153] The service redirection execution module 803 is used to search for a pre-stored redirection rule based on the target user identification information, and if a target redirection rule corresponding to the target user identification information is matched from the redirection rules, perform service redirection on the current traffic based on the target redirection rule.
[0154] Based on the service redirection device of the above embodiment, the current traffic transmitted on the interface between the access network and the user plane function based on the tunnel protocol is obtained by the current traffic acquisition module, and the target user identification information determination module determines the target user identification information corresponding to the current traffic based on the pre-constructed correspondence between the user identification information and the tunnel information for the current traffic, wherein the correspondence is constructed based on the message parsing results of the first reference interface and the second reference interface, the first reference interface is the interface between the user plane function and the control plane function, and the second reference interface is the interface between the access and mobility management function and the session management function, and then the pre-saved redirection rule is queried based on the target user identification information, and if the target redirection rule corresponding to the target user identification information is matched from the redirection rule, the service redirection is performed on the current traffic based on the target redirection rule. By pre-constructing the correspondence between the user identification information and the tunnel information according to the message parsing results of the first reference interface and the first reference interface, the correlation rate between the current traffic flowing into the target interface and the user identification information can be improved, and the accuracy of determining the redirection rule in the user dimension can be improved, thereby improving the accuracy of service redirection and ensuring the operation stability of the system.
[0155] In one embodiment, the service redirection device also includes a correspondence construction module, which is used to receive first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on the first signaling parsing flowing through the first reference interface, and the second user tunnel information is obtained based on the second signaling parsing flowing through the second reference interface; based on the first user tunnel information and the second user tunnel information, the user tunnel information is obtained; the user tunnel information includes user identification information and tunnel information; the correspondence between the user identification information and the tunnel information is constructed according to the user tunnel information, and the correspondence is saved.
[0156] In one of the embodiments, the correspondence construction module also includes a first signaling parsing submodule, which is used to obtain the first type of field information in the first signaling; when the first type of field information represents that the process of the first signaling is a signaling process for creating a session or a signaling process for updating a session, the first signaling is parsed to obtain the first user tunnel information.
[0157] In an exemplary embodiment, the correspondence construction module also includes a second signaling parsing submodule, which is used to obtain second type field information in the second signaling; when the second type field information represents that the process in which the second signaling is located is a PDU session management signaling process provided by the network slice management function or a signaling process provided by the access and mobility management function, the second signaling is parsed to obtain the second user tunnel information.
[0158] In one embodiment, the correspondence construction module is also used to obtain user context information associated with each user tunnel information; parse the user tunnel information to obtain corresponding user identification information and tunnel information; construct a first hash table based on the user identification information, tunnel information and user context information, and construct a second hash table based on the tunnel information and user context information; obtain the correspondence between the user identification information and the tunnel information based on the first hash table and the second hash table.
[0159] In one of the embodiments, the target user identification information determination module 802 is also used to obtain current tunnel information of current traffic; query the second hash table based on the current tunnel information, and determine the target user context information corresponding to the current tunnel information from the second hash table; query the first hash table according to the target user context information, and use the user identification information corresponding to the target user context information determined from the first hash table as the target user identification information.
[0160] In an exemplary embodiment, the correspondence relationship building module further includes an updating submodule:
[0161] The updating submodule is used to receive new first user tunnel information and / or new second user tunnel information; obtain new user tunnel information based on the new first user tunnel information and / or the new second user tunnel information; parse the new user tunnel information to obtain new user identification information and new tunnel information; query the first hash table according to the new user identification information, if the user context information corresponding to the new user identification information is not matched in the first hash table, then add the new user context information corresponding to the new user identification information to the first hash table; continue to query the second hash table based on the new tunnel information; if the hash value corresponding to the new tunnel information is matched in the second hash table, update the corresponding hash value in the second hash table based on the new user context information; if the hash value corresponding to the new tunnel information is not matched in the second hash table, then add the new hash value corresponding to the new tunnel information to the second hash table based on the new user context information.
[0162] In one embodiment, the update submodule is also used to query the first hash table based on the new user identification information. If the user context information corresponding to the new user identification information is matched from the first hash table, the second hash table is continued to be queried based on the new tunnel information; if the hash value corresponding to the new tunnel information is not matched from the second hash table, a new hash value corresponding to the new tunnel information is added to the second hash table based on the matched user context information.
[0163] In one of the embodiments, the service redirection device also includes a redirection rule compilation module for receiving an initial redirection rule; when the initial redirection rule is not an unbinding redirection rule, the initial redirection rule is parsed to obtain user identification information and redirection URL information, and the redirection rule is compiled according to the user identification information and the redirection URL information, and the compiled redirection rule is saved.
[0164] In an exemplary embodiment, the service redirection execution module 803 is also used to send interference traffic to the gateway included in the original URL path of the current traffic, so that subsequent traffic of the current traffic no longer flows into the gateway; the interference traffic carries the device address information of the next-hop gateway of the current gateway; when receiving the confirmation information returned by each gateway included in the original URL path in response to the interference traffic, a redirection message is generated according to the redirection URL information contained in the target redirection rule; a redirection message is sent to the user device corresponding to the current traffic; the redirection message is used to instruct the user device to regenerate a service request and send a service request to the network device; receive the service request, and reconfigure the URL path of the traffic corresponding to the service request.
[0165] Each module in the above service redirection device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a network device in the form of hardware, or can be stored in a memory in the network device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0166] In an exemplary embodiment, a network device is provided. The network device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The network device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the network device is used to provide computing and control capabilities. The memory of the network device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the network device is used to store traffic data, user identification information, tunnel information, the correspondence between user identification information and tunnel information, interface messages and redirection rules. The input / output interface of the network device is used to exchange information between the processor and the external device. The communication interface of the network device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a service redirection method is implemented.
[0167] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the network device to which the scheme of the present application is applied. The specific network device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0168] In an exemplary embodiment, a network device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the service redirection method in the above embodiment when executing the computer program.
[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the service redirection method in the above embodiment is implemented.
[0170] In one embodiment, a computer program product is provided, including a computer program, which implements the service redirection method in the above embodiment when executed by a processor.
[0171] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0172] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0173] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0174] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A service redirection method, characterized in that: Applied to a network device, the method comprises: Acquire current traffic carried on a target interface based on a tunnel protocol; the target interface is an interface between an access network and a user plane function; For the current traffic, based on the pre-constructed correspondence between the user identification information and the tunnel information, determine the target user identification information corresponding to the current traffic; the correspondence is constructed based on the message parsing results of the first reference interface and the second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between the access and mobility management function and the session management function; A pre-saved redirection rule is searched based on the target user identification information, and if a target redirection rule corresponding to the target user identification information is matched from the redirection rules, service redirection is performed on the current traffic based on the target redirection rule.
2. The method according to claim 1, characterized in that The method further comprises: Receive first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on the first signaling parsing flowing through the first reference interface, and the second user tunnel information is obtained based on the second signaling parsing flowing through the second reference interface; Based on the first user tunnel information and the second user tunnel information, user tunnel information is obtained; the user tunnel information includes the user identification information and the tunnel information; A corresponding relationship between the user identification information and the tunnel information is constructed according to the user tunnel information, and the corresponding relationship is saved.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining first type field information in the first signaling; When the first type field information indicates that the process in which the first signaling is located is a signaling process for creating a session or a signaling process for updating a session, the first signaling is parsed to obtain the first user tunnel information.
4. The method according to claim 2, characterized in that: The method further comprises: Obtaining second type field information in the second signaling; When the second type field information represents that the process in which the second signaling is located is a PDU session management signaling process provided by a network slice management function or a signaling process provided by an access and mobility management function, the second signaling is parsed to obtain the second user tunnel information.
5. The method according to claim 2, characterized in that: The constructing a correspondence between the user identification information and the tunnel information according to the user tunnel information includes: For each piece of user tunnel information, obtaining user context information associated with the user tunnel information; Parsing the user tunnel information to obtain corresponding user identification information and tunnel information; constructing a first hash table based on the user identification information, the tunnel information and the user context information, and constructing a second hash table based on the tunnel information and the user context information; According to the first hash table and the second hash table, a correspondence between user identification information and tunnel information is obtained.
6. The method according to claim 5, characterized in that The determining, for the current traffic, target user identification information corresponding to the current traffic based on a pre-established correspondence between user identification information and tunnel information, includes: Obtaining current tunnel information of the current traffic; Querying the second hash table based on the current tunnel information, and determining the target user context information corresponding to the current tunnel information from the second hash table; The first hash table is queried according to the target user context information, and the user identification information corresponding to the target user context information determined in the first hash table is used as the target user identification information.
7. The method according to claim 5, characterized in that The method further comprises: receiving new first user tunnel information and / or new second user tunnel information; Obtaining new user tunnel information based on the new first user tunnel information and / or the new second user tunnel information; Parsing the new user tunnel information to obtain new user identification information and new tunnel information; querying the first hash table according to the new user identification information, and if the user context information corresponding to the new user identification information is not matched in the first hash table, adding new user context information corresponding to the new user identification information to the first hash table; Continue to query the second hash table based on the new tunnel information; If a hash value corresponding to the new tunnel information is matched in the second hash table, updating the corresponding hash value in the second hash table based on the new user context information; If the hash value corresponding to the new tunnel information is not matched in the second hash table, a new hash value corresponding to the new tunnel information is added to the second hash table based on the new user context information.
8. The method according to claim 7, characterized in that The method further comprises: Query the first hash table according to the new user identification information, if user context information corresponding to the new user identification information is matched in the first hash table, continue to query the second hash table based on the new tunnel information; If the hash value corresponding to the new tunnel information is not matched in the second hash table, a new hash value corresponding to the new tunnel information is added to the second hash table based on the matched user context information.
9. The method according to claim 1, characterized in that: The method further comprises: Receive initial redirection rules; In the case that the initial redirection rule is not an unbinding redirection rule, the initial redirection rule is parsed to obtain user identification information and redirection URL information, and the redirection rule is compiled according to the user identification information and the redirection URL information, and the compiled redirection rule is saved.
10. The method according to any one of claims 1 to 9, characterized in that: The performing service redirection on the current traffic based on the target redirection rule includes: Sending interference traffic to the gateway included in the original URL path of the current traffic, so that subsequent traffic of the current traffic no longer flows into the gateway; the interference traffic carries the device address information of the next-hop gateway of the current gateway; Upon receiving confirmation information returned by each gateway included in the original URL path in response to the interference traffic, generating a redirection message according to the redirection URL information included in the target redirection rule; Sending the redirection message to the user equipment corresponding to the current traffic; the redirection message is used to instruct the user equipment to regenerate a service request and send the service request to the network device; Receive the service request and reconfigure the URL path of the traffic corresponding to the service request.
11. A service redirection device, characterized in that: Applied to network equipment, the device comprises: A current traffic acquisition module, used to acquire the current traffic carried by the tunnel protocol and transmitted on the target interface; the target interface is the interface between the access network and the user plane function; a target user identification information determination module, configured to determine, for the current traffic, the target user identification information corresponding to the current traffic based on a pre-established correspondence between user identification information and tunnel information; the correspondence is established based on a message parsing result of a first reference interface and a second reference interface; the first reference interface is an interface between the user plane function and the control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function; The service redirection execution module is used to search for a pre-saved redirection rule based on the target user identification information, and if a target redirection rule corresponding to the target user identification information is matched from the redirection rules, perform service redirection on the current traffic based on the target redirection rule.
12. A network device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Message transmission method, device and system
CN110351030A
Data processing method and device
CN112073512A
Session association method and device, computer equipment, readable storage medium and program product
CN119071942A
Traffic control server and method
US20230141028A1
Communication method and communication apparatus
WO2024164968A1