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

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

Info

Publication number
CN114257562B
CN114257562B CN202111544405.8A CN202111544405A CN114257562B CN 114257562 B CN114257562 B CN 114257562B CN 202111544405 A CN202111544405 A CN 202111544405A CN 114257562 B CN114257562 B CN 114257562B
Authority
CN
China
Prior art keywords
terminal
message
instant
target
instant messaging
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111544405.8A
Other languages
Chinese (zh)
Other versions
CN114257562A (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

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 Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (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, an electronic device and a computer readable storage medium, wherein one embodiment of the method comprises the following steps: when receiving an instant message sent by a first terminal, generating a message extraction credential 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 utilizing an instant messaging server; and when receiving the message extraction certificate sent by the target second terminal, 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, device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of instant messaging, and in particular, to an instant messaging method, an 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 with each other. The user can install the instant messaging application program in the personal mobile terminal, and then can transmit the instant message to the 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 (Software Development Kit, abbreviated as SDK) to rapidly 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, so that the security of the instant message is reduced.
Disclosure of Invention
An object of the embodiments of the present application is to provide an instant messaging method, an apparatus, 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 the risk of instant message leakage and improving the security of the instant message.
In a first aspect, an embodiment of the present application provides an instant messaging method, applied to an application server, where the method includes: when receiving an instant message sent by a first terminal, generating a message extraction credential 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 utilizing an instant messaging server; and when receiving the message extraction certificate sent by the target second terminal, sending the instant message to the target second terminal.
Optionally, the instant message is encrypted in advance, and after the instant message sent by the first terminal is received, the instant messaging method further includes: when the encrypted information corresponding to the instant message is acquired, the encrypted information and first user information corresponding to the first terminal are stored in a correlated 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 can obtain the instant message based on the encrypted information; and the first user information is sent to the target second terminal by the first terminal. Thus, the instant message can be encrypted in advance and decrypted by the encrypted information, so that the instant message can be transmitted more safely.
Optionally, the encryption information includes key information; and encrypting, by the first terminal, the instant message based on: generating symmetric key information and asymmetric key information corresponding to the first user information in response to detection of successful login of the first user 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 the symmetric key and the symmetric key encrypted by the asymmetric public key to obtain an encrypted message; and sending the instant message to the target second terminal when receiving the message extraction credential sent by the target second terminal, including: and sending the encrypted message to the target second terminal. Thus, by encrypting the instant message, the security of the instant message in the transmission process can be improved.
Optionally, the encrypted message is decrypted by the target second terminal based on the steps of: acquiring the asymmetric public key and resolving the asymmetric private key based on the asymmetric public key; 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. Thus, the decrypted instant message can be obtained conveniently and safely.
Optionally, the instant message is compressed by the first terminal based on a preset message data capacity and then sent. In this way, 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 as to improve the transmission speed.
Optionally, after generating the message extraction credential corresponding to the instant message when receiving the instant message sent by the first terminal, the instant messaging method further includes: recording the receiving time corresponding to the instant message; and taking the receiving time as a time starting point, and clearing the instant message and the message extraction certificate when the preset duration is reached. 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 the 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 credential corresponding to the instant message; and receiving a message extraction credential returned by the application server, and sending the message extraction credential to a target second terminal by utilizing the instant messaging server so that the target second terminal acquires the instant message from the application server based on the message extraction credential.
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 the same application server, and the method includes: receiving a message extraction certificate sent by any first terminal by utilizing 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, where the device includes: the generation module is used for generating a message extraction certificate corresponding to the instant message when receiving the instant message sent by the first terminal; the first sending module is used for sending the message extraction certificate to the first terminal so that the first terminal can send the message extraction certificate to a target second terminal by utilizing an instant messaging server; 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 the same application server, and the device includes: the request module is used for sending the instant message to the application server and requesting the application server to return a message extraction credential corresponding to the instant message; and the message extraction module is used for receiving the message extraction credential returned by the application server and sending the message extraction credential to a target second terminal by utilizing the instant messaging server so that the target second terminal acquires the instant message from the application server based on the message extraction credential.
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 the same application server, and the device includes: the receiving module is used for receiving a message extraction certificate sent by any one of the first terminals by using the 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 so as 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 the application server and requesting the application server to return a message extraction credential corresponding to the instant message; transmitting the message extraction certificate to a target second terminal by utilizing 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 utilizing an instant messaging server; when receiving the message extraction certificate sent by the target second terminal, sending the instant message 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 based on the message extraction certificate.
In an eighth aspect, embodiments of the present application provide an electronic device comprising a processor and a memory storing computer readable instructions which, when executed by the processor, perform the steps of the method as provided in the first, second or third aspects above.
In a ninth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method as provided in the first, second or third aspects above.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof 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 needed 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 should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an instant messaging method according to an embodiment of the present application;
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 of an instant messaging device according to an embodiment of the present application;
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 of an instant messaging system according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device for executing an instant messaging method according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
It should be noted that embodiments or technical features of embodiments in the present application may be combined without conflict.
In the related art, there is a problem that 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, an electronic device 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 credential 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 credential. Therefore, the application server can store not only the user data, but also the instant message, so that the instant message is not exposed 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, where 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, where the terminal device may be, for example, a mobile phone, a tablet computer, etc. The present application is described in detail by taking an application server as an example.
The above related art solutions have drawbacks, which are results obtained by the inventor after practice and careful study, and therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present invention hereinafter for the above problems should be all contributions of the inventor to the present invention in the process of the present invention.
Referring to fig. 1, a flowchart of an instant messaging method applied to an application server according to an embodiment of the present application is shown. 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 credential corresponding to the instant message;
the instant message may be, for example, a text message, a voice message, a picture message, a video message, or other messages in different formats.
The message extraction credential may include, for example, a string, a number, a symbol, or a combination thereof, etc. that may be used to substantially extract information of an instant message.
In some application scenarios, after receiving an instant message input by a user, the first terminal may send the instant message to the application server. 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 with a suffix of an image file format such as. Jpg or. Png.
In these application scenarios, after the application server receives the instant message sent by the first terminal, a message extraction credential corresponding to the instant message one-to-one may be generated. For example, for the instant message "tomorrow about" sent by user a, the application server may generate a 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 utilizing an instant messaging server;
The application server may send the generated message extraction credential to the first terminal, and the first terminal may send the message extraction credential to the target second terminal after receiving the message extraction credential. Here, the first terminal may send the message extraction credential to the instant messaging server through the third party SDK, and then the message extraction credential is forwarded to the target second terminal by the instant messaging server, so that the message extraction credential is quickly and stably transmitted.
In some application scenarios, when the first terminal sends a message to the instant messaging server to extract the credential, the first terminal may send the user information of the target user together, so that the instant messaging server can determine the target second terminal from the plurality of second terminals.
And 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 server, the target second terminal can send the message extraction certificate to the application server, so that the application server returns the instant message uniquely corresponding to the message extraction certificate based on the message extraction certificate.
In this embodiment, through steps 101 to 103, when the third party SDK is used to transmit the instant message, the instant message is 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 alternative implementations, the instant message is encrypted in advance, and after the instant message sent by the first terminal is received, the instant messaging method further includes the steps of:
step 1, when the encryption information corresponding to the instant message is obtained, the encryption information and the first user information corresponding to the first terminal are stored in a correlated mode;
the encrypted message may be used to encrypt or decrypt instant messages.
The first user information may include, for example, an identity of the first user corresponding to the first terminal, where the identity may be, for example, a user name, a login account number, 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 encrypted information corresponding to the instant message. The encryption information can be obtained after the instant message is encrypted by the first terminal, or can be obtained by the application server after the instant message sent by the first terminal is received.
After the application server acquires the encryption information, the encryption information and the first user information can be associated and stored, so that the application server 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, 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.
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 encrypted information based on the first user information. Here, after receiving the information extraction credential fed back by the application server, the first terminal may send the first user information together with the information extraction credential to the target second terminal; the first user information may also be sent separately before or after sending the information extraction credential.
The target second terminal can send the received first user information to the application server, and the application server can find the encryption information through the association relation between the first user information and the encryption information. After receiving the encrypted information, the target second terminal can decrypt the obtained encrypted instant information, and then obtain the instant message.
Through the steps 1 to 2, the instant message can be encrypted in advance, and the instant message can be transmitted more safely through the decryption process of the encrypted message.
In some alternative implementations, the encryption information includes key information; and encrypting, by the first terminal, the instant message based on:
step A, generating symmetric key information and asymmetric key information corresponding to the first user information in response to the detection of successful login of the first user 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 login is successful. Here, the symmetric key information described above may be generated by, for example, a sm4 block cipher algorithm.
In these application scenarios, the application server may also generate corresponding asymmetric key information together through the first user information. Here, the asymmetric key information described above 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, since the sm4 block cipher algorithm is used for encrypting the instant message, the instant message may 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 symmetric key is encrypted by adopting the sm2 encryption algorithm, so that the safe transmission of the symmetric key can be protected, and the sm2 encryption algorithm is only used once, so that the mode of combining the sm4 block encryption algorithm and the sm2 encryption algorithm is more efficient.
Step C, splicing the instant message encrypted by the symmetric key and the symmetric key encrypted by 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 one 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 first terminal splices the encrypted instant message with the encrypted symmetric key 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 sign the encrypted message using the asymmetric key and then transmit the encrypted message.
In some alternative implementations, the encrypted message is decrypted by the target second terminal based on:
step a, acquiring the asymmetric public key and resolving the asymmetric private key based on the asymmetric public key;
after receiving the encrypted message, the target second terminal needs to decrypt the encrypted message. In some application scenarios, the target second terminal may obtain the asymmetric public key, so as to resolve the corresponding asymmetric key by using the asymmetric public key. Here, the received encrypted message may be first signed by the asymmetric public key and then received.
In these application scenarios, the asymmetric public key may be sent by the first terminal to the application server, and the target second terminal may be obtained 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, where the process is a prior art and is not described herein.
In some alternative implementations, 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 may satisfy the actually required data capacity.
In some optional implementations, after generating the message extraction credential corresponding to the instant message when the instant message sent by the first terminal is received (step 101 above), the instant messaging method further includes: recording the receiving time corresponding to the instant message; and taking the receiving time as a time starting point, and clearing the instant message and the message extraction certificate when the preset duration is reached.
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 is increased. Therefore, the instant message and the message extraction certificate can be cleared timely. Specifically, the application server may record the receiving time of each instant message, and delete the instant message when the preset duration arrives, so as to relieve the storage pressure of the application server. The predetermined time period may include, for example, a time period of 6 hours, 24 hours, etc., which essentially means that the instant message has failed.
Referring to fig. 2, a flowchart of another instant messaging method according to an embodiment of the present application is shown. In this embodiment, the instant messaging method is applied to a first terminal, where 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 credential corresponding to the instant message;
step 202, receiving a message extraction credential returned by the application server, and sending 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.
The implementation process and the obtained technical effects 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, which are not repeated here.
Referring to fig. 3, a flowchart of another instant messaging method according to an embodiment of the present application is shown. In this embodiment, the instant messaging method is applied to a second terminal, where 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 sent by any one of the first terminals by using an instant messaging server to extract a credential; 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 credential to the application server to obtain the instant message.
The implementation process and the obtained technical effects 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, which are not repeated here.
Referring to fig. 4, a block diagram of an instant messaging device according to an embodiment of the present application is shown, where the instant messaging device may be a module, a program segment, or a code on an electronic device. It should be understood that the apparatus corresponds to the embodiment of the method of fig. 1 described above, and is capable of performing the steps involved in the embodiment of the method of fig. 1, and specific functions of the apparatus may be referred to in the foregoing description, and detailed descriptions thereof are omitted herein as appropriate 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 generating module 401 is configured to generate a message extraction credential corresponding to an instant message when receiving the instant message sent by the first terminal; 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 server; and the second sending module 403 is 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 for: after receiving the instant message sent by the first terminal, when obtaining the encrypted information corresponding to the instant message, storing the encrypted information and the first user information corresponding to the first terminal in a correlated way; 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 can obtain 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 includes key information; and encrypting, by the first terminal, the instant message based on: generating symmetric key information and asymmetric key information corresponding to the first user information in response to detection of successful login of the first user 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 the symmetric key and the symmetric key encrypted by the asymmetric public key to obtain an encrypted message; and the second transmitting 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 the steps of: acquiring the asymmetric public key and resolving the asymmetric private key based on the asymmetric public key; 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 communication device further includes a clearing module, where the clearing module is configured to: after generating a message extraction credential corresponding to the instant message when receiving the instant message sent by the first terminal, recording a receiving moment corresponding to the instant message; and taking the receiving time as a time starting point, and clearing the instant message and the message extraction certificate when the preset duration is reached.
It should be noted that, for convenience and brevity, a person skilled in the art will clearly understand that, for the specific working procedure of the apparatus described above, reference may be made to the corresponding procedure in the foregoing method embodiment, and the description will not be repeated here.
Referring to fig. 5, a block diagram of another instant messaging device provided in an embodiment of the present application is shown, where the instant messaging device may be a module, a program segment, or a code on an electronic device. It should be understood that the apparatus corresponds to the above embodiment of the method of fig. 2, and is capable of performing the steps involved in the embodiment of the method of fig. 2, and specific functions of the apparatus may be referred to in the above description, and detailed descriptions thereof are omitted herein as appropriate to avoid redundancy.
Optionally, the instant messaging device may be applied to a first terminal, where 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; and 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 the 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 convenience and brevity, a person skilled in the art will clearly understand that, for the specific working procedure of the apparatus described above, reference may be made to the corresponding procedure in the foregoing method embodiment, and the description will not be repeated here.
Referring to fig. 6, a block diagram of another instant messaging device provided in an embodiment of the present application is shown, where the instant messaging device may be a module, a program segment, or a code on an electronic device. It should be understood that the apparatus corresponds to the above embodiment of the method of fig. 3, and is capable of executing the steps involved in the embodiment of the method of fig. 3, and specific functions of the apparatus may be referred to in the above description, and detailed descriptions thereof are omitted herein as appropriate to avoid redundancy.
Alternatively, 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 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;
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 convenience and brevity, a person skilled in the art will clearly understand that, for the specific working procedure of the apparatus described above, reference may be made to the corresponding procedure in the foregoing method embodiment, and the description will not be repeated here.
Referring to fig. 7, a block diagram of another instant messaging system according to an embodiment of the present application 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 the application server 702, and request the application server 702 to return a message extraction credential corresponding to the instant message; and sending the message extraction credential to the target second terminal 704 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; transmitting the message extraction credential to the first terminal 701, so that the first terminal 701 transmits the message extraction credential to a target second terminal 704 using an instant messaging server 703; upon receiving the message extraction credential sent by the target second terminal 704, sending the instant message to the target second terminal 704; and a target second terminal 704, 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 convenience and brevity, a person skilled in the art will clearly understand that, for the specific working procedure of the system described above, reference may be made to the corresponding procedure in the foregoing method embodiment, and the description will not be 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 application, 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 to enable direct connection communication for these components. The communication interface 802 of the device in the embodiment of the present application is used to perform signaling or data communication with other node devices. The memory 803 may be a high-speed RAM memory or a nonvolatile memory (non-volatile memory), such as at least one magnetic 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 that, when executed by the processor 801, may perform the method processes described above in fig. 1, 2, or 3.
It will be appreciated that the configuration shown in fig. 8 is merely illustrative, and that the electronic device may also 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 having stored thereon a computer program, which when executed by a processor, may perform a method process performed by an electronic device in a method embodiment as shown in fig. 1, 2 or 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 method embodiments described above, for example, the method may comprise: when receiving an instant message sent by a first terminal, generating a message extraction credential 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 utilizing an instant messaging server; and when receiving the message extraction certificate sent by the target second terminal, 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 manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
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 foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (13)

1. An instant messaging method is characterized by being applied to an application server, and comprises the following steps:
when receiving an instant message sent by a first terminal, generating a message extraction credential 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 utilizing an instant messaging server; when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together so that the instant messaging server determines a target second terminal from a plurality of second terminals;
And when receiving the message extraction certificate sent by the target second terminal, sending the instant message to the target second terminal.
2. The method of claim 1, wherein the instant message is pre-encrypted, and
after the instant message sent by the first terminal is received, the method further comprises:
when the encrypted information corresponding to the instant message is acquired, the encrypted information and first user information corresponding to the first terminal are stored in a correlated 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 can obtain 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 steps of:
generating symmetric key information and asymmetric key information corresponding to the first user information in response to detection of successful login of the first user 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 the symmetric key and the symmetric key encrypted by the asymmetric public key to obtain an encrypted message; and
and when receiving the message extraction certificate sent by the target second terminal, sending the instant message to the target second terminal, wherein the method comprises the following steps:
and sending the encrypted message to the target second terminal.
4. A method according to any of claims 2-3, characterized in that the instant message is sent by the first terminal after compression based on a preset message data capacity.
5. The method of claim 1, wherein upon the receiving the instant message sent by the first terminal, after generating a message extraction credential corresponding to the instant message, the method further comprises:
recording the receiving time corresponding to the instant message;
and taking the receiving time as a time starting point, and clearing the instant message and the message extraction certificate when the preset duration is reached.
6. An instant messaging method, which is characterized in that the 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 credential corresponding to the instant message;
receiving a message extraction credential returned by the application server, and sending the message extraction credential to a target second terminal by utilizing an instant messaging server so that the target second terminal obtains the instant message from the application server based on the message extraction credential;
when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together, so that the instant messaging server determines a target second terminal from a plurality of second terminals.
7. An instant messaging method, which is characterized in that the 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 first terminal by utilizing an instant messaging server; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal; when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together so that the instant messaging server determines a target second terminal from a plurality of second terminals;
And sending the message extraction certificate to the application server to acquire the instant message.
8. An instant messaging device, applied to an application server, comprising:
the generation module is used for generating a message extraction certificate corresponding to the instant message when receiving the instant message sent by the first terminal;
the first sending module is used for sending the message extraction certificate to the first terminal so that the first terminal can send the message extraction certificate to a target second terminal by utilizing an instant messaging server; when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together so that the instant messaging server determines a target second terminal from a plurality of second terminals;
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.
9. An instant messaging device, applied to a first terminal, where the first terminal and at least one second terminal are served by the same application server, the device comprising:
The request module is used for sending the instant message to the application server and requesting the application server to return a message extraction credential corresponding to the instant message;
the message extraction module is used for receiving a message extraction credential returned by the application server and sending the message extraction credential to a target second terminal by utilizing the instant messaging server so that the target second terminal obtains the instant message from the application server based on the message extraction credential; when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together, so that the instant messaging server determines a target second terminal from a plurality of second terminals.
10. An instant messaging device, applied to a second terminal, the second terminal and at least one first terminal being served by a same application server, the device comprising:
the receiving module is used for receiving a message extraction certificate sent by any one of the first terminals by using the instant messaging server; the message extraction certificate is generated by the application server according to the instant message sent by the first terminal; when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together so that the instant messaging server determines a target second terminal from a plurality of second terminals;
And the acquisition module is used for sending the message extraction certificate to the application server so as to acquire the instant message.
11. An instant messaging system, comprising:
the first terminal is used for sending an instant message to the application server and requesting the application server to return a message extraction credential corresponding to the instant message; transmitting the message extraction certificate to a target second terminal by utilizing an instant messaging server; when the first terminal sends a message extraction certificate to the instant messaging server, the first terminal sends user information of a target user together so that the instant messaging server determines a target second terminal from a plurality of second terminals;
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 utilizing an instant messaging server; when receiving the message extraction certificate sent by the target second terminal, sending the instant message 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 based on the message extraction certificate.
12. An electronic device comprising a processor and a memory storing computer readable instructions that, when executed by the processor, perform the method of any one of claims 1-5, claim 6, or claim 7.
13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, runs the method according to any one of claims 1-5, claim 6 or claim 7.
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 CN114257562A (en) 2022-03-29
CN114257562B true 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)

Families Citing this family (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
CN115065651B (en) * 2022-07-06 2023-09-29 展讯通信(天津)有限公司 Management method and device of dialogue message, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107924437A (en) * 2015-06-17 2018-04-17 瑞典爱立信有限公司 Method and associated wireless devices and server for the security provisions for making it possible to realize voucher

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN114257562A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
CN113364760A (en) Data encryption processing method and device, computer equipment and storage medium
CN114257562B (en) Instant messaging method, device, electronic equipment and computer readable storage medium
US20180124023A1 (en) Method, system and apparatus for storing website private key plaintext
CN105634737B (en) Data transmission method, terminal and system
US20150134959A1 (en) Instant Communication Method and System
CN101707772A (en) Identification method based on NFC and system
CN113572743B (en) Data encryption and decryption methods and devices, computer equipment and storage medium
CN105959281B (en) File encryption transmission method and device
US20180083935A1 (en) Method and system for secure sms communications
CN104836784A (en) Information processing method, client, and server
CN110690956A (en) Bidirectional authentication method and system, server and terminal
CN109391473B (en) Electronic signature method, device and storage medium
CN108418679B (en) Method and device for processing secret key under multiple data centers and electronic equipment
JP2007266674A (en) Method of transferring file
CN108513272B (en) Short message processing method and device
CN103634292A (en) Method and system for communication information transmission
CN114726597B (en) Data transmission method, device, system and storage medium
CN107623571B (en) Handshake processing method, client and server
CN104243291A (en) Instant messaging method and system thereof capable of guaranteeing safety of user communication content
CN112769783A (en) Data transmission method, cloud server, receiving end and sending end
KR20130109560A (en) Encryption method of database of mobile communication device
CN112995210A (en) Data transmission method and device and electronic equipment
JP2018042081A (en) Data transmitting/receiving method and sensing system
CN115865530B (en) File management method, file management system and computer storage medium
CN114765595B (en) Chat message display method, chat message sending device, electronic equipment and media

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