Message sharing method and apparatus, electronic device, and storage medium

By encrypting message data on a first server and decrypting it in a second application, the security problem of transmitting private messages between different applications is solved, achieving both security and effectiveness in message transmission.

WO2025261425A1PCT designated stage Publication Date: 2025-12-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101935
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-20
Filing Date
2025-06-19
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

When different applications directly transmit private messages, the effectiveness and security of message sharing cannot be guaranteed.

Method used

The message data is encrypted by the first server and sent to the first application. Upon receiving a decryption request, the decrypted data is returned to the second application, which then shares the data with the recipient via the second server.

Benefits of technology

It effectively ensures the security of message transmission between different applications and prevents messages from being tampered with during transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101935_26122025_PF_FP_ABST
    Figure CN2025101935_26122025_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a message sharing method and apparatus, an electronic device, and a storage medium, relating to the technical field of Internet. The method comprises: receiving a message encryption request sent by a first application of a first terminal, wherein the message encryption request comprises message data; encrypting the message data to obtain encrypted data; sending the encrypted data to the first application, such that the first application transmits the object identifier of a sharing object and the encrypted data to a second application of the first terminal, the first application being different from the second application; receiving a message decryption request sent by the second application of the first terminal; and in response to the message decryption request, returning decrypted data to the second application, such that on the basis of the decrypted data and by means of a second server, the second application shares decrypted message data with the sharing object corresponding to the object identifier. The security of message sharing between different applications can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Message sharing methods, devices, electronic devices and storage media

[0001] This application claims priority to Chinese Patent Application No. 2024108061543, filed on June 20, 2024, entitled “Message Sharing Method, Apparatus, Electronic Device and Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of Internet technology, and more specifically, to a message sharing method, apparatus, electronic device, and storage medium. Background Technology

[0003] With the development of computer technology, more and more applications are being developed and used, and different applications can share various message contents. Currently, different applications can directly share messages through inter-process communication (IPC).

[0004] However, for messages with privacy concerns, such as conversations with privacy issues, the effectiveness and security of message sharing cannot be guaranteed when messages are directly transmitted between different applications. Summary of the Invention

[0005] The purpose of this application is to provide a message sharing method, apparatus, and electronic device that can solve the security problem of message transmission between different applications. The technical solution provided in this disclosure is as follows:

[0006] On one hand, embodiments of this application provide a message sharing method applied to a first server, the method comprising:

[0007] Receive a message encryption request sent by a first application of a first terminal; wherein the message encryption request includes message data;

[0008] The message data is encrypted to obtain encrypted data;

[0009] The encrypted data is sent to the first application, so that the first application transmits the object identifier of the shared object and the encrypted data to the second application of the first terminal; the first application is different from the second application.

[0010] Receive a message decryption request sent by the second application of the first terminal;

[0011] In response to the message decryption request, decrypted data is returned to the second application, so that the second application can share the decrypted message data to the sharing object corresponding to the object identifier through the second server based on the decrypted data.

[0012] On the other hand, embodiments of this application provide a message sharing method, applied to a first application of a first terminal, including:

[0013] In response to a message sharing operation, a message encryption request is sent to a first server; wherein the message encryption request includes message data;

[0014] The system receives encrypted data returned by the first server in response to the message encryption request; the encrypted data is obtained by the first server encrypting the message data.

[0015] The encrypted data and the object identifier of the sharing object are sent to the second application, so that the second application can obtain the decrypted message data through the first server based on the encrypted data, and share the message data to the sharing object corresponding to the object identifier through the second server. The first application and the second application are different.

[0016] On the other hand, embodiments of this application provide a message sharing device, the device comprising:

[0017] The first receiving module is configured to receive a message encryption request sent by a first application of the first terminal; wherein the message encryption request includes message data;

[0018] The first encryption module is used to encrypt the message data to obtain encrypted data;

[0019] A first sending module is configured to send the encrypted data to the first application, so that the first application transmits the object identifier of the sharing object and the encrypted data to a second application of the first terminal; the first application is different from the second application;

[0020] The first sharing module is used to receive a message decryption request sent by the second application of the first terminal; and in response to the message decryption request, return decrypted data to the second application, so that the second application can share the decrypted message data to the sharing object corresponding to the object identifier through the second server based on the decrypted data.

[0021] On the other hand, embodiments of this application provide a message sharing device, the device comprising:

[0022] The second sending module is used to send a message encryption request to the first server in response to a message sharing operation; wherein the message encryption request includes message data;

[0023] The second receiving module is used to receive encrypted data returned by the first server in response to the message encryption request; the encrypted data is obtained by the first server encrypting the message data;

[0024] The second sharing module is used to send the encrypted data and the object identifier of the sharing object to the second application, so that the second application can obtain the decrypted message data through the first server based on the encrypted data, and share the message data to the sharing object corresponding to the object identifier through the second server. The first application is different from the second application.

[0025] On the other hand, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method provided in any optional embodiment of this application.

[0026] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in any optional embodiment of this application.

[0027] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the methods provided in any optional embodiment of this application. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0029] Figure 1 is a schematic diagram of the application environment of a message sharing method provided in an example;

[0030] Figure 2 is a flowchart illustrating a message sharing method provided in an embodiment of this application;

[0031] Figure 3 is a schematic diagram of the interface of a message sharing page provided in an example of this application;

[0032] Figure 4 is a schematic diagram of the sharing page provided in an example of this application;

[0033] Figure 5 is a schematic diagram of a message sharing scheme provided in an example of this application;

[0034] Figure 6 is a schematic diagram of a message sharing scheme provided in an example of this application;

[0035] Figure 7 is a flowchart illustrating a message sharing method provided in an embodiment of this application;

[0036] Figure 8 is a schematic diagram of a message sharing device provided in an embodiment of this application;

[0037] Figure 9 is a schematic diagram of a message sharing device provided in an embodiment of this application;

[0038] Figure 10 is a schematic diagram of the structure of an electronic device to which this application embodiment applies. Detailed Implementation

[0039] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.

[0040] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.” When describing multiple (two or more) items, if the relationship between the multiple items is not explicitly defined, the multiple items can refer to one, several or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A includes A1 or A2 or A3, or it can be implemented as parameter A includes at least two of the three items A1, A2 and A3.

[0041] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0042] The solutions provided in this application involve technologies such as message sharing, which are specifically illustrated through the following embodiments.

[0043] The following description of several optional embodiments illustrates the technical solutions provided in this application and the technical effects produced by these solutions. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0044] In the specific embodiments of this application, any data related to the object, such as message data, requires the object's permission or consent when applied to specific products or technologies. Furthermore, the collection, use, and processing of this data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if any of the aforementioned object-related data is involved in the embodiments of this application, this data must be obtained with the object's authorization and consent, and in accordance with the relevant laws, regulations, and standards of the country and region.

[0045] The message sharing method provided in this application embodiment can be executed by any computer device. Optionally, it can be executed by a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0046] Figure 1 is a schematic diagram of the application environment of the message sharing method provided in this application embodiment. The application environment may include a first server 101, a first terminal 102, a second server 103, and at least one second terminal 104. The first terminal 102 includes a first client and a second client; the first client is a client of a first application, and the second client is a client of a second application. The second terminal 104 also includes a second client. Specifically, the first server 101 receives a message encryption request sent by the first client of the first terminal 102; the message encryption request includes message data to be shared; the first server 101 encrypts the message data to obtain encrypted data; the first server 101 sends the encrypted data to the first client, so that the first client transmits the object identifier of the sharing object and the encrypted data to the second client of the first terminal; the first server 101 receives a message decryption request sent by the second client of the first terminal, and returns decrypted data to the second client in response to the message decryption request, so that the second client shares the decrypted message data through the second server 103 to the sharing object corresponding to the object identifier. The sharing object may include the second client in the first terminal and the second client in the second terminal.

[0047] Those skilled in the art will understand that a server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. A terminal can be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, laptop computer, digital broadcast receiver, MID (Mobile Internet Device), PDA (Personal Digital Assistant), desktop computer, smart home appliance, in-vehicle terminal (such as in-vehicle navigation terminal, in-vehicle computer, etc.), smart speaker, smartwatch, etc. Terminals and servers can be directly or indirectly connected via wired or wireless communication, but are not limited to these methods. Embodiments of this invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving. Specific applications can be determined based on actual application needs and are not limited here.

[0048] The terminal (also referred to as a user terminal or user device) can be a smartphone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device (e.g., smart speaker), wearable electronic device (e.g., smartwatch), in-vehicle terminal, smart home appliance (e.g., smart TV), AR / VR device, aircraft, etc., but is not limited to these. Embodiments of this invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0049] Figure 2 shows a flowchart of a message sharing method provided in an embodiment of this application. Taking the first server as the executing entity as an example, the message sharing method provided in this application may include the following steps:

[0050] Step S201: Receive a message encryption request sent by the first application of the first terminal.

[0051] The message encryption request includes message data.

[0052] In some embodiments, step S201 may receive a message encryption request sent by a first client of a first terminal, wherein the first client is a client of a first application, and the message data sharing object is an object of a second application.

[0053] It should be noted that the object to be shared is an object of the second application, but the terminal to be shared is the terminal corresponding to the second application, not necessarily the first terminal.

[0054] For example, if a sharing object shares a message with a target object in application B on a first terminal through application A on a terminal, the target object receives and views the message based on its own terminal.

[0055] It should be noted that the first and second applications are not limited to chat applications, but both the first and second applications contain the ability to send messages between different objects.

[0056] Specifically, message data can be determined through a selection action by the sharing object in the client of the first application.

[0057] In the specific implementation process, the first client can display a content selection page for sharing. The sharing object selects the message data to be shared through the content selection page and then selects to share the message data, as shown in Figure 3. On the message sharing page 301, the sharing object can select to share the message to the recipient in the first application through the first client, or it can select to share the message to the recipient in the second application, i.e., forwarding to application B as shown in the figure. If the sharing object selects to share the message to the second application, the first client automatically generates a message encryption request based on the sharing object's action of selecting to share the message and sends the message encryption request to the first server.

[0058] Understandably, if the sharing object chooses to share the message to the sharing object in the first application, then message encryption is not required.

[0059] Step S202: Encrypt the message data to obtain encrypted data.

[0060] Specifically, different encryption methods can be used to encrypt different message data, such as key hashing, symmetric encryption, asymmetric encryption, digital signatures, and so on.

[0061] The same encryption method can be used for different message data, but with different encryption information. For example, different message data can all use a key, but different message data can correspond to different keys.

[0062] The specific encryption process for message data will be explained in more detail below.

[0063] In the specific implementation process, before encrypting the message data, the validity of the login status of the first application and the correctness of the message source of the message data can be verified first. That is, the first server determines that the first application is logged in and that the message source of the message data is the first application before encrypting the message.

[0064] Step S203: Send encrypted data to the first application so that the first application can pass the object identifier of the shared object and the encrypted data to the second application of the first terminal.

[0065] Specifically, encrypted data can be sent to a second client, which is a client of a second application.

[0066] Specifically, the encrypted message transmission from the first application to the second application takes place within the same first terminal and can be achieved through inter-process communication methods within the first terminal.

[0067] In practice, the first application transmits encrypted data to the second application, which prevents the message from being tampered with during transmission and effectively ensures the security of message transmission.

[0068] Step S204: Receive a message decryption request sent by the second application of the first terminal;

[0069] Step S205: In response to the message decryption request, decrypted data is returned to the second application, so that the second application can share the decrypted message data to the sharing object corresponding to the object identifier through the second server based on the decrypted data.

[0070] The decryption request may include encrypted data, in which case the first server can decrypt the encrypted data to obtain the decrypted message data. Alternatively, the decryption request may only include the first identifier, which represents the identifier corresponding to the message data and the identifier corresponding to the encryption method. In this case, the first server can send the corresponding decryption method to the second application, so that the second application can perform the decryption process based on the decryption method. The specific process of returning the decrypted data will be further explained in detail below.

[0071] Specifically, after the second application on the first terminal obtains the decrypted message data, the sharing recipient can confirm the sharing on the second application on the first terminal. At this time, the second application then shares the message data to the recipient of the second application through the second server corresponding to the second application.

[0072] As shown in Figure 4, the sharing page 401 is the interface of the second application in the first terminal of the sharing object. If the sharing object confirms the sharing through the interface of the second application, it can select the object to be shared in the interface of the second application, and then share the message data to the object to be shared in the second application, such as user a in the figure.

[0073] In the aforementioned message sharing method, when a first application on a first terminal wants to share a message with a sharing object in a second application, the first application sends a message encryption request to a first server, which encrypts the message data to obtain encrypted data. The first application then receives the encrypted data sent by the first server and transmits the encrypted data to the second application on the first terminal. The second application then sends a message decryption request to the first server and obtains the decrypted message data from the first server. In this way, the first and second applications transmit encrypted data during message sharing, which can effectively ensure the security of message transmission between different applications.

[0074] The above embodiments will be further explained below with reference to examples.

[0075] As shown in Figure 5, in one example, the message sharing method of this application may include:

[0076] The first client (i.e., application A shown in the figure) sends a message encryption request to the first server (i.e., background service C shown in the figure); the message encryption request includes the message data to be shared;

[0077] The first server encrypts the message data to obtain encrypted data;

[0078] The first server sends encrypted data to the first client;

[0079] The first client transmits encrypted data to the second client (i.e., application B shown in the figure) of the first terminal;

[0080] The second client sends a message decryption request to the first server, and the message decryption request includes encrypted data;

[0081] The first server decrypts the encrypted data to obtain the decrypted data, which is the decrypted message data.

[0082] The first server sends the decrypted data to the second client;

[0083] The second client shares message data with the sharing object through the second server.

[0084] In some possible implementations, step S202, which encrypts the message data to obtain encrypted data, may include:

[0085] Select an encryption method for the message data from a variety of candidate encryption methods; encrypt the message data based on the selected encryption method to obtain encrypted data.

[0086] The encrypted data also includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method.

[0087] Specifically, the first server can be used to encrypt messages sent by various applications, and different messages may correspond to different encryption methods. Therefore, a first identifier is needed to mark different messages and encryption methods so that when a message decryption request is received, the corresponding decryption method can be determined for the corresponding encrypted message.

[0088] The message decryption request includes a first identifier; in response to the message decryption request, decrypted data is returned to the second application, including:

[0089] From a variety of candidate encryption methods, query the decryption method corresponding to the first identifier;

[0090] The decrypted data is returned to the second application based on the decryption method.

[0091] Specifically, the first server can pre-store multiple candidate encryption methods. When a message encryption request is received, it can randomly select an encryption method to encrypt the message data and associate the identifier of the message data with the identifier of the selected encryption method. When a message decryption request is received, it can determine the corresponding encryption method based on the first identifier carried in the message decryption request, thereby determining the corresponding decryption method. The first server can decrypt the encrypted data based on the decryption method, or it can send the decryption method to the second application, which will then decrypt the encrypted data based on the decryption method.

[0092] The following will explain the specific encryption process of the message in more detail with reference to the embodiments.

[0093] In some possible implementations, the candidate encryption methods correspond to multiple security levels; the message encryption request also includes at least one of a first identifier of a first application, a second identifier of a second application, and security level selection information for the message data.

[0094] Specifically, selecting an encryption method for message data from multiple candidate encryption methods can include:

[0095] (1) Select a security level from multiple candidate encryption methods based on at least one of the first application type of the first application, the second application type corresponding to the second identifier, and security level selection information for message data;

[0096] (2) Determine the encryption method corresponding to the selected security level from a variety of candidate encryption methods.

[0097] Specifically, the correspondence between different sharing applications (i.e., the first application), different shared applications (i.e., the second application), and security levels can be pre-set. It can also combine the information selected by the sharing object for the security level, that is, the sharing object can choose the target security level by itself, and the first server can determine the corresponding encryption method based on the determined target security level or the target security level selected by the sharing object.

[0098] In some possible implementations, the message encryption request may also include a first identifier of the first application and a second identifier of the second application;

[0099] The message data is encrypted to obtain encrypted data, including:

[0100] Determine the first message format of the first application corresponding to the first identifier, and determine the second message format of the second application corresponding to the second identifier;

[0101] If the first message format is the same as the second message format, the message data is directly encrypted to obtain encrypted data.

[0102] Specifically, if the first message format is the same as the second message format, there is no need to convert the message data format. The message data can be directly encrypted, and the decrypted message data can be directly shared in the second application.

[0103] In some possible implementations, encrypting the message data to obtain encrypted data further includes:

[0104] If the first message format is different from the second message format, then the data format of the message data shall be converted according to the second message format;

[0105] Encrypt the message data that has been converted to a different data format to obtain encrypted data.

[0106] Specifically, if the first message format differs from the second message format, the message data needs to be converted to the second message format. This converted message data can then be displayed in the second application for easy viewing by the recipient.

[0107] In the above embodiments, by comparing the first message format of the first application and the second message format of the second application, if the first message format and the second message format are the same, the message data is directly encrypted to obtain encrypted data; if the first message format and the second message format are different, the data format of the message data is converted according to the second message format, and then the message data with the converted data format is encrypted to obtain encrypted data, so that the recipient can view the message data normally through the second application.

[0108] In some possible implementations, the message encryption request may also include a second identifier of the second application;

[0109] The message data is encrypted to obtain encrypted data, including:

[0110] Determine the second message format for the second application type corresponding to the second identifier;

[0111] The message data is converted to the second message format; the converted message data is then encrypted to obtain the encrypted data. Specifically, it is also possible to directly convert the message data into a target format corresponding to the second message format (i.e., convert the message data to the second message format) without determining whether the first message format of the first application and the second message format of the second application are the same. This ensures that the recipient can view the message data normally through the second application.

[0112] In some possible implementations, the message data is encrypted to obtain encrypted data, including:

[0113] Convert message data into a preset message format;

[0114] Encrypt message data in a preset message format to obtain encrypted data.

[0115] The preset message format can be a universal format applicable to all applications.

[0116] Specifically, it eliminates the need to determine whether the first message format of the first application is the same as the second message format of the second application, or to determine the second message format of the second application. The message data format can be directly converted into a common preset message format. This ensures that the recipient can view the message data normally through the second application, while also saving the process of determining the first or second message format, thus improving the efficiency of message format conversion.

[0117] The following will describe the specific process of decrypting encrypted data with reference to examples.

[0118] In some possible implementations, the message decryption request includes encrypted data;

[0119] Returning decrypted data to a second application in response to a message decryption request may include:

[0120] The encrypted data is decrypted based on the message decryption request to obtain the decrypted message data;

[0121] The decrypted message data is returned to the second application as decrypted data.

[0122] In other words, the first server can receive encrypted data sent by the second application, directly decrypt the encrypted data to obtain the decrypted message data, and then return the message data to the second application.

[0123] In some possible implementations, the message decryption request includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method of the message data.

[0124] Based on the message decryption request, decrypted data is returned to the second application, enabling the second application to share the decrypted message data to the sharing object via the second server, including:

[0125] Query the decryption method corresponding to the first identifier;

[0126] The decryption method is sent as decryption data to the second application, so that the second application can decrypt the encrypted data based on the decryption method, obtain the decrypted message data, and share the message data to the sharing object through the second server.

[0127] In other words, the first server can receive the first identifier sent by the second application, query the decryption method corresponding to the first identifier, return the decryption method to the second application, and the second application can decrypt the encrypted data based on the decryption method to obtain the decrypted message data.

[0128] In some possible implementations, the encrypted data and object identifier are sent from the first application to the second application in the following manner:

[0129] (1) Send the first verification request to the second application.

[0130] The first verification request includes the first identifier of the first application.

[0131] Specifically, the first application launches the second application through the operating system interface of the first terminal, and passes the first verification request to the second application.

[0132] (2) Receive the second verification request sent by the second application.

[0133] The second verification request includes a second identifier of the second application; the second verification request is sent to the first application after the second application passes the first legality verification based on the first identifier.

[0134] (3) Perform a second legality check on the second application based on the second identifier. If the second legality check passes, send the encrypted data and object identifier to the second application.

[0135] Specifically, before the first application sends encrypted data to the second application, the first and second applications need to verify each other.

[0136] In the specific implementation process, the first application first sends a first verification request to the second application, sending the first application's first identifier to the second application; the second application verifies the legitimacy of the first application based on the first identifier; if the first legitimacy verification passes, the second application then sends its second identifier to the first application, and similarly, the first application verifies the legitimacy of the second application based on the second identifier. If the second legitimacy verification also passes, then secure communication can be established between the first application and the second application, that is, the two applications successfully handshake. The first application then sends encrypted data and the identifier of the object to be shared to the second application through inter-process communication.

[0137] To further illustrate the message sharing methods described above, the following examples will be provided.

[0138] As shown in Figure 6, in one example, the message sharing method of this application may include:

[0139] The first client (i.e., application A shown in the figure) sends a message encryption request to the first server (i.e., the backend C shown in the figure); the message encryption request includes the message data to be shared;

[0140] The first server verifies the validity of the login status of the first application in the first client and the correctness of the message content;

[0141] If the verification is successful, the first server will convert the message data into a preset message format and encrypt the message data in the preset message format to obtain encrypted data.

[0142] The first server sends encrypted data to the first client;

[0143] The first client sends the first identifier of the first application to the second client, and the second client performs a legality verification on the first application;

[0144] If the validity of the first application passes the verification, the second client sends the second identifier of the second application to the first client;

[0145] The first client performs a validity check on the second application;

[0146] If the legitimacy verification of the second application also passes, the first client will transmit the encrypted data to the second client of the first terminal (i.e., application B shown in the figure);

[0147] The second client sends a message decryption request to the first server, and the message decryption request includes encrypted data;

[0148] The first server decrypts the encrypted data to obtain the decrypted data, which is the decrypted message data.

[0149] The first server sends the decrypted data to the second client;

[0150] The second client shares message data with the sharing object through the second server.

[0151] Understandably, in the above process, if any of the verifications—the validity of the login status of the first application and the correctness of the message content, the legitimacy of the first application, and the legitimacy of the second application—fail, the message sharing process can be terminated.

[0152] In the aforementioned message sharing method, when a first application on a first terminal wants to share a message with a sharing object in a second application, the first application sends a message encryption request to a first server, which encrypts the message data to obtain encrypted data. The first application then receives the encrypted data sent by the first server and transmits the encrypted data to the second application on the first terminal. The second application then sends a message decryption request to the first server and obtains the decrypted message data from the first server. In this way, the first and second applications transmit encrypted data during message sharing, which can effectively ensure the security of message transmission between different applications.

[0153] Furthermore, by comparing the first message format of the first application with the second message format of the second application, if the first message format and the second message format are the same, the message data is directly encrypted to obtain encrypted data; if the first message format and the second message format are different, the message data is converted into a target format corresponding to the second message format, and then the message data in the target format is encrypted to obtain encrypted data, so that the recipient can view the message data normally through the second application.

[0154] Furthermore, it is possible to directly convert the message data into a target format corresponding to the second message format without needing to determine whether the first message format of the first application is the same as the second message format of the second application. This ensures that the recipient can view the message data normally through the second application.

[0155] Furthermore, it eliminates the need to determine whether the first message format of the first application is the same as the second message format of the second application, nor does it require determining the second message format of the second application. The message data can be directly converted into a common preset message format, ensuring that the recipient can view the message data normally through the second application, while also saving the process of determining the first or second message format, thus improving the efficiency of message format conversion.

[0156] As shown in Figure 7, in some possible implementations, a message sharing method is provided, wherein a first application applied to a first terminal includes:

[0157] Step S701: In response to the message sharing operation, a message encryption request is sent to the first server.

[0158] The message encryption request includes message data to be shared; the first client is a client of the first application, and the message data is shared with an object of the second application; the first application is different from the second application.

[0159] Specifically, the object to be shared is an object of the second application, but the object to be shared uses the terminal corresponding to the second application, which is not necessarily the first terminal.

[0160] It should be noted that the first and second applications are not limited to chat applications, but both the first and second applications contain the ability to send messages between different objects.

[0161] Step S702: Receive encrypted data returned by the first server in response to the message encryption request.

[0162] The encrypted data is obtained by encrypting the message data by the first server.

[0163] Specifically, different encryption methods can be used to encrypt different message data, such as key hashing, symmetric encryption, asymmetric encryption, digital signatures, and so on.

[0164] The same encryption method can be used for different message data, but with different encryption information. For example, different message data can all use a key, but different message data can correspond to different keys.

[0165] In the specific implementation process, before encrypting the message data, the first server can first verify the validity of the login status of the first application and the correctness of the message source of the message data. That is, the first server determines that the first application is logged in and that the message source of the message data is the first application before encrypting the message.

[0166] Step S703: Send the encrypted data and the object identifier of the sharing object to the second application, so that the second application can obtain the decrypted message data through the first server based on the encrypted data, and share the message data to the sharing object corresponding to the object identifier through the second server.

[0167] This can involve sending encrypted data and the object identifier of the shared object to a second client, which is a client of a second application.

[0168] Specifically, the encrypted message transmission from the first application to the second application takes place within the same first terminal and can be achieved through inter-process communication methods within the first terminal.

[0169] In practice, the first application transmits encrypted data to the second application, which prevents the message from being tampered with during transmission and effectively ensures the security of message transmission.

[0170] In the aforementioned message sharing method, when a first application on a first terminal wants to share a message with a sharing object in a second application, the first application sends a message encryption request to a first server, which encrypts the message data to obtain encrypted data. The first application then receives the encrypted data sent by the first server and transmits the encrypted data to the second application on the first terminal. The second application then sends a message decryption request to the first server and obtains the decrypted message data from the first server. In this way, the first and second applications transmit encrypted data during message sharing, which can effectively ensure the security of message transmission between different applications.

[0171] In some possible implementations, the message data is encrypted by the first server in the following manner:

[0172] Select an encryption method for the message data from a variety of candidate encryption methods, and encrypt the message data based on the selected encryption method to obtain encrypted data.

[0173] The encrypted data also includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method.

[0174] Specifically, the first server can be used to encrypt messages sent by various applications, and different messages may correspond to different encryption methods. Therefore, a first identifier is needed to mark different messages and encryption methods so that when a message decryption request is received, the corresponding decryption method can be determined for the corresponding encrypted message.

[0175] Based on the encrypted data, the decrypted message data is obtained through the first server, including:

[0176] Send a message decryption request to the first server; the message decryption request includes a first identifier; receive the decryption data returned by the first server; the decryption data is obtained by the first server from multiple candidate encryption methods by querying the decryption method corresponding to the first identifier and based on the decryption method;

[0177] Obtain the decrypted message data based on the decrypted data.

[0178] Specifically, the first server can pre-store multiple candidate encryption methods. When a message encryption request is received, it can randomly select an encryption method to encrypt the message data and associate the identifier of the message data with the identifier of the selected encryption method. When a message decryption request is received, it can determine the corresponding encryption method based on the first identifier carried in the message decryption request, thereby determining the corresponding decryption method. The first server can decrypt the encrypted data based on the decryption method, or it can send the decryption method to the second client, which will then decrypt the encrypted data based on the decryption method.

[0179] In some possible implementations, the candidate encryption methods correspond to multiple security levels; the message encryption request also includes at least one of a first identifier of a first application, a second identifier of a second application, and security level selection information for the message data;

[0180] The encryption method for the message data is selected from a variety of candidate encryption methods, including:

[0181] Based on at least one of the first application type of the first application, the second application type corresponding to the second identifier, and the security level selection information for the message content, a security level is selected from multiple candidate encryption methods;

[0182] The encryption method corresponding to the selected security level is determined from a variety of candidate encryption methods.

[0183] Specifically, the correspondence between different sharing applications (i.e., the first application), different shared applications (i.e., the second application), and security levels can be pre-set. It can also combine the information selected by the sharing object for the security level, that is, the sharing object can choose the target security level by itself, and the first server can determine the corresponding encryption method based on the determined target security level or the target security level selected by the sharing object.

[0184] In some possible implementations, the message encryption request may also include a first identifier of the first application and a second identifier of the second application;

[0185] The first server encrypts the message data using the following method:

[0186] Determine the first message format of the first application corresponding to the first identifier, and determine the second message format of the second application corresponding to the second identifier;

[0187] If the first message format is the same as the second message format, the message data is directly encrypted to obtain encrypted data.

[0188] Specifically, if the first message format is the same as the second message format, there is no need to convert the message data format. The message data can be directly encrypted, and the decrypted message data can be directly shared in the second application.

[0189] In some possible implementations, the encryption of message data by the first server also includes:

[0190] If the first message format is different from the second message format, the message data is converted into a target format corresponding to the second message format (i.e., the data format of the message data is converted according to the second message format).

[0191] The message data in the target format is encrypted to obtain encrypted data.

[0192] Specifically, if the first message format is different from the second message format, the message data needs to be converted into a target format that corresponds to the second message format of the second application type. In this way, the converted message data can be displayed in the second application so that the recipient can view it.

[0193] In some possible implementations, the message encryption request may also include a second identifier of the second application;

[0194] The first server encrypts the message data using the following method:

[0195] Determine the second message format for the second application type corresponding to the second identifier;

[0196] Convert the message data according to the second message format;

[0197] The message data in the second message format is encrypted to obtain encrypted data.

[0198] Specifically, it is also possible to directly convert the message data into a target format corresponding to the second message format without checking whether the first message format of the first application is the same as the second message format of the second application. This ensures that the recipient can view the message data normally through the second application.

[0199] In some possible implementations, the first server encrypts the message data in the following manner:

[0200] The message data is converted into a preset message format, and the message data in the preset message format is encrypted to obtain encrypted data.

[0201] The preset message format can be a universal format applicable to all applications.

[0202] Specifically, it eliminates the need to determine whether the first message format of the first application is the same as the second message format of the second application, or to determine the second message format of the second application. The message data can be directly converted into a common preset message format, ensuring that the recipient can view the message data normally through the second application, while also saving the process of determining the first or second message format, thus improving the efficiency of message format conversion.

[0203] In some possible implementations, the message decryption request includes encrypted data;

[0204] Encrypted data is decrypted using the following method:

[0205] The encrypted data is decrypted by the first server based on the message decryption request to obtain the decrypted message data;

[0206] The decrypted message data is returned to the second application as decrypted data.

[0207] Specifically, the first server may receive encrypted data sent by the second application, directly decrypt the encrypted data to obtain the decrypted message data, and then return the message data to the second application.

[0208] In some possible implementations, the message decryption request includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method of the message data;

[0209] Encrypted data is decrypted using the following methods:

[0210] The decryption method corresponding to the first identifier is queried through the first server;

[0211] The decryption method is sent as decryption data to the second application, so that the second application can decrypt the encrypted data based on the decryption method, obtain the decrypted message data, and share the message data to the sharing object through the second server.

[0212] Specifically, the first server can receive a first identifier sent by the second application, query the decryption method corresponding to the first identifier, return the decryption method to the second application, and the second application can decrypt the encrypted data based on the decryption method to obtain the decrypted message data.

[0213] In some possible implementations, the encrypted data and object identifier are sent to the second application in the following manner:

[0214] (1) Send the first verification request to the second application.

[0215] The first verification request includes the first identifier of the first application.

[0216] Specifically, the first application launches the second application through the operating system interface of the first terminal, and passes the first verification request to the second application.

[0217] (2) Receive the second verification request sent by the second application.

[0218] The second verification request includes a second identifier of the second application; the second verification request is sent to the first application after the second application passes the first legality verification based on the first identifier.

[0219] (3) Perform a second legality check on the second application based on the second identifier. If the second legality check passes, send the encrypted data and object identifier to the second application.

[0220] Specifically, before the first application sends encrypted data to the second application, the first and second applications need to verify each other.

[0221] In the specific implementation process, the first application first sends a first verification request to the second application, sending the first application's first identifier to the second application; the second application verifies the legitimacy of the first application based on the first identifier; if the first legitimacy verification passes, the second application then sends its second identifier to the first application, and similarly, the first application verifies the legitimacy of the second application based on the second identifier. If the second legitimacy verification also passes, then secure communication can be established between the first application and the second application, that is, the two applications successfully handshake. The first application then sends encrypted data and the identifier of the object to be shared to the second application through inter-process communication.

[0222] In the aforementioned message sharing method, when a first application on a first terminal wants to share a message with a sharing object in a second application, the first application sends a message encryption request to a first server, which encrypts the message data to obtain encrypted data. The first application then receives the encrypted data sent by the first server and transmits the encrypted data to the second application on the first terminal. The second application then sends a message decryption request to the first server and obtains the decrypted message data from the first server. In this way, the first and second applications transmit encrypted data during message sharing, which can effectively ensure the security of message transmission between different applications.

[0223] Furthermore, by comparing the first message format of the first application with the second message format of the second application, if the first message format and the second message format are the same, the message data is directly encrypted to obtain encrypted data; if the first message format and the second message format are different, the message data is converted into a target format corresponding to the second message format, and then the message data in the target format is encrypted to obtain encrypted data, so that the recipient can view the message data normally through the second application.

[0224] Furthermore, it is possible to directly convert the message data into a target format corresponding to the second message format without needing to determine whether the first message format of the first application is the same as the second message format of the second application. This ensures that the recipient can view the message data normally through the second application.

[0225] Furthermore, it eliminates the need to determine whether the first message format of the first application is the same as the second message format of the second application, nor does it require determining the second message format of the second application. The message data can be directly converted into a common preset message format, ensuring that the recipient can view the message data normally through the second application, while also saving the process of determining the first or second message format, thus improving the efficiency of message format conversion.

[0226] As shown in Figure 8, in some possible implementations, a message sharing device is provided, including:

[0227] The first receiving module 801 is used to receive a message encryption request sent by a first application of the first terminal; wherein the message encryption request includes message data;

[0228] The first encryption module 802 is used to encrypt the message data to obtain encrypted data;

[0229] The first sending module 803 is used to send the encrypted data to the first application, so that the first application transmits the object identifier of the sharing object and the encrypted data to the second application of the first terminal; the first application and the second application are different.

[0230] The first sharing module 804 is used to receive a message decryption request sent by the second application of the first terminal; and in response to the message decryption request, return decrypted data to the second application, so that the second application can share the decrypted message data to the sharing object corresponding to the object identifier through the second server based on the decrypted data.

[0231] In some possible implementations, when the first encryption module 802 encrypts the message data to obtain encrypted data, it specifically performs the following functions:

[0232] Select an encryption method for the message data from a variety of candidate encryption methods;

[0233] The message data is encrypted using the selected encryption method to obtain encrypted data; the encrypted data further includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method;

[0234] The message decryption request includes a first identifier; when the first sharing module 804 returns decrypted data to the second application in response to the message decryption request, it is specifically used for:

[0235] From a variety of candidate encryption methods, query the decryption method corresponding to the first identifier;

[0236] The decrypted data is returned to the second application based on the decryption method.

[0237] In some possible implementations, the candidate encryption methods correspond to multiple security levels; the message encryption request also includes at least one of a first identifier of a first application, a second identifier of a second application, and security level selection information for the message data;

[0238] When selecting an encryption method for message data from multiple candidate encryption methods, the first encryption module 802 is specifically used for:

[0239] Based on at least one of the first application type of the first application, the second application type corresponding to the second identifier, and security level selection information for message data, a security level is selected from multiple candidate encryption methods;

[0240] The encryption method corresponding to the selected security level is determined from the candidate encryption methods.

[0241] In some possible implementations, the message encryption request may also include a first identifier of the first application and a second identifier of the second application;

[0242] When the first encryption module 802 encrypts the message data to obtain encrypted data, it specifically performs the following functions:

[0243] Determine the first application type corresponding to the first identifier, and determine the second application type corresponding to the second identifier;

[0244] If the first application type is the same as the second application type, the message data is directly encrypted to obtain encrypted data.

[0245] In some possible implementations, when encrypting message data to obtain encrypted data, the first encryption module 802 is also used to:

[0246] Convert the data format of the message data according to the second message format;

[0247] The message data, which has been converted to a different data format, is encrypted to obtain the encrypted data.

[0248] In some possible implementations, the message encryption request may also include a second identifier of the second application;

[0249] When the first encryption module 802 encrypts the message data to obtain encrypted data, it specifically performs the following functions:

[0250] Determine the second application type corresponding to the second identifier;

[0251] Convert the data format of the message data according to the second message format.

[0252] The message data, which has been converted to a different data format, is encrypted to obtain the encrypted data.

[0253] In some possible implementations, when the first encryption module 802 encrypts the message data to obtain encrypted data, it specifically performs the following functions:

[0254] The message data is converted into a preset message format; the message data in the preset message format is then encrypted to obtain the encrypted data.

[0255] In some possible implementations, the message decryption request includes encrypted data;

[0256] When the first sharing module 804 returns decrypted data to the second application based on the message decryption request, it is specifically used for:

[0257] The encrypted data is decrypted based on the message decryption request to obtain the decrypted message data;

[0258] The decrypted message data is returned to the second application as decrypted data.

[0259] In some possible implementations, the message decryption request includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method of the message data;

[0260] When the first sharing module 804 returns decrypted data to the second application in response to a message decryption request, so that the second application can share the decrypted message data to the sharing object through the second server based on the decrypted data, it is specifically used for:

[0261] Query the decryption method corresponding to the first identifier;

[0262] The decryption method is sent as decryption data to the second application, so that the second application can decrypt the encrypted data based on the decryption method, obtain the decrypted message data, and share the message data to the sharing object through the second server.

[0263] In some possible implementations, the encrypted data and object identifier are sent from the first application to the second application in the following manner:

[0264] Send the first identifier of the first application to the second application;

[0265] Receive a verification request sent by a second application; the verification request includes a second identifier of the second application; the verification request is sent to the first application by the second application after the first application passes the first validity verification based on the first identifier;

[0266] The second application is subjected to a second legitimacy check based on the second identifier. If the second legitimacy check passes, the encrypted data is sent to the second application.

[0267] In the aforementioned message sharing device, when a first application on a first terminal wants to share a message with a sharing target of a second application, the first application sends a message encryption request to a first server, which encrypts the message data to obtain encrypted data. The first application then receives the encrypted data sent by the first server and transmits the encrypted data to the second application on the first terminal. The second application then sends a message decryption request to the first server and obtains the decrypted message data through the first server. In this way, the first application and the second application transmit encrypted data during the message sharing process, which can effectively ensure the security of message transmission between different applications.

[0268] Furthermore, by comparing the first message format of the first application with the second message format of the second application, if the first message format and the second message format are the same, the message data is directly encrypted to obtain encrypted data; if the first message format and the second message format are different, the message data is converted into a target format corresponding to the second message format, and then the message data in the target format is encrypted to obtain encrypted data, so that the recipient can view the message data normally through the second application.

[0269] Furthermore, it is possible to directly convert the message data into a target format corresponding to the second message format without needing to determine whether the first message format of the first application is the same as the second message format of the second application. This ensures that the recipient can view the message data normally through the second application.

[0270] Furthermore, it eliminates the need to determine whether the first message format of the first application is the same as the second message format of the second application, nor does it require determining the second message format of the second application. The message data can be directly converted into a common preset message format, ensuring that the recipient can view the message data normally through the second application, while also saving the process of determining the first or second message format, thus improving the efficiency of message format conversion.

[0271] As shown in Figure 9, in some possible implementations, a message sharing device is provided, including:

[0272] The second sending module 901 is used to send a message encryption request to the first server in response to a message sharing operation; wherein the message encryption request includes message data;

[0273] The second receiving module 902 is used to receive encrypted data returned by the first server in response to the message encryption request; the encrypted data is obtained by the first server encrypting the message data;

[0274] The second sharing module 903 is used to send the encrypted data and the object identifier of the sharing object to the second application, so that the second application can obtain the decrypted message data through the first server based on the encrypted data, and share the message data to the sharing object corresponding to the object identifier through the second server. The first application is different from the second application.

[0275] In some possible implementations, the message data is encrypted by the first server in the following manner:

[0276] An encryption method for the message data is determined from multiple candidate encryption methods, and the message data is encrypted based on the encryption method to obtain encrypted data; the encrypted data also includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method;

[0277] Based on the encrypted data, the decrypted message data is obtained through the first server, including:

[0278] Send a message decryption request to the first server; the message decryption request includes a first identifier; receive the decryption data returned by the first server; the decryption data is obtained by the first server from multiple candidate encryption methods by querying the decryption method corresponding to the first identifier and based on the decryption method;

[0279] Obtain the decrypted message data based on the decrypted data.

[0280] In some possible implementations, the candidate encryption methods correspond to multiple security levels; the message encryption request also includes at least one of a first identifier of a first application, a second identifier of a second application, and security level selection information for the message data;

[0281] Encryption methods for message data are determined from a variety of candidate encryption methods, including:

[0282] The target security level is determined based on at least one of the first application type of the first application, the second application type corresponding to the second identifier, and security level selection information for the message content.

[0283] The encryption method corresponding to the target security level is determined from the candidate encryption methods.

[0284] In some possible implementations, the message encryption request may also include a first identifier of the first application and a second identifier of the second application;

[0285] The first server encrypts the message data using the following method:

[0286] Determine the first application type corresponding to the first identifier, and determine the second application type corresponding to the second identifier;

[0287] If the first application type is the same as the second application type, the message data is directly encrypted to obtain encrypted data.

[0288] In some possible implementations, the encryption of message data by the first server also includes:

[0289] If the first application type is different from the second application type, the message data will be converted into the target format corresponding to the second application type.

[0290] Encrypt the message data in the target format to obtain encrypted data.

[0291] In some possible implementations, the message encryption request may also include a second identifier of the second application;

[0292] The first server encrypts the message data using the following method:

[0293] Determine the second application type corresponding to the second identifier;

[0294] Transform the message data into a target format corresponding to the second application type;

[0295] The message data in the target format is encrypted to obtain encrypted data.

[0296] In some possible implementations, the first server encrypts the message data in the following manner:

[0297] The message data is converted into a preset message format, and the message data in the preset message format is encrypted to obtain encrypted data.

[0298] In some possible implementations, the message decryption request includes encrypted data;

[0299] Encrypted data is decrypted using the following method:

[0300] The encrypted data is decrypted by the first server based on the message decryption request to obtain the decrypted message data;

[0301] The decrypted message data is returned to the second application as decrypted data.

[0302] In some possible implementations, the message decryption request includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method of the message data;

[0303] Encrypted data is decrypted using the following methods:

[0304] The decryption method corresponding to the first identifier is queried through the first server;

[0305] The decryption method is sent as decryption data to the second application, so that the second application can decrypt the encrypted data based on the decryption method, obtain the decrypted message data, and share the message data to the sharing object through the second server.

[0306] In some possible implementations, the encrypted data and object identifier are sent to the second application in the following manner:

[0307] Send the first identifier of the first application to the second application;

[0308] Receive a verification request sent by a second application; the verification request includes a second identifier of the second application; the verification request is sent to the first application by the second application after the first application passes the first validity verification based on the first identifier;

[0309] The second application is subjected to a second legitimacy check based on the second identifier. If the second legitimacy check passes, the encrypted data is sent to the second application.

[0310] In the aforementioned message sharing device, when a first application on a first terminal wants to share a message with a sharing target of a second application, the first application sends a message encryption request to a first server, which encrypts the message data to obtain encrypted data. The first application then receives the encrypted data sent by the first server and transmits the encrypted data to the second application on the first terminal. The second application then sends a message decryption request to the first server and obtains the decrypted message data through the first server. In this way, the first application and the second application transmit encrypted data during the message sharing process, which can effectively ensure the security of message transmission between different applications.

[0311] Furthermore, by comparing the first message format of the first application with the second message format of the second application, if the first message format and the second message format are the same, the message data is directly encrypted to obtain encrypted data; if the first message format and the second message format are different, the message data is converted into a target format corresponding to the second message format, and then the message data in the target format is encrypted to obtain encrypted data, so that the recipient can view the message data normally through the second application.

[0312] Furthermore, it is possible to directly convert the message data into a target format corresponding to the second message format without needing to determine whether the first message format of the first application is the same as the second message format of the second application. This ensures that the recipient can view the message data normally through the second application.

[0313] Furthermore, it eliminates the need to determine whether the first message format of the first application is the same as the second message format of the second application, nor does it require determining the second message format of the second application. The message data can be directly converted into a common preset message format, ensuring that the recipient can view the message data normally through the second application, while also saving the process of determining the first or second message format, thus improving the efficiency of message format conversion.

[0314] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.

[0315] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program stored in the memory, it can implement the method in any optional embodiment of this application.

[0316] In one optional embodiment, an electronic device is provided, as shown in FIG10. The electronic device 4000 shown in FIG10 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this disclosure.

[0317] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0318] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in Figure 10, but this does not indicate that there is only one bus or one type of bus.

[0319] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.

[0320] The memory 4003 is used to store computer programs that execute embodiments of the present disclosure, and is controlled by the processor 4001 to execute them. The processor 4001 is used to execute the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.

[0321] Based on the same principle as the method provided in the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.

[0322] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.

[0323] It should be noted that the terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.

[0324] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.

[0325] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.

Claims

1. A message sharing method, applied to a first server, the method comprising: Receive a message encryption request sent by a first application of a first terminal; wherein the message encryption request includes message data; The message data is encrypted to obtain encrypted data; The encrypted data is sent to the first application, so that the first application transmits the object identifier of the shared object and the encrypted data to the second application of the first terminal; the first application is different from the second application. Receive a message decryption request sent by the second application of the first terminal; In response to the message decryption request, decrypted data is returned to the second application, so that the second application can share the decrypted message data to the sharing object corresponding to the object identifier through the second server based on the decrypted data.

2. The method according to claim 1, wherein, The process of encrypting the message data to obtain encrypted data includes: Select an encryption method for the message data from a variety of candidate encryption methods; The message data is encrypted using the selected encryption method to obtain encrypted data; the encrypted data further includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method; The message decryption request includes the first identifier; returning decrypted data to the second application in response to the message decryption request includes: From a variety of candidate encryption methods, query the decryption method corresponding to the first identifier; Based on the decryption method, the decrypted data is returned to the second application.

3. The method according to claim 2, wherein, The candidate encryption methods correspond to multiple security levels; the message encryption request also includes at least one of the following: a first identifier of the first application, a second identifier of the second application, and security level selection information for the message data; Selecting an encryption method for the message data from a variety of candidate encryption methods includes: Based on at least one of the first application type of the first application, the second application type corresponding to the second identifier, and security level selection information for message data, a security level is selected from multiple candidate encryption methods; From the multiple candidate encryption methods, determine the encryption method corresponding to the selected security level.

4. The method according to any one of claims 1-3, wherein, The message encryption request also includes a first identifier of the first application and a second identifier of the second application; The process of encrypting the message data to obtain encrypted data includes: Determine the first message format of the first application corresponding to the first identifier, and determine the second message format of the second application corresponding to the second identifier; If the first message format is the same as the second message format, the message data is directly encrypted to obtain encrypted data.

5. The method according to claim 4, wherein, The step of encrypting the message data to obtain encrypted data further includes: If the first message format is different from the second message format, then the data format of the message data is converted according to the second message format; The message data, which has been converted to a different data format, is encrypted to obtain the encrypted data.

6. The method according to any one of claims 1-5, wherein, The message encryption request also includes a second identifier of the second application; The process of encrypting the message data to obtain encrypted data includes: Determine the second message format for the second application type corresponding to the second identifier; Convert the data format of the message data according to the second message format; The message data, which has been converted to a different data format, is encrypted to obtain the encrypted data.

7. The method according to any one of claims 1-6, wherein, The process of encrypting the message data to obtain encrypted data includes: Convert the data format of the message data into a preset message format; The message data in the preset message format is encrypted to obtain the encrypted data.

8. The method according to any one of claims 1-7, wherein, The message decryption request includes the encrypted data; The response to the message decryption request, returning decrypted data to the second application, includes: The encrypted data is decrypted based on the message decryption request to obtain the decrypted message data; The decrypted message data is returned to the second application as the decrypted data.

9. The method according to any one of claims 1-8, wherein, The message decryption request includes a first identifier; the first identifier is used to represent the identifier corresponding to the message data and the identifier corresponding to the encryption method of the message data. The step of returning decrypted data to the second application in response to the message decryption request, so that the second application can share the decrypted message data to the sharing object through the second server based on the decrypted data, includes: Query the decryption method corresponding to the first identifier; The decryption method is sent as the decryption data to the second application, so that the second application can decrypt the encrypted data based on the decryption method to obtain the decrypted message data, and then share the message data to the sharing object through the second server.

10. The method according to any one of claims 1-9, wherein, The encrypted data and the object identifier are sent from the first application to the second application in the following manner: Send a first verification request to the second application; the first verification request includes a first identifier of the first application; Receive the second verification request sent by the second application; The second verification request includes a second identifier of the second application; the second verification request is sent to the first application after the second application passes the first validity verification based on the first identifier. The second application is subjected to a second legitimacy check based on the second identifier. If the second legitimacy check passes, the encrypted data and the object identifier are sent to the second application.

11. A message sharing method, applied to a first application on a first terminal, the method comprising: In response to a message sharing operation, a message encryption request is sent to a first server; wherein the message encryption request includes message data; The system receives encrypted data returned by the first server in response to the message encryption request; the encrypted data is obtained by the first server encrypting the message data. The encrypted data and the object identifier of the sharing object are sent to the second application, so that the second application can obtain the decrypted message data through the first server based on the encrypted data, and share the message data to the sharing object corresponding to the object identifier through the second server. The first application and the second application are different.

12. A message sharing device, wherein, The device includes: The first receiving module is configured to receive a message encryption request sent by a first application of the first terminal; wherein the message encryption request includes message data; The first encryption module is used to encrypt the message data to obtain encrypted data; A first sending module is configured to send the encrypted data to the first application, so that the first application transmits the object identifier of the sharing object and the encrypted data to a second application of the first terminal; the first application is different from the second application; The first sharing module is used to receive a message decryption request sent by the second application of the first terminal; and in response to the message decryption request, return decrypted data to the second application, so that the second application can share the decrypted message data to the sharing object corresponding to the object identifier through the second server based on the decrypted data.

13. A message sharing device, wherein, The device includes: The second sending module is used to send a message encryption request to the first server in response to a message sharing operation; wherein the message encryption request includes message data; The second receiving module is used to receive encrypted data returned by the first server in response to the message encryption request; the encrypted data is obtained by the first server encrypting the message data; The second sharing module is used to send the encrypted data and the object identifier of the sharing object to the second application, so that the second application can obtain the decrypted message data through the first server based on the encrypted data, and share the message data to the sharing object corresponding to the object identifier through the second server. The first application is different from the second application.

14. An electronic device comprising a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the method of any one of claims 1 to 11.

15. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1 to 11.

16. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Method, device and system for authentication of application program

    CN109086596A

  • Message forwarding method and device between clients, and terminal

    CN112087362A

  • Message sharing method and device, electronic equipment and storage medium

    CN117061110A

  • Application Program Authorization Method, Terminal, and Server

    US20190334718A1

  • Information processing method, first terminal, second terminal, server and system

    WO2017128870A1