CN114257562A - Instant messaging method, instant messaging device, electronic equipment and computer readable storage medium - Google Patents

Instant messaging method, instant messaging device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114257562A
CN114257562A CN202111544405.8A CN202111544405A CN114257562A CN 114257562 A CN114257562 A CN 114257562A CN 202111544405 A CN202111544405 A CN 202111544405A CN 114257562 A CN114257562 A CN 114257562A
Authority
CN
China
Prior art keywords
terminal
message
instant
target
instant message
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.)
Granted
Application number
CN202111544405.8A
Other languages
Chinese (zh)
Other versions
CN114257562B (en
Inventor
翟明玮
李冲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111544405.8A priority Critical patent/CN114257562B/en
Publication of CN114257562A publication Critical patent/CN114257562A/en
Application granted granted Critical
Publication of CN114257562B publication Critical patent/CN114257562B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides an instant messaging method, an instant messaging device, electronic equipment and a computer-readable storage medium, wherein the specific implementation mode of the method comprises the following steps: when receiving an instant message sent by a first terminal, generating a message extraction certificate corresponding to the instant message; sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal; and when the message extraction certificate sent by the target second terminal is received, sending the instant message to the target second terminal. The method avoids storing the instant message in the server corresponding to the third-party SDK, thereby reducing the risk of instant message leakage and improving the safety of the instant message.

Description

Instant messaging method, instant messaging device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of instant messaging, and in particular, to an instant messaging method, an instant messaging apparatus, an electronic device, and a computer-readable storage medium.
Background
With the popularization of mobile terminals and the internet, instant messaging has become an important way for people to communicate. The user can install an instant messaging application program in the personal mobile terminal, and then can transmit an instant message to a target user through the instant messaging service terminal.
In the related art, in order to transmit an instant message, a mobile terminal generally needs to use a third party Software Development Kit (SDK) to quickly and stably transmit the instant message to a target user. In this way, the instant message to be transmitted is stored in the server corresponding to the third-party SDK, which reduces the security of the instant message.
Disclosure of Invention
An object of the embodiments of the present application is to provide an instant messaging method, an instant messaging device, an electronic device, and a computer-readable storage medium, so as to avoid storing an instant message in a server corresponding to a third-party SDK, thereby reducing a risk of instant message leakage and improving security of the instant message.
In a first aspect, an embodiment of the present application provides an instant messaging method, which is applied to an application server, and the method includes: when receiving an instant message sent by a first terminal, generating a message extraction certificate corresponding to the instant message; sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal; and when the message extraction certificate sent by the target second terminal is received, sending the instant message to the target second terminal.
Optionally, the instant message is encrypted in advance, and after receiving the instant message sent by the first terminal, the instant messaging method further includes: when the encrypted information corresponding to the instant message is obtained, the encrypted information and first user information corresponding to the first terminal are stored in an associated mode; when the first user information sent by the target second terminal is received, sending the encrypted information to the target second terminal so that the target second terminal obtains the instant message based on the encrypted information; and the first user information is sent to the target second terminal by the first terminal. Therefore, the instant message can be encrypted in advance and decrypted through the encrypted information, so that the instant message can be transmitted more safely.
Optionally, the encryption information comprises key information; and the instant message is encrypted by the first terminal based on the following steps: responding to the first user information, which is detected to be successful in logging in the first user, and generating symmetric key information and asymmetric key information corresponding to the first user information; the asymmetric key information comprises an asymmetric public key and an asymmetric private key; encrypting the instant message using the symmetric key and encrypting the symmetric key using the asymmetric public key; splicing the instant message encrypted by using the symmetric key and the symmetric key encrypted by using the asymmetric public key to obtain an encrypted message; and when receiving the message extraction certificate sent by the target second terminal, sending the instant message to the target second terminal, including: and sending the encrypted message to the target second terminal. Therefore, the security of the instant message in the transmission process can be improved by encrypting the instant message.
Optionally, the encrypted message is decrypted by the target second terminal based on: acquiring the asymmetric public key, and analyzing the asymmetric private key based on the asymmetric public key; and decrypting the encrypted symmetric key according to the asymmetric private key, and decrypting the encrypted instant message according to the decrypted symmetric key to obtain the instant message. Therefore, the decrypted instant message can be conveniently and safely obtained.
Optionally, the instant message is compressed by the first terminal based on a preset message data capacity and then sent. Therefore, the first terminal can compress the instant message with the overlarge data capacity within the preset message data capacity and then transmit the instant message, so that the transmission speed is improved.
Optionally, after generating a message extraction credential corresponding to the instant message when the instant message sent by the first terminal is received, the instant messaging method further includes: recording the receiving time corresponding to the instant message; and clearing the instant message and the message extraction voucher when the preset time is reached by taking the receiving moment as a time starting point. In this way, the storage pressure of the application server can be relieved.
In a second aspect, an embodiment of the present application provides another instant messaging method, which is applied to a first terminal, where the first terminal and at least one second terminal are served by a same application server, and the method includes: sending an instant message to the application server and requesting the application server to return a message extraction certificate corresponding to the instant message; and receiving a message extraction certificate returned by the application server, and sending the message extraction certificate to a target second terminal by using the instant communication server so that the target second terminal obtains the instant message from the application server based on the message extraction certificate.
In a third aspect, an embodiment of the present application provides another instant messaging method, which is applied to a second terminal, where the second terminal and at least one first terminal are served by a same application server, and the method includes: receiving a message extraction certificate sent by any one first terminal by using an instant messaging server; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal; and sending the message extraction certificate to the application server to acquire the instant message.
In a fourth aspect, an embodiment of the present application provides an instant messaging device, which is applied to an application server, and the instant messaging device includes: the generation module is used for generating a message extraction certificate corresponding to the instant message when the instant message sent by the first terminal is received; the first sending module is used for sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal; and the second sending module is used for sending the instant message to the target second terminal when receiving the message extraction certificate sent by the target second terminal.
In a fifth aspect, an embodiment of the present application provides another instant messaging device, which is applied to a first terminal, where the first terminal and at least one second terminal are served by a same application server, and the device includes: the request module is used for sending an instant message to the application server and requesting the application server to return a message extraction certificate corresponding to the instant message; and the message extraction module is used for receiving the message extraction certificate returned by the application server and sending the message extraction certificate to a target second terminal by using the instant communication server so that the target second terminal obtains the instant message from the application server based on the message extraction certificate.
In a sixth aspect, an embodiment of the present application provides another instant messaging device, which is applied to a second terminal, where the second terminal and at least one first terminal are served by a same application server, and the device includes: the receiving module is used for receiving a message extraction certificate sent by any one first terminal by using an instant messaging server; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal; and the acquisition module is used for sending the message extraction certificate to the application server to acquire the instant message.
In a seventh aspect, an embodiment of the present application provides an instant messaging system, including: the first terminal is used for sending an instant message to an application server and requesting the application server to return a message extraction certificate corresponding to the instant message; sending the message extraction certificate to a target second terminal by using an instant messaging server; the application server is used for generating a message extraction certificate corresponding to the instant message when receiving the instant message sent by the first terminal; sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal; when the message extraction certificate sent by the target second terminal is received, the instant message is sent to the target second terminal; and the target second terminal is used for receiving the message extraction certificate sent by the first terminal and acquiring the instant message from the application server side based on the message extraction certificate.
In an eighth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method as provided in the first, second or third aspect are executed.
In a ninth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, performs the steps in the method as provided in the first, second or third aspect.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart of an instant messaging method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another instant messaging method according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another instant messaging method according to an embodiment of the present disclosure;
fig. 4 is a block diagram illustrating an instant messaging device according to an embodiment of the present disclosure;
fig. 5 is a block diagram of another instant messaging device according to an embodiment of the present disclosure;
fig. 6 is a block diagram of another instant messaging device according to an embodiment of the present disclosure;
fig. 7 is a block diagram illustrating an instant messaging system according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device for executing an instant messaging method according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
It should be noted that the embodiments or technical features of the embodiments in the present application may be combined without conflict.
In the related art, the security of the instant message is low; in order to solve the problem, the application provides an instant messaging method, an instant messaging device, electronic equipment and a computer-readable storage medium; further, the instant message sent by the user is stored in the application server corresponding to the instant messaging application program, and then the message extraction certificate for extracting the instant message is forwarded through the instant messaging server, so that the target user receiving the instant message can extract the instant message based on the message extraction certificate. Therefore, the application server side can store the instant message without being limited to storing the user data, so that the instant message is not leaked due to the use of the third-party SDK, and the safety of the instant message is improved.
In some application scenarios, the instant messaging method may be applied to the application server, and the application server may provide services for a plurality of terminal devices. In other application scenarios, the instant messaging method may also be applied to a terminal device, and the terminal device may be, for example, a mobile phone, a tablet computer, and the like. For example, the present application will be described in detail by taking an application server as an example.
The above solutions in the related art are all the results of practical and careful study of the inventor, and therefore, the discovery process of the above problems and the solutions proposed by the following embodiments of the present invention to the above problems should be the contribution of the inventor to the present invention in the course of the present invention.
Please refer to fig. 1, which illustrates a flowchart of an instant messaging method applied to an application server according to an embodiment of the present application. As shown in fig. 1, the instant messaging method includes the following steps 101 to 103.
Step 101, when receiving an instant message sent by a first terminal, generating a message extraction certificate corresponding to the instant message;
the instant message may be a text message, a voice message, a picture message, a video message, etc., with different formats.
The message extraction certificate may include, for example, a character string, a number, a symbol, or a combination thereof, which may be used to extract information of the instant message.
In some application scenarios, the first terminal may send an instant message to the application server after receiving the instant message input by the user. In these application scenarios, the application server may store the instant message in a corresponding file format according to the format of the instant message. For example, when the received instant message is a picture message, the instant message may be stored as a file in an image file format with a suffix of.
In these application scenarios, after the application server receives the instant message sent by the first terminal, the application server may generate message extraction credentials corresponding to the instant message one to one. For example, for the instant message "tomorrow date" sent by user a, the application server may generate the message extraction credential "hello" uniquely corresponding thereto.
Step 102, sending the message extraction certificate to the first terminal, so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal;
the application server side can send the generated message extraction certificate to the first terminal, and the first terminal can send the message extraction certificate to the target second terminal after receiving the message extraction certificate. Here, the first terminal may send the message extraction certificate to the instant messaging service end through the third-party SDK, and the instant messaging service end forwards the message extraction certificate to the target second terminal, so that the message extraction certificate is quickly and stably transmitted.
In some application scenarios, when the first terminal sends the message extraction certificate to the instant messaging service end, the first terminal may send the user information of the target user together, so that the instant messaging service end can determine the target second terminal from the plurality of second terminals.
Step 103, when receiving the message extraction certificate sent by the target second terminal, sending the instant message to the target second terminal.
After receiving the message extraction certificate forwarded by the instant messaging service end, the target second terminal can send the message extraction certificate to the application service end, so that the application service end returns the only corresponding instant message based on the message extraction certificate.
In this embodiment, through the steps 101 to 103, when the instant message is transmitted by using the third-party SDK, the instant message can be prevented from being stored in the server corresponding to the third-party SDK, so that the risk of instant message leakage is reduced, and the security of the instant message is improved.
In some optional implementations, the instant message is encrypted in advance, and after receiving the instant message sent by the first terminal, the instant messaging method further includes the following steps:
step 1, when acquiring encrypted information corresponding to the instant message, storing the encrypted information and first user information corresponding to the first terminal in an associated manner;
the encrypted message may be used to encrypt or decrypt an instant message.
The first user information may include, for example, an identity of a first user corresponding to the first terminal, where the identity may be, for example, a user name, a login account, a login number, and other information that may be used to uniquely characterize the identity of the first user.
In some application scenarios, the application server may obtain the encrypted information corresponding to the instant message. The encrypted information may be obtained by encrypting the instant message by the first terminal, or may be obtained by encrypting the instant message sent by the first terminal after the application server receives the instant message.
After the application server side obtains the encrypted information, the encrypted information and the first user information can be stored in an associated mode, so that the application server side can accurately and conveniently search according to the association relation.
Step 2, when the first user information sent by the target second terminal is received, the encrypted information is sent to the target second terminal, so that the target second terminal obtains the instant message based on the encrypted information; and the first user information is sent to the target second terminal by the first terminal.
In some application scenarios, the first terminal may send the first user information to the target second terminal, so that the target second terminal obtains the encryption information based on the first user information. Here, the first terminal may send the first user information to the target second terminal together with the information extraction credential after receiving the information extraction credential fed back by the application server; the first user information may also be sent separately before or after the information extraction credential is sent.
The target second terminal can send the received first user information to the application server, and the application server can search the encrypted information through the association relationship between the first user information and the encrypted information. After the target second terminal receives the encrypted information, the obtained encrypted instant message can be decrypted, and then the instant message is obtained.
Through the steps 1 to 2, the instant message can be encrypted in advance, and the encrypted message is decrypted, so that the instant message can be transmitted more safely.
In some alternative implementations, the encryption information includes key information; and the instant message is encrypted by the first terminal based on the following steps:
step A, responding to the fact that the login of a first user corresponding to the first user information is detected to be successful, and generating symmetric key information and asymmetric key information corresponding to the first user information; the asymmetric key information comprises an asymmetric public key and an asymmetric private key;
in some application scenarios, the application server may generate corresponding symmetric key information according to the first user information after detecting that the first user logs in successfully. Here, the above-described symmetric key information may be generated by, for example, an sm4 block cipher algorithm.
In these application scenarios, the application server may also generate corresponding asymmetric key information together with the first user information. Here, the above-described asymmetric key information may be generated by, for example, an sm2 encryption algorithm.
Step B, encrypting the instant message by using the symmetric key and encrypting the symmetric key by using the asymmetric public key;
in some application scenarios, the first terminal may use the generated symmetric key for encrypting the instant message and the generated asymmetric key for encrypting the symmetric key. Here, when the sm4 block cipher algorithm and the sm2 encryption algorithm are used, instant messages are encrypted by using the sm4 block cipher algorithm, so that the instant messages can be hijacked in the transmission process, and the risk of instant message leakage exists; when the sm2 encryption algorithm is used, the operation process is time-consuming. Therefore, the encryption of the symmetric key by adopting the sm2 encryption algorithm can protect the secure transmission of the symmetric key, and the sm2 encryption algorithm is only used once, so that the combination of the sm4 block cipher algorithm and the sm2 encryption algorithm is more efficient.
Step C, splicing the instant message encrypted by using the symmetric key and the symmetric key encrypted by using the asymmetric public key to obtain an encrypted message;
in some application scenarios, after the instant message and the symmetric key are encrypted by using the sm4 block cipher algorithm and the sm2 encryption algorithm, the encrypted instant message and the encrypted symmetric key may be spliced, so that the encrypted instant message and the encrypted symmetric key are uploaded to the application server as a ciphertext data packet (i.e., the encrypted message).
Thus, the step 103 may include: and sending the encrypted message to the target second terminal.
In some application scenarios, after the encrypted instant message and the encrypted symmetric key are spliced by the first terminal to obtain the encrypted message, the encrypted message can be sent to the target second terminal, so as to improve the security of the instant message in the transmission process. Here, the first terminal may transmit after signing the encrypted message using the asymmetric key.
In some optional implementations, the encrypted message is decrypted by the target second terminal based on:
step a, acquiring the asymmetric public key, and analyzing the asymmetric private key based on the asymmetric public key;
after the target second terminal receives the encrypted message, the encrypted message needs to be decrypted. In some application scenarios, the target second terminal may obtain the asymmetric public key to resolve the corresponding asymmetric key by using the asymmetric public key. Here, the received encrypted message may be received after being signed by the asymmetric public key.
In these application scenarios, the asymmetric public key may be sent from the first terminal to the application server, and the target second terminal may obtain the asymmetric public key from the application server.
And b, decrypting the encrypted symmetric key according to the asymmetric private key, and decrypting the encrypted instant message according to the decrypted symmetric key to obtain the instant message.
After the target second terminal decrypts the encrypted symmetric key by using the asymmetric private key, the encrypted instant message can be further decrypted by using the decrypted symmetric key, so as to obtain the decrypted instant message. Here, the decryption process may be performed according to the corresponding sm4 encryption algorithm and sm2 encryption algorithm, respectively, and the process is the prior art and is not described herein again.
In some optional implementation manners, the instant message is sent by the first terminal after being compressed based on a preset message data capacity.
In some application scenarios, the first terminal encrypts the instant message and then sends the encrypted instant message to the application server. Thus, if the instant message is a message with an excessively large data capacity, such as a picture message or a video message, the transmission speed of the instant message is affected. Therefore, the first terminal can compress the instant message with the overlarge data capacity within the preset message data capacity and then transmit the instant message, so that the transmission speed is improved. The preset message data capacity may include, for example, 10M, 15M, etc. that can satisfy the actually required data capacity.
In some optional implementations, after generating a message extraction credential corresponding to an instant message sent by a first terminal when the instant message is received (step 101 above), the instant messaging method further includes: recording the receiving time corresponding to the instant message; and clearing the instant message and the message extraction voucher when the preset time is reached by taking the receiving moment as a time starting point.
In some application scenarios, if a large number of instant messages and corresponding message extraction credentials are stored in the application server, the storage pressure of the application server may be increased. Therefore, the instant message and the message extraction certificate can be cleared in time. Specifically, the application server may record the receiving time of each instant message, and may delete the receiving time as a time starting point when a preset time length is reached, so as to relieve the storage pressure of the application server. The preset time period may include, for example, 6 hours, 24 hours, etc., which substantially means the time period in which the instant message has expired.
Please refer to fig. 2, which illustrates a flowchart of another instant messaging method according to an embodiment of the present application. In this embodiment, the instant messaging method is applied to a first terminal, and the first terminal and at least one second terminal are served by the same application server. As shown in fig. 2, the instant messaging method includes the following steps 201 to 202.
Step 201, sending an instant message to the application server, and requesting the application server to return a message extraction certificate corresponding to the instant message;
step 202, receiving a message extraction certificate returned by the application server, and sending the message extraction certificate to a target second terminal by using an instant messaging server, so that the target second terminal obtains the instant message from the application server based on the message extraction certificate.
The implementation process and the obtained technical effect of the steps 201 to 202 may be the same as or similar to those of the steps 101 to 103 in the embodiment shown in fig. 1, and are not repeated herein.
Please refer to fig. 3, which illustrates a flowchart of another instant messaging method according to an embodiment of the present application. In this embodiment, the instant messaging method is applied to a second terminal, and the second terminal and at least one first terminal are served by the same application server. As shown in fig. 3, the instant messaging method includes the following steps 301 to 302.
Step 301, receiving a message extraction certificate sent by any one of the first terminals by using an instant messaging service terminal; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal;
step 302, sending the message extraction certificate to the application server to obtain the instant message.
The implementation process and the obtained technical effect of the steps 301 to 302 may be the same as or similar to those of the steps 101 to 103 in the embodiment shown in fig. 1, and are not repeated herein.
Referring to fig. 4, a block diagram of an instant messaging device, which may be a module, a program segment, or a code on an electronic device, according to an embodiment of the present application is shown. It should be understood that the apparatus corresponds to the above-mentioned embodiment of the method of fig. 1, and can perform various steps related to the embodiment of the method of fig. 1, and the specific functions of the apparatus can be referred to the description above, and the detailed description is appropriately omitted here to avoid redundancy.
Optionally, the instant messaging device may be applied to an application server. Specifically, the instant messaging device may include a generating module 401, a first sending module 402, and a second sending module 403. The generation module 401 is configured to generate a message extraction credential corresponding to an instant message when the instant message sent by a first terminal is received; a first sending module 402, configured to send the message extraction credential to the first terminal, so that the first terminal sends the message extraction credential to a target second terminal by using an instant messaging service; a second sending module 403, configured to send the instant message to the target second terminal when receiving the message extraction credential sent by the target second terminal.
Optionally, the instant message is encrypted in advance, and the instant messaging device further includes an encryption module, the encryption module being configured to: after receiving an instant message sent by a first terminal, when acquiring encrypted information corresponding to the instant message, storing the encrypted information and first user information corresponding to the first terminal in an associated manner; when the first user information sent by the target second terminal is received, sending the encrypted information to the target second terminal so that the target second terminal obtains the instant message based on the encrypted information; and the first user information is sent to the target second terminal by the first terminal.
Optionally, the encryption information comprises key information; and the instant message is encrypted by the first terminal based on the following steps: responding to the first user information, which is detected to be successful in logging in the first user, and generating symmetric key information and asymmetric key information corresponding to the first user information; the asymmetric key information comprises an asymmetric public key and an asymmetric private key; encrypting the instant message using the symmetric key and encrypting the symmetric key using the asymmetric public key; splicing the instant message encrypted by using the symmetric key and the symmetric key encrypted by using the asymmetric public key to obtain an encrypted message; and the second sending module 403 is further configured to: and sending the encrypted message to the target second terminal.
Optionally, the encrypted message is decrypted by the target second terminal based on: acquiring the asymmetric public key, and analyzing the asymmetric private key based on the asymmetric public key; and decrypting the encrypted symmetric key according to the asymmetric private key, and decrypting the encrypted instant message according to the decrypted symmetric key to obtain the instant message.
Optionally, the instant message is compressed by the first terminal based on a preset message data capacity and then sent.
Optionally, the instant messaging device further includes a clearing module, where the clearing module is configured to: when the instant message sent by the first terminal is received, after a message extraction certificate corresponding to the instant message is generated, recording the receiving time corresponding to the instant message; and clearing the instant message and the message extraction voucher when the preset time is reached by taking the receiving moment as a time starting point.
It should be noted that, for the convenience and brevity of description, the specific working procedure of the above-described apparatus may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated herein.
Referring to fig. 5, a block diagram of another instant messaging device provided in the embodiment of the present application is shown, where the instant messaging device may be a module, a program segment, or code on an electronic device. It should be understood that the apparatus corresponds to the above-mentioned embodiment of the method of fig. 2, and can perform various steps related to the embodiment of the method of fig. 2, and the specific functions of the apparatus can be referred to the description above, and the detailed description is appropriately omitted here to avoid redundancy.
Optionally, the instant messaging device may be applied to a first terminal, and the first terminal and at least one second terminal are served by the same application server. Specifically, the instant messaging device may include a request module 501 and a message extraction module 502. The request module 501 is configured to send an instant message to the application server, and request the application server to return a message extraction credential corresponding to the instant message; the message extraction module 502 is configured to receive a message extraction credential returned by the application server, and send the message extraction credential to a target second terminal by using an instant messaging server, so that the target second terminal obtains the instant message from the application server based on the message extraction credential.
It should be noted that, for the convenience and brevity of description, the specific working procedure of the above-described apparatus may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated herein.
Referring to fig. 6, a block diagram of another instant messaging device provided in the embodiment of the present application is shown, where the instant messaging device may be a module, a program segment, or code on an electronic device. It should be understood that the apparatus corresponds to the above-mentioned embodiment of the method of fig. 3, and can perform various steps related to the embodiment of the method of fig. 3, and the specific functions of the apparatus can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy.
Optionally, the instant messaging device may be applied to a second terminal, where the second terminal and at least one first terminal are served by the same application server. Specifically, the instant messaging device may include a receiving module 601 and an obtaining module 602. The receiving module 601 is configured to receive a message extraction credential sent by any one of the first terminals through an instant messaging service end; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal;
an obtaining module 602, configured to send the message extraction credential to the application server to obtain the instant message.
It should be noted that, for the convenience and brevity of description, the specific working procedure of the above-described apparatus may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated herein.
Referring to fig. 7, a block diagram of another instant messaging system according to an embodiment of the present disclosure is shown, and as shown in fig. 7, the instant messaging system includes a first terminal 701, an application server 702, and a target second terminal 704. The first terminal 701 is configured to send an instant message to an application server 702, and request the application server 702 to return a message extraction credential corresponding to the instant message; sending the message extraction certificate to the target second terminal 704 by using the instant messaging server 703; an application server 702, configured to generate a message extraction credential corresponding to an instant message when receiving the instant message sent by the first terminal 701; sending the message extraction certificate to the first terminal 701, so that the first terminal 701 sends the message extraction certificate to a target second terminal 704 by using an instant messaging server 703; sending the instant message to the target second terminal 704 upon receiving the message extraction credential sent by the target second terminal 704; the target second terminal 704 is configured to receive the message extraction credential sent by the first terminal 701, and obtain the instant message from the application server 702 based on the message extraction credential.
It should be noted that, for the convenience and brevity of description, the specific working procedure of the system described above may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated here.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device for executing an instant messaging method according to an embodiment of the present disclosure, where the electronic device may include: at least one processor 801, such as a CPU, at least one communication interface 802, at least one memory 803, and at least one communication bus 504. Wherein the communication bus 804 is used for realizing direct connection communication of the components. In this embodiment, the communication interface 802 of the device in this application is used for performing signaling or data communication with other node devices. The memory 803 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 803 may optionally be at least one memory device located remotely from the processor. The memory 803 stores computer readable instructions which, when executed by the processor 801, enable the electronic device to perform the method processes described above with reference to fig. 1, fig. 2 or fig. 3.
It will be appreciated that the configuration shown in fig. 8 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 8 or have a different configuration than shown in fig. 8. The components shown in fig. 8 may be implemented in hardware, software, or a combination thereof.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program may perform the method processes performed by an electronic device in the method embodiments shown in fig. 1, fig. 2 or fig. 3.
Embodiments of the present application provide a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, the method may include: when receiving an instant message sent by a first terminal, generating a message extraction certificate corresponding to the instant message; sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal; and when the message extraction certificate sent by the target second terminal is received, sending the instant message to the target second terminal.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (14)

1. An instant messaging method is applied to an application server, and the method comprises the following steps:
when receiving an instant message sent by a first terminal, generating a message extraction certificate corresponding to the instant message;
sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal;
and when the message extraction certificate sent by the target second terminal is received, sending the instant message to the target second terminal.
2. The method of claim 1, wherein the instant message is encrypted in advance, and wherein
After receiving the instant message sent by the first terminal, the method further comprises the following steps:
when the encrypted information corresponding to the instant message is obtained, the encrypted information and first user information corresponding to the first terminal are stored in an associated mode;
when the first user information sent by the target second terminal is received, sending the encrypted information to the target second terminal so that the target second terminal obtains the instant message based on the encrypted information; and the first user information is sent to the target second terminal by the first terminal.
3. The method of claim 2, wherein the encryption information comprises key information; and
the instant message is encrypted by the first terminal based on the following steps:
responding to the first user information, which is detected to be successful in logging in the first user, and generating symmetric key information and asymmetric key information corresponding to the first user information; the asymmetric key information comprises an asymmetric public key and an asymmetric private key;
encrypting the instant message using the symmetric key and encrypting the symmetric key using the asymmetric public key;
splicing the instant message encrypted by using the symmetric key and the symmetric key encrypted by using the asymmetric public key to obtain an encrypted message; and
when receiving the message extraction certificate sent by the target second terminal, the sending the instant message to the target second terminal includes:
and sending the encrypted message to the target second terminal.
4. The method according to claim 3, characterized in that the encrypted message is decrypted by the target second terminal based on the following steps:
acquiring the asymmetric public key, and analyzing the asymmetric private key based on the asymmetric public key;
and decrypting the encrypted symmetric key according to the asymmetric private key, and decrypting the encrypted instant message according to the decrypted symmetric key to obtain the instant message.
5. The method according to any of claims 2-4, wherein the instant message is sent by the first terminal after compression based on a preset message data capacity.
6. The method of claim 1, wherein after generating the message extraction credential corresponding to the instant message upon receiving the instant message sent by the first terminal, the method further comprises:
recording the receiving time corresponding to the instant message;
and clearing the instant message and the message extraction voucher when the preset time is reached by taking the receiving moment as a time starting point.
7. An instant messaging method is applied to a first terminal, wherein the first terminal and at least one second terminal are served by the same application server, and the method comprises the following steps:
sending an instant message to the application server and requesting the application server to return a message extraction certificate corresponding to the instant message;
and receiving a message extraction certificate returned by the application server, and sending the message extraction certificate to a target second terminal by using the instant communication server so that the target second terminal obtains the instant message from the application server based on the message extraction certificate.
8. An instant messaging method is applied to a second terminal, wherein the second terminal and at least one first terminal are served by the same application server, and the method comprises the following steps:
receiving a message extraction certificate sent by any one first terminal by using an instant messaging server; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal;
and sending the message extraction certificate to the application server to acquire the instant message.
9. An instant messaging device, applied to an application server, the instant messaging device comprising:
the generation module is used for generating a message extraction certificate corresponding to the instant message when the instant message sent by the first terminal is received;
the first sending module is used for sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal;
and the second sending module is used for sending the instant message to the target second terminal when receiving the message extraction certificate sent by the target second terminal.
10. An instant messaging device, applied to a first terminal, wherein the first terminal and at least one second terminal are served by a same application server, the device comprising:
the request module is used for sending an instant message to the application server and requesting the application server to return a message extraction certificate corresponding to the instant message;
and the message extraction module is used for receiving the message extraction certificate returned by the application server and sending the message extraction certificate to a target second terminal by using the instant communication server so that the target second terminal obtains the instant message from the application server based on the message extraction certificate.
11. An instant messaging device, applied to a second terminal, wherein the second terminal and at least one first terminal are served by the same application server, the device comprising:
the receiving module is used for receiving a message extraction certificate sent by any one first terminal by using an instant messaging server; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal;
and the acquisition module is used for sending the message extraction certificate to the application server to acquire the instant message.
12. An instant messaging system, comprising:
the first terminal is used for sending an instant message to an application server and requesting the application server to return a message extraction certificate corresponding to the instant message; sending the message extraction certificate to a target second terminal by using an instant messaging server;
the application server is used for generating a message extraction certificate corresponding to the instant message when receiving the instant message sent by the first terminal; sending the message extraction certificate to the first terminal so that the first terminal sends the message extraction certificate to a target second terminal by using an instant messaging service terminal; when the message extraction certificate sent by the target second terminal is received, the instant message is sent to the target second terminal;
and the target second terminal is used for receiving the message extraction certificate sent by the first terminal and acquiring the instant message from the application server side based on the message extraction certificate.
13. An electronic device comprising a processor and a memory, the memory storing computer readable instructions that, when executed by the processor, perform the method of any of claims 1-6, claim 7, or claim 8.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6, claim 7 or claim 8.
CN202111544405.8A 2021-12-16 2021-12-16 Instant messaging method, device, electronic equipment and computer readable storage medium Active CN114257562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111544405.8A CN114257562B (en) 2021-12-16 2021-12-16 Instant messaging method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111544405.8A CN114257562B (en) 2021-12-16 2021-12-16 Instant messaging method, device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114257562A true CN114257562A (en) 2022-03-29
CN114257562B CN114257562B (en) 2024-02-06

Family

ID=80795383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111544405.8A Active CN114257562B (en) 2021-12-16 2021-12-16 Instant messaging method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114257562B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745372A (en) * 2022-05-10 2022-07-12 南京酷派软件技术有限公司 File sending method and related equipment
CN115065651A (en) * 2022-07-06 2022-09-16 展讯通信(天津)有限公司 Management method and device of conversation message, electronic equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160373418A1 (en) * 2015-06-17 2016-12-22 Telefonaktiebolaget L M Ericsson (Publ) Method for Enabling a Secure Provisioning of a Credential, and Related Wireless Devices and Servers
CN106302133A (en) * 2016-09-14 2017-01-04 广东欧珀移动通信有限公司 Message synchronization control method and server
CN106612265A (en) * 2015-10-27 2017-05-03 阿里巴巴集团控股有限公司 Instant messaging method and server
CN106886708A (en) * 2015-12-15 2017-06-23 深圳市银信网银科技有限公司 A kind of processing method of extraction information, device and server
CN106886927A (en) * 2015-12-15 2017-06-23 深圳市银信网银科技有限公司 A kind of processing method and processing device, system for extracting voucher
CN109274582A (en) * 2018-09-20 2019-01-25 腾讯科技(武汉)有限公司 Methods of exhibiting, device, equipment and the storage medium of instant communication information
CN110535751A (en) * 2019-08-19 2019-12-03 深圳追一科技有限公司 A kind of message responding method, device, computer equipment and storage medium
CN111818466A (en) * 2020-05-29 2020-10-23 维沃移动通信有限公司 Information sending and receiving method and device, electronic equipment and readable storage medium
CN112437044A (en) * 2020-11-03 2021-03-02 建信金融科技有限责任公司 Instant messaging method and device
CN113343208A (en) * 2021-05-20 2021-09-03 网易(杭州)网络有限公司 Certificate authorization method, device, terminal and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160373418A1 (en) * 2015-06-17 2016-12-22 Telefonaktiebolaget L M Ericsson (Publ) Method for Enabling a Secure Provisioning of a Credential, and Related Wireless Devices and Servers
CN106612265A (en) * 2015-10-27 2017-05-03 阿里巴巴集团控股有限公司 Instant messaging method and server
CN106886708A (en) * 2015-12-15 2017-06-23 深圳市银信网银科技有限公司 A kind of processing method of extraction information, device and server
CN106886927A (en) * 2015-12-15 2017-06-23 深圳市银信网银科技有限公司 A kind of processing method and processing device, system for extracting voucher
CN106302133A (en) * 2016-09-14 2017-01-04 广东欧珀移动通信有限公司 Message synchronization control method and server
CN109274582A (en) * 2018-09-20 2019-01-25 腾讯科技(武汉)有限公司 Methods of exhibiting, device, equipment and the storage medium of instant communication information
CN110535751A (en) * 2019-08-19 2019-12-03 深圳追一科技有限公司 A kind of message responding method, device, computer equipment and storage medium
CN111818466A (en) * 2020-05-29 2020-10-23 维沃移动通信有限公司 Information sending and receiving method and device, electronic equipment and readable storage medium
CN112437044A (en) * 2020-11-03 2021-03-02 建信金融科技有限责任公司 Instant messaging method and device
CN113343208A (en) * 2021-05-20 2021-09-03 网易(杭州)网络有限公司 Certificate authorization method, device, terminal and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745372A (en) * 2022-05-10 2022-07-12 南京酷派软件技术有限公司 File sending method and related equipment
CN115065651A (en) * 2022-07-06 2022-09-16 展讯通信(天津)有限公司 Management method and device of conversation message, electronic equipment and storage medium
CN115065651B (en) * 2022-07-06 2023-09-29 展讯通信(天津)有限公司 Management method and device of dialogue message, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114257562B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN109150499B (en) Method and device for dynamically encrypting data, computer equipment and storage medium
CN111130803B (en) Method, system and device for digital signature
CN113364760A (en) Data encryption processing method and device, computer equipment and storage medium
CN102916869B (en) Instant messaging method and system
CN106254327A (en) Information processor and method
CN106067874B (en) It is a kind of by the method for data record to server end, terminal and server
CN109450777B (en) Session information extraction method, device, equipment and medium
CN114257562B (en) Instant messaging method, device, electronic equipment and computer readable storage medium
CN104660589A (en) Method and system for controlling encryption of information and analyzing information as well as terminal
CN113572743B (en) Data encryption and decryption methods and devices, computer equipment and storage medium
CN106878324B (en) Short message authentication method, short message authentication server and terminal
CN114900304B (en) Digital signature method and apparatus, electronic device, and computer-readable storage medium
CN106161224B (en) Method for interchanging data, device and equipment
CN110690956A (en) Bidirectional authentication method and system, server and terminal
CN115225672B (en) End-to-end data transmission method, equipment and medium
CN115396177A (en) Encrypted communication method for realizing efficient communication of web end based on WASM
CN107249002B (en) Method, system and device for improving safety of intelligent electric energy meter
CN108418679B (en) Method and device for processing secret key under multiple data centers and electronic equipment
CN114205142A (en) Data transmission method and device, electronic equipment and storage medium
CN110175471B (en) File storage method and system
CN108513272B (en) Short message processing method and device
CN107070653A (en) A kind of POS transaction encryptions system, method, POSP front servers and POS terminal
CN114650181B (en) E-mail encryption and decryption method, system, equipment and computer readable storage medium
CN103634292A (en) Method and system for communication information transmission
CN115567263A (en) Data transmission management method, data processing method and device

Legal Events

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