CN112492704B - Session management method, device, terminal equipment and computer readable storage medium - Google Patents

Session management method, device, terminal equipment and computer readable storage medium Download PDF

Info

Publication number
CN112492704B
CN112492704B CN202011463574.4A CN202011463574A CN112492704B CN 112492704 B CN112492704 B CN 112492704B CN 202011463574 A CN202011463574 A CN 202011463574A CN 112492704 B CN112492704 B CN 112492704B
Authority
CN
China
Prior art keywords
session
timer
network
release request
network device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011463574.4A
Other languages
Chinese (zh)
Other versions
CN112492704A (en
Inventor
李紫阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN202011463574.4A priority Critical patent/CN112492704B/en
Publication of CN112492704A publication Critical patent/CN112492704A/en
Application granted granted Critical
Publication of CN112492704B publication Critical patent/CN112492704B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • H04W76/38Connection release triggered by timers

Abstract

The embodiment of the application discloses a session management method, a session management device, terminal equipment and a computer readable storage medium. The method is applied to the terminal equipment and comprises the following steps: sending a session release request to the network equipment; if the response instruction sent by the network equipment is not received within the timing duration set by the first timer, and the sending times of sending the session release request to the network equipment do not reach the time threshold, the session release request is sent to the network equipment again, and the timing duration of the first timer is reset according to the sending times, wherein the timing duration set by the first timer is in a negative correlation relation with the sending times; and when the sending times reach a time threshold value and the response instruction is not received within the timing duration set by the first timer, releasing the session locally. The session management method, the session management device, the terminal equipment and the computer-readable storage medium can reduce the time for the terminal equipment to wait for releasing the session and improve the session release efficiency.

Description

Session management method, session management device, terminal equipment and computer-readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a session management method, an apparatus, a terminal device, and a computer-readable storage medium.
Background
In a wireless communication system, for example, in communication technologies of fourth generation (4th generation mobile networks, 4G), fifth generation (5th generation mobile networks, 5G), etc., a terminal device needs to establish a communication session with a network device, and the network device can provide a service to the terminal device through the communication session, thereby implementing data transmission. At present, when a terminal device requests a network device to release a session, if the network device is abnormal, it needs to wait for a long time to actually release the session.
Disclosure of Invention
The embodiment of the application discloses a session management method, a session management device, terminal equipment and a computer readable storage medium, which can reduce the time for the terminal equipment to wait for releasing a session and improve the session release efficiency.
The embodiment of the application discloses a session management method, which is applied to terminal equipment and comprises the following steps:
sending a session release request to a network device, wherein the session release request is used for requesting the network device to release a session established with the terminal device;
if a response instruction sent by the network equipment is not received within the timing duration set by the first timer, and the sending times of sending the session release request to the network equipment do not reach a time threshold value, the session release request is sent to the network equipment again, and the timing duration of the first timer is reset according to the sending times, wherein the response instruction represents that the network equipment releases the session, and the timing duration set by the first timer is in a negative correlation with the sending times;
and when the sending times reach the time threshold and the response instruction is not received within the timing duration set by the first timer, locally releasing the session.
The embodiment of the application discloses a session management device, which is applied to terminal equipment, and the device comprises:
a request sending module, configured to send a session release request to a network device, where the session release request is used to request the network device to release a session established with the terminal device;
the request sending module is further configured to, if a response instruction sent by the network device is not received within a timing duration set by the first timer, and a sending frequency of sending the session release request to the network device does not reach a frequency threshold, resend the session release request to the network device, and reset the timing duration of the first timer according to the sending frequency, where the response instruction indicates that the network device releases the session, and the timing duration set by the first timer is in a negative correlation with the sending frequency;
a setting module, configured to reset the timing duration of the first timer according to the sending times after the request sending module sends the session release request to the network device again, where the timing duration set by the first timer is in a negative correlation with the sending times;
and the release module is used for releasing the session locally when the sending times reach the time threshold and the response instruction is not received within the timing duration set by the first timer.
The embodiment of the application discloses a terminal device, which comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is enabled to realize the method.
An embodiment of the application discloses a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described above.
The session management method, the session management device, the terminal device and the computer-readable storage medium disclosed in the embodiments of the present application, the terminal device sends a session release request to the network device, and if a response instruction for the network device to release a session is not received within a timing duration set by a first timer and a sending frequency for sending the session release request to the network device does not reach a frequency threshold, the session release request is sent to the network device again, and the timing duration of the first timer is reset according to the sending frequency, wherein the timing duration set by the first timer is in a negative correlation with the sending frequency, and when the sending frequency reaches the frequency threshold and a response instruction is not received within the timing duration set by the first timer, the session is released locally, and as the frequency for retransmitting the session release request by the terminal device increases, the timing duration set by the timer is shortened, the method and the device can reduce the waiting time of the terminal equipment under the condition that the network equipment is abnormal and can not release the session, so that the terminal equipment can release the session locally more quickly, the session release efficiency is improved, the influence of the abnormality of the network equipment on the terminal equipment is weakened, and the stability of the terminal equipment is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a diagram of an application scenario of a session management method in one embodiment;
FIG. 2 is a flow diagram of a method for session management in one embodiment;
fig. 3A is a diagram illustrating a terminal device requesting a network device to release a session in the related art;
fig. 3B is a schematic diagram illustrating a terminal device requesting a network device to release a session according to an embodiment of the present application;
FIG. 4 is a flow diagram of a session management method in another embodiment;
FIG. 5 is a block diagram of a session management apparatus in one embodiment;
fig. 6 is a block diagram of a terminal device in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the examples and figures of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first timer may be referred to as a second timer, and similarly, a second timer may be referred to as a first timer, without departing from the scope of the present application.
The first timer and the second timer are both timers, but they are not the same timer.
Fig. 1 is a diagram illustrating an application scenario of a session management method according to an embodiment. As shown in fig. 1, a communication connection is established between the terminal device 10 and the network device, optionally, the terminal device 10 and the network device may establish a communication connection through communication technologies such as 4G and 5G, and the communication connection manner is not limited in this embodiment of the application. The network device may include an access network device 20, and one or more core network devices 30 in communication with the access network device 20.
In some embodiments, the terminal device 10 may be referred to as a User Equipment (UE). The terminal device may be a Personal Communication Service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), or the like, and may also be a mobile phone, a Mobile Station (MS), a terminal device (mobile terminal), a notebook computer, or the like, and the terminal device 10 may communicate with one or more core networks through a Radio Access Network (RAN). The terminal equipment 10 may be, for example, a mobile telephone (or so-called "cellular" telephone) or a computer with terminal equipment, etc., and the terminal equipment 10 may also be, for example, a portable, pocket, hand-held, computer-included, or vehicle-mounted mobile device that exchanges voice and/or data with the radio access network. The terminal device 10 may also be a handheld device with a wireless communication function, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a network evolved in the future, and the like, and the implementation of the present application is not limited.
The access network device 20 may be a long-term evolution (LTE) system, a New Radio (NR) (mobile communication system) system, or an evolved base station (evolved Node B, which may be referred to as eNB or e-NodeB) macro base station, a micro base station (also referred to as a "small base station"), a pico base station, an Access Point (AP), a Transmission Point (TP), a new generation base station (new generation Node B, NodeB) in an authorized assisted access long-term evolution (LAA-LTE) system.
The Core network device 30 may be a Next Generation Core (NGC) device, an Evolved Packet Core (EPC), or the like.
Before sending data to the network device 20, the terminal device 10 needs to establish a communication session with the network device 20 and perform data transmission through the communication session. Terminal device 10 may establish one or more sessions with network device 20 based on actual service requirements.
In the related art, when the terminal device 10 is in a scenario where the data network is closed or the like, the session established with the network device 20 needs to be released to normally close the data network. The terminal device 10 sends a session release request to the network device 20, and may start a timer T3582, where the duration of the timer T3582 is usually 16s (seconds), and if the terminal device 10 does not release the session after the T3582 times out, the terminal device 10 may send a release request to the network device 20 again, and restart the timer T3582 for 16 s. If the network device 20 is abnormal, the terminal device 10 will terminate the process of requesting the network device 20 to release the session only if the terminal device 10 resends the session release request to the network device 20 for 4 times and the network device 20 still does not release the session. That is, when the network device 20 is abnormal and does not release the session all the time, the terminal device 10 needs to wait 16s by 5 to 80s, and needs to wait for a long time to actually release the session.
The embodiment of the application discloses a session management method, a session management device, a terminal device and a computer-readable storage medium, which can reduce the waiting time of the terminal device under the condition that the network device is abnormal and cannot release a session, so that the terminal device can release the session locally more quickly, the session release efficiency is improved, the influence of the abnormality of the network device on the terminal device is weakened, and the stability of the terminal device is improved.
As shown in fig. 2, in an embodiment, a session management method is provided, and the method may be applied to the terminal device described above, and the terminal device may include, but is not limited to, a mobile phone, a smart wearable device, a tablet computer, a vehicle-mounted terminal, and the like, which is not limited in this application. The method may comprise the steps of:
step 210, sending a session release request to the network device, where the session release request is used to request the network device to release the session established with the terminal device.
The terminal device may establish one or more sessions with the network device according to service requirements, where each session may correspond to a session identifier, for example, a session ID (Identity, Identity number) and the like. If the data networks accessed by the terminal equipment are different, different sessions can be established with the network equipment.
As an implementation manner, when the terminal device accesses the NR network of 5G, a PDU (Protocol Data Unit) session may be established with a core network device of 5G, where the PDU refers to a Data Unit transmitted between peer layers in a hierarchical network structure, and the terminal device establishes a PDU session with the network device to establish a Data transmission channel with the Data network, so as to implement PDU packet transmission with the Data network.
As another embodiment, when the terminal device accesses the LTE Network of 4G, a PDN (Packet Data Network) session, that is, a PDN connection, may be established with a core Network device of 4G, where the PDN session refers to an IP connection provided by the core Network system of 4G between the terminal device and an external Packet Data Network of a PLMN (Public Land Mobile Network). Each PDN session may include multiple bearers on which the terminal device may perform data transmissions.
When the resources related to the session need to be released, the terminal device may send a session release request to the network device, where the session release request may include a session identifier requesting release. When the network device receives the session release request, the session release request may be analyzed to obtain a session identifier, and resources of the session corresponding to the meeting mark identifier are released, and optionally, the resources of the session may include, but are not limited to, IP (Internet Protocol) resources, tunnel resources occupied by the session, such as N3, N9, and the like.
In some embodiments, when detecting a data network disconnection operation, the terminal device may send a session release request to the network device to request the network device to release a session established with the terminal device, and after the network device successfully releases the session, the terminal device may normally disconnect the data connection with the network device, and successfully disconnect the data network. Optionally, the data network disconnect operation may include, but is not limited to, any of the following:
(1) the data network switch is closed. The terminal device may be provided with a data network switch control, and a user may select to turn on or off a data network by triggering the data network switch control, where the data network may include, but is not limited to, a 5G NR network, a 4G LTE network, and the like. When the terminal device detects that the user triggers the data network switch control to close the data network, the terminal device can send a session release request to the network device to ensure that the data network is normally closed.
(2) Switching from a first SIM (Subscriber Identity Module) card to a second SIM card. The terminal equipment can be provided with a plurality of (two or more than two) SIM card slots, a user can put a plurality of corresponding SIM cards in the terminal equipment, one SIM card can be selected as a main card, and the SIM main card is used for realizing network communication. The first SIM card may refer to a SIM card currently serving as a master card, and the second SIM card may refer to a SIM card selected for switching. Optionally, the first SIM card and the second SIM card may support the same data network, for example, both the first SIM card and the second SIM card are SIM cards supporting an LTE network, but correspond to different network operators, respectively. The first SIM card and the second SIM card may also support different data networks, for example, the first SIM card is a SIM card of an NR network supporting 5G, and the second SIM card is a SIM card of an LTE network supporting 4G, but is not limited thereto.
When the terminal device detects that the first SIM card is switched to the second SIM card, the terminal device can send a session release request to the network device, and after the session is successfully released, the data network accessed through the first SIM card is normally disconnected, and the second SIM card is used as a data master card and accessed into the data network corresponding to the second SIM card for data communication. In some embodiments, switching from the first SIM card to the second SIM card may include manual switching by a user, automatic switching by the terminal device, and the like, and optionally, the terminal device may switch from the first SIM card to the second SIM card according to a preset switching policy, for example, switching when the current network signal strength is lower than a signal threshold, switching when a data network supported by the first SIM card does not match a data network required by the currently performed service data, and the like, but is not limited thereto.
(3) The flight mode is turned on. The flight mode may refer to a mode in which the terminal device cuts off all communication signals so as to prevent the transmission and reception of the mobile phone signal from affecting the flight of the airplane. The terminal equipment can be provided with a flight mode switch control, and a user can select to turn on or turn off the flight mode by triggering the flight mode switch control. When the terminal device detects that the user triggers the flight mode switch control to disconnect all network connections, a session release request can be sent to the network device to ensure that the data network is normally closed.
(4) Switching from the data network to the wireless network. The Wireless network may include, but is not limited to, a WiFi (Wireless Fidelity) network, and the like. When the terminal device detects that the communication connection with the wireless access point is established, namely the terminal device is accessed into the wireless network, the data network can be closed and the wireless network is used for data transmission, and a session release request can be sent to the network device, so that the data network can be normally closed, and the flow loss of the data network can be reduced.
It should be noted that the terminal device may also send the session release request to the network device in other scenarios, which is not limited to the above scenarios, for example, if the terminal device detects that the session is not used for data transmission with the network device for a long time, the terminal device may send the session release request to the network device to request to release the resources related to the session that is not used for the long time, so as to save the network resources and make better use of the network resources.
Step 220, determining whether a response instruction sent by the network device is received within a timing duration set by the first timer, if yes, performing step 260, and if no, performing step 230.
Step 230, determining whether the number of times of sending the session release request to the network device reaches a threshold number of times, if so, performing step 250, and if not, performing step 240.
When the terminal device sends the session release request to the network device, a first timer (e.g., timer T3582) may be started, where the first timer may set a timing duration, and the timing duration represents a waiting duration for the terminal device to send the session release request to the network device again. Optionally, the terminal device sends a session release request to the network device, and the started first timer may count up from 0 or count down from a set timing duration.
If the network device receives the session release request, the session requested by the session release request can be released, and a response instruction is returned to the terminal device. When the terminal device receives the response instruction sent by the network device, the first timer can be paused, and the response instruction sent by the network device is received within the timing duration set by the first timer. If the time recorded by the first timer expires or is overtime, if the first timer counts positively from 0, the recorded time reaches the timing duration, or the first timer counts negatively from the set timing duration, and the recorded time reaches 0, that is, it indicates that the response instruction sent by the network device is not received after exceeding the set timing duration.
If the terminal device does not receive a response instruction used for representing the network device to release the session and sent by the network device within the timing duration set by the first timer, it indicates that the network device does not successfully release the session within the timing duration set by the first timer, the terminal device may further determine whether the sending times of sending the session release request to the network device reaches a time threshold, and if the sending times does not reach the time threshold, the terminal device may send the session release request to the network device again.
If the terminal equipment receives the response instruction sent by the network equipment within the timing duration set by the first timer, the terminal equipment indicates that the network equipment successfully releases the session within the timing duration, and the network connection with the network equipment can be disconnected.
In some embodiments, the number threshold may be a value set according to an actual requirement, for example, 4 times, 5 times, and the like, and when the number of times that the terminal device sends the session release request to the network device reaches the number threshold and a response instruction of the network device is not received all the time, it may be described that the network device fails to successfully release the session due to an abnormal problem occurring on a large probability, and therefore, the terminal device may not send the session release request to the network device any more, and directly release the established session locally.
It should be noted that, in other embodiments, the terminal device may also determine whether the number of retransmissions for retransmitting the session release request to the network device reaches a set threshold, for example, the number of retransmissions reaches 4 or 3, and if the number of retransmissions reaches the set threshold, the terminal device may not retransmit the session release request to the network device.
Step 240, resending the session release request to the network device, resetting the timing duration of the first timer according to the sending times, and re-executing step 220.
In the embodiment of the present application, the timing duration set by the first timer is an adjustable duration. The terminal device can update the sending times when sending the session release request to the network device every time, and reset the timing duration of the first timer according to the updated sending times. The timing duration set by the first timer may be in a negative correlation with the number of times that the terminal device sends the session release request to the network device, and when the number of times of sending is larger, the corresponding timing duration may be shorter. Since the probability that the network device returns the response command is reduced if the network device still does not return the response command as the number of times of sending increases, the corresponding shortening of the duration of the first timer can achieve a greater benefit.
After the terminal equipment sends the session release request to the network equipment again, the timing duration of the first timer can be reset according to the sending times of the session release request sent to the network equipment, whether a response instruction sent by the network equipment is received or not is judged within the reset timing duration, the process can be repeatedly circulated until the sending times of the session release request sent to the network equipment by the terminal equipment reaches the threshold value of the times, and the session release request is not sent to the network equipment again.
In some embodiments, the first timer may be set with an initial duration, which is a timing duration set by the first timer when the session release request is first sent to the network device, for example, the initial duration of the first timer may be set to 8s, 10s, 7s, and the like, but is not limited thereto. The initial time can be set according to actual requirements, or can be an optimal value obtained by testing the network for multiple times, and the initial time can be selected to be moderate, so that the situation that the terminal equipment needs to wait for a longer time due to overlong initial time can be avoided, and the situation that the network equipment has overlarge processing pressure due to the fact that the terminal equipment frequently sends a session release request to the network equipment due to overlong initial time can also be avoided.
When the terminal device sends a session release request to the network device for the first time, the first timer is started, and it may be determined whether a response instruction sent by the network device is received within an initial time period T1 (e.g., 8s) set by the first timer. If the response instruction is not received within the initial duration T1, the session release request may be sent to the network device again, and the timing duration T2 of the first timer corresponding to the session release request sent 2 nd time may be set again (e.g., 6 s). The first timer may be restarted, and it may be determined whether a response instruction is received within a timing duration T2 reset by the first timer, and if the response instruction is not received within the timing duration T2, the session release request … … may be sent to the network device again, and so on until a response instruction returned by the network device is received, or the number of times of sending the session release request to the network device reaches the threshold number of times.
With the increase of the number of times of retransmitting the session release request by the terminal device, the timing duration set by the timer is shortened, and the duration of waiting for the response instruction each time by the terminal device is shortened, so that compared with the mode that the fixed timing duration is set by the timer in the related art, namely, the duration of the timer started by sending the session release request each time is the same, the waiting time of the terminal device under the condition that the session cannot be released when the network device is abnormal is obviously reduced.
The session is released locally, step 250.
If the number of times that the terminal device sends the session release request to the network device reaches the number threshold and the response instruction sent by the network device is not received within the timing duration set when the first timer sends the session release request for the last time, the terminal device may locally release the session to release the resource corresponding to the session. Further, the terminal device may delete information related to the released session, such as an IP address, data transmission information, etc., further saving space.
In step 260, the network connection with the network device is disconnected.
After the network device successfully releases the session or the terminal device locally releases the session, the terminal device may respond to the data network disconnection operation to disconnect the network connection with the network device. By adopting the method described in the embodiment of the application, the network connection between the terminal equipment and the network equipment can be disconnected more quickly, the time that each data module on the terminal equipment is still in a working state when a user triggers to close the data network can be reduced, and the power consumption can be reduced.
For example, please refer to fig. 3A and fig. 3B simultaneously, where fig. 3A is a schematic diagram of a terminal device requesting to release a session from a network device in the related art, and fig. 3B is a schematic diagram of a terminal device requesting to release a session from a network device in an embodiment of the present application. As shown in fig. 3A, in the related art, the terminal device 10 sends a session release request to the core network device 30, and starts a first timer at the same time, where a timing duration set by the first timer is a fixed T', and when the first timer expires or times out, sends the session release request to the core network device 30 again, and restarts the first timer. The terminal device 10 sends a session release request to the core network device 30 for 4 times, and locally releases the session when a response instruction returned by the core network device 30 is not received within a timing duration T' set by the first timer started at the 4th time. The terminal device 10 waits for 4T' in this process.
As shown in fig. 3B, in an embodiment of the present application, when the terminal device 10 sends a session release request to the core network device 30 for the first time, a first timer is started, where a timing duration set by the first timer is an initial duration T1, if the first timer expires or times out, the session release request is sent to the core network device 30 again, a timing duration of the first timer is set to T2 again, the first timer is restarted, … …, and so on, until the terminal device 10 sends a session release request to the core network device 30 for 4 times, and when a response instruction returned by the core network device 30 is not received by a timing duration T4 set by the first timer started for the 4th time, the session is released locally. The initial duration T1 may be less than or equal to T ', and since T1> T2> T3> T4, the duration T1+ T2+ T3+ T4 for which the terminal device 10 waits is less than 4T'. It can be seen from fig. 3A and fig. 3B that the embodiment of the present application can significantly shorten the time for the terminal device to wait for the session release when the network device is abnormal.
In the embodiment of the application, a terminal device sends a session release request to a network device, if a response instruction of the network device to release a session is not received within a timing duration set by a first timer, and the sending frequency of the session release request sent to the network device does not reach a frequency threshold, the session release request is sent to the network device again, and the timing duration of the first timer is reset according to the sending frequency, wherein the timing duration set by the first timer and the sending frequency are in a negative correlation relationship, when the sending frequency reaches the frequency threshold and no response instruction is received within the timing duration set by the first timer, the session is released locally, and as the number of times of retransmitting the session release request by the terminal device increases, the timing duration set by the timer shortens, so that the waiting time of the terminal device under the condition that the network device cannot release the session due to abnormality can be reduced, the terminal equipment can release the session locally more quickly, the session release efficiency is improved, the influence of the network equipment abnormality on the terminal equipment is weakened, and the stability of the terminal equipment is improved.
In some embodiments, the step of resetting the timing duration of the first timer based on the number of transmissions may include, but is not limited to, any of the following:
in the first mode, the timing duration of the first timer is set as the ratio of the initial duration to the sending times. The terminal device may reset the timing duration of the first timer according to the number of times of transmission when retransmitting the session release request to the network device each time. Starting from the 2 nd time that the terminal device sends the session release request to the network device, the set timing duration may be the ratio of the initial duration to the sending times, and the timing duration may be shortened as the sending times increase. The timing duration of the first timer may be set according to equation (1):
Figure BDA0002830041470000121
wherein T represents a set timing duration, T0Indicating the initial time duration and n the number of transmissions. For example, if the initial duration is 8s, the timing duration of the first timer may be set to 8/2-4 s when the 2 nd session release request is sent, the timing duration of the first timer may be set to 8/3-2.667 s when the 3 rd session release request is sent, and the timing duration of the first timer may be set to 8/4-2 s … … when the 4th session release request is sent.
And setting the timing duration of the first timer as the product of the initial duration and a proportional value, wherein the example value is obtained by performing exponentiation operation with the number of retransmissions for retransmitting the session release request to the network device as an exponent and a decreasing proportion as a base number, and the number of retransmissions is the number of retransmissions minus 1. When the terminal device sends a session release request to the network device again each time, the set timing duration of the first timer may be decremented according to a fixed decrement proportion, where the decrement proportion may be a proportion of the timing duration of the first timer set this time to the timing duration set last time. The decreasing ratio may be preset according to actual requirements, for example, 50%, 40%, etc. The timing duration of the first timer may be set according to equation (2):
T=T0*n-1formula (2);
wherein T represents a set timing duration, T0Indicates the initial time duration, n indicates the number of transmissions, and a indicates the decrement ratio. For example, if the initial duration is 8s and the decrement ratio is 50%, the timing duration of the first timer may be set to 8 × 0.5 — 4s when the session release request is transmitted 2, and the timing duration of the first timer may be set to 8 × 0.5 when the session release request is transmitted 322s, the 4th time when sending the session release request, the timing duration of the first timer may be set to 8 × 0.53=1s……。
And the reduced time length is increased along with the increase of the number of times that the terminal equipment sends the session release request to the network equipment, so that the set timing time length of the first timer is shortened.
In some embodiments, the reduced duration may be a product of the fixed decrement time and a number of retransmissions to resend the session release request to the network device, which may be the number of transmissions minus 1. When the terminal device sends a session release request to the network device again each time, the set timing duration of the first timer may be decremented according to a fixed decrement time, where the fixed decrement time may be understood as a time that the timing duration of the first timer set this time is reduced by the last set timing duration. The fixed decrement time can be set according to actual requirements, such as 1s, 2s and the like. The timing duration of the first timer may be set according to equation (3):
T=T0- (n-1) b formula (3);
wherein T represents a set timing duration, T0Indicating an initial time duration, n indicating transmissionThe number of times, b, represents a fixed decrement time. For example, the initial duration is 9s, the fixed decrement time is 2s, the timing duration of the first timer may be set to 9-2 ═ 7s when the session release request is sent 2 nd time, the timing duration of the first timer may be set to 9-2 × -2 ═ 5s when the session release request is sent 3 rd time, and the timing duration of the first timer may be set to 9-2 × -3 ═ 3s … … when the session release request is sent 4th time.
In other embodiments, the reduced duration may also be obtained by querying an established corresponding relationship between the reduced duration and the sending times. The corresponding relationship between the reduced duration and the sending times can be established in advance according to actual requirements, the more the sending times are, the longer the corresponding reduced duration can be, and optionally, the corresponding relationship can be described in a form, a corresponding curve or other manners. For example, the correspondence between the reduced duration and the number of transmissions may be as shown in table 1:
TABLE 1
Number of transmissions Reducing duration
2 times (one time) 1 second
3 times of 3 seconds
4 times (twice) 5 seconds
For example, if the initial duration is 7s, the timing duration of the first timer may be set to 7-1 to 6s when the session release request is transmitted at the 2 nd time, the timing duration of the first timer may be set to 7-3 to 4s when the session release request is transmitted at the 3 rd time, and the timing duration of the first timer may be set to 7-5 to 2s when the session release request is transmitted at the 4th time.
It can be understood that other manners may also be adopted in the embodiment of the present application to set the timing duration of the first timer, which is not limited to the foregoing manners, and only needs to satisfy that the timing duration set by the first timer has a negative correlation with the sending times.
In the embodiment of the application, as the number of times that the terminal device retransmits the session release request to the network device increases, the timing duration set by the timer is shortened, so that the waiting time of the terminal device under the condition that the network device is abnormal and cannot release the session can be reduced, the terminal device can release the session locally more quickly, the session release efficiency is improved, the influence of the abnormality of the network device on the terminal device is weakened, and the stability of the terminal device is improved.
As shown in fig. 4, in an embodiment, another session management method is provided, which is applicable to the terminal device described above, and the method may include the following steps:
step 402, sending a session release request to the network device, where the session release request is used to request the network device to release the session established with the terminal device.
In some embodiments, in the NR network scenario of 5G, the terminal device accesses the NR network through the network device and establishes a PDU session with the network device. If the terminal device detects a data network disconnection operation in an NR network scenario, a protocol data unit PDU session release request may be sent to the network device through a Non-Access Stratum (NAS). The NAS may exist in a wireless communication protocol stack as a functional layer between a core network and a user equipment. When accessing the 5G NR network, if the connected NR network needs to be disconnected, the established PDU session needs to be released first, and the connected NR network is disconnected after the PDU session is successfully released.
As a specific implementation manner, the terminal device may send a PDU session release request conforming to an NAS message format to the 5G core network device, where the session release request in the NAS message format may include a session ID of the PDU session requested to be released, and the like. The Session release request in the NAS message format may be forwarded to AN AMF (Access and Mobility Management Function) through AN (Access network)/RAN (wireless Access network), and forwarded to AN SMF (Session Management Function) by the AMF. After receiving the PDU session release request, the SMF may release the resource related to the PDU session requested to be released according to the session ID included in the PDU session release request.
In some embodiments, in the LTE network scenario of 4G, the terminal device accesses the LTE network through the network device, and establishes a PDN session with the network device. The terminal equipment sends an attachment request and a PDN connection request to the network equipment when starting up, wherein the PDN connection request aims to establish default load between the terminal equipment and a P-GW (PDN GateWay), and each PDN connection can correspond to one default load and one IP address.
In the LTE network, in order to meet the always-on (always on) requirement, when there is no data transmission, the network device still retains the resources related to the default PDN connection of the terminal device, such as resources like IP address. An attach PDN established by the terminal device during a process of power-on registration with the PLMN (i.e., an attach process) is both a data PDN (PDN connection for data transfer) and a default PDN (default PDN connection). Therefore, when the data network is closed, the terminal device does not need to send a PDN session release request to the network device, that is, the accessed data network can be disconnected without interaction with the network device.
In some specific scenarios, if an attach PDN is disconnected by a network device for some reason, other PDN connections may become default PDNs, for example, an IMS (IP Multimedia Subsystem) PDN may become default PDN, where the IMS PDN may be a PDN connection established with the network device for transmitting an IMS SIP (Session Initiation Protocol) signaling message and a user Voice packet when a terminal device accesses a VOLTE (Voice over Long-Term Evolution) network. Although the terminal device will try again to request establishment of the data PDN in the following, the re-established data PDN is not the default PDN. Therefore, when the data network is closed, a PDN session release request needs to be sent to the network device to request release of data PDN related resources.
In an LTE network scenario, if a PDN connection established with a network device is disconnected during an attach process, when a terminal device detects a data network disconnection operation, a PDN session release request may be sent to the network device through an NAS. An ESM (EPS Session Management, evolved packet system Session Management) module of the NAS may implement Management functions related to a PDN Session, such as establishing a PDN connection and releasing the PDN connection. The PDN session release request may include a PDN disconnect request (PDN disconnect request) to request the network device to disconnect the PDN connection with the terminal device, release the relevant resources, and close the data network after the network device successfully releases the PDN session.
It should be noted that the scenario in which the terminal device needs to release the session is not limited to the foregoing several scenarios, and may also be other scenarios.
Step 404, determining whether a response instruction sent by the network device is received within a timing duration set by the first timer, if yes, performing step 414, and if no, performing step 406.
Step 406, determining whether the number of times of sending the session release request to the network device reaches a threshold number of times, if so, performing step 412, and if not, performing step 408.
The descriptions of steps 404 to 406 can refer to the related descriptions in the above embodiments, and are not repeated herein.
Step 408, resending the session release request to the network device, and adding 1 to the sending times recorded by the second timer to update the sending times recorded by the second timer.
When the terminal device needs to release the session, it may start a second timer, for example, the timer N3582, and the second timer may be used to record the number of times that the terminal device sends the session release request to the network device. When the terminal device sends the session release request to the network device again each time, the sending times recorded by the second timer can be updated, and the timing duration of the first timer is reset according to the updated sending times.
When the terminal device sends a session release request to the network device for the first time, a first timer and a second timer may be started at the same time, the timing duration set by the first timer is an initial duration, and the value of the second timer may be set to 1. If the response instruction sent by the network device is not received within the initial time length set by the first timer, the session release request is sent to the network device again, the value of the second timer may be increased by 1, that is, 2, so as to update the sending times recorded by the second timer, and the timing time length of the first timer is reset, … …, and so on, until the second timer is overtime (that is, the value recorded by the second timer reaches the time threshold), and the response instruction is not received within the latest set timing time length of the first timer, the terminal device releases the session locally.
And step 410, resetting the timing duration of the first timer according to the updated sending times.
The session is released locally, step 412.
At step 414, the network connection with the network device is disconnected.
The descriptions of steps 410-414 can refer to the related descriptions in the above embodiments, and are not repeated herein.
In some embodiments, when detecting a data network disconnection operation, the terminal device may obtain an initial duration and a time threshold corresponding to the detected data network disconnection operation, may set the first timer according to the initial duration, and may set the second timer according to the time threshold. Different data network disconnection operations can respectively correspond to different initial time lengths and time threshold values, and the initial time lengths and the time threshold values can be set according to specific scenes of the data network disconnection operations.
For example, the detected data network disconnection operation is switching from the first SIM card to the second SIM card, and since the waiting time for the user to disconnect the data network is sensitive in the SIM card switching scenario, the initial duration may be set to a smaller value, for example, 5s, 4s, and the time threshold may also be set to a smaller value, for example, 3 times, 4 times, and the like, which can improve the efficiency of closing the data network, and prevent the first SIM card from occupying resources all the time and affecting the normal service of the second SIM card. The detected data network disconnection operation is to start a flight mode, and under the scene that the flight mode is required to be started by a user, the currently connected data network does not need to be closed particularly urgently, so that the initial time length can be set to be a large value, such as 10s, 12s and the like, and the time threshold can also be set to be a small value, such as 6 times, 7 times and the like, so that the condition of misjudgment can be reduced, and the accuracy in the session release process can be improved. The initial duration and the time threshold can be adjusted according to a specific scene, so that the retransmission strategy of retransmitting the session release request to the network equipment by the terminal equipment can better meet the actual requirements of the user.
In the embodiment of the application, when the terminal device sends a session release request to the network device for the first time, the first timer and the second timer can be started simultaneously, the second timer can be used for recording the sending times of the session release request sent by the terminal device to the network device, the sending times recorded by the second timer can be updated when the session release request is sent to the network device again, the timing duration of the first timer is reset according to the updated sending times, the timing duration set by the timer is shortened along with the increase of the times of the session release request re-sent by the terminal device, the waiting time of the terminal device under the condition that the network device has abnormity and cannot release the session can be reduced, the terminal device can release the session locally more quickly, the session release efficiency is improved, and the influence of the network device abnormity on the terminal device is reduced, the stability of the terminal equipment is improved.
As shown in fig. 5, in one embodiment, a session management apparatus 500 is provided, which is applicable to the terminal device described above. The session management apparatus 500 may include a request sending module 510, a setting module 520, and a releasing module 530.
A request sending module 510, configured to send a session release request to the network device, where the session release request is used to request the network device to release a session established with the terminal device.
The request sending module 510 is further configured to, if a response instruction sent by the network device is not received within the timing duration set by the first timer, and the sending frequency of sending the session release request to the network device does not reach the frequency threshold, resend the session release request to the network device, and reset the timing duration of the first timer according to the sending frequency, where the response instruction represents that the network device releases the session, and the timing duration set by the first timer is in a negative correlation with the sending frequency.
A setting module 520, configured to reset the timing duration of the first timer according to the sending times after the request sending module sends the session release request to the network device again, where the timing duration set by the first timer and the sending times are in a negative correlation relationship.
A releasing module 530, configured to release the session locally when the sending times reaches the time threshold and the response instruction is not received within the timing duration set by the first timer.
In the embodiment of the application, a terminal device sends a session release request to a network device, if a response instruction of the network device to release a session is not received within a timing duration set by a first timer, and the sending frequency of the session release request sent to the network device does not reach a frequency threshold, the session release request is sent to the network device again, and the timing duration of the first timer is reset according to the sending frequency, wherein the timing duration set by the first timer and the sending frequency are in a negative correlation relationship, when the sending frequency reaches the frequency threshold and no response instruction is received within the timing duration set by the first timer, the session is released locally, and as the number of times of retransmitting the session release request by the terminal device increases, the timing duration set by the timer shortens, so that the waiting time of the terminal device under the condition that the network device cannot release the session due to abnormality can be reduced, the method and the device have the advantages that the terminal device can release the session locally more quickly, the session release efficiency is improved, the influence of the network device abnormality on the terminal device is weakened, and the stability of the terminal device is improved.
In an embodiment, the setting module 520 is further configured to set a timing duration of the first timer to a ratio of an initial duration to the number of sending times, where the initial duration is the timing duration set by the first timer when the session release request is sent to the network device for the first time.
In one embodiment, the setting module 520 is further configured to set the timing duration of the first timer to be a product of the initial duration and a proportional value, where the proportional value is obtained by performing a power operation with the number of retransmissions for retransmitting the session release request to the network device as an exponent and the decreasing proportion as a base, and the number of retransmissions is the number of retransmissions minus 1.
In one embodiment, the setting module 520 is further configured to set the timing duration of the first timer to be a difference between the initial duration and a reduced duration, where the reduced duration is in a positive correlation with the sending times.
In one embodiment, the reduced duration is a product of the fixed decrement time and a number of retransmissions for resending the session release request to the network device, the number of retransmissions being the number of transmissions minus 1; or the reduced duration is obtained by inquiring the established corresponding relation between the reduced duration and the sending times.
In the embodiment of the application, as the number of times that the terminal device retransmits the session release request to the network device increases, the timing duration set by the timer is shortened, so that the waiting time of the terminal device under the condition that the network device is abnormal and cannot release the session can be reduced, the terminal device can release the session locally more quickly, the session release efficiency is improved, the influence of the abnormality of the network device on the terminal device is weakened, and the stability of the terminal device is improved.
In one embodiment, the session management apparatus 500 further includes an update module in addition to the request sending module 510, the setting module 520, and the releasing module 530.
And an updating module, configured to add 1 to the number of sending times recorded by the second timer after the request sending module 510 sends the session release request to the network device again, so as to update the number of sending times recorded by the second timer.
In an embodiment, the request sending module 510 is further configured to, in a new air interface NR network scenario, send a protocol data unit PDU session release request to the network device through a non-access stratum NAS if a data network disconnection operation is detected; and the device is used for sending a PDN session release request to the network equipment through the NAS when the disconnection operation of the data network is detected if the PDN connection established with the network equipment in the attachment process is disconnected in a Long Term Evolution (LTE) network scene.
In one embodiment, the data network disconnect operation includes any one of turning off a data network switch, switching from a first subscriber identity module, SIM, card to a second SIM card, turning on an airplane mode, and switching from a data network to a wireless network.
In the embodiment of the application, when the terminal device sends a session release request to the network device for the first time, the first timer and the second timer can be started simultaneously, the second timer can be used for recording the sending times of the session release request sent by the terminal device to the network device, the sending times recorded by the second timer can be updated when the session release request is sent to the network device again, the timing duration of the first timer is reset according to the updated sending times, the timing duration set by the timer is shortened along with the increase of the times of the session release request re-sent by the terminal device, the waiting time of the terminal device under the condition that the network device has abnormity and cannot release the session can be reduced, the terminal device can release the session locally more quickly, the session release efficiency is improved, and the influence of the network device abnormity on the terminal device is reduced, the stability of the terminal equipment is improved.
Fig. 6 is a block diagram of a terminal device in one embodiment. As shown in fig. 6, the terminal device may include: radio frequency module 610, memory 620, input unit 630, display unit 640, sensor 650, audio circuitry 660, WiFi module 670, processor 680, and power supply 690. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 6 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components.
The rf module 610 may be configured to receive and transmit signals during information transmission and reception or during a call, and in particular, receive downlink information of a base station and then process the downlink information to the processor 680; in addition, the data for designing uplink is transmitted to the base station. Generally, the rf module 610 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the radio frequency module 610 may also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), long term evolution, email, Short Message Service (SMS), etc.
The memory 620 may be used to store software programs and modules, and the processor 680 may execute various functional applications of the terminal device and data processing by operating the software programs and modules stored in the memory 620. The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal device, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the input unit 630 may include a touch panel 632 and other input devices 634. The touch panel 632, also referred to as a touch screen, can collect touch operations of a user (e.g., operations of the user on the touch panel 632 or near the touch panel 632 by using a finger, a stylus, or any other suitable object or accessory) thereon or nearby, and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 632 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch panel 632 can be implemented by various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 630 may include other input devices 634 in addition to the touch panel 632. In particular, other input devices 634 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 640 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The display unit 640 may include a display panel 642, and optionally, the display panel 642 may be configured in the form of a Liquid Crystal Display (LCD), an organic light-Emitting diode (OLED), or the like. Further, the touch panel 632 can cover the display panel 642, and when the touch panel 632 detects a touch operation on or near the touch panel 632, the touch panel can transmit the touch operation to the processor 680 to determine the type of the touch event, and then the processor 680 can provide a corresponding visual output on the display panel 642 according to the type of the touch event. Although in FIG. 6, the touch panel 632 and the display panel 642 are shown as two separate components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 632 and the display panel 642 may be integrated to implement the input and output functions of the terminal device.
The terminal device may also include at least one sensor 650, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 642 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 642 and/or a backlight when the terminal device is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of the terminal device, and related functions (such as pedometer and tapping) for vibration recognition; other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor and the like which can be configured on the terminal equipment are not described in detail herein.
The audio circuit 660, speaker 662, microphone 664 may provide an audio interface between a user and a terminal device. The audio circuit 660 can transmit the electrical signal converted from the received audio data to the loudspeaker 662, and convert the electrical signal into a sound signal by the loudspeaker 662 and output the sound signal; on the other hand, the microphone 664 converts the collected sound signal into an electrical signal, converts the electrical signal into audio data after being received by the audio circuit 660, and then outputs the audio data to the processor 680 for processing, and then sends the audio data to, for example, another terminal device through the radio frequency module 610, or outputs the audio data to the memory 620 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the terminal equipment can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 670, and provides wireless broadband internet access for the user.
The processor 680 is a control center of the terminal device, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 620 and calling data stored in the memory 620, thereby monitoring the terminal device as a whole. Optionally, processor 680 may include one or more processing units; preferably, the processor 680 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 680.
The terminal device also includes a power supply 690 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 680 via a power management system to manage charging, discharging, and power consumption via the power management system. Although not shown, the terminal device may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In one embodiment, computer programs stored in memory 620, when executed by processor 680, cause processor 680 to implement the methods as described in the various embodiments above.
The embodiment of the application discloses a computer readable storage medium, which stores a computer program, wherein the computer program realizes the method described in the above embodiments when being executed by a processor.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program, and the computer program, when executed by a processor, implements the method as described in the embodiments above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a non-volatile computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are all alternative embodiments and that the acts and modules involved are not necessarily required for this application.
In various embodiments of the present application, it should be understood that the size of the serial number of each process described above does not mean that the execution sequence is necessarily sequential, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a computer accessible memory. Based on such understanding, the technical solutions of the present application, which essentially or partly contribute to the prior art, or all or part of the technical solutions, may be embodied in the form of a software product, which is stored in a memory and includes several requests for causing a computer device (which may be a personal computer, a server, or a network device, etc., and may specifically be a processor in the computer device) to execute some or all of the steps of the above methods of the embodiments of the present application.
The above detailed description is given to a session management method, a session management apparatus, a terminal device, and a computer-readable storage medium, which are disclosed in the embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the above embodiments are only used to help understand the method and the core idea of the present application. Meanwhile, for a person skilled in the art, according to the idea of the present application, the specific implementation manner and the application scope may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (11)

1. A session management method is applied to a terminal device, and comprises the following steps:
sending a session release request to a network device, wherein the session release request is used for requesting the network device to release a session established with the terminal device;
if a response instruction sent by the network equipment is not received within the timing duration set by the first timer, and the sending times of sending the session release request to the network equipment do not reach a time threshold value, the session release request is sent to the network equipment again, and the timing duration of the first timer is reset according to the sending times, wherein the response instruction represents that the network equipment releases the session, and the timing duration set by the first timer is in a negative correlation with the sending times;
and when the sending times reach the time threshold and the response instruction is not received within the timing duration set by the first timer, locally releasing the session.
2. The method of claim 1, wherein said resetting the timing duration of the first timer according to the number of transmissions comprises:
and setting the timing duration of the first timer as the ratio of initial duration to the sending times, wherein the initial duration is the timing duration set by the first timer when the session release request is sent to the network equipment for the first time.
3. The method of claim 1, wherein said resetting the timing duration of the first timer according to the number of transmissions comprises:
setting the timing duration of the first timer as the product of the initial duration and a proportional value, wherein the proportional value is obtained by performing exponentiation operation with the number of retransmissions for retransmitting the session release request to the network device as an exponent and a decreasing proportion as a base number, and the number of retransmissions is obtained by subtracting 1 from the number of transmissions.
4. The method of claim 1, wherein said resetting the timing duration of the first timer according to the number of transmissions comprises:
and setting the timing duration of the first timer as a difference value between an initial duration and a reduced duration, wherein the reduced duration and the sending times are in positive correlation.
5. The method of claim 4, wherein the reduced duration is a product of a fixed decrement time and the number of retransmissions for resending the session release request to the network device, the number of retransmissions being the number of transmissions minus 1; or
The reduced duration is obtained by inquiring the established corresponding relation between the reduced duration and the sending times.
6. The method according to any of claims 1 to 5, wherein after said resending said session release request to said network device, said method further comprises:
and adding 1 to the sending times recorded by the second timer so as to update the sending times recorded by the second timer.
7. The method according to any of claims 1 to 5, wherein said sending a session release request to a network device comprises:
in a new air interface NR network scene, if a data network disconnection operation is detected, sending a protocol data unit PDU session release request to network equipment through a non-access stratum NAS;
in a Long Term Evolution (LTE) network scene, if a Packet Data Network (PDN) connection established with the network equipment in the attachment process is disconnected, when a data network disconnection operation is detected, a PDN session release request is sent to the network equipment through a Network Attached Storage (NAS).
8. The method of claim 7, wherein the data network disconnect operation comprises any one of turning off a data network switch, switching from a first Subscriber Identity Module (SIM) card to a second SIM card, turning on an airplane mode, and switching from a data network to a wireless network.
9. A session management apparatus, applied to a terminal device, the apparatus comprising:
a request sending module, configured to send a session release request to a network device, where the session release request is used to request the network device to release a session established with the terminal device;
the request sending module is further configured to, if a response instruction sent by the network device is not received within the timing duration set by the first timer and the sending frequency of the session release request sent to the network device does not reach a frequency threshold, resend the session release request to the network device, and reset the timing duration of the first timer according to the sending frequency, where the response instruction represents that the network device releases the session, and the timing duration set by the first timer is in a negative correlation with the sending frequency;
a setting module, configured to reset the timing duration of the first timer according to the sending times after the request sending module sends the session release request to the network device again, where the timing duration set by the first timer is in a negative correlation with the sending times;
and the release module is used for releasing the session locally when the sending times reach the time threshold and the response instruction is not received within the timing duration set by the first timer.
10. A terminal device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to implement the method of any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
CN202011463574.4A 2020-12-11 2020-12-11 Session management method, device, terminal equipment and computer readable storage medium Active CN112492704B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011463574.4A CN112492704B (en) 2020-12-11 2020-12-11 Session management method, device, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011463574.4A CN112492704B (en) 2020-12-11 2020-12-11 Session management method, device, terminal equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112492704A CN112492704A (en) 2021-03-12
CN112492704B true CN112492704B (en) 2022-07-19

Family

ID=74917808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011463574.4A Active CN112492704B (en) 2020-12-11 2020-12-11 Session management method, device, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112492704B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115119338A (en) * 2021-03-19 2022-09-27 夏普株式会社 Method for switching network connection among multiple network connections and user equipment
CN113472841B (en) * 2021-05-13 2023-05-23 新华三技术有限公司合肥分公司 Implementation method and device for terminating remote procedure call request
CN113438612B (en) * 2021-06-30 2022-09-13 Oppo广东移动通信有限公司 Call method, terminal device and storage medium
CN116209098A (en) * 2021-12-01 2023-06-02 夏普株式会社 User equipment, base station and method thereof
CN114650578B (en) * 2022-04-20 2024-04-05 中国电信股份有限公司 Terminal voice service connection method, device, equipment and storage medium
CN115150870B (en) * 2022-06-30 2023-03-21 广州爱浦路网络技术有限公司 Session residue processing method, device, session management functional entity and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794622A (en) * 2005-08-23 2006-06-28 华为技术有限公司 Method of assuring network side to receive user equipment message
CN102958101A (en) * 2012-12-03 2013-03-06 李俊 Method for avoiding wireless channel congestion on wireless communication terminal
CN102958198A (en) * 2011-08-23 2013-03-06 鼎桥通信技术有限公司 Abnormality processing method for RAB (radio access bearer) release request and RNC (radio network controller)
CN105530699A (en) * 2016-01-15 2016-04-27 华为技术有限公司 Tracking area forbidding method and user equipment
CN110167202A (en) * 2019-04-26 2019-08-23 维沃移动通信有限公司 Conversation processing method, device, terminal and medium
CN110225601A (en) * 2019-05-23 2019-09-10 Oppo广东移动通信有限公司 RRC Connection Release method, apparatus and terminal device
CN110582995A (en) * 2018-04-09 2019-12-17 联发科技股份有限公司 method and apparatus for session release in wireless communications

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10123374B2 (en) * 2015-09-08 2018-11-06 Verizon Patent And Licensing Inc. Using a temporary default bearer for a packet data network session

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794622A (en) * 2005-08-23 2006-06-28 华为技术有限公司 Method of assuring network side to receive user equipment message
CN102958198A (en) * 2011-08-23 2013-03-06 鼎桥通信技术有限公司 Abnormality processing method for RAB (radio access bearer) release request and RNC (radio network controller)
CN102958101A (en) * 2012-12-03 2013-03-06 李俊 Method for avoiding wireless channel congestion on wireless communication terminal
CN105530699A (en) * 2016-01-15 2016-04-27 华为技术有限公司 Tracking area forbidding method and user equipment
CN110582995A (en) * 2018-04-09 2019-12-17 联发科技股份有限公司 method and apparatus for session release in wireless communications
CN110167202A (en) * 2019-04-26 2019-08-23 维沃移动通信有限公司 Conversation processing method, device, terminal and medium
CN110225601A (en) * 2019-05-23 2019-09-10 Oppo广东移动通信有限公司 RRC Connection Release method, apparatus and terminal device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
C1-182029 "Abnormal cases for PDU session release procedure";Huawei等;《3GPP TSG-CT WG1 Meeting #110 C1-182029》;20180331;全文 *
GMR-1 3G综测仪RRC层协议软件的设计与实现;安小静;《信息科技辑》;20180415;全文 *

Also Published As

Publication number Publication date
CN112492704A (en) 2021-03-12

Similar Documents

Publication Publication Date Title
CN112492704B (en) Session management method, device, terminal equipment and computer readable storage medium
US20210345292A1 (en) Paging indication method, paging method, terminal and network side device
CN109803347B (en) Service processing method and mobile communication terminal
WO2020134873A1 (en) State switching method, mobile terminal, network device and communication system
US11627486B2 (en) Data sending method and apparatus, and device
CN111970683A (en) Method and device for switching SIM (subscriber identity Module) card, terminal equipment and storage medium
CN110784898A (en) Network switching method, mobile terminal and computer readable storage medium
US10728718B2 (en) Incoming call processing method, user equipment, and storage medium
EP4007361A1 (en) Method for network switching and terminal
CN107124428B (en) Method, equipment and storage medium for improving VoLTE call success rate
CN110096375B (en) Method and device for sharing data by application programs and computer readable storage medium
CN107172605B (en) Emergency call method, mobile terminal and computer readable storage medium
CN112888018B (en) Network injection method and terminal equipment
US20230041176A1 (en) Paging response method, terminal, and network device
CN110831227A (en) Random access method, network equipment and terminal
US20220141742A1 (en) Network switching method
WO2018120032A1 (en) Cell switching method and terminal device
CN111885748B (en) Method for releasing RRC connection, terminal equipment and network equipment
EP4087283A1 (en) Multicast service transmission method, transmission processing method, and related device
CN110191477B (en) Network search control method, terminal and computer readable storage medium
CN111836311B (en) Capability negotiation method, terminal and network equipment
US20220141734A1 (en) Network switching method
US20220053485A1 (en) Configuration information obtaining and sending method, terminal, and network side device
CN112911666A (en) Cell reselection method and device
CN111615158A (en) Updating method, reconstruction request processing method, terminal and network equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant