Message transmission method, device, electronic device and storage medium

By building a Moments contract on the blockchain and encrypting message delivery using public and private key pairs, the problem of user information leakage in the centralized Moments system is solved, and decentralized and secure message delivery is achieved.

CN115695365BActive Publication Date: 2025-04-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211358878.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2025-04-01
Estimated Expiration
2042-11-01

AI Technical Summary

Technical Problem

The existing centralized circle of friends system is prone to leakage of user information, and centralized service providers can obtain user information and information, resulting in user privacy leakage.

Method used

By building a circle of friends contract on the blockchain and generating a public-private key pair, the encrypted message delivery is realized. User information and messages are encrypted through public-private keys during delivery, ensuring that only authorized users can decrypt and view.

Benefits of technology

Decentralized messaging is realized, reducing the risk of user information leakage, improving the security of user privacy information, and reducing the cost of messaging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695365B_ABST
    Figure CN115695365B_ABST
Patent Text Reader

Abstract

The present application provides a message transmission method, device, electronic device and storage medium. The method includes: in response to receiving a registration request from a first user, constructing a friend circle contract on a blockchain according to the registration request, and generating a first public-private key pair and a second public-private key pair; wherein the registration request includes: a list of target users; in response to receiving a message publishing request from a first user, obtaining an original message according to the message publishing request, encrypting the original message in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message; in response to receiving a message acquisition request from a second user, determining whether the second user exists in the target user list according to the message acquisition request; in response to determining that the second user exists in the target user list, decrypting the encrypted message using the second public-private key pair to obtain the target message, and sending the target message to the second user. The purpose of decentralization is achieved, and the security of user information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a message transmission method, device, electronic device and storage medium. Background Art

[0002] In the related technologies, the current circle of friends systems are usually based on services provided by centralized systems, that is, all users register their accounts in the centralized system, and add their personal friends to the centralized system, and use centralized service systems such as WeChat to control the transmission of messages. However, there is a problem that the service system is too centralized, which easily leads to user information leakage. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a message transmission method, device, electronic device and storage medium.

[0004] Based on the above objectives, in a first aspect, the present application provides a message delivery method, comprising:

[0005] In response to receiving a registration request from a first user, a friend circle contract is constructed on a blockchain according to the registration request, and a first public-private key pair and a second public-private key pair are generated; wherein the registration request includes: a list of target users;

[0006] In response to receiving a message publishing request from a first user, obtaining an original message according to the message publishing request, and encrypting the original message in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message;

[0007] In response to receiving a message acquisition request from a second user, determining whether the second user exists in the target user list according to the message acquisition request;

[0008] In response to determining that the second user exists in the target user list, the encrypted message is decrypted using the second public-private key pair to obtain a target message, and the target message is sent to the second user.

[0009] In a possible implementation, the registration request includes: first user information;

[0010] In response to receiving a registration request from the first user, constructing a friend circle contract on the blockchain according to the registration request, including:

[0011] In response to receiving a registration request from a first user, obtaining first user information according to the registration request, and generating a first account address according to the first user information;

[0012] The target user list is obtained according to the registration request, and the friend circle contract is constructed on the blockchain according to the target user list and the first account address.

[0013] In a possible implementation, the target user list includes: user information corresponding to a plurality of users;

[0014] The method further comprises:

[0015] In response to receiving a target user list adding request from the first user, acquiring new user information according to the target user list adding request; wherein the target user list adding request includes: new user information;

[0016] Determine whether the newly added user information exists in all the user information in the target user list;

[0017] In response to the new user information not existing in all the user information in the target user list, the new user information is added to the target user list.

[0018] In a possible implementation, the target user list includes: user information corresponding to a plurality of users;

[0019] The method further comprises:

[0020] In response to receiving a target user list deletion request from the first user, obtaining deletion user information according to the target user list deletion request; wherein the target user list deletion request includes: deleting user information;

[0021] Determine whether the deleted user information exists in all the user information in the target user list;

[0022] In response to the deletion user information existing in all the user information in the target user list, the user information corresponding to the deletion user information in the target user list is deleted.

[0023] In a possible implementation, the message publishing request includes: an original message; the first public-private key pair includes: a first private key; the second public-private key pair includes: a second private key;

[0024] The method of receiving a message publishing request from a first user in response, obtaining an original message according to the message publishing request, and encrypting the original message in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message includes:

[0025] In response to receiving a message publishing request from a first user, obtaining the original message according to the message publishing request;

[0026] Encrypting the original message using the first private key to determine the target message;

[0027] The target message is encrypted using the second private key to determine the encrypted message.

[0028] In a possible implementation manner, after encrypting the target message by using the second private key to determine the encrypted message, the method further includes:

[0029] The encrypted message is stored in a message storage service, and a target message publishing event is published in the friend circle contract; wherein the target message publishing event is used to indicate that the first user publishes the encrypted message in the friend circle contract.

[0030] In a possible implementation, the first public-private key pair includes: a first public key; the second public-private key pair includes: a second public key;

[0031] After the original message is encrypted in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message, the method further includes:

[0032] In response to receiving a message update request from the first user, obtaining an update log and an update identifier according to the message update request, and determining the encrypted message according to the update identifier; wherein the update identifier is used to indicate the updated encrypted message;

[0033] decrypting the encrypted message using the second public key to determine the target message;

[0034] decrypting the target message using the first public key to determine the original message, and updating the original message according to the update log to determine the updated message;

[0035] encrypting the update message using the first private key to determine the target update message;

[0036] The target update message is encrypted using the second private key to determine the encrypted update message.

[0037] In a possible implementation, the message acquisition request includes: second user information; the target user list includes: user information corresponding to multiple users;

[0038] In response to receiving a message acquisition request from a second user, determining whether the second user exists in the target user list according to the message acquisition request includes:

[0039] In response to receiving a message acquisition request from a second user, acquiring the second user information according to the message acquisition request;

[0040] Determining whether the second user information exists in all the user information in the target user list;

[0041] In response to the second user information being present in all the user information in the target user list, it is determined that the second user is present in the target user list.

[0042] In a possible implementation, the second public-private key pair includes: a second public key;

[0043] In response to determining that the second user exists in the target user list, decrypting the encrypted message using the second public-private key pair to obtain the target message comprises:

[0044] In response to determining that the second user exists in the target user list, establishing a peer-to-peer network connection between the first user and the second user to obtain the second public key;

[0045] The encrypted message is decrypted using the second public key to obtain the target message.

[0046] In a possible implementation, after publishing the target message publishing event in the friend circle contract, the method further includes:

[0047] In response to receiving a monitoring message request from a second user, obtaining the second user information according to the monitoring message request; wherein the monitoring message request includes: the second user information;

[0048] Determining whether the second user information exists in all the user information in the target user list;

[0049] In response to the presence of the second user information in all the user information in the target user list, a monitoring channel is established between the second user and the circle of friends contract so that the second user obtains the target message publishing event through the monitoring channel.

[0050] In a possible implementation, the second public-private key pair includes: a second public key;

[0051] The method further comprises:

[0052] In response to determining that a public key update request from the first user is received, an updated second public key is obtained according to the public key update request, and the second public key is replaced with the updated second public key.

[0053] In a possible implementation, the first public-private key pair includes: a first private key; the second public-private key pair includes: a second private key;

[0054] The method further comprises:

[0055] In response to receiving a restricted message publishing request from the first user, obtaining a restricted user list and an original restricted message according to the restricted message publishing request; wherein the restricted message publishing request includes: the restricted user list and the original restricted message;

[0056] Determine the intersection of the target user list and the restricted user list to determine a visible user list;

[0057] encrypting the original restriction message using the first private key to determine a target restriction message;

[0058] encrypting the target restriction message using the second private key to determine an encrypted restriction message;

[0059] A restricted message publishing event is published to each user in the visible user list; wherein the restricted message publishing event is used to indicate that the first user publishes the encrypted restricted message in the circle of friends contract.

[0060] In a second aspect, the present application provides a message delivery device, including:

[0061] The construction module is configured to, in response to receiving a registration request from a first user, construct a friend circle contract on the blockchain according to the registration request, and generate a first public-private key pair and a second public-private key pair; wherein the registration request includes: a list of target users;

[0062] a publishing module configured to, in response to receiving a message publishing request from a first user, obtain an original message according to the message publishing request, and encrypt the original message in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message;

[0063] a determination module, configured to, in response to receiving a message acquisition request from a second user, determine whether the second user exists in the target user list according to the message acquisition request;

[0064] The acquisition module is configured to, in response to determining that the second user exists in the target user list, decrypt the encrypted message using the second public-private key pair to obtain a target message, and send the target message to the second user.

[0065] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the message transmission method as described in the first aspect is implemented.

[0066] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a computer to execute the message transmission method as described in the first aspect.

[0067] From the above, it can be seen that the message transmission method, device, electronic device and storage medium provided by the present application can construct a circle of friends contract on the blockchain according to the registration request when receiving a registration request from the first user, thereby registering the first user in the circle of friends contract and generating a first public-private key pair and a second public-private key pair. When receiving a message publishing request from the first user, the original message that the first user wants to publish can be obtained according to the message publishing request. In order to provide user privacy security, the original message can be encrypted in sequence using the first public-private key pair and the second public-private key pair, thereby generating an encrypted message, thereby avoiding the problem of user information leakage. Further, when receiving a message acquisition request from the second user, it can be determined whether the second user exists in the target user list set by the first user in the registration request according to the message acquisition request. When it is determined that the second user exists in the target user list, it can be determined that the second user is a friend of the first user, and then the second public-private key pair is used to decrypt the encrypted message to obtain the target message, so that the second user can obtain the target message, thereby realizing decentralized message transmission. Executing message transmission through blockchain can achieve the purpose of decentralization, reduce the cost of message transmission, reduce the risk of user information leakage in the circle of friends, and improve the security of user privacy information. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0069] Figure 1 A schematic diagram of an exemplary flow chart of a message transmission method provided in an embodiment of the present application is shown.

[0070] Figure 2 An exemplary flow chart of a specific embodiment according to the embodiment of the present application is shown.

[0071] Figure 3 A schematic diagram showing an exemplary process of a first user publishing a message according to an embodiment of the present application is shown.

[0072] Figure 4 A schematic diagram of an exemplary structure of a message transmission device provided in an embodiment of the present application is shown.

[0073] Figure 5 A schematic diagram of an exemplary structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0074] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0075] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0076] As described in the background technology section, the current circle of friends systems are generally based on services provided by centralized systems, that is, all users register their accounts in the centralized system, add their personal friends to the centralized system, and use centralized service systems such as WeChat to control the transmission of messages.

[0077] Through research, the applicant found that the centralized circle of friends in the relevant technology has the problem that the service system is too centralized, which easily leads to the leakage of user information. In addition, since the centralized circle of friends can obtain the messages posted by each user and the registered user information, there is also the problem that the provider of the centralized circle of friends can obtain the messages and user information of each user, and even cause the leakage of the user's real life information.

[0078] For this reason, the message transmission method, device, electronic device and storage medium provided by the present application can construct a circle of friends contract on the blockchain according to the registration request when receiving a registration request from the first user, thereby registering the first user in the circle of friends contract and generating a first public-private key pair and a second public-private key pair. When receiving a message publishing request from the first user, the original message that the first user wants to publish can be obtained according to the message publishing request. In order to provide user privacy security, the original message can be encrypted in sequence using the first public-private key pair and the second public-private key pair, thereby generating an encrypted message, thereby avoiding the problem of user information leakage. Further, when receiving a message acquisition request from the second user, it can be determined whether the second user exists in the target user list set by the first user in the registration request according to the message acquisition request. When it is determined that the second user exists in the target user list, it can be determined that the second user is a friend of the first user, and then the second public-private key pair is used to decrypt the encrypted message to obtain the target message, so that the second user can obtain the target message, thereby realizing decentralized message transmission. Executing message transmission through blockchain can achieve the purpose of decentralization, reduce the cost of message transmission, reduce the risk of user information leakage in the circle of friends, and improve the security of user privacy information.

[0079] The message transmission method provided in the embodiment of the present application is described in detail below through specific examples.

[0080] Figure 1 A schematic diagram of an exemplary flow chart of a message transmission method provided in an embodiment of the present application is shown.

[0081] refer to Figure 1 , a message transmission method provided in an embodiment of the present application specifically includes the following steps:

[0082] S102: In response to receiving a registration request from the first user, construct a circle of friends contract on the blockchain according to the registration request, and generate a first public-private key pair and a second public-private key pair; wherein the registration request includes: a list of target users.

[0083] S104: In response to receiving a message publishing request from the first user, obtaining an original message according to the message publishing request, and encrypting the original message in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message.

[0084] S106: In response to receiving a message acquisition request from a second user, determining whether the second user exists in the target user list according to the message acquisition request.

[0085] S108: In response to determining that the second user exists in the target user list, decrypt the encrypted message using the second public-private key pair to obtain a target message, and send the target message to the second user.

[0086] Figure 2 An exemplary flow chart of a specific embodiment according to the embodiment of the present application is shown.

[0087] refer to Figure 2 In one embodiment, each personal device can represent a user, and the friend circle system can be operated in the form of software in the personal device used by the user. It is determined that when any user (for example, the first user) registers and logs in to the decentralized personal friend circle software, a registration request sent by the first user will be received, wherein the registration request may include the first user information and the target user list. The target user list can be a friend list set by the first user, that is, a trusted user list set by the first user. It can be understood that the purpose of setting the target user list is to enable the friend circle message posted by the first user to be received by users trusted by the first user, thereby ensuring the security of the user's private messages.

[0088] Furthermore, when a registration request is received from a first user, the first user information, such as the first user's account blockchain address, the first user's name, the first user's ID card and other information, can be obtained according to the registration request, and a first account address can be generated according to the first user information. The first account address represents a unique user account corresponding to the first user, and a first public-private key pair and a second public-private key pair can also be generated for encrypting messages posted by the first user.

[0089] Furthermore, the target user list can be obtained according to the registration request, and the friend circle contract can be constructed on the blockchain according to the target user list and the first account address used to uniquely represent the first user. After logging into the friend circle contract, the first user can manage the target user list, that is, his own friend list, in the friend circle contract.

[0090] Specifically, in some embodiments, the target user list may include user information corresponding to multiple users, such as user information such as account addresses and names of friend users. When a target user list addition request is received from a first user, it can be determined that the first user wants to add a friend user to the target user list in the friend circle contract, and the target user list addition request can be parsed to obtain the newly added user information carried by the target user list addition request, such as the account address or name of the newly added user.

[0091] Furthermore, it can be determined whether there is any new user information in the target user list, that is, it can be determined whether the friend user that the first user wants to add to the target user list already exists in the target user list. If it is determined that there is no new user information in the target user list, it proves that the new user information is not in the target user list, and the new user information can be added to the target user list, thereby updating the target user list and expanding the friend list of the first user.

[0092] Furthermore, if it is determined that the new user information already exists in all the user information in the target user list, the new user information is not added repeatedly, and an adding failure notification can be sent to the first user to inform the first user that the new user he wants to add already exists in the target user list.

[0093] In some embodiments, when a target user list deletion request is received from a first user, it can be determined that the first user wants to delete a friend user from the target user list in the friend circle contract, and then the target user list deletion request can be parsed to obtain the deletion user information carried by the target user list deletion request, such as the account address or name of the deleted user.

[0094] Furthermore, it can be determined whether there is deleted user information in all the user information in the target user list, that is, it can be determined whether the friend user that the first user wants to delete in the target user list exists in the target user list. If it is determined that there is deleted user information in all the user information in the target user list, it proves that the deleted user information is in the target user list, and the user information corresponding to the deleted user information in the target user list can be deleted.

[0095] Furthermore, if it is determined that the deleted user information does not exist in all the user information in the target user list, a deletion failure notification may be sent to the first user to inform the first user that the deleted user to be deleted does not originally exist in the target user list.

[0096] Figure 3 A schematic diagram showing an exemplary process of a first user publishing a message according to an embodiment of the present application is shown.

[0097] In some embodiments, reference Figure 3 When a message publishing request is received from the first user, it is determined that the first user will publish a dynamic message in the circle of friends contract, and the message publishing request can be parsed to obtain the original message carried by the message publishing request.

[0098] It should be noted that the first public-private key pair may include a first private key and a first public key, and the second public-private key pair may include a second private key and a second public key. In order to ensure the privacy of the original message posted by the first user and prevent the original message from being maliciously edited or changed, the first private key may be used to encrypt the original message for the first time, and then generate a target message. The message content displayed in the target message may be the same as the original message, but cannot be edited or changed by anyone, that is, the target message can only be viewed.

[0099] Furthermore, in order to ensure that the target message will not be viewed by users other than those trusted by the first user, the target message can be encrypted a second time using the second private key to determine the encrypted message. For example, the encrypted message can be a string of code, and the target message can be hidden in the encrypted state, further ensuring the privacy and security of the message.

[0100] After the target message is encrypted using the second private key, the encrypted message can be stored in the IPFS decentralized storage service (i.e., the message storage service), and a hash value uniquely bound to the encrypted message is generated to identify the encrypted message. In addition, a target message publishing event can be published in the Moments contract, wherein the target message publishing event can be used to identify that the first user has published an encrypted message in the Moments contract. For example, the target message publishing event can be a notification visible only to users in the target user list, which is used to inform users in the target user list that the second user has published a Moments dynamic message.

[0101] Since even users in the target user list cannot directly view the target message protected by the encrypted message, when the first user wants to update or modify the published message, a message update request can be sent. When the message update request from the first user is received, the message update request can be parsed to obtain the update log and update identifier carried by the message update request, and the encrypted message to be updated can be found in the message storage service according to the update identifier. Among them, the update identifier can be used to indicate the updated encrypted message.

[0102] Further, the second public key can be used to decrypt the encrypted message that needs to be updated, thereby determining the target message, and further, the first public key can be used to decrypt the target message, thereby determining the original message that needs to be updated. The content that the first user wants to update is determined based on the update log, and the content that needs to be updated is updated to the original message, thereby determining the update message.

[0103] Furthermore, after the update message is determined, the message can be republished, the update message can be encrypted using the first private key to determine the target update message, and the target update message can be encrypted using the second private key to determine the encrypted update message.

[0104] It is understandable that after the target update message is encrypted using the second private key, the encrypted update message can be stored in the IPFS decentralized storage service (i.e., the message storage service), and a hash value uniquely bound to the encrypted update message is generated to identify the encrypted update message. In addition, a target message publishing event can also be published in the Moments contract, wherein the target message publishing event can be used to identify that the first user has published an encrypted update message in the Moments contract. For example, the target message publishing event can be a notification visible only to users in the target user list, used to inform users in the target user list that the second user has published a Moments dynamic message.

[0105] In some embodiments, when a user (e.g., a second user) wants to view a message posted by a first user, a message acquisition request may be sent. When a message acquisition request sent by a second user is received, the message acquisition request may be parsed to obtain the second user information carried by the message acquisition request, wherein the second user information may be user information such as an account address and name of the second user. Since only users in the target user list (e.g., a friend list) set by the first user can view the message posted by the first user, it may be determined whether the second user information of the second user exists in all the user information in the target user list. If the second user information exists in the target user list, it is determined that the second user is a user trusted by the first user, i.e., a friend user of the first user.

[0106] Furthermore, a peer-to-peer network connection (i.e., a P2P connection) can be established between the first user and the second user, and the first user's second public key can be sent to the second user through the peer-to-peer network connection, so that the second user can decrypt the encrypted message published by the first user according to the second public key, and then obtain the target message and perform a viewing operation. This also makes it impossible for users other than the target user list set by the first user to view any message published by the first user, thereby ensuring the security of the first user's information and the published message.

[0107] Prior to this, since the first user may make changes to the target user list, such as adding or deleting users, the target user list may change. Only when a new user is added to the target user list, the second public key can be obtained by any user in the target user list, and then the encrypted message published by the first user can be decrypted and viewed, which will not affect the privacy security of the first user. However, if some users are deleted from the target user list, then if the second public key is not updated, these deleted users may have obtained the second public key before being deleted. Even if these users are deleted, they can still use the second public key to view the messages subsequently published by the first user, which causes the problem that the privacy security of the first user is affected.

[0108] Therefore, when a public key update request sent by the first user is received, the updated second public key of the first user can be obtained according to the public key update request, and the updated second public key can be used to replace the previous second public key, thereby ensuring that the deleted user cannot continue to view the first user's information or published dynamic messages using the previously obtained second public key.

[0109] It should be noted that after detecting that at least one user information has been deleted from the target user list, the friend circle contract can automatically generate an updated second public key, and while replacing the previous second public key, the updated second public key is sent to the first user, so that the first user can retain the latest second public key.

[0110] It should be noted that after a peer-to-peer network connection is established between the first user and the second user, the first user or the second user can transmit messages or the second public key to each other through the peer-to-peer network connection, wherein an encrypted transmission mode of SSL (also known as Secure Sockets Layer) can be used to ensure the security of the transmitted messages.

[0111] In some embodiments, some messages published by the first user may not be viewed by all users in the target user list, but it is not necessary to delete these users who are not allowed to view individual messages from the target user list. Therefore, when receiving a restricted message publishing request sent by the first user, the restricted message publishing request can be parsed to obtain the restricted user list and the original restricted message carried in the restricted message publishing request. The restricted user list can be a list of users set by the first user who can view the message published this time.

[0112] Further, the intersection of the target user list and the restricted user list is determined, and then the visible user list is determined. The original restricted message is encrypted using the first private key to determine the target restricted message. Further, the target restricted message can be encrypted using the second private key to determine the encrypted restricted message. Since the first user only wants the users in the visible user list to view the target restricted message, a restricted message publishing event can be published to each user in the visible user list. This event can be used to indicate that the first user has published an encrypted restricted message in the Moments contract.

[0113] It should be noted that the visible user list is determined by determining the intersection of the target user list and the restricted user list in order to screen out the risk of leakage of user information and published dynamic messages caused by placing users who are not in the target user list in the visible user list due to the operational error of the first user.

[0114] It is understandable that if at least one user message in the restricted user list is not in the target user list, a confirmation notification can be sent to the first user so that the first user can confirm whether it is necessary to add users outside the visible user list to the visible user list, thereby ensuring the security of user information.

[0115] In some embodiments, after publishing a target message publishing event in a friend circle contract, a user (e.g., a second user) in the target user list can monitor the friend circle of the first user. Specifically, upon receiving a monitoring message request sent by the second user, the monitoring message request can be parsed to obtain the second user information carried by the monitoring message request, and further, it can be determined whether the second user information exists in the user information in the target user list. If it is determined that the second user information exists in the target user list, a monitoring channel can be established between the second user and the friend circle contract, so that the second user can monitor the friend circle of the first user through the monitoring channel, and then obtain the target message publishing event.

[0116] It should be noted that the software reading page of the circle of friends contract can include the following information:

[0117] contract IndividualSocialLifeMsg{

[0118] 1) Personal account (identifies whose friend circle contract it is);

[0119] 2) Contract administrator (user himself, transfer is not supported);

[0120] 3) Friend list (the public key management service determines whether to allow access to the encrypted public key);

[0121] 4) Dynamic message encryption public key version (used to indicate whether the user has recently updated the public key);

[0122] 5) Friend addition and deletion interface (users can add and delete their own friend lists through the interface function);

[0123] 6) Release personal dynamic message interface (users first store the encrypted information on ipfs, and then save the hash of ipfs through the contract, which is convenient for users);

[0124] 7) Query the user's message list;

[0125] 8) Event list (to facilitate other users to understand the user's latest dynamics, including friend change events, latest news release events, etc.)

[0126] }.

[0127] From the above, it can be seen that the message transmission method, device, electronic device and storage medium provided by the present application can construct a circle of friends contract on the blockchain according to the registration request when receiving a registration request from the first user, thereby registering the first user in the circle of friends contract and generating a first public-private key pair and a second public-private key pair. When receiving a message publishing request from the first user, the original message that the first user wants to publish can be obtained according to the message publishing request. In order to provide user privacy security, the original message can be encrypted in sequence using the first public-private key pair and the second public-private key pair, thereby generating an encrypted message, thereby avoiding the problem of user information leakage. Further, when receiving a message acquisition request from the second user, it can be determined whether the second user exists in the target user list set by the first user in the registration request according to the message acquisition request. When it is determined that the second user exists in the target user list, it can be determined that the second user is a friend of the first user, and then the second public-private key pair is used to decrypt the encrypted message to obtain the target message, so that the second user can obtain the target message, thereby realizing decentralized message transmission. Executing message transmission through blockchain can achieve the purpose of decentralization, reduce the cost of message transmission, reduce the risk of user information leakage in the circle of friends, and improve the security of user privacy information.

[0128] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0129] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0130] Figure 4 A schematic diagram of an exemplary structure of a message transmission device provided in an embodiment of the present application is shown.

[0131] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a message transmission device.

[0132] refer to Figure 4 The message delivery device includes: a construction module, a publishing module, a determination module and an acquisition module; wherein,

[0133] The construction module is configured to, in response to receiving a registration request from a first user, construct a friend circle contract on the blockchain according to the registration request, and generate a first public-private key pair and a second public-private key pair; wherein the registration request includes: a list of target users;

[0134] a publishing module configured to, in response to receiving a message publishing request from a first user, obtain an original message according to the message publishing request, and encrypt the original message in sequence using the first public-private key pair and the second public-private key pair to determine an encrypted message;

[0135] a determination module, configured to, in response to receiving a message acquisition request from a second user, determine whether the second user exists in the target user list according to the message acquisition request;

[0136] The acquisition module is configured to, in response to determining that the second user exists in the target user list, decrypt the encrypted message using the second public-private key pair to obtain a target message, and send the target message to the second user.

[0137] In a possible implementation, the registration request includes: first user information;

[0138] The building block is further configured to:

[0139] In response to receiving a registration request from a first user, obtaining first user information according to the registration request, and generating a first account address according to the first user information;

[0140] The target user list is obtained according to the registration request, and the friend circle contract is constructed on the blockchain according to the target user list and the first account address.

[0141] In a possible implementation, the target user list includes: user information corresponding to a plurality of users;

[0142] The device further includes: a modification module;

[0143] The modification module is configured to:

[0144] In response to receiving a target user list adding request from the first user, acquiring new user information according to the target user list adding request; wherein the target user list adding request includes: new user information;

[0145] Determine whether the newly added user information exists in all the user information in the target user list;

[0146] In response to the new user information not existing in all the user information in the target user list, the new user information is added to the target user list.

[0147] In a possible implementation, the target user list includes: user information corresponding to a plurality of users;

[0148] The modification module is further configured to:

[0149] In response to receiving a target user list deletion request from the first user, obtaining deletion user information according to the target user list deletion request; wherein the target user list deletion request includes: deleting user information;

[0150] Determine whether the deleted user information exists in all the user information in the target user list;

[0151] In response to the deletion user information existing in all the user information in the target user list, the user information corresponding to the deletion user information in the target user list is deleted.

[0152] In a possible implementation, the message publishing request includes: an original message; the first public-private key pair includes: a first private key; the second public-private key pair includes: a second private key;

[0153] The encryption module is further configured to:

[0154] In response to receiving a message publishing request from a first user, obtaining the original message according to the message publishing request;

[0155] Encrypting the original message using the first private key to determine the target message;

[0156] The target message is encrypted using the second private key to determine the encrypted message.

[0157] In a possible implementation, the publishing module is further configured to:

[0158] The encrypted message is stored in a message storage service, and a target message publishing event is published in the friend circle contract; wherein the target message publishing event is used to indicate that the first user publishes the encrypted message in the friend circle contract.

[0159] In a possible implementation, the first public-private key pair includes: a first public key; the second public-private key pair includes: a second public key;

[0160] The encryption module is further configured to:

[0161] In response to receiving a message update request from the first user, obtaining an update log and an update identifier according to the message update request, and determining the encrypted message according to the update identifier; wherein the update identifier is used to indicate the updated encrypted message;

[0162] decrypting the encrypted message using the second public key to determine the target message;

[0163] decrypting the target message using the first public key to determine the original message, and updating the original message according to the update log to determine the updated message;

[0164] encrypting the update message using the first private key to determine the target update message;

[0165] The target update message is encrypted using the second private key to determine the encrypted update message.

[0166] In a possible implementation, the message acquisition request includes: second user information; the target user list includes: user information corresponding to multiple users;

[0167] The determining module is further configured to:

[0168] In response to receiving a message acquisition request from a second user, acquiring the second user information according to the message acquisition request;

[0169] Determining whether the second user information exists in all the user information in the target user list;

[0170] In response to the second user information being present in all the user information in the target user list, it is determined that the second user is present in the target user list.

[0171] In a possible implementation, the second public-private key pair includes: a second public key;

[0172] The acquisition module is further configured to:

[0173] In response to determining that the second user exists in the target user list, establishing a peer-to-peer network connection between the first user and the second user to obtain the second public key;

[0174] The encrypted message is decrypted using the second public key to obtain the target message.

[0175] In a possible implementation, the device further includes: a monitoring module;

[0176] The monitoring module is configured as follows:

[0177] In response to receiving a monitoring message request from a second user, obtaining the second user information according to the monitoring message request; wherein the monitoring message request includes: the second user information;

[0178] Determining whether the second user information exists in all the user information in the target user list;

[0179] In response to the presence of the second user information in all the user information in the target user list, a monitoring channel is established between the second user and the circle of friends contract so that the second user obtains the target message publishing event through the monitoring channel.

[0180] In a possible implementation, the second public-private key pair includes: a second public key;

[0181] The device further includes: an update module;

[0182] The update module is configured to:

[0183] In response to determining that a public key update request from the first user is received, an updated second public key is obtained according to the public key update request, and the second public key is replaced with the updated second public key.

[0184] In a possible implementation, the first public-private key pair includes: a first private key; the second public-private key pair includes: a second private key;

[0185] The publishing module is further configured to:

[0186] In response to receiving a restricted message publishing request from the first user, obtaining a restricted user list and an original restricted message according to the restricted message publishing request; wherein the restricted message publishing request includes: the restricted user list and the original restricted message;

[0187] Determine the intersection of the target user list and the restricted user list to determine a visible user list;

[0188] encrypting the original restriction message using the first private key to determine a target restriction message;

[0189] encrypting the target restriction message using the second private key to determine an encrypted restriction message;

[0190] A restricted message publishing event is published to each user in the visible user list; wherein the restricted message publishing event is used to indicate that the first user publishes the encrypted restricted message in the circle of friends contract.

[0191] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0192] The device of the above embodiment is used to implement the corresponding message transmission method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0193] Figure 5 A schematic diagram of an exemplary structure of an electronic device provided in an embodiment of the present application is shown.

[0194] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the message transmission method described in any of the above embodiments is implemented. Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 510, a memory 520, an input / output interface 530, a communication interface 540, and a bus 550. The processor 510, the memory 520, the input / output interface 530, and the communication interface 540 are connected to each other in communication within the device through the bus 550.

[0195] The processor 510 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0196] The memory 520 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 520 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 520 and are called and executed by the processor 510.

[0197] The input / output interface 530 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0198] The communication interface 540 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0199] The bus 550 comprises a pathway that transmits information between the various components of the device (eg, the processor 510 , the memory 520 , the input / output interface 530 , and the communication interface 540 ).

[0200] It should be noted that, although the above device only shows the processor 510, the memory 520, the input / output interface 530, the communication interface 540 and the bus 550, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0201] The electronic device of the above embodiment is used to implement the corresponding message transmission method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0202] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the message transmission method described in any of the above embodiments.

[0203] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0204] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the message transmission method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0205] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0206] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0207] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0208] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A message transmission method, characterized in that: include: In response to receiving a registration request from the first user, a friend circle contract is constructed on the blockchain according to the registration request, and a first public-private key pair and a second public-private key pair are generated; wherein the registration request includes: a target user list; wherein the target user list is a trusted user list set by the first user; In response to receiving a message publishing request sent by a first user, it is determined that the first user will publish a dynamic message in the circle of friends contract, the message publishing request is parsed, and the original message carried by the message publishing request is obtained; the first public-private key pair includes a first private key and a first public key, and the second public-private key pair includes a second private key and a second public key; the original message is encrypted for the first time using the first private key to generate a target message, and the message content displayed in the target message is the same as the original message; the target message is encrypted for the second time using the second private key to determine the encrypted message; the encrypted message is stored in a message storage service, and a target message publishing event is published in the circle of friends contract; wherein the target message publishing event is used to indicate that the first user publishes the encrypted message in the circle of friends contract; In response to receiving a message acquisition request from a second user, determining whether the second user exists in the target user list according to the message acquisition request; In response to determining that the second user exists in the target user list, a peer-to-peer network connection is established between the first user and the second user, and the second public key of the first user is sent to the second user through the peer-to-peer network connection, so that the second user decrypts the encrypted message published by the first user according to the second public key, thereby obtaining the target message and performing a viewing operation.

2. The method according to claim 1, characterized in that The registration request includes: first user information; In response to receiving a registration request from the first user, constructing a friend circle contract on the blockchain according to the registration request, including: In response to receiving a registration request from a first user, obtaining first user information according to the registration request, and generating a first account address according to the first user information; The target user list is obtained according to the registration request, and the friend circle contract is constructed on the blockchain according to the target user list and the first account address.

3. The method according to claim 1, characterized in that The target user list includes: user information corresponding to multiple users; The method further comprises: In response to receiving a target user list adding request from the first user, acquiring new user information according to the target user list adding request; wherein the target user list adding request includes: new user information; Determine whether the newly added user information exists in all the user information in the target user list; In response to the new user information not existing in all the user information in the target user list, the new user information is added to the target user list.

4. The method according to claim 1, characterized in that: The target user list includes: user information corresponding to multiple users; The method further comprises: In response to receiving a target user list deletion request from the first user, obtaining deletion user information according to the target user list deletion request; wherein the target user list deletion request includes: deleting user information; Determine whether the deleted user information exists in all the user information in the target user list; In response to the deletion user information existing in all the user information in the target user list, the user information corresponding to the deletion user information in the target user list is deleted.

5. The method according to claim 1, characterized in that The first private key is used to encrypt the original message for the first time to generate a target message, and the message content displayed in the target message is the same as the original message; The target message is encrypted for the second time using the second private key. After the encrypted message is determined, the following steps are also included: In response to receiving a message update request from the first user, obtaining an update log and an update identifier according to the message update request, and determining the encrypted message according to the update identifier; wherein the update identifier is used to indicate the updated encrypted message; decrypting the encrypted message using the second public key to determine the target message; decrypting the target message using the first public key to determine the original message, and updating the original message according to the update log to determine the updated message; encrypting the update message using the first private key to determine the target update message; The target update message is encrypted using the second private key to determine the encrypted update message.

6. The method according to claim 1, characterized in that The message acquisition request includes: second user information; the target user list includes: user information corresponding to multiple users; In response to receiving a message acquisition request from a second user, determining whether the second user exists in the target user list according to the message acquisition request includes: In response to receiving a message acquisition request from a second user, acquiring the second user information according to the message acquisition request; Determining whether the second user information exists in all the user information in the target user list; In response to the second user information being present in all the user information in the target user list, it is determined that the second user is present in the target user list.

7. The method according to claim 1, characterized in that After the target message publishing event is published in the friend circle contract, it also includes: In response to receiving a monitoring message request from a second user, obtaining the second user information according to the monitoring message request; wherein the monitoring message request includes: the second user information; Determining whether the second user information exists in all the user information in the target user list; In response to the presence of the second user information in all the user information in the target user list, a monitoring channel is established between the second user and the circle of friends contract so that the second user obtains the target message publishing event through the monitoring channel.

8. The method according to claim 1, characterized in that The method further comprises: In response to determining that a public key update request from the first user is received, an updated second public key is obtained according to the public key update request, and the second public key is replaced with the updated second public key.

9. The method according to claim 1, characterized in that: The method further comprises: In response to receiving a restricted message publishing request from the first user, obtaining a restricted user list and an original restricted message according to the restricted message publishing request; wherein the restricted message publishing request includes: the restricted user list and the original restricted message; Determine the intersection of the target user list and the restricted user list to determine a visible user list; encrypting the original restriction message using the first private key to determine a target restriction message; encrypting the target restriction message using the second private key to determine an encrypted restriction message; A restricted message publishing event is published to each user in the visible user list; wherein the restricted message publishing event is used to indicate that the first user publishes the encrypted restricted message in the circle of friends contract.

10. A message delivery device, characterized in that: include: The construction module is configured to, in response to receiving a registration request from a first user, construct a friend circle contract on the blockchain according to the registration request, and generate a first public-private key pair and a second public-private key pair; wherein the registration request includes: a target user list; wherein the target user list is a trusted user list set by the first user; The publishing module is configured to respond to receiving a message publishing request sent by a first user, determine that the first user will publish a dynamic message in the circle of friends contract, parse the message publishing request, and obtain the original message carried by the message publishing request; the first public-private key pair includes a first private key and a first public key, and the second public-private key pair includes a second private key and a second public key; use the first private key to encrypt the original message for the first time to generate a target message, and the message content displayed in the target message is the same as the original message; use the second private key to encrypt the target message for the second time to determine the encrypted message; store the encrypted message in the message storage service, and publish the target message publishing event in the circle of friends contract; wherein the target message publishing event is used to indicate that the first user publishes the encrypted message in the circle of friends contract; a determination module, configured to, in response to receiving a message acquisition request from a second user, determine whether the second user exists in the target user list according to the message acquisition request; The acquisition module is configured to establish a peer-to-peer network connection between the first user and the second user in response to determining that the second user exists in the target user list, and send the second public key of the first user to the second user through the peer-to-peer network connection, so that the second user decrypts the encrypted message published by the first user according to the second public key, thereby obtaining the target message and performing a viewing operation.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.

12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Information issuing method, on-demand method, issuing service platform and user terminal

    CN102685021A

  • Confidential information transmitting method and device for public platform client

    CN106685634A