CN113923797A - Session establishment method, apparatus, client device, and computer storage medium - Google Patents
Session establishment method, apparatus, client device, and computer storage medium Download PDFInfo
- Publication number
- CN113923797A CN113923797A CN202111128425.7A CN202111128425A CN113923797A CN 113923797 A CN113923797 A CN 113923797A CN 202111128425 A CN202111128425 A CN 202111128425A CN 113923797 A CN113923797 A CN 113923797A
- Authority
- CN
- China
- Prior art keywords
- session
- target
- address information
- server
- session identifier
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/19—Connection re-establishment
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The application relates to a session establishment method, a session establishment device, a client device and a computer storage medium. The method comprises the following steps: acquiring target address information of a server; searching in stored session mapping information based on the target address information, and confirming a session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information; and generating a handshake message according to the target session identifier, and sending the handshake message to a server so that the server recovers the session corresponding to the target session identifier. By adopting the method, the verification process in the session establishment process can be reduced, the time consumption in the session establishment process is shortened, the data flow consumption of the client equipment in the process is reduced, and the power consumption of the client equipment is further reduced.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a session establishment method, apparatus, client device, and computer storage medium.
Background
With the development of wireless communication technology, not only can people-to-people communication be realized, but also object-to-object communication and object-to-people communication can be realized. In view of the diversification of communication devices, to meet the application requirements (such as low power consumption and small storage space) of a specific communication device, a LWM2M (light Machine to Machine, Lightweight M2M) protocol is established to meet the aforementioned requirements. However, in the case of communication using the LWM2M protocol, a client device configured with an LWM2M client has a problem of excessive power consumption.
Disclosure of Invention
Based on this, there is a need to provide a session establishment method, apparatus, client device and computer storage medium for reducing power consumption of the client device.
A method of session establishment, the method comprising:
acquiring target address information of a server;
searching in stored session mapping information based on the target address information, and confirming a session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and generating a handshake message according to the target session identifier, and sending the handshake message to a server so that the server recovers the session corresponding to the target session identifier.
In one embodiment, the session mapping information further includes a session establishment time, where the session establishment time is a time when a session is successfully established for a server corresponding to the server address information last time;
the method further comprises the following steps:
searching in the stored session mapping information based on the target address information to obtain session establishment time corresponding to the target address information;
and acquiring the current time, and judging whether the session identifier corresponding to the target address information is confirmed as the target session identifier or not according to the current time and the session establishment time corresponding to the target address information.
In one embodiment, the determining, according to the session establishment time corresponding to the current time and the destination address information, whether to confirm the session identifier corresponding to the destination address information as the destination session identifier includes:
acquiring the time interval between the current moment and the session establishment moment corresponding to the target address information;
and confirming the session identifier corresponding to the target address information as the target session identifier under the condition that the time interval is less than or equal to the effective duration.
In one embodiment, the determining, according to the session establishment time corresponding to the current time and the target address information, whether to confirm the session identifier corresponding to the target address information as the target session identifier further includes:
and sending an initial handshake message to the server to enable the server to newly establish a session under the condition that the time interval is greater than the effective duration.
In one embodiment, the method further comprises: under the condition that the server successfully recovers the session corresponding to the target session identifier, acquiring the session establishment time of the current session;
and updating the session establishment time corresponding to the target address information to the session establishment time of the current session.
In one embodiment, the method further comprises: and if the session recovery corresponding to the target session identifier fails, deleting the session mapping information corresponding to the target session identifier.
In one embodiment, the method further comprises: if the stored session mapping information does not have session mapping information corresponding to the target address information, sending an initial handshake message to the server so that the server newly establishes a session;
and under the condition of successfully establishing the new session, establishing and storing corresponding session mapping information according to the target address information and the session identifier of the new session.
A session establishment apparatus, the apparatus comprising:
the target address information acquisition module is used for acquiring the target address information of the server;
a target session identifier obtaining module, configured to search in stored session mapping information based on the target address information, and determine a session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and the session recovery module is used for generating a handshake message according to the target session identifier and sending the handshake message to the server so that the server recovers the session corresponding to the target session identifier.
A client device comprising a memory and a processor, the memory storing a computer program that when executed by the processor performs the steps of:
acquiring target address information of a server;
searching in stored session mapping information based on the target address information, and confirming a session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and generating a handshake message according to the target session identifier, and sending the handshake message to a server so that the server recovers the session corresponding to the target session identifier.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring target address information of a server;
searching in stored session mapping information based on the target address information, and confirming a session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and generating a handshake message according to the target session identifier, and sending the handshake message to a server so that the server recovers the session corresponding to the target session identifier.
The session establishing method, the session establishing device, the client device and the computer storage medium are characterized in that the client device stores server address information and session identification corresponding to the server address information, namely session mapping information. Under the condition that the client device obtains the target address information of the server, the client device searches the session identifier corresponding to the target address information from the stored session mapping information, and confirms the session identifier obtained by searching as the target session identifier. And generating handshake information according to the target session identifier, and sending the handshake information to the server. Therefore, the client device can enable the server to recover the session corresponding to the target session identifier through a short handshaking flow to complete session establishment without performing a complete handshaking flow in each session establishment process, thereby reducing the verification process in the session establishment process, shortening the time consumption in the session establishment process, reducing the data flow consumption of the client device in the process and further reducing the power consumption of the client device.
Drawings
FIG. 1 is a diagram of an application environment of a session establishment method in one embodiment;
FIG. 2 is a flowchart illustrating a session establishment method according to an embodiment;
FIG. 3 is a flowchart illustrating a target session identifier obtaining step in one embodiment;
FIG. 4 is a flowchart illustrating a session identifier determination step according to an embodiment;
FIG. 5 is a second flowchart illustrating a session establishment method according to an embodiment;
FIG. 6 is a third flowchart illustrating a session establishment method according to an embodiment;
FIG. 7 is a fourth flowchart illustrating a session establishment method according to an embodiment;
fig. 8 is a block diagram showing the configuration of a session establishing apparatus according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As described in the background, a client device configured with an LWM2M client consumes excessive power during communication. The inventor researches and finds that the problem is caused because a complete handshake flow is required between the LWM2M client and the server to establish each time during the session establishment between the LWM2M client and the server, so that the client device configured with the LWM2M client needs to spend more data traffic and time during the session establishment, and the power consumption of the client device is increased.
Based on this, it is necessary to provide a session establishment method, apparatus, client device and computer storage medium, which can initiate a session recovery procedure based on stored session mapping information by storing server address information and a session identifier corresponding to the server address information, and do not need to establish each session through a complete session procedure, thereby reducing the time taken by the session establishment procedure and reducing the data traffic consumed by the client device in the procedure to reduce the power consumption of the client device.
The session establishment method, the session establishment device, the client device and the computer storage medium provided by the application can be applied to the application environment shown in fig. 1. The client device may be a device having a communication function and configured with a communication protocol client. The client device realizes communication with the server through a communication protocol, and further realizes data interaction. It can be understood that any communication protocol may be configured on the client device, which is not limited in this application, and only the communication protocol may be used to implement communication between the client device and the server. In one embodiment, the client device is configured with a client of the LWM2M protocol, and the client device and the server communicate via the LWM2M protocol.
The client device may be any form of communication device, such as a module, a chip, or a circuit having a communication function, or a terminal device provided with the communication device, such as various types of narrowband internet of things devices, a mobile phone, a tablet computer, a notebook computer, an intelligent automobile, an intelligent home, and the like, which is not limited in this application. In one embodiment, the client device is a 5G communication module. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In one embodiment, as shown in fig. 2, a session establishment method is provided, which is described by taking the application of the method to the client device in fig. 1 as an example, and includes the following steps:
The target address information refers to address information of a server for performing application layer data interaction with the client device. In one embodiment, the server to which the target address information corresponds may be a server to which the client device is currently connected. It should be noted that the connection status of the client device and the server is not necessarily related to whether a session is established. In other words, in the case where the client device is connected to the server, the session between the client device and the server may not yet be established.
The client device facilitates communication with the server by obtaining destination address information. It is to be understood that the destination address information may include one or more information indicating an address of the server, which is not specifically limited in this application. In one embodiment, the destination address information may include the IP address and port of the server.
Specifically, one or more sets of session mapping information are stored in the client device, each set of session mapping information includes server address information and a session identifier corresponding to the server address information, and the session identifier can be determined according to a historical session establishment procedure between the client device and a server corresponding to the server address information. The session mapping information reflects a session corresponding to the session identification once established between the client device and the server corresponding to the server address information. In one embodiment, the session mapping relationship stored by the client device may be dynamically adjusted according to the session establishment between the client device and the server, so as to improve the accuracy of the session mapping information.
It can be understood that, under the condition that the client device stores multiple sets of session mapping information, the contents included in any two sets of session mapping information may be different, partially the same, or completely overlapped. For example, in the case where the client device stores multiple sets of session mapping information, the server address information of any two sets of session mapping information may be the same or different; the target session identifier included in the multiple sets of session mapping information with the same server address information may be the same or different.
After obtaining the target address information, the client device may perform a lookup in the stored session mapping information to determine whether a session identifier corresponding to the target address information, i.e., a target session identifier, exists. If the target session identifier corresponding to the target address information is found, it indicates that a session has been established between the client device and the server, and the session identifier obtained by the finding can be confirmed as the target session identifier.
Specifically, in the session establishment process, the client device and the server need to perform a handshake procedure, so that the server establishes a session according to a handshake result. Under the condition that the handshake message sent by the client device includes the session identifier, the session corresponding to the session identifier can be tried to be recovered between the client device and the server through a simplified handshake process. Under the condition that the handshake message sent by the client device does not include the session identifier, a complete handshake flow needs to be performed between the client device and the server to realize the allocation and the transmission of the session identifier and the establishment of the session.
It is understood that the client device and the server may perform a handshake procedure based on any handshake protocol, which is not specifically limited in this application. In one embodiment, the client device and the server handshake via a DTLS (packet Transport Layer Security) protocol.
After the client device obtains the target session identifier, a handshake message is generated according to the target session identifier, so that the handshake message includes the target session identifier. After the client sends the handshake message, a short handshake flow is carried out between the client and the server, so that the server recovers the target session to represent the corresponding session, and the session establishment process is completed. After the session is established, data interaction at an application layer can be performed between the client device and the server.
In the above-mentioned session establishing method, the client device stores the server address information and the session identifier corresponding to the server address information, i.e. the session mapping information. Under the condition that the client device obtains the target address information of the server, the client device searches the session identifier corresponding to the target address information from the stored session mapping information, and confirms the session identifier obtained by searching as the target session identifier. And generating handshake information according to the target session identifier, and sending the handshake information to the server. Therefore, the client device can enable the server to recover the session corresponding to the target session identifier through a short handshaking flow to complete session establishment without performing a complete handshaking flow in each session establishment process, thereby reducing the verification process in the session establishment process, shortening the time consumption in the session establishment process, reducing the data flow consumption of the client device in the process and further reducing the power consumption of the client device.
In one embodiment, the session mapping information further includes a session establishment time, where the session establishment time is a time when the server corresponding to the server address information successfully establishes the session last time.
As shown in fig. 3, the session establishment method of the present application further includes:
Specifically, each set of session mapping information further includes a session establishment time, which is a time when the client device successfully establishes a session with the server corresponding to the session mapping information last time. The client device may query the stored session mapping information according to the destination address information to determine whether session mapping information corresponding to the destination address information exists. If the session establishment time exists, the session establishment time (hereinafter referred to as target session establishment time) corresponding to the target address information can be determined, that is, the time when the client device successfully establishes the session with the server corresponding to the target address information last time. Under the condition of determining the target session establishment time, the client device may determine whether to confirm the session identifier corresponding to the target address information as the target session identifier according to the current time and the target session establishment time. If yes, the session identifier corresponding to the target address information is confirmed as the target session identifier, and step 400 is executed. If not, a complete handshake flow can be performed between the client device and the server to confirm the new session identifier and establish the session.
Further, the session identifier corresponding to the target address information can be confirmed as the target session identifier when the target session establishment time is earlier than the current time, otherwise, a complete handshake process is executed. Therefore, the interference of wrong session mapping information to the session establishment process can be avoided, and the success rate of session establishment can be further improved. Or, the present application may determine the session identifier valid period according to the target session establishment time, and when the current time is within the session identifier valid period, the session identifier corresponding to the target address information is determined as the target session identifier, otherwise, a complete handshake procedure is performed.
In this embodiment, the time when the client device successfully establishes the session with the server corresponding to the server address information last time is obtained, and whether the session identifier corresponding to the target address information is determined to be the target session identifier is determined according to the session establishment time corresponding to the current time and the target address information, so that the validity of the session identifier corresponding to the target address information can be ensured, the session recovery success rate is further improved, and the average duration of session establishment is reduced.
In an embodiment, as shown in fig. 4, determining whether to confirm the session identifier corresponding to the destination address information as the destination session identifier according to the session establishment time corresponding to the current time and the destination address information includes:
Specifically, when the target session establishment time is obtained, the client device obtains a time interval between the current time and the target session establishment time, where the time interval is a difference between the previous session establishment time and the current time of the server corresponding to the client device and the target address information. If the time interval is less than or equal to the effective duration, the session identifier corresponding to the target address information is indicated to be more likely to remain effective, and the server has more likely to be able to recover the session corresponding to the session identifier, so as to simplify the session establishment process. Therefore, the client device may confirm the session identifier corresponding to the target address information as the target session identifier, and perform step 400, so that the server recovers the session corresponding to the target session identifier.
It is understood that the specific time length of the valid duration may be set according to the device type of the client device, the communication frequency between the client device and the server, and/or the update frequency of the server for the session identifier, which is not particularly limited in this application. In one example, the effective duration may be 24 hours.
In this embodiment, when the time interval between the current time and the target session establishment time is less than or equal to the valid duration, the session identifier corresponding to the target address information is determined as the target session identifier, so that a session recovery failure caused by an excessively long time interval can be avoided, the session recovery success rate is further improved, and the time consumption, the data traffic consumption and the power consumption in the session establishment process are reduced to the maximum extent.
In an embodiment, referring to fig. 4, determining whether to confirm the session identifier corresponding to the destination address information as the destination session identifier according to the session establishment time corresponding to the current time and the destination address information, further includes:
Specifically, when the time interval between the current time and the target session establishment time is longer than the effective duration, the session recovery based on the session identifier corresponding to the target address information has a high probability of failure, that is, the session corresponding to the session identifier cannot be recovered. Therefore, when the time interval is greater than the effective duration, the client device generates an initial handshake message and sends the initial handshake message to the server, so that the server newly establishes a session. In this way, the client device and the server perform a complete handshake procedure, so that the server re-determines the session identifier and establishes the session. In one embodiment, the session identifier length in the initial handshake message is zero, i.e., the session identifier in the initial handshake message is empty.
In this embodiment, when the time interval is greater than the effective duration, a new session identifier is determined through a complete handshake flow, instead of generating a handshake message based on the session identifier corresponding to the destination address information, to perform a simplified handshake flow. Therefore, the method can avoid initiating the session recovery process with higher failure rate, and further improve the success rate of session establishment. Meanwhile, the average duration of the session establishment process can be reduced, and the time consumption, the data flow consumption and the power consumption of the client equipment are further reduced.
In one embodiment, as shown in fig. 5, the session establishment method further includes:
Specifically, when the server successfully recovers the session corresponding to the target session identifier, the session establishment time of the session (i.e., the current session) is obtained, and the session establishment time in the target mapping relationship is updated. It can be understood that the session establishment time may be determined according to the session recovery process corresponding to the target session identifier, which is not specifically limited in this application. In one embodiment, the session establishment time is a handshake completion time, that is, the time when the client device and the server complete a handshake process, so as to improve the accuracy of the session establishment time.
In one embodiment, the same server address information corresponds to at most one set of session mapping information among the session mapping information stored in the client device, in other words, session mapping information in which the two sets of server address information are the same is not stored. The session mapping information of each group is dynamically updated according to the session establishment between the client device and the server, for example, the session establishment time and/or the session identifier are updated. Therefore, on one hand, the data size of storage can be reduced, the hardware requirement of the client equipment is further reduced, and the applicability is widened. On the other hand, the accuracy and the effectiveness of the session mapping information can be improved, so that the query efficiency and the session recovery success rate are improved, and the power consumption of the client equipment is further reduced.
In this embodiment, under the condition that the session is successfully recovered, the session establishment time of the current session is updated to the session establishment time, so that the validity and accuracy of the session mapping information can be improved, and the power consumption of the client device in the session establishment process is further reduced.
In one embodiment, the session establishment method further includes: and if the session recovery corresponding to the target session identifier fails, deleting the session mapping information corresponding to the target session identifier. Specifically, the client device generates a handshake message based on the target session identification and sends the handshake message to the server to cause the server to attempt to recover the session corresponding to the target session identification. If the session recovery fails, the client device deletes the session mapping information corresponding to the target session identifier stored in the client device. Further, after the session recovery fails, the client device may also perform a complete handshake procedure with the server to determine a new session identifier and establish the session.
In this embodiment, the session mapping information corresponding to the target session identifier is deleted when the session recovery corresponding to the target session identifier fails, which not only reduces the amount of stored data, but also avoids interference of invalid information on the session establishment process, thereby further improving the efficiency of session establishment.
In one embodiment, as shown in fig. 6, the session establishment method further includes:
Specifically, if the session mapping information stored in the client device does not include the session identifier corresponding to the destination address information, the client device sends the initial handshake information to the server. In this way, the client device performs a complete handshake procedure with the server to determine the session identification and establish a new session. And under the condition of successfully establishing the session, the client equipment generates corresponding session mapping information according to the target address information and the session identifier of the newly-established session, and stores the session mapping information so as to be used in the next session establishment process. Therefore, the corresponding session can be recovered in the subsequent session establishment process, and the time consumption, the data flow consumption and the power consumption in the session establishment process are reduced.
To facilitate an understanding of the present application, a description is provided below with a specific embodiment. As shown in fig. 7, a session establishment method is provided, where the method is applied to a client device, and specifically includes:
In step 904, the client device queries the stored session mapping information to determine whether there is target session mapping information corresponding to the target address information, if not, then step 906 is performed, and if so, then step 914 is performed.
In step 912, the client device performs application layer data interaction with the server.
In step 916, the CLIENT device generates a target CLIENT HELLO message based on the session identifier of the target session mapping information and sends the target CLIENT HELLO message to the server. Wherein the target CLIENT HELLO message includes the session identification of the target session mapping information. Specifically, after the CLIENT device sends the target CLIENT HELLO message to the server, the CLIENT device and the server perform a short handshake procedure, so that the server attempts to recover the session corresponding to the session identifier of the target session mapping information.
In step 920, the client device deletes the target session mapping information and proceeds to step 904 to reinitiate the handshake flow.
In the application, the LWMM client is started after the client device is started and is connected with the server. After connection, the CLIENT device initiates a CLIENT HELLO message packing and sending flow in the DTLS handshake flow. Specifically, the client device queries the cached session mapping information according to the server address information and the port of the server, and determines whether to establish a session through a session recovery flow or establish a session through a session new-establishment flow according to a query result.
And if the client equipment does not have the target session mapping information, the client equipment and the server perform a complete DTLS handshake process, and store the session identification of the new session, the handshake completion time of the new session, the IP address of the server and the port after the handshake is successful. If the target session mapping information exists in the client device, whether the time interval between the current time and the session establishment time of the target session mapping information is greater than the effective duration (such as 24 hours) or not is judged. If yes, carrying out a complete DTLS handshake process; if not, packing the session identifier in the target session mapping information into a CLIENT HELLO message, and performing session recovery verification and a session recovery flow by the CLIENT device and the server. Under the condition of successfully recovering the session, the client equipment updates the session establishment time in the target session mapping information; in case of failure of session recovery, the handshake is re-handshake through the complete DTLS handshake flow. Therefore, the session flow of the LWM2M client and the server can be simplified, and the power consumption of the client device can be reduced.
It should be understood that although the various steps in the flow charts of fig. 2-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-7 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 8, there is provided a session establishment apparatus, including: the device comprises a target address information acquisition module, a target session identification acquisition module and a session recovery module, wherein:
the target address information acquisition module is used for acquiring the target address information of the server;
the target session identification acquisition module is used for searching in the stored session mapping information based on the target address information and confirming the session identification corresponding to the target address information as the target session identification; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and the session recovery module is used for generating a handshake message according to the target session identifier and sending the handshake message to the server so that the server recovers the session corresponding to the target session identifier.
In one embodiment, the session mapping information further includes a session establishment time, where the session establishment time is a time when the server corresponding to the server address information successfully establishes the session last time. The session establishing device comprises a time determining module and an identification judging module, wherein the time determining module is used for searching in the stored session mapping information based on the target address information to obtain the session establishing time corresponding to the target address information. The identification judging module is used for acquiring the current time and judging whether the session identification corresponding to the target address information is confirmed as the target session identification according to the current time and the session establishment time corresponding to the target address information.
In one embodiment, the identifier determining module includes an identifier obtaining unit, where the identifier obtaining unit is configured to obtain a time interval between a current time and a session establishment time corresponding to the target address information; and confirming the session identifier corresponding to the target address information as the target session identifier under the condition that the time interval is less than or equal to the effective duration.
In an embodiment, the identification determining module includes an initial handshake message sending unit, where the initial handshake message sending unit is configured to send an initial handshake message to the server when the time interval is greater than the valid duration, so that the server creates a new session.
In an embodiment, the session establishing apparatus further includes a session establishing time obtaining module and an updating module, where the session establishing time obtaining module is configured to obtain the session establishing time of the current session when the server successfully recovers the session corresponding to the target session identifier. The updating module is used for updating the session establishment time corresponding to the target address information to the session establishment time of the current session.
In an embodiment, the session establishing apparatus further includes a deleting module, where the deleting module is configured to delete the session mapping information corresponding to the target session identifier if the session recovery corresponding to the target session identifier fails.
In an embodiment, the session establishing apparatus further includes a session establishing module and a session mapping information establishing module, where the session establishing module is configured to send an initial handshake message to the server if there is no session mapping information corresponding to the target address information in the stored session mapping information, so that the server establishes a session. And the session mapping information establishing module is used for establishing and storing the corresponding session mapping information according to the target address information and the session identification of the newly-built session under the condition of successfully newly-built session.
For the specific definition of the session establishing apparatus, reference may be made to the above definition of the session establishing method, which is not described herein again. The modules in the session establishment apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a client device is provided. The client device may be any device having a communication function, and the present application does not specifically limit this. For example, the client device may be a mobile phone, a tablet computer, a notebook computer, an intelligent automobile, an intelligent home, and the like, and a module having a communication function. In one embodiment, the client device is a communication module, in one example, a high-pass 5G communication module.
The client device comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the following steps when executing the computer program:
acquiring target address information of a server;
searching in the stored session mapping information based on the target address information, and confirming the session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and generating a handshake message according to the target session identifier, and sending the handshake message to the server so that the server recovers the session corresponding to the target session identifier.
In one embodiment, the session mapping information further includes a session establishment time, where the session establishment time is a time when the server corresponding to the server address information successfully establishes the session last time. The processor, when executing the computer program, further performs the steps of: searching in the stored session mapping information based on the target address information to obtain session establishment time corresponding to the target address information; and acquiring the current time, and judging whether the session identifier corresponding to the target address information is confirmed as the target session identifier or not according to the current time and the session establishment time corresponding to the target address information.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring a time interval between the current moment and the session establishment moment corresponding to the target address information; and confirming the session identifier corresponding to the target address information as the target session identifier under the condition that the time interval is less than or equal to the effective duration.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and sending an initial handshake message to the server under the condition that the time interval is greater than the effective duration so that the server newly establishes a session.
In one embodiment, the processor, when executing the computer program, further performs the steps of: under the condition that the server successfully recovers the session corresponding to the target session identifier, acquiring the session establishment moment of the current session; and updating the session establishment time corresponding to the target address information to the session establishment time of the current session.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and if the session recovery corresponding to the target session identifier fails, deleting the session mapping information corresponding to the target session identifier.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the session mapping information does not have session mapping information corresponding to the target address information, sending an initial handshake message to the server so that the server newly establishes a session; and under the condition of successfully establishing the new session, establishing and storing corresponding session mapping information according to the target address information and the session identifier of the new session.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring target address information of a server;
searching in the stored session mapping information based on the target address information, and confirming the session identifier corresponding to the target address information as a target session identifier; the session mapping information comprises server address information and a session identifier corresponding to the server address information;
and generating a handshake message according to the target session identifier, and sending the handshake message to the server so that the server recovers the session corresponding to the target session identifier.
In one embodiment, the session mapping information further includes a session establishment time, where the session establishment time is a time when the server corresponding to the server address information successfully establishes the session last time. The computer program when executed by the processor further realizes the steps of: searching in the stored session mapping information based on the target address information to obtain session establishment time corresponding to the target address information; and acquiring the current time, and judging whether the session identifier corresponding to the target address information is confirmed as the target session identifier or not according to the current time and the session establishment time corresponding to the target address information.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring a time interval between the current moment and the session establishment moment corresponding to the target address information; and confirming the session identifier corresponding to the target address information as the target session identifier under the condition that the time interval is less than or equal to the effective duration.
In one embodiment, the computer program when executed by the processor further performs the steps of: and sending an initial handshake message to the server under the condition that the time interval is greater than the effective duration so that the server newly establishes a session.
In one embodiment, the computer program when executed by the processor further performs the steps of: under the condition that the server successfully recovers the session corresponding to the target session identifier, acquiring the session establishment moment of the current session; and updating the session establishment time corresponding to the target address information to the session establishment time of the current session.
In one embodiment, the computer program when executed by the processor further performs the steps of: and if the session recovery corresponding to the target session identifier fails, deleting the session mapping information corresponding to the target session identifier.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the stored session mapping information does not have session mapping information corresponding to the target address information, sending an initial handshake message to the server so that the server newly establishes a session; and under the condition of successfully establishing the new session, establishing and storing corresponding session mapping information according to the target address information and the session identifier of the new session.
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 can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111128425.7A CN113923797A (en) | 2021-09-26 | 2021-09-26 | Session establishment method, apparatus, client device, and computer storage medium |
| PCT/CN2022/087867 WO2023045313A1 (en) | 2021-09-26 | 2022-04-20 | Session establishment method and apparatus, and client device and computer storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111128425.7A CN113923797A (en) | 2021-09-26 | 2021-09-26 | Session establishment method, apparatus, client device, and computer storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN113923797A true CN113923797A (en) | 2022-01-11 |
Family
ID=79236161
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111128425.7A Pending CN113923797A (en) | 2021-09-26 | 2021-09-26 | Session establishment method, apparatus, client device, and computer storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN113923797A (en) |
| WO (1) | WO2023045313A1 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114866594A (en) * | 2022-04-24 | 2022-08-05 | 普联技术有限公司 | Equipment connection management method, device, system, server and readable storage medium |
| CN115296847A (en) * | 2022-07-06 | 2022-11-04 | 杭州涂鸦信息技术有限公司 | Flow control method and device, computer equipment and storage medium |
| WO2023045313A1 (en) * | 2021-09-26 | 2023-03-30 | 深圳市广和通无线通信软件有限公司 | Session establishment method and apparatus, and client device and computer storage medium |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116319946A (en) * | 2023-04-04 | 2023-06-23 | 中国农业银行股份有限公司 | Session holding method, device, electronic device and storage medium |
| CN117763131B (en) * | 2023-12-18 | 2025-02-28 | 北京轻松怡康信息技术有限公司 | A method, device, equipment and medium for data processing |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101296238A (en) * | 2008-06-17 | 2008-10-29 | 杭州华三通信技术有限公司 | A method and device for maintaining secure socket layer session persistence |
| WO2009109133A1 (en) * | 2008-03-04 | 2009-09-11 | 华为技术有限公司 | Method and apparatus for recovering the connection |
| CN103795632A (en) * | 2012-10-31 | 2014-05-14 | 华为技术有限公司 | Data message transmission method, related equipment and system |
| WO2017097011A1 (en) * | 2015-12-09 | 2017-06-15 | 国家电网公司 | Session synchronization method based on instant copy between cluster nodes |
| CN109246172A (en) * | 2017-07-11 | 2019-01-18 | 华为技术有限公司 | A kind of method, apparatus and computer storage medium for restoring session |
| WO2020233059A1 (en) * | 2019-05-21 | 2020-11-26 | 深圳壹账通智能科技有限公司 | Login processing method based on data processing and related apparatus |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2546800B (en) * | 2016-01-29 | 2020-08-05 | Tectonic Interactive Ltd | System and method for managing communication sessions between clients and a server |
| CN110445826B (en) * | 2018-05-04 | 2021-11-30 | 阿里巴巴集团控股有限公司 | Session information acquisition method, device and server |
| CN113923797A (en) * | 2021-09-26 | 2022-01-11 | 深圳市广和通无线通信软件有限公司 | Session establishment method, apparatus, client device, and computer storage medium |
-
2021
- 2021-09-26 CN CN202111128425.7A patent/CN113923797A/en active Pending
-
2022
- 2022-04-20 WO PCT/CN2022/087867 patent/WO2023045313A1/en not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2009109133A1 (en) * | 2008-03-04 | 2009-09-11 | 华为技术有限公司 | Method and apparatus for recovering the connection |
| CN101296238A (en) * | 2008-06-17 | 2008-10-29 | 杭州华三通信技术有限公司 | A method and device for maintaining secure socket layer session persistence |
| CN103795632A (en) * | 2012-10-31 | 2014-05-14 | 华为技术有限公司 | Data message transmission method, related equipment and system |
| WO2017097011A1 (en) * | 2015-12-09 | 2017-06-15 | 国家电网公司 | Session synchronization method based on instant copy between cluster nodes |
| CN109246172A (en) * | 2017-07-11 | 2019-01-18 | 华为技术有限公司 | A kind of method, apparatus and computer storage medium for restoring session |
| WO2020233059A1 (en) * | 2019-05-21 | 2020-11-26 | 深圳壹账通智能科技有限公司 | Login processing method based on data processing and related apparatus |
Non-Patent Citations (4)
| Title |
|---|
| 佚名: "Session会话恢复:两种简短的握手总结Session ID&Session Ticket", pages 1 - 2, Retrieved from the Internet <URL:https://m.yht7.com/news/128958> * |
| 李敏,卢跃生: "《网络安全技术与实例》", vol. 1, 31 August 2013, 复旦大学出版社, pages: 197 - 199 * |
| 裴新凤, 薛贺, 吴健: "网络安全传输系统中会话重用技术的实现", 微电子学与计算机, no. 06, 20 July 2005 (2005-07-20) * |
| 高雅荣: "《JSP Web技术及应用教程》", vol. 1, 31 January 2019, 中国铁道出版社, pages: 106 * |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023045313A1 (en) * | 2021-09-26 | 2023-03-30 | 深圳市广和通无线通信软件有限公司 | Session establishment method and apparatus, and client device and computer storage medium |
| CN114866594A (en) * | 2022-04-24 | 2022-08-05 | 普联技术有限公司 | Equipment connection management method, device, system, server and readable storage medium |
| CN114866594B (en) * | 2022-04-24 | 2023-08-08 | 普联技术有限公司 | Device connection management method, device, system, server and readable storage medium |
| CN115296847A (en) * | 2022-07-06 | 2022-11-04 | 杭州涂鸦信息技术有限公司 | Flow control method and device, computer equipment and storage medium |
| CN115296847B (en) * | 2022-07-06 | 2024-02-13 | 杭州涂鸦信息技术有限公司 | Flow control method, flow control device, computer equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2023045313A1 (en) | 2023-03-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113923797A (en) | Session establishment method, apparatus, client device, and computer storage medium | |
| CN108595207B (en) | A grayscale publishing method, rule engine, system, terminal and storage medium | |
| CN103905311B (en) | Flow table matching method and device and switch | |
| CN113824642B (en) | Method for sending message, network device and computer-readable storage medium | |
| US11954092B2 (en) | Internet of things (IOT) device update validation | |
| CN117793952A (en) | A communication method and device | |
| WO2014154101A1 (en) | Method and device for implementing fast network connection | |
| CN113377812B (en) | Method and device for deduplicating orders of big data | |
| CN120301758A (en) | Method and apparatus for optimizing user equipment capability signaling | |
| CN114338603B (en) | Edge application server discovery method, device, blockchain system and medium | |
| RU2365046C2 (en) | Route tips | |
| CN116361309B (en) | Data query system and method for updating cache data | |
| CN110909030B (en) | Information processing method and server cluster | |
| WO2019119962A1 (en) | Information processing method, system, terminal, and computer readable storage medium | |
| US20220030071A1 (en) | Dynamic user plane function (upf) selection based on supported protocol type | |
| CN102882906A (en) | Method and device of data communication in constrained application protocol | |
| CN111614442B (en) | Network communication method, device, electronic equipment and storage medium | |
| CN103036907B (en) | A kind of session stream aging method and device | |
| CN107612831B (en) | A method and device for transmitting data message for accessing source station | |
| CN116074922B (en) | Routing data processing method and device and readable storage medium | |
| WO2016177135A1 (en) | Resource management method, device, and control terminal | |
| CN113254203B (en) | Service degradation processing method and device | |
| CN114124275B (en) | A time synchronization method, device, equipment and storage medium | |
| CN110896414B (en) | Method for realizing message notification between services by using IOT (Internet of things) | |
| CN116647476A (en) | Network management method, apparatus, computer device, storage medium, and program product |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220111 |
|
| RJ01 | Rejection of invention patent application after publication |