A user session recovery method, system, device and medium
Patent Information
- Application Number
- CN202610743512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-27
- Publication Date
- 2026-10-13
AI Technical Summary
[0006]本发明所要解决的技术问题是依靠人工下发下线指令、人工核查会话接入状态,无法实现大批量物联网用户会话自动批量剔除与回迁,导致用户会话恢复效率低
[0008]本发明的有益效果是:通过当主用户面功能网元出现异常时直接由辅用户面功能网元承接用户会话并同步获取主用隧道状态,待主用隧道判定为可用且备用路由完成向主用路由的切换后,将辅用户面功能网元上的用户会话迁移至主用户面功能网元完成会话恢复,无需运维人员人工监测状态、手动下发下线指令以及人工核查终端接入位置,解决了相关技术中依赖人工操作所造成的大批量用户会话无法自动批量处理、用户会话整体恢复效率低下的问题。
Smart Images

Figure CN122909111A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and specifically to a user session recovery method, system, device, and medium. Background Technology
[0002] With the large-scale deployment of IoT terminal devices, various IoT services place extremely high demands on the stability, continuity, and fault self-healing capabilities of network access.
[0003] In related technologies, maintenance personnel monitor the operating status of the primary user plane function network element and the tunnel connectivity status in real time. After confirming that the primary network element has recovered and is available and the backhaul route has been switched, they manually log in to the network management backend, issue session disconnection commands in batches, force user terminals in the secondary user plane function network element to disconnect from the network, wait for the terminal to reconnect to the network on its own, manually verify the reconnection to the network element, and complete the session migration operation.
[0004] However, relying on manually issuing offline instructions and manually checking session access status cannot achieve automatic batch removal and migration of large numbers of IoT user sessions, resulting in low user session recovery efficiency.
[0005] Therefore, there is an urgent need for a method to improve the efficiency of user session recovery. Summary of the Invention
[0006] The technical problem that this invention aims to solve is that relying on manual issuance of offline instructions and manual verification of session access status makes it impossible to automatically remove and migrate a large number of IoT user sessions, resulting in low efficiency in user session recovery.
[0007] The technical solution of this invention to solve the above-mentioned technical problems is as follows: A user session recovery method, characterized in that the method is applied to a session recovery module in a session recovery system, the session recovery system further including a primary user plane function network element and a secondary user plane function network element, the method comprising: if the secondary user plane function network element carries a user session, obtaining the status of the primary tunnel between the primary user plane function network element and the client side; wherein, the secondary user plane function network element carrying the user session is implemented when the primary user plane function network element is abnormal; if the status of the primary tunnel indicates that the primary tunnel is available, obtaining the backhaul route status corresponding to the primary user plane function network element; if the status of the backhaul route indicates that the backup route corresponding to the secondary user plane function network element has been switched to the primary route corresponding to the primary user plane function network element, migrating the user session residing in the secondary user plane function network element to the primary user plane function network element to complete the user session recovery.
[0008] The beneficial effects of this invention are as follows: when the primary user plane function network element malfunctions, the secondary user plane function network element directly takes over the user session and synchronously obtains the status of the primary tunnel. After the primary tunnel is determined to be available and the backup route completes the switch to the primary route, the user sessions on the secondary user plane function network element are migrated to the primary user plane function network element to complete the session recovery. This eliminates the need for maintenance personnel to manually monitor the status, manually issue offline commands, and manually verify the terminal access location. It solves the problems of large-scale user sessions that cannot be automatically processed in batches and the overall efficiency of user session recovery that are caused by relying on manual operation in related technologies.
[0009] Based on the above technical solution, the present invention can be further improved as follows.
[0010] Furthermore, the status of the primary tunnel between the primary user plane functional network element and the client side is obtained, including: performing connectivity detection on the primary tunnel to obtain the link connectivity status of the primary tunnel; performing data interaction verification on the primary tunnel to obtain the data transmission quality status of the primary tunnel; and determining the status of the primary tunnel based on the link connectivity status and the data transmission quality status.
[0011] The beneficial effect of adopting the above-mentioned further scheme is that by conducting connectivity detection on the main tunnel to obtain the link connection status, and by cooperating with data interaction verification to obtain the data transmission quality status, the actual status of the main tunnel can be determined by combining the two types of status information. This can determine the actual operation of the main tunnel and avoid the problem of one-sided status judgment caused by only judging the link connection.
[0012] Furthermore, migrating user sessions residing in secondary user plane function network elements to primary user plane function network elements includes: receiving a session deletion command; deleting the corresponding user session on the secondary user plane function network element based on the session deletion command to trigger the user terminal to initiate a reattach command; and completing the migration and switching of the user session from the secondary user plane function network element to the primary user plane function network element based on the reattach command initiated by the user terminal.
[0013] The beneficial effect of adopting the above-mentioned further solution is that by receiving a session deletion command, the corresponding user session on the secondary user plane function network element is deleted according to the command, thereby triggering the user terminal to initiate a reattach command due to the deletion of the session, and then completing the migration and switching of the user session from the secondary user plane function network element to the primary user plane function network element based on the reattach command. This realizes the automatic triggering and execution of user session migration, without the need for manual intervention to issue offline commands, wait for the session to expire naturally, or verify the migration results. It can efficiently complete the batch migration of sessions and solve the problems of low efficiency and disordered migration caused by manual operation.
[0014] Furthermore, based on the reattach command initiated by the user terminal, the migration and handover of the user session from the secondary user plane function network element to the primary user plane function network element is completed, including: scheduling the user terminal that initiated the reattach command to the primary user plane function network element according to the preset primary and backup priority policy; using the user terminal, establishing a target user session on the primary user plane function network element to complete the migration and handover; wherein, the target user session is matched with the primary route.
[0015] The beneficial effect of adopting the above-mentioned further solution is that the user terminal that initiates the reattachment command is scheduled by the preset primary and backup priority strategy. After being scheduled to the primary user plane function network element, the target user session is established with the help of the user terminal to complete the migration and handover. At the same time, it ensures that the target user session and the primary route are matched, and can realize the orderly management of the user terminal's network access location.
[0016] Furthermore, after migrating the user sessions residing in the secondary user plane functional network element to the primary user plane functional network element, the method also includes: performing uplink and downlink data transmission verification on the target user session on the primary user plane functional network element to determine whether the target user session has resumed normal communication; if the target user session has resumed normal communication, the user session recovery process is completed; if the target user session has not resumed normal communication, alarm information including the cause of the abnormality, session identifier, and number of affected users is output.
[0017] The beneficial effect of adopting the above-mentioned further solution is that after the user session migration is completed, the uplink and downlink data transmission of the target user session in the main user plane functional network element is verified to determine the session communication status. If the communication is normal, the recovery process ends; if the communication is abnormal, an alarm content carrying the corresponding information is output. This can promptly verify the actual communication effect after the session migration, quickly identify communication anomalies, and synchronously push relevant anomaly information.
[0018] Furthermore, the method also includes: during the process of a user session being carried by a secondary user plane function network element, periodically acquiring the primary tunnel status at time intervals until the primary tunnel status indicates that the primary tunnel is available.
[0019] The advantage of adopting the above-mentioned further solution is that by periodically acquiring the status of the primary tunnel at time intervals during the user session carried by the secondary user plane function network element, and continuously monitoring it until the primary tunnel is available, the operation of the primary tunnel can be tracked in real time, and the opportunity for the tunnel to be restored to availability can be captured in a timely manner, without the need for continuous manual monitoring.
[0020] Furthermore, the present invention provides a user session recovery system, which includes a primary user plane function network element, a secondary user plane function network element, and a user session recovery device. The user session recovery device is used to take over the user session from the secondary user plane function network element if the primary user plane function network element fails, and to obtain the status of the primary tunnel between the primary user plane function network element and the customer side; if the primary tunnel status indicates that the primary tunnel is available, it obtains the backhaul route status corresponding to the primary user plane function network element; if the route status indicates that the backup route corresponding to the secondary user plane function network element has been switched to the primary route corresponding to the primary user plane function network element, it migrates the user session residing in the secondary user plane function network element to the primary user plane function network element to complete the user session recovery.
[0021] Furthermore, the present invention provides a user session recovery device, which includes: a first acquisition module, configured to acquire the primary tunnel status between the primary user plane function network element and the client side if the secondary user plane function network element carries the user session; wherein, the secondary user plane function network element carrying the user session is implemented when the primary user plane function network element is abnormal; a second acquisition module, configured to acquire the backhaul route status corresponding to the primary user plane function network element if the primary tunnel status indicates that the primary tunnel is available; and a migration module, configured to migrate the user session residing in the secondary user plane function network element to the primary user plane function network element if the backhaul route status indicates that the backup route corresponding to the secondary user plane function network element has been switched to the primary route corresponding to the primary user plane function network element, so as to complete the user session recovery.
[0022] Furthermore, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the user session recovery method described in the first aspect or any corresponding embodiment.
[0023] Furthermore, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the user session recovery method described in the first aspect or any corresponding embodiment thereof.
[0024] Furthermore, this application provides a computer program product, including computer instructions for causing a computer to execute the user session recovery method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0025] Figure 1 A schematic diagram of the user session recovery system provided by the present invention. Figure 2 A flowchart illustrating the user session recovery method provided by the present invention; Figure 3 This is a flowchart illustrating another user session recovery method provided by the present invention; Figure 4A flowchart illustrating another user session recovery method provided by the present invention; Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0026] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0027] With the large-scale deployment of IoT terminal devices, various IoT services place extremely high demands on the stability, continuity, and fault self-healing capabilities of network access.
[0028] In related technologies, maintenance personnel monitor the operating status of the primary user plane function network element and the tunnel connectivity status in real time. After confirming that the primary network element has recovered and is available and the backhaul route has been switched, they manually log in to the network management backend, issue session disconnection commands in batches, force user terminals in the secondary user plane function network element to disconnect from the network, wait for the terminal to reconnect to the network on its own, manually verify the reconnection to the network element, and complete the session migration operation.
[0029] However, relying on manually issuing offline instructions and manually checking session access status cannot achieve automatic batch removal and migration of large numbers of IoT user sessions, resulting in low user session recovery efficiency.
[0030] Based on this, the present invention provides a user session recovery method. When the primary user plane function network element malfunctions, the secondary user plane function network element directly takes over the user session and synchronously obtains the status of the primary tunnel. After the primary tunnel is determined to be available and the backup route completes the switch to the primary route, the user session on the secondary user plane function network element is migrated to the primary user plane function network element to complete the session recovery. This eliminates the need for maintenance personnel to manually monitor the status, manually issue offline commands, and manually verify the terminal access location. It solves the problems of large-scale user session processing failure and low overall user session recovery efficiency caused by reliance on manual operation in related technologies.
[0031] Please refer to Figure 1 , Figure 1 A schematic diagram of a user session recovery system is provided.
[0032] Combination Figure 1 As shown, the user session recovery system may include a primary user plane function network element, a secondary user plane function network element, and a user session recovery device.
[0033] During normal operation of the session recovery system, the primary user plane function network element, as the core user session bearer, is responsible for handling the data transmission of massive user terminal service sessions. The secondary user plane function network element is in standby mode, ready to respond to any abnormal scenarios of the primary user plane function network element. When the session recovery system detects anomalies such as operational failures, performance overloads, or maintenance shutdowns in the primary user plane function network element, the system automatically triggers a primary / standby switchover mechanism. The secondary user plane function network element seamlessly takes over all user sessions originally carried by the primary user plane function network element, ensuring uninterrupted communication services for user terminals and guaranteeing service continuity. Simultaneously, the session recovery system initiates the primary tunnel status acquisition process. The primary tunnel is the core data transmission link connecting the primary user plane function network element and the client side. The system acquires the operational status of this primary tunnel in real time through a preset detection mechanism.
[0034] The session recovery system continuously analyzes and determines the status of the primary tunnel. If the determination indicates that the primary tunnel is available (i.e., the primary tunnel link is connected and data transmission has the basic conditions), it no longer stops at tunnel connectivity detection but further obtains the backhaul route status corresponding to the primary user plane functional network element. The backhaul route is the critical path for user session data to be transmitted back from the primary user plane functional network element to the core network, and its status directly determines the stability of data transmission after session migration. Therefore, it is necessary to accurately obtain the backhaul route status to confirm whether the primary user plane functional network element has the complete network conditions to carry user sessions.
[0035] If the return route status indicates that the backup route corresponding to the secondary user plane function element has completed the switchover to the primary route corresponding to the primary user plane function element, meaning the current network routing architecture has been restored to a normal state dominated by the primary route and the primary user plane function element has full session carrying capacity, then the user session migration process is triggered. This process orderly migrates all user sessions currently residing on the secondary user plane function element to the restored primary user plane function element. Through this migration process, a smooth transition of user sessions from the secondary user plane function element to the primary user plane function element is achieved, ultimately completing user session recovery. This allows the session recovery system to return to the normal operating mode of primary user plane function element dominance and secondary user plane function element backup, ensuring the rational allocation of network resources and the stability of service transmission.
[0036] According to an embodiment of the present invention, a user session recovery method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] This embodiment provides a user session recovery method, which can be used in the aforementioned user session recovery system. Figure 2 This is a flowchart of a user session recovery method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S201: If the secondary user plane function network element carries the user session, obtain the status of the primary tunnel between the primary user plane function network element and the client side; wherein, the secondary user plane function network element carrying the user session is implemented when the primary user plane function network element is abnormal.
[0038] The main user plane functional network element can be understood as the core network element in the session recovery system that is responsible for carrying user sessions and processing user terminal service data transmission on a daily basis. It is the main carrier of user sessions.
[0039] Secondary user plane function network elements can be understood as backup network elements in the session recovery system. When the primary user plane function network element fails, it is used to take over the user sessions of the primary network element to ensure that services are not interrupted.
[0040] A user session can be understood as a communication connection link established between a user terminal and the network, used to transmit terminal service data.
[0041] The customer side can be understood as the side where user terminals are deployed (such as IoT parks and enterprise terminal rooms), which is a centralized deployment scenario for user terminals; The primary tunnel can be understood as the core data transmission link connecting the primary user plane functional network element and the client side, used for business data interaction between the primary user plane functional network element and the client-side terminal.
[0042] The primary tunnel status describes the operation of the primary tunnel, which may include link connectivity and data transmission quality.
[0043] Specifically, when the session recovery system detects an anomaly in the primary user plane function network element (such as operational failure, performance overload, etc.), in order to avoid interruption of user terminal communication, it automatically triggers the primary / backup switchover mechanism, and the secondary user plane function network element seamlessly takes over all user sessions originally carried by the primary user plane function network element, ensuring the service continuity of IoT terminals; at the same time, the primary tunnel status acquisition process is initiated synchronously to monitor the primary tunnel status between the primary user plane function network element and the client side.
[0044] In one possible implementation, a multi-dimensional anomaly detection mechanism for the primary user plane function network element is adopted (such as monitoring CPU utilization, memory usage, and session capacity). When any indicator exceeds a preset threshold (such as CPU utilization ≥ 85%), the primary user plane function network element is determined to be abnormal. Through a preset network element switching protocol, the secondary user plane function network element is instructed to take over the user session. At the same time, the status of the primary tunnel is obtained by using TCP connection probing. By establishing temporary TCP connections, the link response time and connection success rate of the primary tunnel are detected, and the overall operating status of the primary tunnel is obtained.
[0045] Step S202: If the primary tunnel status indicates that the primary tunnel is available, obtain the backhaul route status corresponding to the primary user plane function element.
[0046] Backhaul routing can be understood as the communication link between the main user plane functional network element and the core network. It is responsible for transmitting the user terminal's service data from the main user plane functional network element back to the core network, where the core network forwards and processes the data. It is a critical link for the normal operation of user sessions.
[0047] Backhaul route status can indicate and describe the operation of the backhaul route, specifically including route connectivity and route switching status, and is used to determine whether the backhaul route can transmit data normally.
[0048] Specifically, the obtained primary tunnel status is continuously analyzed and judged. When the primary tunnel status indicates that it is available (i.e., the primary tunnel link is connected and there are no serious abnormalities in data transmission), it means that the primary user plane function network element has a preliminary session carrying foundation. At this time, the backhaul route status corresponding to the primary user plane function network element is further obtained.
[0049] As an example, the detection results of the primary tunnel are analyzed. When the primary tunnel link is connected, the data transmission packet loss rate is ≤1%, and the latency is ≤50ms, the primary tunnel is determined to be available. Then, the connection status of the backhaul route corresponding to the primary user plane function network element is obtained through the PFCP protocol to confirm whether the backhaul route has been restored to normal.
[0050] Step S203: If the backhaul route status indicates that the backup route corresponding to the secondary user plane function network element has been switched to the primary route corresponding to the primary user plane function network element, the user sessions residing in the secondary user plane function network element are migrated to the primary user plane function network element to complete the user session recovery.
[0051] Specifically, if the backhaul routing status indicates that the backup route corresponding to the secondary user plane function network element has been switched to the primary route corresponding to the primary user plane function network element, it means that the current network routing architecture has been restored to the normal state dominated by the primary route, and the primary user plane function network element has complete session carrying capacity. At this time, the session recovery device triggers the user session migration process, sends a session deletion command to the secondary user plane function network element, deletes the user session resources on the secondary user plane function network element, triggers the user terminal to reattach, and then migrates the user session residing in the secondary user plane function network element to the primary user plane function network element, and finally completes the user session recovery.
[0052] In a feasible scenario, the park deploys 1000 IoT terminals (including environmental monitoring terminals and equipment control terminals). The session recovery system deploys a primary user plane function network element and a secondary user plane function network element. The primary user plane function network element is responsible for carrying the session data transmission of all terminals on a daily basis, while the secondary user plane function network element stands by as a backup network element. When the primary user plane function network element malfunctions due to hardware failure (such as board damage), the secondary user plane function network element automatically takes over all terminal sessions to avoid service interruption. The session recovery device continuously monitors the status of the primary tunnel and backhaul route. Once the primary user plane function network element is repaired, the primary tunnel is available, and the route switch is completed, it automatically migrates the terminal sessions on the secondary user plane function network element back to the primary user plane function network element.
[0053] The user session recovery method provided by this invention allows the secondary user plane function network element to take over the user session and synchronously obtain the status of the primary tunnel when the primary user plane function network element malfunctions. After the primary tunnel is determined to be available and the backup route completes the switch to the primary route, the user session on the secondary user plane function network element is migrated to the primary user plane function network element to complete the session recovery. This eliminates the need for maintenance personnel to manually monitor the status, manually issue offline commands, and manually verify the terminal access location. It solves the problems of low efficiency in the overall recovery of user sessions caused by the reliance on manual operation in related technologies, which prevents the automatic batch processing of large numbers of user sessions.
[0054] Based on step S201 of this embodiment, obtaining the primary tunnel status between the primary user plane function network element and the client side is as follows: Figure 3 The implementation of steps S3011 to S3013 is as follows: Step S3011: Perform connectivity detection on the primary tunnel to obtain the link connectivity status of the primary tunnel.
[0055] The link connectivity status can be understood as the basic connection status of the primary tunnel link, distinguishing between two core states: "connected" and "disconnected".
[0056] Specifically, after the primary user plane function network element malfunctions and the secondary user plane function network element takes over the session, a connectivity probe is simultaneously performed on the primary tunnel. Through preset probe methods, the probe detects whether the primary tunnel link is in a connected state, eliminates basic faults such as link breakage and open circuit, and obtains the link connectivity status of the primary tunnel.
[0057] As an example, the session recovery device uses ICMP ping probing to send ping request packets to the target node (client-side terminal gateway) of the primary tunnel. If a corresponding response packet is received within a preset time (e.g., 100ms), the primary tunnel link is determined to be connected. If no response packet is received or a timeout feedback is received, the primary tunnel link is determined to be disconnected, and the link connectivity status is recorded synchronously.
[0058] Step S3012: Perform data interaction verification on the primary tunnel to obtain the data transmission quality status of the primary tunnel.
[0059] Data transmission quality status can be used to describe the data transmission performance of the primary tunnel, and can specifically include key parameters such as data packet loss rate, transmission delay, and bandwidth utilization.
[0060] Specifically, based on the connection status of the primary tunnel link, data interaction verification is performed on the primary tunnel to simulate the data transmission scenario of a real user session, send test data and receive feedback data, obtain key parameters in the data transmission process, and thus determine the data transmission quality status of the primary tunnel.
[0061] As an example, a fixed-size test data packet (e.g., 1024 bytes) is sent to the primary tunnel for a preset duration (e.g., 10 seconds). The total number of data packets sent and the total number of received feedback data packets are counted, and the data packet loss rate is calculated. At the same time, the sending time and receiving time of each data packet are recorded, the average transmission delay is calculated, and the data transmission quality status of the primary tunnel is determined by combining the packet loss rate and delay parameters.
[0062] Step S3013: Determine the primary tunnel status based on the link connectivity status and data transmission quality status.
[0063] By integrating link connectivity and data transmission quality status, and based on preset judgment rules, the operation of the primary tunnel is comprehensively analyzed to ultimately determine the primary tunnel status (available or unavailable).
[0064] As an example, the preset judgment rules are: the link connectivity status is "connected", and the data transmission packet loss rate is ≤1% and the average transmission delay is ≤50ms; integrating the link connectivity status and data transmission quality status, if both of the above conditions are met, the primary tunnel status is judged to be "available"; if the link is disconnected, or the data transmission quality does not meet the threshold, the primary tunnel status is judged to be "unavailable", and the judgment results and abnormal parameters are recorded synchronously.
[0065] The user session recovery method provided by this invention obtains the link connectivity status by conducting connectivity detection on the primary tunnel and obtains the data transmission quality status by data interaction verification. The actual status of the primary tunnel is determined by combining the two types of status information, which can determine the actual operation of the primary tunnel and avoid the problem of one-sided status judgment caused by only judging the link connectivity.
[0066] Based on step S203 in this embodiment, the user sessions residing in the secondary user plane function element are migrated to the primary user plane function element, as follows: Figure 4 The implementation of steps S4041 to S4043 is as follows: Step S4041: Receive session deletion command.
[0067] A session deletion command can be understood as a control command for a secondary user plane function network element to delete the user session resources it carries, which may include key information such as session identifier and deletion scope.
[0068] Specifically, it can receive session deletion commands.
[0069] As an example, the session recovery device sends a session deletion command to the secondary user plane function network element via the PFCP protocol. The command carries a list of user session identifiers to be deleted. The secondary user plane function network element receives the command through the PFCP protocol port, verifies the legality and completeness of the command, and records the command information after confirming that it is correct.
[0070] Step S4042: Based on the session deletion command, delete the corresponding user session on the secondary user plane function network element to trigger the user terminal to initiate a reattach command.
[0071] A session deletion command is a control command that instructs a secondary user plane function network element to delete the user session resources it carries. Specifically, it may include key information such as session identifier and deletion scope.
[0072] The reattach command can be understood as a request command initiated by the user terminal to the network to re-establish the communication connection after the user terminal detects that its user session with the network has been interrupted.
[0073] Specifically, after receiving and verifying the session deletion instruction, the secondary user plane function network element deletes the corresponding user session resources it carries based on the session identifier and deletion range specified in the instruction, and terminates the communication connection with the user terminal. Since the session between the user terminal and the secondary user plane function network element is actively deleted, the terminal can initiate a reattach instruction after detecting the session interruption and attempt to re-establish the network connection.
[0074] Step S4043: Based on the reattach command initiated by the user terminal, complete the migration and switching of the user session from the secondary user plane function network element to the primary user plane function network element.
[0075] Specifically, after receiving the reattachment instruction initiated by the user terminal, the user terminal is directed to the primary user plane function network element that has recovered to normal according to the preset primary and backup priority policy. A new user session is established for the terminal on the primary user plane function network element, realizing the migration and switching of the user session from the secondary user plane function network element to the primary user plane function network element, and finally completing the session migration.
[0076] As an example, after receiving a reattachment command initiated by a user terminal, the terminal identifier and service information in the command are parsed. Based on the preset primary / backup priority policy (the primary user plane function element has higher priority than the secondary user plane function element), the terminal is scheduled to the primary user plane function element. The primary user plane function element allocates the corresponding session resources according to the terminal's service requirements, establishes the target user session, and sends attachment success information back to the terminal, thus completing the migration and switching of the user session from the secondary user plane function element to the primary user plane function element.
[0077] Specifically, step S4043 above, based on the reattachment command initiated by the user terminal, completes the migration and handover of the user session from the secondary user plane function network element to the primary user plane function network element, including: Step a1: According to the preset primary / backup priority policy, the user terminal that initiates the reattachment command is scheduled to the primary user plane function element.
[0078] The preset primary / backup priority strategy can be understood as a preset network element scheduling rule. The core rule is that the primary user plane function network element has a higher priority than the secondary user plane function network element. This is used to direct the terminal to the primary network element when the user terminal reattaches.
[0079] Specifically, based on the preset primary and backup priority strategy, the target bearer network element of the user terminal is identified as the primary user plane function network element, and then the user terminal that initiates the reattach command is directed to the primary user plane function network element.
[0080] Step a2: Using the user terminal, establish a target user session on the primary user plane functional network element to complete the migration switch; wherein, the target user session is matched with the primary route.
[0081] Specifically, after scheduling the user terminal to the primary user plane function network element, the user terminal's reattachment requirement is used to establish a new target user session for the terminal on the primary user plane function network element. At the same time, it is ensured that the target user session matches the primary route, that is, the data transmission path of the session is consistent with the primary route corresponding to the primary user plane function network element, ensuring that the session data can be normally transmitted back to the core network through the primary route, and finally completing the migration and handover of the user session from the secondary user plane function network element to the primary user plane function network element.
[0082] As an example, after a user terminal is scheduled to the primary user plane function network element, it sends a session establishment request to the primary user plane function network element. After receiving the request, the primary user plane function network element parses the terminal's service requirements, allocates the corresponding session resources (such as bandwidth and port), and establishes the target user session. At the same time, the primary user plane function network element queries its own corresponding primary routing information, binds the data flow of the target user session to the primary route, ensures that the session matches the primary route, and after the session is established, it sends an attachment success message to the terminal, completing the migration and handover.
[0083] The user session recovery method provided by this invention receives a session deletion command, deletes the corresponding user session on the secondary user plane functional network element according to the command, and then triggers the user terminal to initiate a reattach command due to the deletion of the session. Based on the reattach command, the user session is migrated and switched from the secondary user plane functional network element to the primary user plane functional network element. This realizes the automatic triggering and execution of user session migration without the need for manual intervention to issue offline commands, wait for the session to expire naturally, or verify the migration results. It can efficiently complete the batch migration of sessions and solve the problems of low efficiency and disordered migration caused by manual operation.
[0084] In addition, by using a preset primary and backup priority strategy, user terminals that initiate reattach commands are scheduled in a targeted manner. After being scheduled to the primary user plane function network element, the target user session is established with the help of the user terminal to complete the migration and handover. At the same time, it is ensured that the target user session and the primary route are matched, so as to achieve orderly management of the user terminal's network access location.
[0085] In one possible implementation, the above user session recovery method may further include the following steps: Step b1: Verify uplink and downlink data transmission of the target user session on the primary user plane functional network element to determine whether the target user session has resumed normal communication.
[0086] Specifically, for the target user sessions already established on the main user plane functional network elements, bidirectional uplink and downlink data transmission verification is carried out to simulate real business data uplink (user terminal transmitting data to the core network) and downlink (core network transmitting data to the user terminal) transmission scenarios. By detecting the integrity and real-time performance of data transmission, it is determined whether the target user session can communicate normally.
[0087] Step b2: If the target user session resumes normal communication, the user session recovery process is complete.
[0088] If the target user session resumes normal communication, it indicates that the user session has been successfully migrated from the secondary user plane function network element to the primary user plane function network element, and the migrated session can run normally. At this time, no additional operations are required, and the user session recovery process can be completed directly.
[0089] Step b3: If the target user session does not resume normal communication, output alarm information including the cause of the error, session identifier, and number of affected users.
[0090] If the target user session fails to resume normal communication (e.g., severe data packet loss, inability to transmit data, etc.), in order to facilitate system administrators to quickly locate the problem and handle it in a timely manner, the system automatically analyzes the cause of the anomaly (e.g., primary route matching error, insufficient primary user plane function network element session resources, etc.), extracts the identifier of the target user session that has not resumed normal communication, counts the number of user terminals affected by the anomaly, and obtains alarm information.
[0091] In one implementation scenario, a smart park deploys 600 IoT terminals (covering environmental monitoring and smart access control terminals). The session recovery system includes a primary user plane function network element, a secondary user plane function network element, and a session recovery device. The primary route is a dedicated communication link between the core network and the primary user plane function network element, with a preset primary tunnel monitoring interval of 30 seconds. Initially, due to a primary user plane function network element failure, the secondary user plane function network element automatically takes over all terminal sessions. The session recovery device periodically acquires the primary tunnel status at 30-second intervals, performing connectivity detection and data transmission quality verification during each monitoring. After 10 minutes of continuous monitoring, if the primary tunnel link is found to be connected, the data packet loss rate is ≤0.5%, and the latency is ≤50ms, the primary tunnel is determined to be available. Periodic monitoring stops, and a session migration process is triggered simultaneously. The terminal reattaches and establishes the target user session on the primary user plane function network element. The session recovery device verifies uplink and downlink data transmission for 600 target user sessions on the primary user plane functional network element. Of these, 580 sessions transmit uplink and downlink data normally, while 20 sessions fail to transmit downlink data normally. For the 580 verified target user sessions, the session recovery device generates a recovery completion log, marking the recovery of these sessions as complete, thus completing the session recovery process for the corresponding batch. For the 20 sessions that failed to recover, the session recovery device analyzes the cause of the anomaly (mismatch between the primary route and the session), extracts the unique identifier of these 20 sessions, counts the number of affected users as 20, generates an alarm message and pushes it to the system administrator terminal, simultaneously triggering a platform alarm. Upon receiving the alarm, the administrator quickly logs into the system to adjust the binding relationship between the session and the primary route, completing the anomaly repair.
[0092] The user session recovery method provided by this invention performs uplink and downlink data transmission verification on the target user session within the main user plane functional network element after completing the user session migration, thereby determining the session communication status. If the communication is normal, the recovery process ends; if the communication is abnormal, an alarm content carrying corresponding information is output. This method can promptly verify the actual communication effect after the session migration, quickly identify abnormal communication situations, and synchronously push relevant abnormal information.
[0093] In one possible implementation, the above user session recovery method may further include the following steps: Step c1: During the process of user sessions being carried by secondary user plane function network elements, the primary tunnel status is periodically acquired at time intervals until the primary tunnel status indicates that the primary tunnel is available.
[0094] The time interval can be understood as a preset period for obtaining the status of the primary tunnel, and the time interval can be adjusted according to business needs.
[0095] Specifically, a periodic monitoring mechanism is initiated to continuously acquire the status of the primary tunnel at preset fixed time intervals. The monitoring process will not affect the session carrying function of the secondary user plane function network element until the primary tunnel status is detected to indicate that it is available, at which point the periodic monitoring will stop.
[0096] As an example, after the secondary user plane function network element takes over all user sessions, it periodically obtains the status of the primary tunnel at fixed time intervals (e.g., 30 seconds). Each time it obtains the status, it first performs connectivity detection on the primary tunnel, then verifies the data transmission quality, and comprehensively determines the status of the primary tunnel. If the primary tunnel status is unavailable, it continues to monitor at 30-second intervals. If it detects that the primary tunnel link is connected, the data packet loss rate is ≤1%, and the average transmission delay is ≤50ms, it determines that the primary tunnel is available, stops periodic monitoring, and records the monitoring results synchronously.
[0097] The user session recovery method provided by this invention periodically acquires the status of the primary tunnel at time intervals during the user session carried by the secondary user plane functional network element, and continuously monitors it until the primary tunnel is available. This allows for real-time tracking of the primary tunnel's operation and timely capture of the opportunity for the tunnel to be restored to availability, without the need for continuous manual monitoring.
[0098] In some embodiments, the user session recovery device of the present invention can be implemented in a combination of hardware and software. As an example, the user session recovery device of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the user session recovery method of the present invention. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0099] The modules described in the embodiments of this invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.
[0100] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned user session recovery methods. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the user session recovery method shown in any embodiment of the present invention by calling the computer program.
[0101] In one alternative embodiment, an electronic device is provided, such as Figure 5 As shown, Figure 5 The illustrated electronic device 5000 includes a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are connected, for example, via a bus 5002. Optionally, the electronic device 5000 may further include a transceiver 5004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 5004 is not limited to one type, and the structure of the electronic device 5000 does not constitute a limitation on the embodiments of the present invention.
[0102] Processor 5001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 5001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0103] Bus 5002 may include a path for transmitting information between the aforementioned components. Bus 5002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 5002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5The bus 5002 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.
[0104] The memory 5003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0105] The memory 5003 stores application code (computer program) for executing the present invention, and its execution is controlled by the processor 5001. The processor 5001 executes the application code stored in the memory 5003 to implement the content shown in the foregoing method embodiments.
[0106] Among them, electronic devices can also be terminal devices. Terminal devices can be any devices that can install applications, including at least two of the following: smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.
[0107] It should be noted that, Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0108] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described user session recovery methods.
[0109] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.
[0110] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the user session recovery method described above.
[0111] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0112] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0113] The computer-readable storage medium provided in this invention can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EEPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0114] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
[0115] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0116] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and do not imply a specific order or sequence. Where appropriate, the order of use of similar objects may be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.
[0117] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a circuit, module, or system. Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0118] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for restoring a user session, characterized in that, The method is applied to the session recovery module of a session recovery system, which further includes a primary user plane function network element and a secondary user plane function network element. The method includes: If the secondary user plane function network element carries a user session, the status of the primary tunnel between the primary user plane function network element and the client side is obtained; wherein, the secondary user plane function network element carrying the user session is implemented when the primary user plane function network element is abnormal; If the primary tunnel status indicates that the primary tunnel is available, obtain the backhaul route status corresponding to the primary user plane function network element; If the backhaul route status indicates that the backup route corresponding to the secondary user plane function element has been switched to the primary route corresponding to the primary user plane function element, the user sessions residing in the secondary user plane function element will be migrated to the primary user plane function element to complete the user session recovery.
2. The user session recovery method according to claim 1, characterized in that, The step of obtaining the status of the primary tunnel between the primary user plane function network element and the client side includes: Connectivity detection is performed on the primary tunnel to obtain the link connectivity status of the primary tunnel; Data interaction verification is performed on the primary tunnel to obtain the data transmission quality status of the primary tunnel; The status of the primary tunnel is determined based on the link connectivity status and the data transmission quality status.
3. The user session recovery method according to claim 1, characterized in that, The migration of user sessions residing in the secondary user plane function network element to the primary user plane function network element includes: Receive session deletion command; Based on the session deletion instruction, the corresponding user session on the secondary user plane function network element is deleted, thereby triggering the user terminal to initiate a reattach instruction. Based on the reattach command initiated by the user terminal, the user session is migrated and switched from the secondary user plane function network element to the primary user plane function network element.
4. The user session recovery method according to claim 3, characterized in that, Based on the reattach command initiated by the user terminal, the migration and handover of the user session from the secondary user plane function network element to the primary user plane function network element is completed, including: According to the preset primary and backup priority strategy, the user terminal that initiates the reattachment command is scheduled to the primary user plane function network element; Using the user terminal, a target user session is established on the primary user plane function network element to complete the migration and handover; wherein, the target user session is matched with the primary route.
5. The user session recovery method according to claim 1, characterized in that, After migrating user sessions residing in the secondary user plane function network element to the primary user plane function network element, the method further includes: Uplink and downlink data transmission verification is performed on the target user session on the main user plane functional network element to determine whether the target user session has resumed normal communication. If the target user session resumes normal communication, the user session recovery process is complete. If the target user session fails to resume normal communication, an alarm message containing the cause of the error, session identifier, and number of affected users will be output.
6. The user session recovery method according to claim 1, characterized in that, The method further includes: During the process of a user session being carried by a secondary user plane function network element, the primary tunnel status is periodically acquired at time intervals until the primary tunnel status indicates that the primary tunnel is available.
7. A user session recovery system, characterized in that, The user session recovery system includes a primary user plane function network element, an auxiliary user plane function network element, and a user session recovery device. The user session recovery device is configured to: if the secondary user plane function network element carries the user session, obtain the status of the primary tunnel between the primary user plane function network element and the client side; wherein, the secondary user plane function network element carrying the user session is implemented when the primary user plane function network element is abnormal; if the status of the primary tunnel indicates that the primary tunnel is available, obtain the backhaul route status corresponding to the primary user plane function network element; if the status of the backhaul route indicates that the backup route corresponding to the secondary user plane function network element has been switched to the primary route corresponding to the primary user plane function network element, migrate the user session residing in the secondary user plane function network element to the primary user plane function network element to complete the user session recovery.
8. An electronic device, characterized in that, include: A processor and a memory connected to the processor; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to cause the processor to perform the user session recovery method as described in any one of claims 1-6.
9. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the user session recovery method according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the user session recovery method according to any one of claims 1-6.