Business redirection method and apparatus, network device, and computer-readable storage medium
By constructing a correspondence between user identification information and tunnel information in the 5G core network, and combining packet parsing results and redirection rules, the problem of low service redirection accuracy was solved, achieving higher redirection accuracy and system stability.
Patent Information
- Application Number
- CN202411991631.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing user tracing and association method based on the 5G core network N2, N3, and N4 interfaces has the problem of low service redirection accuracy.
By acquiring traffic carried by the tunnel protocol, utilizing the pre-built correspondence between user identification information and tunnel information, and combining the packet parsing results of the first and second reference interfaces, the target user identification information corresponding to the current traffic is determined, and service redirection is performed based on the target redirection rules.
It improves the accuracy of service redirection, ensures the stability of system operation and the adaptability of traffic control, reduces bandwidth waste, and optimizes network resource allocation.
Smart Images

Figure CN119697083B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data communication, and in particular to a service redirection method and device, a network device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the development of data communication, the application of DPI (Deep Packet Inspection) system in 5G core network is increasingly important, which analyzes the content of all data packets transmitted through the network to identify, classify and manage network traffic. At present, a user traceability association method and system based on 5G core network N2, N3 and N4 interfaces are provided, an association table of tunnel information and users is established based on the N4 interface, the location relationship of the user is extracted and supplemented according to the N2 interface, and finally the device identity of the user is obtained by searching the association table according to the tunnel identifier of the N3 service data, and the corresponding label is added to the service data, which is filtered and distributed by the back-end data analysis system.
[0003] However, the current user traceability association method based on 5G core network N2, N3 and N4 interfaces has the problem of low service redirection accuracy. SUMMARY
[0004] Therefore, it is necessary to provide a service redirection method, device, network device, computer readable storage medium and computer program product capable of improving the accuracy of service redirection.
[0005] In a first aspect, the present application provides a service redirection method applied to a network device, comprising:
[0006] obtaining current traffic transmitted on a target interface based on a tunnel protocol bearer; the target interface being an interface between an access network and a user plane function;
[0007] determining target user identification information corresponding to the current traffic based on a pre-constructed corresponding relationship between user identification information and tunnel information; the corresponding relationship being constructed based on message analysis results of a first reference interface and a second reference interface; the first reference interface being an interface between a user plane function and a control plane function, and the second reference interface being an interface between an access and mobility management function and a session management function;
[0008] searching 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 rule, performing service redirection on the current traffic based on the target redirection rule.
[0009] In one of the embodiments, the method further comprises:
[0010] receiving first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on parsing first signaling flowing through a first reference interface, and the second user tunnel information is obtained based on parsing second signaling flowing through a second reference interface;
[0011] obtaining user tunnel information based on the first user tunnel information and the second user tunnel information; the user tunnel information comprises user identification information and tunnel information;
[0012] constructing a corresponding relationship between the user identification information and the tunnel information according to the user tunnel information, and saving the corresponding relationship.
[0013] In one of the embodiments, the method further comprises:
[0014] obtaining first type field information in the first signaling;
[0015] in a case where the first type field information represents that a flow in which the first signaling is located is a signaling flow of creating a session or a signaling flow of updating a session, obtaining the first user tunnel information by parsing the first signaling.
[0016] In one of the embodiments, the method further comprises:
[0017] obtaining second type field information in the second signaling;
[0018] in a case where the second type field information represents that a flow in which the second signaling is located is a PDU session management signaling flow provided by a network slice management function or a signaling flow provided by an access and mobility management function, obtaining the second user tunnel information by parsing the second signaling.
[0019] In one of the exemplary embodiments, constructing the corresponding relationship between the user identification information and the tunnel information according to the user tunnel information comprises:
[0020] for each user tunnel information, obtaining user context information associated with the user tunnel information;
[0021] parsing the user tunnel information to obtain 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 according to the tunnel information and the user context information;
[0023] obtaining the corresponding relationship between the user identification information and the tunnel information according to the first hash table and the second hash table.
[0024] In one of the embodiments, for current traffic, determining target user identification information corresponding to the current traffic based on the corresponding relationship between the user identification information and the tunnel information constructed in advance comprises:
[0025] obtaining current tunnel information of current traffic;
[0026] querying the second hash table based on the current tunnel information, and determining target user context information corresponding to the current tunnel information from the second hash table;
[0027] querying the first hash table according to the target user context information, and taking user identification information corresponding to the target user context information determined from the first hash table as 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 the new user tunnel information to obtain new user identification information and new tunnel information;
[0032] querying the first hash table according to the new user identification information, and adding new user context information corresponding to the new user identification information in the first hash table if no user context information corresponding to the new user identification information is matched from the first hash table;
[0033] continuing to query the second hash table based on the new tunnel information;
[0034] updating the hash value corresponding to the new user context information in the second hash table based on the new user context information if the hash value corresponding to the new tunnel information is matched from the second hash table;
[0035] adding a new hash value corresponding to the new tunnel information in the second hash table based on the new user context information if no hash value corresponding to the new tunnel information is matched from the second hash table.
[0036] In one exemplary embodiment, the method further comprises:
[0037] querying the first hash table according to the new user identification information, and continuing to query the second hash table based on the new tunnel information if user context information corresponding to the new user identification information is matched from the first hash table;
[0038] adding a new hash value corresponding to the new tunnel information in the second hash table based on the matched user context information if no hash value corresponding to the new tunnel information is matched from the second hash table.
[0039] In one embodiment, the method further comprises:
[0040] receiving an initial redirection rule;
[0041] In the case that the initial redirection rule is not an unbundling redirection rule, parsing the initial redirection rule to obtain user identification information and redirection URL information, and performing redirection rule compilation according to the user identification information and the redirection URL information, and saving the compiled redirection rule.
[0042] In an exemplary embodiment, performing service redirection on the current traffic based on the target redirection rule includes:
[0043] sending interference traffic to a gateway included in an 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 device address information of a next-hop gateway of the current gateway;
[0044] In the case that the confirmation information returned by each gateway in response to the interference traffic is received, generating a redirection packet according to redirection URL information included in the target redirection rule;
[0045] sending the redirection packet to a user device corresponding to the current traffic; the redirection packet is used to instruct the user device to regenerate a service request and send the service request to the network device;
[0046] receiving the service request, and reconfiguring a URL path of traffic corresponding to the service request.
[0047] In a second aspect, the present application further provides a service redirection apparatus applied to a network device, including:
[0048] obtaining current traffic transmitted on a target interface based on a tunnel protocol; the target interface is an interface between an access network and a user plane function;
[0049] determining target user identification information corresponding to the current traffic based on a pre-constructed correspondence relationship between user identification information and tunnel information for the current traffic; the correspondence relationship is constructed based on packet analysis results of a first reference interface and a second reference interface; the first reference interface is an interface between a user plane function and a control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function;
[0050] finding a pre-saved redirection rule based on the target user identification information, and performing service redirection on the current traffic based on a target redirection rule corresponding to the target user identification information matched from the redirection rule.
[0051] In a third aspect, the present application provides a network device, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0052] obtaining current traffic transmitted on a target interface based on a tunnel protocol bearer; the target interface being an interface between an access network and a user plane function;
[0053] determining target user identification information corresponding to the current traffic based on a pre-constructed correspondence between user identification information and tunnel information; the correspondence being constructed based on message analysis results of a first reference interface and a second reference interface; the first reference interface being an interface between the user plane function and a control plane function, and the second reference interface being an interface between an access and mobility management function and a session management function;
[0054] searching for a pre-stored redirection rule based on the target user identification information, and performing service redirection on the current traffic based on a target redirection rule corresponding to the target user identification information if the target redirection rule is matched from the redirection rule.
[0055] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0056] obtaining current traffic transmitted on a target interface based on a tunnel protocol bearer; the target interface being an interface between an access network and a user plane function;
[0057] determining target user identification information corresponding to the current traffic based on a pre-constructed correspondence between user identification information and tunnel information; the correspondence being constructed based on message analysis results of a first reference interface and a second reference interface; the first reference interface being an interface between the user plane function and a control plane function, and the second reference interface being an interface between an access and mobility management function and a session management function;
[0058] searching for a pre-stored redirection rule based on the target user identification information, and performing service redirection on the current traffic based on a target redirection rule corresponding to the target user identification information if the target redirection rule is matched from the redirection rule.
[0059] In a fifth aspect, the present application provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the following steps:
[0060] obtaining current traffic transmitted on a target interface based on a tunnel protocol bearer; the target interface being an interface between an access network and a user plane function;
[0061] For the current traffic, the target user identifier information corresponding to the current traffic is determined based on a correspondence relationship between user identifier information and tunnel information which is constructed in advance; the correspondence relationship is constructed based on message analysis results of a first reference interface and a second reference interface; the first reference interface is an interface between a user plane function and a control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function;
[0062] The target redirection rule corresponding to the target user identifier information is matched from the redirection rules, and service redirection is performed on the current traffic based on the target redirection rule.
[0063] The above service redirection method, device, network equipment, computer readable storage medium and computer program product acquire current traffic borne by a tunnel protocol and transmitted on a target interface which is an interface between an access network and a user plane function, for the current traffic, determine target user identifier information corresponding to the current traffic based on a correspondence relationship between user identifier information and tunnel information which is constructed in advance, wherein the correspondence relationship is constructed based on message analysis results of a first reference interface which is an interface between a user plane function and a control plane function, and a second reference interface which is an interface between an access and mobility management function and a session management function, find a target redirection rule corresponding to the target user identifier information from pre-stored redirection rules, and perform service redirection on the current traffic based on the target redirection rule if the target redirection rule is matched. By constructing the correspondence relationship between user identifier information and tunnel information in advance according to the first reference interface and the message analysis results of the first reference interface, the association rate between the current traffic flowing into the target interface and the user identifier information can be improved, the determination accuracy of the user dimension redirection rule is improved, and the accuracy of service redirection is improved, thereby ensuring the operation stability of the system. BRIEF DESCRIPTION OF DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor based on these drawings.
[0065] Figure 1 An application environment diagram of the service redirection method in one embodiment;
[0066] Figure 2 A flowchart of the service redirection method in one embodiment;
[0067] Figure 3 a flowchart for parsing the first signaling in one embodiment;
[0068] Figure 4 a flowchart for parsing the second signaling in one embodiment;
[0069] Figure 5 a flowchart for updating the hash table in another embodiment;
[0070] Figure 6 a flowchart for compiling the redirection rule in one embodiment;
[0071] Figure 7 a flowchart for the service redirection method in another embodiment;
[0072] Figure 8 a block diagram of the service redirection apparatus in one embodiment;
[0073] Figure 9 an internal structure diagram of the network device in one embodiment. DETAILED DESCRIPTION
[0074] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0075] The service redirection method provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the user equipment 102 can communicate with the network equipment 104, the network equipment is integrated with multiple interfaces for data communication, wherein the target interface is carried on 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, and the corresponding relationship between the user identifier information and the tunnel information can be constructed based on the message analysis result of the first reference interface and the second reference interface. The network equipment obtains the current traffic transmitted on the target interface, determines the target user identifier information corresponding to the current traffic based on the pre-constructed corresponding relationship between the user identifier information and the tunnel information, and then searches the pre-saved redirection rule based on the target user identifier information. If the target redirection rule corresponding to the target user identifier information is matched from the redirection rule, the target redirection rule is executed for the current traffic. Among them, the user equipment 102 can be but not limited to various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, the Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart vehicle-mounted device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (Virtual Reality, VR) device, an augmented reality (Augmented Reality, AR) device, smart glasses, etc. The network equipment 104 can be an information network equipment, device, etc. Common network equipment includes: switches, routers, firewalls, 、 、 、 servers, cards (NIC), ( ), 、 、 、 , etc.
[0076] In an exemplary embodiment, as shown in Figure 2 , a service redirection method is provided, and the method is applied to Figure 1The network device in the network is taken as an example for illustration, it is assumed that the network where the network device is located is a 5G core network, the target interface at this time is an N3 interface, the N3 interface corresponds to an interface between an access network and a user plane function, the first reference interface is an N4 interface, the N4 interface corresponds to an interface between a user plane function and a control plane function, and the second reference interface is an N11 interface, the N11 interface corresponds to an interface between an access and mobility management function and a session function; the method comprises the following steps S201 to S203. Wherein:
[0077] In step S201, current traffic carried based on a tunnel protocol and transmitted on a target interface is acquired; the target interface is an interface between an access network and a user plane function.
[0078] The tunnel protocol can be understood as a technology of encapsulating data packets in different protocol data packets in a network, which is commonly used to implement various types of network connections. Common tunnel protocols include IPsec (used to provide security between IP networks, commonly used in VPN), L2TP (Layer 2 Tunneling Protocol, commonly used in combination with IPsec to provide tunnel services for point-to-point connections), GRE (Generic Routing Encapsulation, used to encapsulate different types of protocols into IP packets, suitable for multiple protocols and does not provide encryption), MPLS (Multiprotocol Label Switching, which uses labels to implement data packet forwarding and can also be used to establish tunnels), etc.
[0079] By way of example, the network device 104 captures all data packets transmitted on the N3 interface based on a 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 and other information, and separates the current traffic that needs to be judged for service redirection. By classifying the captured data packets, the current traffic that needs to be associated with user identification information is determined, avoiding processing multiple data packet traffic, and thus speeding up the redirection speed of the N3 interface service.
[0080] In step S202, for the current traffic, the target user identification information corresponding to the current traffic is determined based on a pre-constructed correspondence between user identification information and tunnel information; the correspondence is constructed based on message analysis results of the first reference interface and the second reference interface; the first reference interface is an interface between a user plane function and a control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function.
[0081] The user identification information can be understood as an identity code of a user, used to distinguish different users, such as an International Subscription Mobile Identity (IMSI), which is a user identity identifier related to an SM card. The user plane function can be understood as a component in a network architecture that processes user data traffic (such as video, web pages, and audio, etc.), including data forwarding, traffic management, tunnel management, packet filtering, and charging. The control plane function can be understood as a 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 a user equipment (UE) to ensure that the user can maintain continuous service connection 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 pre-constructs a correspondence between the user identification information and the tunnel information according to the message parsing results of the N4 interface and the N11 interface. For the current traffic, the network device 104 determines the target user identification information corresponding to the current traffic according to the pre-constructed correspondence between the user identification information and the tunnel information. By determining the target user identification information corresponding to the current traffic according to 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, and thus the accuracy of the target redirection rule determined subsequently is improved.
[0083] In step S203, the target redirection rule corresponding to the target user identification information is searched from the pre-stored redirection rules based on the target user identification information. If the target redirection rule corresponding to the target user identification information is matched from the redirection rules, the 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 contains the user identification information of the user who initiates the current service and the url (Uniform Resource Locator) path after the traffic change.
[0085] Exemplarily, the network device 104 finds the pre-stored 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, the service redirection is performed on the current traffic based on the target redirection rule, mainly sending the tcp interference traffic to the gateway contained in the original url path, so that the gateway no longer receives the subsequent traffic of the current traffic, and the interference is considered successful, and the url path is reconfigured after the interference is successful. If the target redirection rule corresponding to the target user identification information is not matched from the redirection rule, the service redirection is not performed on the current traffic, and the current traffic continues to flow according to the original url path. Through the way of finding the redirection rule based on the user identification information, the environmental adaptability of the traffic control is enhanced, the problem of traffic transmission waste caused by the path not being updated in time is avoided, the bandwidth is saved, and the stability of the system operation is ensured.
[0086] In the above service redirection method, the current traffic carried based on the tunnel protocol and transmitted on the target interface as the interface between the access network and the user plane function is obtained, 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, wherein the correspondence is constructed based on the message analysis result 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, the pre-stored redirection rule is found 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 first reference interface and the message analysis result of the first reference interface, the association rate between the current traffic flowing into the target interface and the user identification information can be improved, the determination accuracy of the user dimension redirection rule is improved, and the accuracy of the service redirection is improved, thereby ensuring the operation stability of the system.
[0087] In one embodiment, the method further comprises: receiving first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on the analysis of the first signaling flowing through the first reference interface, and the second user tunnel information is obtained based on the analysis of the second signaling flowing through the second reference interface; obtaining the user tunnel information based on the first user tunnel information and the second user tunnel information; the user tunnel information contains the user identification information and the tunnel information; constructing the correspondence between the user identification information and the tunnel information according to the user tunnel information, and saving the correspondence.
[0088] Tunnel information can be understood as all data, configuration, status and control information involved in the process of establishing and running a tunnel, including source and destination addresses, tunnel protocol type, etc.
[0089] In an exemplary embodiment, where the first reference interface is the N4 interface and the second reference interface is the N11 interface, the network device 104 receives first user tunnel information obtained by parsing first signaling flowing through the N4 interface and second user tunnel information obtained by parsing second signaling flowing through the N11 interface. Based on the first user tunnel information and the second user tunnel information, the network device 104 obtains user tunnel information encapsulating user identification information and tunnel information. Finally, a correspondence between the user identification information and the tunnel information is established based on the user tunnel information. By integrating the parsing results of messages flowing through the N4 interface and the N11 interface to establish the correspondence between the user identification information and the tunnel information, the accuracy of determining the correspondence is improved.
[0090] In one embodiment, 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 PFCP protocol traffic. Network device 104 first parses the PFCP protocol. Then, based on the first type field information in the parsed first signaling, if the first type field information indicates that the first signaling is in a session establishment signaling process or a session modification signaling process, a process (proc) is created to extract the first user tunnel information from the parsed first signaling. If the process ages (i.e., a specific message ends or times out), the extracted first user tunnel information is used as the user tunnel information for subsequent use. By extracting the user tunnel information after determining the process, the availability and validity of the extracted user tunnel information are guaranteed. Furthermore, by creating an extraction process, the quantity of corresponding user tunnel information is maintained, thereby improving the generality of the determined correspondence.
[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 the network slice management function or a signaling process provided by the access and mobility management function, parsing the second signaling to obtain second user tunnel information.
[0093] In one exemplary embodiment, as shown in Figure 4 In one exemplary embodiment, as shown in
[0094] In one embodiment, the corresponding relationship between the user identifier information and the tunnel information is constructed according to the 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 identifier information and tunnel information; constructing a first hash table based on the user identifier information, the tunnel information and the user context information, and constructing a second hash table according to the tunnel information and the user context information; and obtaining the corresponding relationship between the user identifier information and the tunnel information according to the first hash table and the second hash table.
[0095] In one embodiment, the corresponding relationship between the user identifier information and the tunnel information is constructed according to the 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 identifier information and tunnel information; constructing a first hash table based on the user identifier information, the tunnel information and the user context information, and constructing a second hash table according to the tunnel information and the user context information; and obtaining the corresponding relationship between the user identifier information and the tunnel information according to the first hash table and the second hash table.
[0096] Exemplarily, the network device 104 creates a first hash table: a hash table is created with user information (IMSI, IMEI, MSISDN) as the key and user context ue_ctx (i.e., user context information) as the value information, wherein the user context contains all gtp_tunnels (GPRS Tunneling Protocol Tunnel, General Packet Radio Service Tunneling Protocol Tunnel) of the user, and the gtp_tunnels contain tunnel information keys of the user and are 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, GNB IP, UPF IP, and GNB TEID, UPF TEID) as the key and gtp_tunnels as the value information, wherein the gtp_tunnels contain user context ue_ctx. By constructing the first hash table and the second hash table, the tunnel information can be updated in real time, and thus the accuracy of the correspondence between the user identification information and the tunnel information is enhanced.
[0097] In one embodiment, for the current traffic, 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, including: obtaining current tunnel information of the current traffic; querying the second hash table based on the current tunnel information, and determining target user context information corresponding to the current tunnel information from the second hash table; and querying the first hash table according to the target user context information, and taking 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 current tunnel information of the current traffic, first queries the second hash table based on the current tunnel information, and determines target user context information corresponding to the current tunnel information from the second hash table, and then further queries the first hash table according to the target user context information, and takes the user identification information corresponding to the target user context determined from the first hash table as the target user identification information. In the case where the target user context information corresponding to the current tunnel information is not determined from the second hash table, the process is directly ended and no longer ended. By querying the second hash table first and then querying the first hash table, the accuracy of the finally determined target user identification information is improved, and in the case where the first hash table query fails, the query is ended in time to avoid consuming excessive query cost.
[0099] In one embodiment, 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 no user context information corresponding to the new user identification information is matched from the first hash table, adding new user context information corresponding to the new user identification information in the first hash table; continuing to query the second hash table based on the new tunnel information; if a 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; and if no hash value corresponding to the new tunnel information is matched from the second hash table, adding a new hash value corresponding to the new tunnel information in the second hash table based on the new user context information.
[0100] In one embodiment, the first hash table is created with user information (IMSI, IMEI, MSISDN) as a key and user context ue_ctx (i.e. user context information) as value information, wherein the user context contains all gtp_tunnel of the user, and the gtp_tunnel contains tunnel information key of the user in the form of an array. The second hash table is created with tunnel information (IP TYPE, GNB IP, UPF IP and GNB TEID, UPF TEID) as a key and gtp_tunnel (i.e. hash value) as value information, wherein the gtp_tunnel contains user context ue_ctx.
[0101] For example, the first hash table is created with user information (IMSI, IMEI, MSISDN) as a key and user context ue_ctx (i.e. user context information) as value information, wherein the user context contains all gtp_tunnel of the user, and the gtp_tunnel contains tunnel information key of the user in the form of an array. The second hash table is created with tunnel information (IP TYPE, GNB IP, UPF IP and GNB TEID, UPF TEID) as a key and gtp_tunnel (i.e. hash value) as value information, wherein the gtp_tunnel contains user context ue_ctx. 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 new user identification information (i.e., ismi in the figure) is queried according to the new user identification information. If user context information (i.e., user context ue_ctx in the figure) corresponding to the new user identification information is not matched from the first hash table, corresponding new user context information is created according to the new user identification information. Then, the new tunnel information is queried based on the new tunnel information. If gtp_tunnel corresponding to the new tunnel information is matched from the second hash table, ue_ctx in gtp_tunnel is updated, and gtp_tunnel in ue_ctx is updated to the new gtp_tunnel. If gtp_tunnel corresponding to the new tunnel information is not matched from the second hash table, new gtp_tunnel is constructed based on the new tunnel information, the new gtp_tunnel is added to the created ue_ctx, and ue_ctx is mounted to gtp_tunnel. By dynamically creating and updating user context information according to new user identification information and tunnel information, it is ensured that the network can quickly adapt to the state change of the user. Appropriate operations (updating or creating) can be taken for different users and tunnel information, and the processing flexibility and response speed are improved.
[0102] In an exemplary embodiment, the method further comprises: querying the first hash table according to the new user identification information, continuing to query the second hash table based on the new tunnel information if user context information corresponding to the new user identification information is matched from the first hash table; and adding a new hash value corresponding to the new tunnel information in the second hash table based on the matched user context information if a hash value corresponding to the new tunnel information is not matched from the second hash table.
[0103] Exemplarily, as Figure 5As shown, the table in the figure updates another flow, in which the network device 104 queries the first hash table according to the new user identification information, and in the case that the user context ue_ctx corresponding to the new user identification information is matched from the first hash table, the second hash table is still queried based on the new tunnel information, and in the case that the second gtp tunnel corresponding to the new tunnel information is not matched from the second hash table, the new gtp_tunnel is constructed based on the new tunnel information, and the new gtp_tunnel is mounted into 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 is proved that the correspondence between the user identification information and the tunnel information contained in the newly received new user tunnel information has been recorded, and there is no need to update the related content. Through the foregoing manner, efficient management and update of the user context information are ensured, and dynamic adjustment can be made according to actual needs. Through rapid matching and confirmation, if the existing record exists, unnecessary update operation is avoided, and consumption of system resources is reduced.
[0104] In one of the embodiments, the method further comprises: receiving an initial redirection rule; in the case that 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 performing redirection rule compilation according to the user identification information and the redirection url information, and saving the compiled redirection rule.
[0105] The redirection url information can be understood as unique identification information of a node through which traffic needs to flow and which is stored on the network device.
[0106] In one of the embodiments, the method further comprises: receiving an initial redirection rule; in the case that 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 performing redirection rule compilation according to the user identification information and the redirection url information, and saving the compiled redirection rule. Figure 6 As shown, the network device 104 receives an initial redirection rule, and judges whether the initial redirection rule is an unbinding redirection rule. 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 redirection rule compilation is performed according to the user identification information and the redirection url information, and the compiled redirection rule is saved. In the case that the initial redirection rule is an unbinding redirection rule, the redirection rule of a certain user (which can be a user specified by the initial redirection rule) is removed, the redirection rule is recompiled and saved. The redirection strategy can be adjusted according to real-time needs, unnecessary redirection rules can be removed, the system redundancy configuration and resource waste can be effectively reduced, and the compiled and saved redirection rule can be quickly applied, thereby improving the management efficiency and performance of network resources.
[0107] In one of the embodiments, the method further comprises: receiving an initial redirection rule; in the case that 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 performing redirection rule compilation according to the user identification information and the redirection url information, and saving the compiled redirection rule.
[0108] The network device sends 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 device address information of the next-hop gateway of the current gateway; in the case that the network device receives confirmation information returned by each gateway in response to the interference traffic, the network device generates a redirection message according to redirection URL information included in the target redirection rule; the network device sends the 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; and the network device receives the service request and reconfigures a URL path of traffic corresponding to the service request.
[0109] The URL path can be understood as a route of nodes through which traffic flowing into the target interface needs to pass.
[0110] For example, when the network device matches the target redirection rule corresponding to the current traffic, the network device can label the current traffic with a preset label, can not immediately perform service redirection, and can first store the labeled traffic in a ready queue to wait for processing by the network device 104. When the queue state meets the processing condition, the network device can process the service redirection task in the order of processing or according to user levels to select a service redirection task to be processed preferentially. By adding a label to join the queue, a buffer time is provided for the network device 104 to perform the service redirection operation, and the label is easy to distinguish from other tasks that need to be processed, avoiding task conflict processing, thereby ensuring the stability of the system.
[0111] The network device 104 sends interference traffic carrying 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 subsequent traffic of the current traffic no longer flows into the gateway and the interference traffic can be successfully sent from the current gateway to the next-hop gateway. In the case that the network device receives confirmation information returned by each gateway in response to the interference traffic, the network device generates a redirection message according to redirection URL information included in the target redirection rule, sends the redirection message to the user device 102 corresponding to the current traffic, and the user device 102 regenerates a service request under the instruction of the redirection message and sends the service request to the network device 104. The network device 104 reconfigures a URL path of traffic corresponding to the service request according to the received service request. By the above method, the network device 104 can flexibly control the flow direction of traffic by using interference traffic, thereby optimizing network resource allocation, ensuring effective use of bandwidth, and reducing the opportunity of network congestion and traffic conflict. After the user device 102 receives the redirection message, the user device 102 can quickly obtain a new service request address, maintain the continuity of user experience, and avoid request failure caused by path change.
[0112] In one example embodiment, as 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 through information interaction between the units.
[0114] 1. Signaling unit:
[0115] The signaling analysis of N4 and N11 interfaces is completed, and the user and tunnel information is encapsulated in 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 analysis of the N4 and N11 interfaces by the signaling unit is also the processing of the PFCP protocol and the HTTP2 protocol, and the IMSI, IMEI, MSISDN, INTERFACE TYPE, GTP INFO (IP TYPE, GNBIP, UPF IP, and GNB TEID, UPF TEID) are obtained from these two protocols. The assembly format of the user tunnel information after analysis is encapsulated in TLV (type-length-value), as shown in the following table:
[0118]
[0119] The user tunnel information is assembled in TLV format, and the user three-code information is separately encapsulated. The specific TLV format description is shown in the above figure. GTP INFO contains tunnel information in this field, and the tag value is 4. The contents inside are encapsulated according to the fixed length.
[0120] The user tunnel information of the N4 interface is mainly obtained from the session establishment and session modification processes, and the user tunnel information of the N4 interface is mainly obtained from the new and modified processes.
[0121] The user tunnel information of the N11 interface is mainly obtained from the nsmf-pdusession (network slice management function user data session signaling) process and the namf-comm (network access management function communication signaling) process.
[0122] 1.2. User tunnel information update:
[0123] When the signaling information of the user changes, such as during the change of the location of the user, from one base station to another base station, the user tunnel information carried by the N4 interface and the N11 interface is also 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 be queried to the correct user identification information according to the updated user tunnel information.
[0124] 2. Execution unit:
[0125] The execution unit mainly completes the following functions:
[0126] 1) receiving user tunnel information from the signaling unit and storing it in the user tunnel module;
[0127] 2) receiving redirection rules from the control unit and compiling them into the rule module;
[0128] 3) receiving N3 traffic and performing user matching on the N3 traffic, and matching the traffic matched with the user with the redirection rules;
[0129] 4) performing service redirection actions on the traffic matched with the redirection rules.
[0130] 2.1, User tunnel information receiving and storage:
[0131] The execution unit receives user tunnel information from the signaling unit, parses the user tunnel information according to the format in Figure 1 and establishes a hash table of users and tunnels. In order to ensure that the hash table can be quickly updated when the base station of the user changes, the hash table needs to be created with the following several dimensions of key:
[0132] 1) create a hash table with user identification information (IMSI, IMEI, MSISDN) as key, value information as user context ue_ctx, which contains all gtp_tunnel of the user, and gtp_tunnel stores the tunnel information key of the user in the form of an array;
[0133] 2) create a hash table with tunnel information (IP TYPE, GNBIP, UPFIP and GNBTEID, UPFTEID) as key, value information as gtp_tunnel, which contains user context ue_ctx.
[0134] The association between the two hash tables is maintained by user tunnel information contained in the user context ue_ctx. When the user tunnel information is received, the user identification information is first queried in the hash table. If no query is found, a new hash table for the user is created, and the tunnel information carried this time is associated with the user context. If the gtp_tunnel is queried using the tunnel information, the association between the gtp_tunnel obtained from the tunnel information and the user context ue_ctx is established, otherwise the gtp_tunnel is created using the tunnel information and added to the ue_ctx, and the ue_ctx is mounted to the gtp_tunnel.
[0135] 2.2, receiving and compiling of redirection rules:
[0136] The execution unit also needs to receive the redirection rules issued by the control unit, which are user-dimensioned redirection rules such as IMSI / MSISDN / IMEI, and the rules contain the redirected url. After receiving the redirection rules, the execution unit compiles the rules into the local rule module.
[0137] 2.3, user association and rule matching of N3 traffic:
[0138] The execution unit receives the N3 traffic of the 5G core network, queries the hash table in 1.2 through the outer GTP information of the traffic, and stores the queried user identification information into the current traffic. The traffic matched with the user identification information can be matched with the redirection rules in the rule module, and the traffic matched with the redirection rules is marked with FLOW_NEED_REDIRECT_FLAG (traffic needs service redirection).
[0139] 2.4, execution of traffic redirection action:
[0140] The redirection module performs redirection action according to whether the traffic is marked with FLOW_NEED_REDIRECT_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 continues to interact;
[0142] 2) The destination mac address of the sent tcp interference traffic is the mac of the next hop gateway of the interference port, which ensures that the interference packet can be smoothly sent from the next hop gateway to complete the interference function;
[0143] 3) Send a redirect message. After sending the interference traffic, you need to send a redirect message according to the redirect URL included in the issued rule to redirect the original traffic to the configured URL path.
[0144] Compared with the existing technology, this application has the following advantages:
[0145] 1. The signaling unit is responsible for parsing traffic on the N4 and N11 interfaces, extracting key user tunnel information such as IMSI, IMEI, and MSISDN, and sending this information to the execution unit to provide basic data for subsequent service redirection;
[0146] 2. The execution unit receives and stores 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 service redirection strategies.
[0147] 3. The control unit issues redirection policies for specific users and compiles these policies 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 various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed 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 portion of steps or stages in other steps.
[0149] Based on the same inventive concept, embodiments of the present application also provide a service redirection device for implementing the aforementioned service redirection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more service redirection device embodiments provided below can be found in the aforementioned limitations on the service redirection method and will not be further elaborated 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] Target user identification information determination module 802 is configured to determine target user identification information corresponding to the current traffic flow based on a pre-established correspondence between user identification information and tunnel information; the correspondence is established based on message parsing results of a first reference interface and a second reference interface; the first reference interface is an interface between a user plane function and a control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function;
[0153] The service redirection execution module 803 is used to search for pre-stored redirection rules 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 carried by the tunnel protocol and transmitted on the interface between the access network and the user plane function is obtained by the current traffic acquisition module. The target user identification information determination module determines 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 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. Then, based on the target user identification information, a pre-stored redirection rule is queried. If a target redirection rule corresponding to the target user identification information is matched from the redirection rule, service redirection is performed on the current traffic based on the target redirection rule. By pre-establishing the correspondence between the user identification information and the tunnel information based on the message parsing results of the first reference interface and the second reference interface, the correlation rate between the current traffic flowing into the target interface and the user identification information can be improved, the accuracy of determining the redirection rule in the user dimension can be improved, and the accuracy of service redirection can be improved, thereby ensuring the operational stability of the system.
[0155] In an embodiment, the service redirecting apparatus further comprises a correspondence constructing module configured to receive first user tunnel information and second user tunnel information, the first user tunnel information being parsed based on the first signaling flowing through the first reference interface, and the second user tunnel information being parsed based on the second signaling flowing through the second reference interface; obtain user tunnel information based on the first user tunnel information and the second user tunnel information; the user tunnel information comprising user identity information and tunnel information; construct a correspondence between the user identity information and the tunnel information according to the user tunnel information, and save the correspondence.
[0156] In one of the embodiments, the correspondence constructing module further comprises a first signaling parsing submodule configured to obtain first type field information in the first signaling; and in a case where the first type field information indicates that the first signaling is in a signaling procedure of creating a session or a signaling procedure of updating a session, parse the first signaling to obtain the first user tunnel information.
[0157] In an exemplary embodiment, the correspondence constructing module further comprises a second signaling parsing submodule configured to obtain second type field information in the second signaling; and in a case where the second type field information indicates that the second signaling is in a PDU session management signaling procedure provided by a network slice management function or a signaling procedure provided by an access and mobility management function, parse the second signaling to obtain the second user tunnel information.
[0158] In an embodiment, the correspondence constructing module is further configured to, for each user tunnel information, obtain user context information associated with the user tunnel information; parse the user tunnel information to obtain corresponding user identity information and tunnel information; construct a first hash table based on the user identity information, the tunnel information and the user context information, and construct a second hash table according to the tunnel information and the user context information; and obtain the correspondence between the user identity information and the tunnel information according to the first hash table and the second hash table.
[0159] In one of the embodiments, the target user identity information determining module 802 is further configured to obtain current tunnel information of current traffic; query the second hash table based on the current tunnel information, and determine target user context information corresponding to the current tunnel information from the second hash table; and query the first hash table according to the target user context information, and determine user identity information corresponding to the target user context information from the first hash table as the target user identity information.
[0160] In an exemplary embodiment, the correspondence constructing module further comprises an updating submodule configured to:
[0161] The updating submodule is configured 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, and if no user context information corresponding to the new user identification information is matched from the first hash table, add the new user context information corresponding to the new user identification information in 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 from the second hash table, update the corresponding hash value in the second hash table based on the new user context information; and if no hash value corresponding to the new tunnel information is matched from the second hash table, add a new hash value corresponding to the new tunnel information in the second hash table based on the new user context information.
[0162] In one embodiment, the updating submodule is further configured to query the first hash table according to the new user identification information, continue to query the second hash table based on the new tunnel information if user context information corresponding to the new user identification information is matched from the first hash table, and add a new hash value corresponding to the new tunnel information in the second hash table based on the matched user context information if no hash value corresponding to the new tunnel information is matched from the second hash table.
[0163] In one embodiment, the service redirection device further comprises a redirection rule compiling module configured to receive an initial redirection rule, parse the initial redirection rule to obtain user identification information and redirection url information, and compile the redirection rule according to the user identification information and the redirection url information and save the compiled redirection rule if the initial redirection rule is not an unbinding redirection rule.
[0164] In one exemplary embodiment, the service redirection executing module 803 is further configured to send interference traffic to a gateway included in an 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 device address information of a next-hop gateway of the current gateway; in a case where response confirmation information returned by each gateway included in the original url path in response to the interference traffic is received, generate a redirection packet according to redirection url information included in the target redirection rule; send the redirection packet to a user device corresponding to the current traffic; the redirection packet is used to instruct the user device to regenerate a service request and send the service request to a network device; and receive the service request and reconfigure a url path of traffic corresponding to the service request.
[0165] The modules in the service redirection apparatus can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in the network device in hardware form, or stored in a memory in the network device in software form, so as to be invoked by the processor to perform operations corresponding to the modules.
[0166] In an example embodiment, a network device, which can be a server, has an internal structure as shown in Figure 9 The network device includes a processor, a memory, an input / output interface, and a communication interface. 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. The processor of the network device is configured 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 running the operating system and the computer program in the non-volatile storage medium. The database of the network device is configured to store traffic data, user identification information, tunnel information, a correspondence between the user identification information and the tunnel information, interface messages, and redirection rules. The input / output interface of the network device is configured to exchange information between the processor and external devices. The communication interface of the network device is configured to communicate with terminals outside through a network connection. The computer program is configured to be executed by the processor to implement a service redirection method.
[0167] Those skilled in the art can understand that Figure 9 The structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not limit the network device to which the scheme of the present application is applied. The specific network device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0168] In an example embodiment, a network device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the service redirection method in the above embodiments.
[0169] In an example embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the service redirection method in the above embodiments.
[0170] In an example embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the service redirection method in the above embodiments.
[0171] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0172] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. 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 above-mentioned embodiments of each method. In the embodiments provided in the present application, any reference to memory, database or other medium 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 storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive 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 but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0173] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of these technical features is deemed to be within the scope of the present application.
[0174] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications 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 should be subject to the appended claims.
Claims
1. A service redirection method, characterized by, The method is applied to a network device, and comprises the following steps: acquiring current traffic carried based 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; for the current traffic, determining target user identification information corresponding to the current traffic based on a pre-constructed correspondence between user identification information and tunnel information; the construction process of the correspondence comprises the following steps: receiving first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on analysis of first signaling flowing through a first reference interface, and the second user tunnel information is obtained based on analysis of second signaling flowing through a second reference interface; the first reference interface is an interface between the user plane function and a control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function; obtaining user tunnel information based on the first user tunnel information and the second user tunnel information; the user tunnel information comprises the user identification information and the tunnel information; constructing the correspondence between the user identification information and the tunnel information according to the user tunnel information, and saving the correspondence; based on the target user identification information, searching for a pre-saved redirection rule, and if a target redirection rule corresponding to the target user identification information is matched from the redirection rule, performing service redirection on the current traffic based on the target redirection rule.
2. The method of claim 1, wherein, The method further comprises the following steps: acquiring first type field information in the first signaling; in a case where the first type field information represents that a process in which the first signaling is located is a signaling process of creating a session or a signaling process of updating a session, analyzing the first signaling to obtain the first user tunnel information.
3. The method of claim 1, wherein, The method further comprises the following steps: acquiring second type field information in the second signaling; in a case where the second type field information represents that a 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, analyzing the second signaling to obtain the second user tunnel information.
4. The method of claim 1, wherein, The construction of the correspondence between the user identification information and the tunnel information according to the user tunnel information comprises the following steps: for each user tunnel information, acquiring user context information associated with the user tunnel information; analyzing 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; obtaining the correspondence between the user identification information and the tunnel information according to the first hash table and the second hash table.
5. The method of claim 4, wherein, The determination of 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 comprises the following steps: acquiring current tunnel information of the current traffic; querying the second hash table based on the current tunnel information, and determining target user context information corresponding to the current tunnel information from the second hash table; According to the target user context information, the first hash table is queried, and user identification information corresponding to the target user context information determined from the first hash table is taken as the target user identification information.
6. The method of claim 4, wherein, The method further comprises: receiving new first user tunnel information and / or new second user tunnel information; based on the new first user tunnel information and / or new second user tunnel information, obtaining new user tunnel information; parsing the new user tunnel information to obtain new user identification information and new tunnel information; according to the new user identification information, querying the first hash table, and if user context information corresponding to the new user identification information is not matched from the first hash table, adding new user context information corresponding to the new user identification information in 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, adding new hash value corresponding to the new tunnel information in the second hash table based on the new user context information.
7. The method of claim 6, wherein, The method further comprises: according to the new user identification information, querying the first hash table, and if 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, adding new hash value corresponding to the new tunnel information in the second hash table based on the matched user context information.
8. The method of claim 1, wherein, The method further comprises: receiving an initial redirection rule; in the case that 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 performing redirection rule compilation according to the user identification information and the redirection url information, and saving the compiled redirection rule.
9. The method according to any one of claims 1 to 8, characterized in that, The business redirection performed on the current traffic based on the target redirection rule comprises: sending interference traffic to a gateway included in an 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 device address information of a next-hop gateway of the current gateway; in the case that the confirmation information returned by each gateway included in the original url path in response to the interference traffic is received, generating a redirection packet according to redirection url information included in the target redirection rule; sending the redirection packet to a user equipment corresponding to the current traffic; the redirection packet is used to instruct the user equipment to regenerate a service request and send the service request to the network device; receiving the service request, and reconfiguring a url path of traffic corresponding to the service request.
10. A service redirection apparatus, characterized by, The application is applied to a network device, and the device comprises: a current traffic acquisition module, configured to acquire 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; a target user identifier information determination module, configured to determine target user identifier information corresponding to the current traffic based on a pre-constructed correspondence between user identifier information and tunnel information for the current traffic; the construction process of the correspondence comprises: receiving first user tunnel information and second user tunnel information; the first user tunnel information is obtained based on analysis of first signaling flowing through a first reference interface, and the second user tunnel information is obtained based on analysis of second signaling flowing through a second reference interface; the first reference interface is an interface between the user plane function and a control plane function, and the second reference interface is an interface between an access and mobility management function and a session management function; user tunnel information is obtained based on the first user tunnel information and the second user tunnel information; the user tunnel information contains the user identifier information and the tunnel information; the correspondence between the user identifier information and the tunnel information is constructed according to the user tunnel information, and the correspondence is saved; a service redirection execution module, configured to search a pre-saved redirection rule based on the target user identifier information, and perform service redirection on the current traffic based on a target redirection rule corresponding to the target user identifier information in the redirection rule if the target redirection rule is matched from the redirection rule. 11.A network device, comprising a memory and a processor, wherein the memory stores a computer program, and the network device is configured to perform the method according to any one of claims 1-10. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 9.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 9.
13. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 9. The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 9.
Citation Information
Patent Citations
Data processing method and device
CN112073512A
Session association method and device, computer equipment, readable storage medium and program product
CN119071942A