Session establishment method, device, storage medium and electronic device

Generate random codes and distribute session keys through the session platform. The keys are used directly to establish sessions between applications, which solves the problems of session establishment complexity and public key management in the existing technology, and realizes simplified session establishment and improved security sex.

CN115549956BActive Publication Date: 2024-12-20QINGDAO HAIER TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210989159.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-17
Publication Date
2024-12-20
Estimated Expiration
2042-08-17

AI Technical Summary

Technical Problem

In the prior art, the session establishment process is complex, especially when a secure session is conducted between multiple parties, the public keys of multiple parties need to be saved and updated, resulting in an increase in the complexity of session establishment.

Method used

Random codes are generated and distributed through the session platform, and the random codes are used between applications to obtain the session key and establish a session, avoiding the storage and update of the public keys, and directly using the secret key provided by the session platform for encryption and decryption.

Benefits of technology

Simplifies the session establishment process, reduces complexity, improves the efficiency and security of session establishment, and avoids the complexity of public key management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115549956B_ABST
    Figure CN115549956B_ABST
Patent Text Reader

Abstract

The present application discloses a session establishment method, device, storage medium and electronic device, and relates to the field of smart home technology. The session establishment method includes: receiving a first request message sent by a first application, wherein the first request message includes a first random code generated by the first application; in response to the first request message, sending an acquired session key to the first application; receiving a second request message sent by a second application, wherein the second request message includes a first random code, and the first random code is sent by the first application to the second application; in response to the second request message, sending the session key to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a session establishment method, device, storage medium and electronic device. Background Art

[0002] When two accounts want to have a secure conversation, the conversation data needs to be encrypted. In the prior art, an asymmetric encryption algorithm is usually used to encrypt the conversation data. For example, when account A wants to have a conversation with account B, account A needs to use account B's public key to encrypt the conversation data, and account B needs to use the private key to decrypt the conversation data. Therefore, account A must save account B's public key. If account A wants to have a conversation with multiple parties, account A needs to save the public keys of multiple parties. If the public keys are modified, account A needs to continuously update the public keys of multiple parties. This increases the complexity of establishing a conversation. Summary of the invention

[0003] The embodiments of the present invention provide a session establishment method, device, storage medium and electronic device to at least solve the problem of complex session establishment in the related art.

[0004] According to one embodiment of the present invention, a session establishment method is provided, comprising: receiving a first request message sent by a first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of a second application; in response to the first request message, sending an acquired session key to the first application; receiving a second request message sent by a second application, wherein the second request message includes the first random code, and the first random code is sent by the first application to the second application; in response to the second request message, sending the session key to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key.

[0005] According to another embodiment of the present invention, a session establishment method is provided, comprising: upon receiving a session request sent by a second application, generating a first random code, wherein the session request is used to indicate that the second application requests to establish a session with the first application, and the first random code is generated based on the session request of the second application; sending a first request message to a session platform, wherein the first request message includes the first random code; receiving a session key sent by the session platform; and establishing a session with the second application using the session key.

[0006] According to another embodiment of the present invention, a session establishment method is provided, including: receiving a first random code and a second address sent by a first application; sending a second request message to a session platform via the second address, wherein the second request message includes the first random code, and the second request message is used to request a session key; receiving a session key sent by the session platform, wherein the session key is determined by the session platform based on the first random code; and establishing a session with the first application via the session key.

[0007] According to another embodiment of the present invention, a session establishing device is provided, including: a first receiving module, used to receive a first request message sent by a first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of a second application; a first responding module, used to respond to the first request message, and send the acquired session key to the first application; a second receiving module, used to receive a second request message sent by a second application, wherein the second request message includes the first random code, and the first random code is sent by the first application to the second application; a second responding module, used to respond to the second request message, and send the session key to the second application based on the first random code, so as to instruct the second application to establish a session with the first application through the session key.

[0008] In an exemplary embodiment, the above-mentioned device also includes: a sixth receiving module, which is used to receive a first registration request sent by the above-mentioned first application before receiving the first request message sent by the above-mentioned first application, wherein the above-mentioned first registration request includes the account information, callback address and verification code of the above-mentioned first application; a third response module, which is used to respond to the above-mentioned first registration request and generate entry address information, wherein the above-mentioned entry address information includes a first address and a second address, the above-mentioned first address is used for the above-mentioned first application to initiate a session, and the above-mentioned second address is used for the above-mentioned first application to accept a session.

[0009] In an exemplary embodiment, the first receiving module includes: a first receiving unit, configured to receive the first request message sent by the first application via the first address.

[0010] In an exemplary embodiment, the second receiving module includes: a second receiving unit, configured to receive the first request message sent by the second application via the second address, wherein the first address is sent by the first application to the second application.

[0011] In an exemplary embodiment, the first response module includes: a first generation unit, used to generate the session key using a quantum key distribution protocol; and a first sending unit, used to send the session key to the first application based on the callback address and verification code of the first application.

[0012] In an exemplary embodiment, the second response module includes: a first search unit, used to use the first random code to search for the cached session key; and a second sending unit, used to send the session key to the second application.

[0013] According to another embodiment of the present invention, a session establishment device is provided, including: a first generating module, used to generate a first random code when receiving a session request sent by a second application, wherein the above-mentioned session request is used to indicate that the above-mentioned second application requests to establish a session with the first application, and the first random code is generated based on the session request of the second application; a first sending module, used to send a first request message to a session platform, wherein the above-mentioned first request message includes the above-mentioned first random code; a third receiving module, used to receive a session key sent by the above-mentioned session platform; a first establishing module, used to establish a session with the above-mentioned second application using the above-mentioned session key.

[0014] In an exemplary embodiment, the above-mentioned device also includes: a third sending module, used to respond to the above-mentioned second request message, and when receiving the session request sent by the second application, before generating the first random code, send a first registration request to the above-mentioned session platform, wherein the above-mentioned first registration request includes the account information, callback address and verification code of the above-mentioned first application, and the above-mentioned registration request is used to request registration to the above-mentioned session platform; a seventh receiving module, used to receive the entry address information sent by the above-mentioned session platform, wherein the above-mentioned entry address information includes a first address and a second address, the above-mentioned first address is used for the above-mentioned first application to initiate a session, and the above-mentioned second address is used for the above-mentioned first application to accept a session.

[0015] In an exemplary embodiment, the above-mentioned device also includes: a fourth sending module, which is used to respond to the above-mentioned second request message, and after generating a first random code, upon receiving a session request sent by the second application, send the above-mentioned first random code to the above-mentioned second application to instruct the above-mentioned second application to request the above-mentioned session key from the above-mentioned session platform through the above-mentioned first random code.

[0016] In an exemplary embodiment, the third receiving module includes: a third receiving unit, configured to receive the session key sent by the session platform through the first address.

[0017] According to another embodiment of the present invention, a session establishment device is provided, including: a fourth receiving module, used to receive a first random code and a second address sent by a first application, the first random code being generated based on a session request of the second application; a second sending module, used to send a second request message to a session platform via the second address, wherein the second request message includes the first random code, and the second request message is used to request a session key; a fifth receiving module, used to receive a session key sent by the session platform, wherein the session key is determined by the session platform based on the first random code; and a second establishing module, used to establish a session with the first application via the session key.

[0018] In an exemplary embodiment, the apparatus further includes: a fifth sending module, configured to send a session request to the first application before receiving the first random code and the second address sent by the first application, wherein the session request is used to request to establish a session with the first application.

[0019] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0020] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0021] According to the present invention, a first request message sent by a first application is received, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of a second application; in response to the first request message, the acquired session key is sent to the first application; a second request message sent by a second application is received, wherein the second request message includes a first random code, and the first random code is sent by the first application to the second application; in response to the second request message, the session key is sent to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key. Since in the above method, the key for establishing a session between the first application and the second application is sent by the session platform, not through the public keys of the first application and the second application. The first application and the second application do not need to store each other's public keys, nor do they need to update the public keys. Thus, the effect of reducing the complexity of session establishment is achieved, and the problem of relatively complex session establishment in the related art is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 is a schematic diagram of a hardware environment of an interaction method of a smart device according to an embodiment of the present application;

[0025] Figure 2 is a flowchart of an image processing method according to an embodiment of the present invention (I);

[0026] Figure 3 is a flowchart of an image processing method according to an embodiment of the present invention (II);

[0027] Figure 4 is a flowchart of an image processing method according to an embodiment of the present invention (III);

[0028] Figure 5 is a schematic diagram of interactions between various conversation platforms according to an embodiment of the present invention;

[0029] Figure 6 is a schematic diagram of a secure session process between platform A and platform B based on a quantum key platform according to an embodiment of the present invention;

[0030] Figure 7 is a schematic diagram of a quantum key platform according to an embodiment of the present invention;

[0031] Figure 8 is a structural block diagram of a session establishment device according to an embodiment of the present invention (I);

[0032] Fig. 9 is a structural block diagram of a session establishment device according to an embodiment of the present invention (II);

[0033] Fig.10 3 is a structural block diagram of a session establishing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] According to one aspect of an embodiment of the present application, a session establishment method is provided. Optionally, in this embodiment, the session establishment method can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0037] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0038] This embodiment provides a session establishment method. Figure 2 is a flowchart of an image processing method according to an embodiment of the present invention (I), such as Figure 2 As shown, the process includes the following steps:

[0039] Step S202: receiving a first request message sent by a first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of a second application;

[0040] Step S204, in response to the first request message, sending the acquired session key to the first application;

[0041] Step S206, receiving a second request message sent by the second application, wherein the second request message includes a first random code, and the first random code is sent by the first application to the second application;

[0042] Step S208: In response to the second request message, the session key is sent to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key.

[0043] Optionally, the above session establishment method may be applied, but is not limited to, to a scenario where a session is established between accounts using a session key.

[0044] In this embodiment, the first application and the second application may be accounts that log in to the same client in different terminals. For example, account A and account B log in to a social platform at the same time and establish a session in the social platform. Optionally, the clients logged in by the first application and the second application may be the same client or different clients. They may be different versions of the same client.

[0045] In this embodiment, the session key may be a private key. For example, in a scenario where a second application requests to establish a session with a first application, the first application obtains a private key from the session platform and uses the private key to encrypt session data between the first application and the second application. The second application obtains a private key from the session platform and uses the private key to encrypt session data between the first application and the second application. This ensures the security of data transmission.

[0046] In this embodiment, the session platform can be a quantum key service platform, which is mainly divided into two parts, one is a quantum key generation device for generating a session key, and the other is a key service for sending the session key to the first application and the second application.

[0047] Among them, the execution subject of the above steps can be a terminal, a server, a specific processor set in the terminal or server, or a processor or processing device (such as a session platform) set relatively independently from the terminal or server, etc., but is not limited to this.

[0048] Through the above steps, by receiving a first request message sent by a first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on the session request of the second application; in response to the first request message, the acquired session key is sent to the first application; receiving a second request message sent by a second application, wherein the second request message includes a first random code, and the first random code is sent by the first application to the second application; in response to the second request message, the session key is sent to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key. Since in the above method, the key for establishing a session between the first application and the second application is sent by the session platform, not through the public keys of the first application and the second application. The first application and the second application do not need to store each other's public keys, nor do they need to update the public keys. Thus, the effect of reducing the complexity of session establishment is achieved, and the problem of relatively complex session establishment in the related art is solved.

[0049] In an exemplary embodiment, before receiving the first request message sent by the first application, the method further includes:

[0050] S1, receiving a first registration request sent by a first application, wherein the first registration request includes account information, a callback address, and a verification code of the first application;

[0051] S2, responding to the first registration request, generating entry address information, wherein the entry address information includes a first address and a second address, the first address is used for the first application to initiate a session, and the second address is used for the first application to accept a session.

[0052] In this embodiment, the first registration request is used to register the account information (including the account name), callback address, callback verification code and other data of the first application to the session platform, so as to obtain the session key from the session platform when the first application establishes a session. The callback address is used to indicate the address sent by the session platform to the first application. The callback verification code is used to verify the data transmitted between the session receipt and the first application. The second application can be registered to the session platform in the same way as the first application. After the first application and the second application are registered to the session platform, the session key can be quickly obtained to improve the efficiency of session establishment.

[0053] In an exemplary embodiment, receiving a first request message sent by a first application includes:

[0054] S1, receiving a first request message sent by a first application through a first address.

[0055] In this embodiment, data is transmitted between the first application and the session platform via the first address, so that the session key can be quickly obtained, thereby improving the efficiency of session establishment.

[0056] In an exemplary embodiment, receiving a second request message sent by a second application includes:

[0057] S1, receiving a first request message sent by a second application through a second address, wherein the first address is sent by the first application to the second application.

[0058] In this embodiment, data is transmitted between the second application and the session platform via the second address, so that the session key can be quickly obtained, thereby improving the efficiency of session establishment.

[0059] In an exemplary embodiment, in response to the first request message, sending the acquired session key to the first application includes:

[0060] S1, generate session keys using quantum key distribution protocol;

[0061] S2: Send the session key to the first application based on the callback address and verification code of the first application.

[0062] In this embodiment, a session key can be generated by a quantum key generator using a quantum key distribution protocol, and the quantum key distribution protocol can be BB84 or BBM92 protocol. The quantum key generator consists of a transmitter, a receiver, a photon channel, and a universal channel. A clock signal is generated by a clock pulse device to trigger the key generator to generate a session key. After the session key is generated, it is stored in the key pool through the key interface. This embodiment can accurately generate a session key through the quantum key distribution protocol.

[0063] In an exemplary embodiment, in response to the second request message, sending the session key to the second application based on the first random code includes:

[0064] S1, using the first random code to search for the cached session key;

[0065] S2, sending the session key to the second application.

[0066] In this embodiment, the first random code is generated by the second application and sent to the first application. When the first application requests the session key, it sends it to the session platform. The session platform searches for the session key from the key pool according to the first random code. The session key and the first random code are stored, and when the second application requests the session key, it is directly sent to the second application. The first random code can be a number or a letter, or a combination thereof. By generating a random code, the first application and the second application can obtain the same session key to encrypt and decrypt the session data.

[0067] This embodiment provides a session establishment method. Figure 3 is a flowchart of an image processing method according to an embodiment of the present invention (II), such as Figure 3 As shown, the process includes the following steps:

[0068] Step S302, generating a first random code when receiving a session request sent by the second application, wherein the session request is used to indicate that the second application requests to establish a session with the first application, and the first random code is generated based on the session request of the second application;

[0069] Step S304: sending a first request message to the session platform, wherein the first request message includes a first random code;

[0070] Step S306, receiving the session key sent by the session platform;

[0071] Step S308: Establish a session with the second application using the session key.

[0072] Among them, the executor of the above steps can be a terminal, a server, a specific processor set in the terminal or server, or a processor or processing device set relatively independently from the terminal or server (for example, a first application), but is not limited to this.

[0073] Through the above steps, a first random code is generated when a session request sent by the second application is received, wherein the session request is used to indicate that the second application requests to establish a session with the first application; a first request message is sent to the session platform, wherein the first request message includes the first random code; a session key sent by the session platform is received; and a session is established with the second application using the session key. In the above method, the key for establishing a session between the first application and the second application is sent by the session platform, not through the public keys of the first application and the second application. The first application and the second application do not need to store each other's public keys, nor do they need to update the public keys. This reduces the complexity of session establishment and solves the problem of complex session establishment in the related art.

[0074] In an exemplary embodiment, in response to the second request message, upon receiving the session request sent by the second application, before generating the first random code, the method further includes:

[0075] S1, sending a first registration request to the conversation platform, wherein the first registration request includes account information, a callback address, and a verification code of the first application, and the registration request is used to request registration to the conversation platform;

[0076] S2, receiving entry address information sent by the session platform, wherein the entry address information includes a first address and a second address, the first address is used for the first application to initiate a session, and the second address is used for the first application to accept a session.

[0077] In an exemplary embodiment, in response to the second request message, upon receiving the session request sent by the second application, after generating the first random code, the method further includes:

[0078] S1, sending a first random code to a second application to instruct the second application to request a session key from a session platform through the first random code.

[0079] In an exemplary embodiment, receiving a session key sent by a session platform includes:

[0080] S1, receiving the session key sent by the session platform through the first address.

[0081] This embodiment provides a session establishment method. Figure 4Flowchart (III) of the image processing method according to an embodiment of the present invention, Figure 4 As shown, the process includes the following steps:

[0082] Step S402, receiving a first random code and a second address sent by a first application;

[0083] Step S404: sending a second request message to the session platform through the second address, wherein the second request message includes the first random code, and the second request message is used to request a session key;

[0084] Step S406, receiving a session key sent by the session platform, wherein the session key is determined by the session platform based on the first random code;

[0085] Step S408: Establish a session with the first application using the session key.

[0086] Among them, the executor of the above steps can be a terminal, a server, a specific processor set in the terminal or server, or a processor or processing device set relatively independently from the terminal or server (for example, a second application), but is not limited to this.

[0087] Through the above steps, by receiving the first random code and the second address sent by the first application, the first random code is generated based on the session request of the second application; sending the second request message to the session platform through the second address, wherein the second request message includes the first random code, and the second request message is used to request the session key; receiving the session key sent by the session platform, wherein the session key is determined by the session platform based on the first random code; and establishing a session with the first application through the session key. Because in the above method, the key for establishing a session between the first application and the second application is sent by the session platform, not through the public keys of the first application and the second application. The first application and the second application do not need to store each other's public keys, nor do they need to update the public keys. Thereby achieving the effect of reducing the complexity of session establishment, and solving the problem of complex session establishment in the related art.

[0088] In an exemplary embodiment, before receiving the first random code and the second address sent by the first application, the method further includes:

[0089] S1, sending a session request to a first application, wherein the session request is used to request to establish a session with the first application.

[0090] The present invention will be described below in conjunction with specific embodiments:

[0091] This embodiment provides a quantum key-based secure session protocol and a quantum key service platform, which enables multi-party secure conversations without the need to store the other party's public key. The interaction process between the quantum key service platform and each conversation platform is as follows: Figure 5 shown.

[0092] This embodiment takes the establishment of a session between platform A and platform B as an example for explanation. Figure 6 As shown in the figure, the secure session process between platform A and platform B based on the quantum key platform includes the following steps:

[0093] S1, platform A registers on the Quantum Key platform and needs to provide data such as platform name, callback address, callback verification code, etc.

[0094] S2, the quantum key platform will dynamically generate two entry addresses, one for initiating a session and one for accepting a session;

[0095] S3: When platform B wants to communicate with platform A, platform B generates a session request ID (sessionId) and sends it to platform A.

[0096] S4, the A platform generates a random code (e.g., K1) and returns K1 and the B entry address to the B platform;

[0097] S5, platform A applies for a key from the quantum key platform through the A entry address, and the parameter is the random code K1;

[0098] S6, the quantum key platform obtains the quantum key SK1;

[0099] S7, the quantum key platform returns the secret key SK1 through the callback address and verification code filled in during registration, and caches SK1 at the same time;

[0100] S8, platform B obtains the key from the quantum key platform through the B entry address and K1, and the platform takes the key from the cache and returns it to B;

[0101] S9, platform B and platform A conduct a secure session using a secret key.

[0102] In this embodiment, the quantum key platform can be a quantum key PaaS platform. Figure 7As shown, the quantum key platform is divided into two parts, one is the quantum key generation device, and the other is the key service. The key generation device consists of a clock pulse device, a quantum key generator, a key pool, and a key interface. The clock pulse device generates a clock signal at regular intervals to trigger the key generator to generate a key. The quantum key generator consists of a transmitter, a receiver, a photon channel, and a universal channel. The key is generated through a quantum key distribution protocol (such as BB84, BBM92 protocol). After the key is generated, it will be stored in the key pool. The key generation device provides a key acquisition interface to obtain the key in real time. The key service provides session key services for external platforms.

[0103] The key service includes that platform A registers through the platform registration service, and the key service generates two entry addresses and stores them in the platform registration library. When platform A receives a session request, platform A applies for a session key from the key service platform. The service platform obtains the key from the key generation device, returns the key to platform A through the callback interface, and caches the key at the same time. When platform B applies for a session key through the B entry, the key service platform takes out the cached key and returns it to platform B.

[0104] In summary, this embodiment distributes secret keys through the secret key service platform, so that each platform does not need to store the other party's public key, nor does it need to update the public key. This reduces the complexity of session establishment and solves the problem of complex session establishment in related technologies.

[0105] In this embodiment, a session establishment device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0106] Figure 8 1 is a block diagram of a session establishment device according to an embodiment of the present invention (I), Figure 8 As shown, the device comprises:

[0107] A first receiving module 82 is configured to receive a first request message sent by a first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of a second application;

[0108] A first response module 84, configured to send the acquired session key to the first application in response to the first request message;

[0109] A second receiving module 86 is configured to receive a second request message sent by a second application, wherein the second request message includes the first random code, and the first random code is sent by the first application to the second application;

[0110] The second response module 88 is used to respond to the second request message and send the session key to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key.

[0111] In an exemplary embodiment, the above device further comprises:

[0112] A sixth receiving module, configured to receive a first registration request sent by the first application before receiving the first request message sent by the first application, wherein the first registration request includes the account information, callback address and verification code of the first application;

[0113] The third response module is used to respond to the above-mentioned first registration request and generate entry address information, wherein the above-mentioned entry address information includes a first address and a second address, the above-mentioned first address is used for the above-mentioned first application to initiate a session, and the above-mentioned second address is used for the above-mentioned first application to accept a session.

[0114] In an exemplary embodiment, the first receiving module includes:

[0115] The first receiving unit is used to receive the first request message sent by the first application through the first address.

[0116] In an exemplary embodiment, the second receiving module includes:

[0117] The second receiving unit is used to receive the first request message sent by the second application through the second address, wherein the first address is sent by the first application to the second application.

[0118] In an exemplary embodiment, the first response module includes:

[0119] A first generating unit, configured to generate the session key using a quantum key distribution protocol;

[0120] The first sending unit is used to send the session key to the first application based on the callback address and verification code of the first application.

[0121] In an exemplary embodiment, the second response module includes:

[0122] A first search unit, configured to use the first random code to search for the cached session key;

[0123] The second sending unit is used to send the above-mentioned session key to the above-mentioned second application.

[0124] Fig. 9 2 is a block diagram of a session establishment device according to an embodiment of the present invention. Fig. 9 As shown, the device comprises:

[0125] A first generating module 92, configured to generate a first random code upon receiving a session request sent by a second application, wherein the session request is used to indicate that the second application requests to establish a session with the first application, and the first random code is generated based on the session request of the second application;

[0126] A first sending module 94, configured to send a first request message to the conversation platform, wherein the first request message includes the first random code;

[0127] The third receiving module 96 is used to receive the session key sent by the above session platform;

[0128] The first establishing module 98 is used to establish a session with the second application using the session key.

[0129] In an exemplary embodiment, the above device further comprises:

[0130] a third sending module, configured to respond to the second request message, and, in the case of receiving the session request sent by the second application, send a first registration request to the session platform before generating the first random code, wherein the first registration request includes the account information, callback address and verification code of the first application, and the registration request is used to request registration to the session platform;

[0131] The seventh receiving module is used to receive the entry address information sent by the above-mentioned session platform, wherein the above-mentioned entry address information includes a first address and a second address, the above-mentioned first address is used by the above-mentioned first application to initiate a session, and the above-mentioned second address is used by the above-mentioned first application to accept a session.

[0132] In an exemplary embodiment, the above device further comprises:

[0133] The fourth sending module is used to respond to the above-mentioned second request message. When receiving the session request sent by the second application, after generating a first random code, the fourth sending module sends the above-mentioned first random code to the above-mentioned second application to instruct the above-mentioned second application to request the above-mentioned session key from the above-mentioned session platform through the above-mentioned first random code.

[0134] In an exemplary embodiment, the third receiving module includes:

[0135] The third receiving unit is used to receive the session key sent by the session platform through the first address.

[0136] Fig.10 3 is a block diagram of a session establishment device according to an embodiment of the present invention, Fig.10 As shown, the device comprises:

[0137] A fourth receiving module 1002 is configured to receive a first random code and a second address sent by a first application, where the first random code is generated based on a session request of a second application;

[0138] A second sending module 1004 is used to send a second request message to the session platform through the second address, wherein the second request message includes the first random code, and the second request message is used to request a session key;

[0139] A fifth receiving module 1006 is configured to receive a session key sent by the session platform, wherein the session key is determined by the session platform based on the first random code;

[0140] The second establishing module 1008 is used to establish a session with the first application through the session key.

[0141] In an exemplary embodiment, the above device further comprises:

[0142] The fifth sending module is used to send a session request to the first application before receiving the first random code and the second address sent by the first application, wherein the session request is used to request to establish a session with the first application.

[0143] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A session establishment method, characterized in that: Applied to a conversation platform, the application programs registered in the conversation platform include a first application program and a second application program, and the method includes: receiving a first request message sent by the first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of the second application; In response to the first request message, sending the acquired session key to the first application; receiving a second request message sent by the second application, wherein the second request message includes the first random code, and the first random code is sent by the first application to the second application; In response to the second request message, sending the session key to the second application based on the first random code to instruct the second application to establish a session with the first application through the session key; Receiving a first request message sent by a first application includes: receiving the first request message sent by the first application through a first address, wherein the first address is a session address of the first application, and the first address is used by the first application to initiate a session; Receiving a second request message sent by a second application includes: receiving the second request message sent by the second application through a second address, wherein the second address is sent by the first application to the second application, and the second address is a session address of the second application.

2. The method according to claim 1, characterized in that Before receiving the first request message sent by the first application, the method further includes: Receiving a first registration request sent by the first application, wherein the first registration request includes account information, a callback address, and a verification code of the first application; In response to the first registration request, entry address information is generated, wherein the entry address information includes the first address and the second address.

3. The method according to claim 1 or 2, characterized in that: In response to the first request message, sending the acquired session key to the first application includes: Generating the session key using a quantum key distribution protocol; Based on the callback address and verification code of the first application, the session key is sent to the first application.

4. The method according to claim 1 or 2, characterized in that: In response to the second request message, sending the session key to the second application based on the first random code includes: Using the first random code to search for the cached session key; The session key is sent to the second application, where the session key is used to encrypt a session between the first application and the second application.

5. A session establishment method, characterized in that: Applied to a first application, the first application has been registered with a conversation platform, and the applications registered in the conversation platform also include a second application, the method includes: generating a first random code upon receiving a session request sent by the second application, wherein the session request is used to indicate that the second application requests to establish a session with the first application, and the first random code is generated based on the session request of the second application; Sending a first request message to the session platform, wherein the first request message includes the first random code; receiving a session key sent by the session platform in response to the first request message; establishing a session with the second application using the session key; The session platform is further used to receive the first request message sent by the first application through a first address, wherein the first address is the session address of the first application, and the first address is used for the first application to initiate a session, and the first request message includes a first random code generated by the first application, and the first random code is generated based on the session request of the second application; receive the second request message sent by the second application through a second address, wherein the second address is sent from the first application to the second application, the second address is the session address of the second application, the second request message includes the first random code, the first random code is sent from the first application to the second application, and the second request message is used to request the session key.

6. The method according to claim 5, characterized in that In case of receiving a session request sent by the second application, after generating the first random code, the method further includes: The first random code is sent to the second application to instruct the second application to request the session key from the session platform through the first random code.

7. A session establishment method, characterized in that: Applied to a second application, the second application has been registered with a conversation platform, and the applications registered in the conversation platform also include the first application, the method comprising: receiving a first random code and a second address sent by the first application, wherein the first random code is generated based on a session request of the second application, and the second address is a session address of the second application; Sending a second request message to the session platform through the second address, wherein the second request message includes the first random code, the first random code is sent by the first application to the second application, and the second request message is used to request a session key; receiving a session key sent by the session platform, wherein the session key is determined by the session platform based on the first random code; establishing a session with the first application using the session key; The session platform is also used to receive a first request message sent by the first application through a first address and send the acquired session key to the first application in response to the first request message, wherein the first address is the session address of the first application, and the first address is used for the first application to initiate a session, and the first request message includes a first random code generated by the first application, and the first random code is generated based on the session request of the second application; and the second request message sent by the second application is received through a second address.

8. A session establishing device, characterized in that: Applied to a conversation platform, the application programs registered in the conversation platform include a first application program and a second application program, and the device includes: A first receiving module, configured to receive a first request message sent by the first application, wherein the first request message includes a first random code generated by the first application, and the first random code is generated based on a session request of the second application; A first response module, configured to send the acquired session key to the first application in response to the first request message; A second receiving module, configured to receive a second request message sent by a second application, wherein the second request message includes the first random code, and the first random code is sent by the first application to the second application; a second response module, configured to send the session key to the second application based on the first random code in response to the second request message, so as to instruct the second application to establish a session with the first application through the session key; The first receiving module is further configured to receive the first request message sent by the first application via a first address, wherein the first address is a session address of the first application, and the first address is used for the first application to initiate a session; The second receiving module is further used to receive the first request message sent by the second application through a second address, wherein the second address is sent by the first application to the second application, and the second address is a session address of the second application.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 4 when it is run, or the program executes the method of claim 5 or 6 when it is run, or the program executes the method of claim 7 when it is run.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method of any one of claims 1 to 4 through the computer program, or the processor is configured to execute the method of claim 5 or 6 through the computer program, or the processor is configured to execute the method of claim 7 through the computer program.

Citation Information

Patent Citations

  • Mail secure transmission method based on quantum key public cloud service platform

    CN109951381A