Label sharing method, system, electronic device and readable storage medium

By using blockchain and fully homomorphic encryption algorithms, the problems of tag leakage and abuse in cross-system tag sharing are solved, and the secure and trustworthy transmission of tag datasets is achieved.

CN119814382BActive Publication Date: 2025-11-11CHINA MOBILE INTERNET CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411828618.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-11-11
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

Cross-system tag sharing typically employs plaintext sharing or simple encryption methods, which carries the risk of tag leakage and misuse, and users of shared tags cannot verify the trustworthiness of the shared tags.

Method used

By using blockchain technology, the tag dataset is encrypted using a fully homomorphic encryption algorithm, and the encrypted tag dataset and tag rules are stored on the blockchain. The tag user determines the target encrypted tag dataset from the blockchain based on the target tag identification information, and encrypts the data to be sent using the user's public key to ensure that the data conforms to the tag rules before sending it to the target user terminal.

Benefits of technology

It ensures the security and trustworthiness of the labeled dataset, avoids the plaintext exposure of the labeled dataset, and guarantees the security and accuracy of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814382B_ABST
    Figure CN119814382B_ABST
Patent Text Reader

Abstract

This application discloses a tag sharing method, system, electronic device, and readable storage medium, applied to blockchain. The method includes: receiving data to be distributed and target tag identification information sent by a tag user; determining a target encrypted tag dataset and target tag rules from at least one encrypted tag dataset and tag rules corresponding to each encrypted tag dataset based on the target tag identification information; wherein the target encrypted tag dataset includes a user public key and encrypted user identification information; when it is determined that the data to be distributed conforms to the target tag rules, encrypting the data to be distributed using the user public key to obtain target encrypted data; and sending the target encrypted data to the user terminal corresponding to the encrypted user identification information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of blockchain technology, specifically relating to a tag sharing method, system, electronic device, and readable storage medium. Background Technology

[0002] Currently, user tags in various systems can be used for product operations and are digital assets accumulated during the system's development. To improve the capabilities and efficiency of product operations, a system may also use user tags from other systems. However, this cross-system tag sharing is usually implemented using plaintext sharing or simple encryption, which poses risks of tag leakage and misuse. Furthermore, users of shared tags cannot verify the trustworthiness of the shared tags. Summary of the Invention

[0003] This application provides a tag sharing method, system, electronic device, and readable storage medium, which can solve the problems in related technologies where cross-system tag sharing is usually implemented in plaintext sharing or simple encryption, which poses the risk of tag leakage and misuse, and the users of shared tags cannot determine the trustworthiness of the shared tags.

[0004] In a first aspect, embodiments of this application provide a tag sharing method applied to blockchain. The method includes: receiving data to be distributed and target tag identification information sent by a tag user; determining a target encrypted tag dataset and target tag rules from at least one encrypted tag dataset and tag rules corresponding to each encrypted tag dataset based on the target tag identification information; wherein the target encrypted tag dataset includes a user public key and encrypted user identification information; when it is determined that the data to be distributed conforms to the target tag rules, encrypting the data to be distributed using the user public key to obtain target encrypted data; and sending the target encrypted data to the user terminal corresponding to the encrypted user identification information.

[0005] Secondly, embodiments of this application provide a tag sharing method applied to tag users. The method includes: determining target tag identification information corresponding to a target encrypted tag dataset from a blockchain; wherein the blockchain stores encrypted tag datasets uploaded by tag providers and tag rules corresponding to the encrypted tag datasets; and sending the data to be distributed and the target tag identification information corresponding to the target encrypted tag datasets to the blockchain.

[0006] Thirdly, this application provides a tag sharing method applied to a tag provider. The method includes: encrypting at least one tag dataset using a public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset; and uploading at least one encrypted tag dataset, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset to a blockchain.

[0007] Fourthly, this application provides a tag sharing system, which includes: a blockchain, a tag user, and a tag provider; wherein the tag user is used to determine target tag identification information corresponding to a target encrypted tag dataset from the blockchain; wherein the blockchain stores encrypted tag datasets uploaded by the tag provider and tag rules corresponding to the encrypted tag datasets; and sends data to be distributed and the target tag identification information corresponding to the target encrypted tag dataset to the blockchain; the blockchain is used to receive the data to be distributed and the target tag identification information sent by the tag user; determine a target encrypted tag dataset and a target tag rule from at least one encrypted tag dataset and the tag rule corresponding to each encrypted tag dataset according to the target tag identification information; wherein the target encrypted tag dataset includes a user public key and encrypted user identification information; when it is determined that the data to be distributed conforms to the target tag rule, the data to be distributed is encrypted using the user public key to obtain target encrypted data; and the target encrypted data is sent to the user terminal corresponding to the encrypted user identification information.

[0008] Fifthly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of the method described in the first aspect, or the steps of the method described in the second aspect, or the steps of the method described in the third aspect.

[0009] In a sixth aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect, or the method described in the second aspect, or the method described in the third aspect.

[0010] In a seventh aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the method described in the first aspect, or the method described in the second aspect, or the method described in the third aspect.

[0011] Eighthly, embodiments of this application provide a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including a program or instructions, which, when executed, implement the steps of the method described in the first aspect, or the method described in the second aspect, or the method described in the third aspect.

[0012] In this embodiment, the blockchain receives data to be distributed and target tag identification information sent by the tag user. The target tag identification information reveals the tag dataset selected by the tag user. Based on this target tag identification information, a target encrypted tag dataset and target tag rules are determined from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset. The data to be distributed is then verified against the target tag rules corresponding to the target encrypted tag dataset selected by the tag user to determine whether the data to be distributed can be distributed based on the target encrypted tag dataset. If the data to be distributed conforms to the target tag rules, it is encrypted using the user's public key in the target encrypted tag dataset to obtain target encrypted data. This target encrypted data is then sent to the user terminal corresponding to the encrypted user identification information in the target encrypted tag dataset. This avoids exposing the tag dataset to the tag user, ensuring the security of the shared tag dataset, and by verifying the data to be distributed against the target tag rules, ensures the trustworthiness of the target encrypted tag dataset selected by the tag user. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a tag sharing method provided in an embodiment of this application;

[0014] Figure 2 This is a schematic diagram of a distribution queue for multiple target encrypted data packets provided in an embodiment of this application;

[0015] Figure 3 This is a flowchart illustrating a tag sharing method provided in an embodiment of this application;

[0016] Figure 4 This is a flowchart illustrating a tag sharing method provided in an embodiment of this application;

[0017] Figure 5 This is a schematic diagram of the structure of a tag sharing system provided in an embodiment of this application;

[0018] Figure 6 This is a flowchart illustrating another tag sharing method provided in an embodiment of this application;

[0019] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0022] The following description, in conjunction with the accompanying drawings, details a tag-sharing method, system, electronic device, and readable storage medium provided in this application through specific embodiments and application scenarios.

[0023] Figure 1 This diagram illustrates a flowchart of a tag-sharing method provided in an embodiment of this application. This method is applied to blockchain and can be executed by an electronic device. See also... Figure 1 The method may include the following steps.

[0024] Step 102: Receive the data to be distributed and the target tag identification information sent by the tag user.

[0025] In this context, the tag user is the party that needs to use tag data maintained in other systems, platforms, or organizations. The data to be distributed is the data required by the user terminal and distributed by the tag user according to the user terminal's needs. Each encrypted tag dataset in the blockchain has corresponding tag identification information, with the target tag identification information being one of them, used to indicate the currently selected encrypted tag dataset.

[0026] Step 104: Based on the target tag identification information, determine the target encrypted tag dataset and target tag rules from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset; wherein, the target encrypted tag dataset includes the user's public key and encrypted user identification information.

[0027] In this blockchain, user public keys and encrypted user identification information are encapsulated within encrypted tag datasets and are not displayed in plaintext. Different encrypted tag datasets can be distinguished by the tag identification information corresponding to the encrypted tag datasets, and thus the corresponding target tag dataset can be determined from the stored encrypted tag datasets by using the target tag identification information selected by the tag user.

[0028] Step 106: If it is determined that the data to be sent conforms to the target tag rule, the data to be sent is encrypted using the user's public key to obtain the target encrypted data.

[0029] Among them, the target label rule is used to specify which data can be sent to the user terminal indicated in the target encrypted label dataset based on the target encrypted label dataset. In other words, the target label rule restricts the use of the target encrypted label dataset and can ensure that the target encrypted label dataset is not abused.

[0030] Step 108: Send the target encrypted data to the user terminal corresponding to the encrypted user identification information.

[0031] In this embodiment, the blockchain receives data to be distributed and target tag identification information sent by the tag user. The target tag identification information reveals the tag dataset selected by the tag user. Based on this target tag identification information, a target encrypted tag dataset and target tag rules are determined from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset. The data to be distributed is then verified against the target tag rules corresponding to the target encrypted tag dataset selected by the tag user to determine whether the data to be distributed can be distributed based on the target encrypted tag dataset. If the data to be distributed conforms to the target tag rules, it is encrypted using the user's public key in the target encrypted tag dataset to obtain target encrypted data. This target encrypted data is then sent to the user terminal corresponding to the encrypted user identification information in the target encrypted tag dataset. This avoids exposing the tag dataset to the tag user, ensuring the security of the shared tag dataset, and by verifying the data to be distributed against the target tag rules, ensures the trustworthiness of the target encrypted tag dataset selected by the tag user.

[0032] In one implementation, before step 104 above, which determines the target encrypted tag dataset and target tag rules from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset based on the target tag identification information, the method further includes: receiving and storing at least one encrypted tag dataset uploaded by the tag provider, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset.

[0033] In this embodiment, the tag provider uploads at least one encrypted tag dataset, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset to the blockchain. The blockchain receives and stores these data, thus enabling the blockchain to serve as a platform covering shareable tag datasets. This allows tag users to select the target encrypted tag dataset they currently need from the blockchain, thereby ensuring the security of the tag dataset while enabling its sharing.

[0034] In one implementation, before step 106 above, in which the data to be sent is determined to conform to the target tag rule, and the data to be sent is encrypted using the user's public key to obtain the target encrypted data, the method further includes the following steps.

[0035] Step 1061: Extract the first feature vector corresponding to the data to be sent and the second feature vector corresponding to the target label rule.

[0036] The first feature vector is used to characterize the features of the data to be sent, and the second feature vector is used to characterize the features of the target label rule. The features of the two are represented in vector form to facilitate the measurement of the relationship between them.

[0037] Step 1062: Calculate the similarity between the first feature vector and the second feature vector.

[0038] One way to calculate the similarity between the first feature vector and the second feature vector is to calculate the Euclidean distance between them, and then use the Euclidean distance to measure the similarity between the first feature vector and the second feature vector.

[0039] Step 1063: Based on the similarity, determine whether the data to be sent conforms to the target label rule.

[0040] Specifically, when measuring the similarity between the first feature vector and the second feature vector based on Euclidean distance, a larger Euclidean distance (greater than or equal to a preset Euclidean distance threshold) indicates a lower similarity between the first feature vector and the second feature vector, while a smaller Euclidean distance (less than a preset Euclidean distance threshold) indicates a higher similarity between the first feature vector and the second feature vector.

[0041] In this embodiment of the application, by extracting the first feature vector corresponding to the data to be sent and the second feature vector corresponding to the target label rule, and calculating the similarity between the first feature vector and the second feature vector, it is determined whether the data to be sent conforms to the target label rule by measuring the magnitude of the similarity between the first feature vector and the second feature vector, so as to determine whether the data to be sent can be sent based on the target encrypted label dataset and determine the credibility of the target encrypted label dataset.

[0042] In one implementation, step 1063 above, determining whether the data to be sent conforms to the target label rule based on the similarity, includes: if the similarity is greater than the similarity threshold, determining that the data to be sent conforms to the target label rule.

[0043] The process involves determining the similarity between a first and second feature vector using a preset similarity threshold, and then using this similarity to determine subsequent operations. If the similarity is greater than the threshold (meaning the first and second feature vectors are relatively similar), the data to be sent conforms to the target label rules and can be sent based on that target encrypted label dataset. If the similarity is less than the threshold (meaning the first and second feature vectors are not very similar), the data to be sent does not conform to the target label rules and cannot be sent based on that target encrypted label dataset. In this case, another encrypted label dataset can be selected for further evaluation.

[0044] In this embodiment of the application, if the similarity between the first feature vector and the second feature vector is greater than the similarity threshold, it indicates that the first feature vector and the second feature vector have a large similarity, thereby indicating that the data to be distributed conforms to the target label rules, and the data to be distributed can be distributed based on the target encrypted label dataset, thus ensuring the credibility of the target encrypted label dataset selected by the label user.

[0045] In one implementation, step 108 above, which sends the target encrypted data to the user terminal corresponding to the encrypted user identification information, may include the following steps.

[0046] Step 1081: Encrypt the target encrypted data using the public key of a fully homomorphic encryption algorithm to obtain homomorphic ciphertext.

[0047] Among them, the fully homomorphic encryption algorithm can directly encrypt ciphertext without decryption. Therefore, when the target encrypted data is encrypted again based on the fully homomorphic encryption algorithm, it is not necessary to decrypt the target encrypted data first, which further protects the privacy and security of the data to be sent during the data distribution process.

[0048] Step 1082: Package the encrypted user identification information and the homomorphic ciphertext into a target encrypted data packet.

[0049] The encrypted user identification information is used to identify user terminals. The encrypted user identification information is used to determine which user terminals have the need to receive the data to be sent, rather than sending the data to be sent to all user terminals.

[0050] Step 1083: Send the target encrypted data packet to the user terminal corresponding to the encrypted user identification information.

[0051] In this embodiment, the target encrypted data is encrypted using the public key of a fully homomorphic encryption algorithm to obtain homomorphic ciphertext, achieving secondary encryption of the target encrypted data and further ensuring the security of the data to be sent. The encrypted user identification information and the homomorphic ciphertext are then packaged into a target encrypted data packet, enabling the receiver of the target encrypted data packet to send the target encrypted data packet to the user terminal corresponding to the encrypted user identification information based on the encrypted user identification information, thereby ensuring the security and accuracy of the data to be sent during transmission.

[0052] In one implementation, step 1083 above, which involves sending the target encrypted data packet to the user terminal corresponding to the encrypted user identification information, may include: sending the target encrypted data packet to the user terminal corresponding to the encrypted user identification information via a message sending platform.

[0053] The message sending platform is used to decrypt the encrypted user identification information and the homomorphic ciphertext based on the private key of the fully homomorphic encryption algorithm to obtain user identification information and the target encrypted data, and to send the target encrypted data to the user terminal corresponding to the user identification information.

[0054] In this embodiment, a message sending platform is introduced between the blockchain and the user terminal. The blockchain sends the target encrypted data packet to the user terminal corresponding to the encrypted user identification information through the message sending platform. The message sending platform receives the target encrypted data packet and decrypts the encrypted user identification information and the homomorphic ciphertext in the target encrypted data packet based on the private key of the fully homomorphic encryption algorithm, thereby obtaining the user identification information and the target encrypted data. At this time, the message sending platform can determine the user terminal receiving the target encrypted data through the user identification information. The target encrypted data is obtained by encrypting the data to be sent based on the user's public key in the target encrypted tag dataset. Decrypting the target encrypted data requires the user's private key, which is located on the user terminal side, thus ensuring the security of the target encrypted data on the message sending platform.

[0055] In one implementation, when the data to be sent by the tag user includes multiple data packets, step 108 above, which sends the target encrypted data to the user terminal corresponding to the encrypted user identification information, includes: sending the target encrypted data packets corresponding to the multiple data packets to be sent to the user terminal corresponding to the encrypted user identification information in a preset sending order.

[0056] In this embodiment of the application, the data to be sent includes multiple data sets, the target encrypted tag datasets selected for the data to be sent also include multiple datasets, and the corresponding target encrypted data packets also include multiple datasets. See [link to relevant documentation]. Figure 2 For multiple target encrypted data packets to be sent, they can be sent in a preset sending order, such as a random order. For target encrypted data packets with a logical order (e.g., S1 and S2, which are target encrypted data packets sent to two user terminals in the target tag dataset T1), they can be sent in a random order (e.g., S3 and S4, which are encrypted data packets sent to user terminals in other tag datasets T2 and T3, with other encrypted data packets S3 and S4 sent before S2), thereby further enhancing the security of data transmission.

[0057] Figure 3 This document shows a flowchart illustrating a tag-sharing method provided in an embodiment of this application. (See attached diagram.) Figure 3 This method is applied to the tag user and can be performed by an electronic device. The method may include the following steps.

[0058] Step 302: Determine the target tag identification information corresponding to the target encrypted tag dataset from the blockchain.

[0059] The blockchain stores at least one encrypted tag dataset uploaded by the tag provider.

[0060] Step 304: Send the data to be sent and the target tag identification information corresponding to the target encrypted tag dataset to the blockchain.

[0061] Among them, the data to be distributed is the data required by the user terminal and distributed by the tag user according to the user terminal's needs.

[0062] In this embodiment, the blockchain stores at least one encrypted tag dataset uploaded by the tag provider and tag rules corresponding to each encrypted tag dataset. The blockchain can serve as a platform covering shareable tag datasets, enabling tag users to select the desired target encrypted tag dataset from the blockchain, determine the target tag identification information corresponding to the target encrypted tag dataset, and then send the data to be distributed and the target tag identification information corresponding to the target encrypted tag dataset to the blockchain. The blockchain then verifies the data to be distributed against the target tag rules corresponding to the target encrypted tag dataset selected by the tag user to determine whether the data to be distributed can be distributed based on the target encrypted tag dataset. If it is determined that the data to be distributed conforms to the target tag rules, the data to be distributed is encrypted using the user's public key in the target encrypted tag dataset to obtain target encrypted data; the target encrypted data is then sent to the user terminal corresponding to the encrypted user identification information in the target encrypted tag dataset. This enables tag users to determine the required target encrypted tag dataset from the encrypted tag dataset shared by tag uploaders on the blockchain, and to distribute the data to be distributed based on the target encrypted tag dataset. This not only avoids exposing the tag dataset to the tag users and ensures the security of the shared tag dataset, but also ensures the trustworthiness of the target encrypted tag dataset selected by the tag users by verifying the data to be distributed and the target tag rules.

[0063] In one implementation, step 304 above, which involves sending the data to be distributed to the blockchain, may include the following steps.

[0064] Step 3041: Encrypt the data to be sent using the public key of a fully homomorphic encryption algorithm.

[0065] Step 3042: Send the encrypted data to be sent to the blockchain.

[0066] In this embodiment of the application, the tag user encrypts the data to be sent using the public key of a fully homomorphic encryption algorithm, and then sends the encrypted data to be sent to the blockchain, ensuring the security of the data to be sent to the blockchain.

[0067] Figure 4 This document shows a flowchart illustrating a tag-sharing method provided in an embodiment of this application. (See attached diagram.) Figure 4This method is applied to the tag provider and can be performed by an electronic device. The method may include the following steps.

[0068] Step 402: Encrypt at least one tag dataset using the public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset.

[0069] Step 404: Upload at least one of the encrypted tag datasets, the tag identification information corresponding to each encrypted tag dataset, and the tag rules corresponding to each encrypted tag dataset to the blockchain.

[0070] In this embodiment, the tag provider encrypts at least one tag dataset using the public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset. Then, it uploads at least one of the encrypted tag datasets, the tag identification information corresponding to each encrypted tag dataset, and the tag rules corresponding to each encrypted tag dataset to the blockchain. This ensures the security of the tag datasets while enabling sharing of the tag datasets by uploading them to the blockchain.

[0071] In one implementation, the tag dataset includes user identification information and user public key; step 402 above encrypts at least one tag dataset using the public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset, including the following steps.

[0072] Step 4021: Encrypt the user identification information in the tag dataset using the public key of the fully homomorphic encryption algorithm to obtain encrypted user identification information.

[0073] Among them, the user identification information in the tag dataset is privacy information that needs to be protected. The user identification information is encrypted to ensure its security.

[0074] Step 4022: Store the encrypted user identification information and the user public key as an encrypted tag dataset.

[0075] In this system, there is a one-to-one correspondence between encrypted user identification information and user public key. In other words, when sending data to be sent to the user terminal corresponding to the encrypted user identification information, the data to be sent needs to be encrypted using the user public key corresponding to the encrypted user identification information. This allows the user terminal to decrypt the target encrypted data using the user terminal's private user key, thereby obtaining the data to be sent.

[0076] In this embodiment, the tag provider encrypts the user identification information in the tag dataset using the public key of a fully homomorphic encryption algorithm to obtain encrypted user identification information, and stores the encrypted user identification information and the user public key in correspondence as an encrypted tag dataset. The tag provider then uploads the encrypted tag dataset to the blockchain to achieve secure sharing of the tag dataset.

[0077] Figure 5 A schematic diagram of the structure of a tag-sharing system provided in an embodiment of this application is shown. Figure 5 As shown, the tag sharing system 500 includes: a blockchain 51, tag users 52, and tag providers 53.

[0078] The tag user 52 is used to determine the target tag identification information corresponding to the target encrypted tag dataset from the blockchain 51; wherein the blockchain 51 stores the encrypted tag dataset uploaded by the tag provider 53 and the tag rules corresponding to the encrypted tag dataset; and sends the data to be distributed and the target tag identification information corresponding to the target encrypted tag dataset to the blockchain 51; the blockchain 51 is used to receive the data to be distributed and the target tag identification information sent by the tag user 52; and, based on the target tag identification information, determines the target encrypted tag dataset and the target tag rules from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset; wherein the target encrypted tag dataset includes a user public key and encrypted user identification information; if it is determined that the data to be distributed conforms to the target tag rules, the data to be distributed is encrypted using the user public key to obtain the target encrypted data; and the target encrypted data is sent to the user terminal corresponding to the encrypted user identification information.

[0079] In one implementation, the tag provider 53 is used to encrypt at least one tag dataset using a public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset; and to upload at least one encrypted tag dataset, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset to the blockchain 51; the blockchain 51 is also used to receive and store the at least one encrypted tag dataset, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset uploaded by the tag provider 53.

[0080] In one implementation, the blockchain 51 is used to send the target encrypted data to the user terminal corresponding to the encrypted user identification information, including: encrypting the target encrypted data using the public key of a fully homomorphic encryption algorithm to obtain homomorphic ciphertext; packaging the encrypted user identification information and the homomorphic ciphertext into a target encrypted data packet; and sending the target encrypted data packet to the user terminal corresponding to the encrypted user identification information.

[0081] In one implementation, see [link to implementation details]. Figure 5 The aforementioned tag sharing system 500 also includes: a message sending platform 54.

[0082] The blockchain 51 is further used to send the target encrypted data packet to the message sending platform 54; the message sending platform 54 is used to decrypt the encrypted user identification information and the homomorphic ciphertext based on the private key of the fully homomorphic encryption algorithm to obtain user identification information and the target encrypted data, and to send the target encrypted data to the user terminal corresponding to the user identification information.

[0083] In one implementation, the blockchain 51 can also be used to extract a first feature vector corresponding to the data to be sent and a second feature vector corresponding to the target label rule; calculate the similarity between the first feature vector and the second feature vector; and determine whether the data to be sent conforms to the target label rule based on the similarity.

[0084] In one implementation, the blockchain 51 is used to determine whether the data to be sent conforms to the target label rule based on the similarity, which may include: determining that the data to be sent conforms to the target label rule when the similarity is greater than a similarity threshold.

[0085] In one implementation, when the data to be sent by the tag user includes multiple data packets, the blockchain 51 for sending the target encrypted data packets to the user terminal corresponding to the encrypted user identification information may include: sending the target encrypted data packets corresponding to the multiple data packets to be sent to the user terminal corresponding to the encrypted user identification information in a preset sending order.

[0086] In one implementation, the tag user 52 is used to send the data to be distributed to the blockchain 51, which may include: encrypting the data to be distributed using a public key of a fully homomorphic encryption algorithm; and sending the encrypted data to be distributed to the blockchain 51.

[0087] In one implementation, the tag dataset includes user identification information and a user public key; the tag provider 53 is used to encrypt at least one tag dataset using the public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset, which may include: encrypting the user identification information in the tag dataset using the public key of a fully homomorphic encryption algorithm to obtain encrypted user identification information; and storing the encrypted user identification information and the user public key in correspondence as an encrypted tag dataset.

[0088] Figure 6 This illustration shows a flowchart of another tag-sharing method provided in an embodiment of this application. This method can be applied to, for example... Figure 5 The tag sharing system shown is described in [reference]. Figure 6 The method includes the following steps.

[0089] Step 601: The message sending platform generates a fully homomorphic private key and a fully homomorphic public key based on a fully homomorphic encryption algorithm, and sends the fully homomorphic public key to the blockchain, the tag user, and the tag provider.

[0090] Step 602: The tag provider uploads the encrypted tag dataset and the tag rules corresponding to the encrypted tag dataset to the blockchain.

[0091] Among them, the tag dataset of the tag provider for:

[0092]

[0093] Encrypted tag dataset from the tag provider for:

[0094]

[0095] in, For the user identification information of the nth user terminal, To use a fully homomorphic public key The encrypted user identification information of the nth user terminal is obtained by encrypting the user identification information. The public key for the nth user terminal is stored on the user terminal side, and correspondingly, the private key for the nth user terminal is stored on the user terminal side. The tag dataset contains tag identification information, such as the name of the tag dataset.

[0096] Step 603: The tag user uploads the encrypted data to be distributed and the target tag identification information corresponding to the target encrypted tag dataset to the blockchain.

[0097] In this process, the label user selects the required target label identification information based on the publicly available label identification information on the blockchain.

[0098] Step 604: The blockchain extracts the first feature vector corresponding to the encrypted data to be sent and the second feature vector corresponding to the target label rule, and calculates the Euclidean distance between the first feature vector and the second feature vector.

[0099] In this process, blockchain can extract the first feature vector corresponding to the encrypted data to be sent through an artificial intelligence (AI) model. and the second feature vector corresponding to the target label rule . , Therefore, the Euclidean distance between the first eigenvector and the second eigenvector is: .

[0100] Since the Euclidean distance is calculated based on the encrypted data to be sent and the target label rules, the resulting Euclidean distance is ciphertext data. This ciphertext data is sent to the message sending platform for decryption in order to determine the magnitude of the decrypted Euclidean distance and thus determine the subsequent operations.

[0101] Step 605a: If the blockchain determines that the Euclidean distance is greater than a preset distance threshold, it returns an error notification message.

[0102] Specifically, an error notification message is sent to the tag user to indicate that the data to be sent does not conform to the target tag rules corresponding to the currently selected target encrypted tag dataset, so that the tag user can reselect another encrypted tag dataset.

[0103] Step 605b: When the Euclidean distance is determined to be less than a preset distance threshold, the blockchain encrypts the data to be sent using the user's public key in the target encrypted tag dataset to obtain the target encrypted data.

[0104] If the Euclidean distance is less than the preset distance threshold, it means that the data to be sent conforms to the target label rules and the data to be sent can be sent based on the target encrypted label dataset.

[0105] Among them, the user's public key , where x is the length of the nth user's public key, and e is a random number.

[0106] Step 606: The blockchain sends the homomorphic ciphertext and the encrypted user identification information to the message sending platform.

[0107] The homomorphic ciphertext is obtained by encrypting the target encrypted data using a fully homomorphic public key, further ensuring the security of the data to be sent. The homomorphic ciphertext and the encrypted user identification information can be encapsulated into a data packet.

[0108] in, Represents a labeled dataset The data packet sent by the nth user terminal as indicated. To pass Treating the distributed data The target encrypted data is obtained through encryption. When the blockchain also receives other data to be distributed from the tag user (e.g., ... , , When other users of the data to be distributed are selected to use different tag datasets, the blockchain also needs to distribute the other data based on these different tag datasets. At this point, the blockchain includes multiple target encrypted data sets to be distributed. This can be achieved by sending the target encrypted data corresponding to different tag datasets to the message sending platform in a random order, such as... Figure 2 As shown, this is to enhance the security of the data to be sent.

[0109] Step 607: The message sending platform decrypts the homomorphic ciphertext and the encrypted user identification information using a fully homomorphic private key to obtain the target encrypted data and user identification information.

[0110] Step 608: The message sending platform sends the target encrypted data to the user terminal corresponding to the user identification information.

[0111] Step 609: The user terminal decrypts the target encrypted data using the user's private key to obtain the data to be sent.

[0112] This application's embodiments utilize a fully homomorphic public key and a fully homomorphic private key generated by a fully homomorphic encryption algorithm to encrypt and decrypt the tag dataset, protecting the privacy and security of the shareable tag dataset uploaded by the tag provider. It also encrypts and decrypts the target encrypted data, protecting the privacy and security of the data to be distributed. By verifying the data to be distributed against the target tag rules, the trustworthiness of the data distributed based on the target encrypted tag dataset is ensured. Storing the shareable encrypted tag dataset on a blockchain eliminates the need to expose the tag dataset in plaintext to the tag users, further guaranteeing the security of the tag dataset.

[0113] This application also provides an electronic device for performing the tag sharing method described above. Figure 7This is a schematic diagram of the structure of an electronic device to implement the various embodiments of this application. The electronic device can vary significantly due to differences in configuration or performance, and may include a processor 701, a communications interface 702, a memory 703, and a communication bus 704. The processor 701, communications interface 702, and memory 703 communicate with each other via the communication bus 704. The processor 701 can call a computer program stored in the memory 703 and executable on the processor 701 to perform the various steps of the above-described tag-sharing method embodiments, achieving the same technical effects. To avoid repetition, further details are omitted here.

[0114] The above electronic device structure does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or arrange them differently. For example, an input unit may include a Graphics Processing Unit (GPU) and a microphone, and a display unit may use a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar display panels. User input units include at least one of a touch panel and other input devices. A touch panel is also called a touchscreen. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be elaborated further here.

[0115] Memory can be used to store software programs and various data. Memory can primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area can store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, memory can include volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM).

[0116] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly handles operations related to the operating system, user interface, and applications, while the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor.

[0117] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described tag sharing method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0118] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0119] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described tag sharing method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0120] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0121] This application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes a program or instructions. When the program or instructions are executed, they implement the various processes of the above-described tag sharing method embodiments and can achieve the same technical effects. To avoid repetition, they will not be described again here.

[0122] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0124] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A tag sharing method, characterized in that, Applications in blockchain, including: Receive the data to be distributed and the target tag identification information sent by the tag user; Based on the target tag identification information, a target encrypted tag dataset and target tag rules are determined from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset; wherein, the target encrypted tag dataset includes a user public key and encrypted user identification information; the target tag rules are used to indicate whether the data to be sent is sent based on the target encrypted tag dataset; If it is determined that the data to be sent conforms to the target tag rule, the data to be sent is encrypted using the user's public key to obtain the target encrypted data; The target encrypted data is sent to the user terminal corresponding to the encrypted user identification information.

2. The method according to claim 1, characterized in that, Before determining the target encrypted tag dataset and target tag rules from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset based on the target tag identification information, the method further includes: Receive and store at least one encrypted tag dataset uploaded by the tag provider, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset.

3. The method according to claim 1, characterized in that, Before encrypting the data to be sent using the user's public key to obtain the target encrypted data, after determining that the data to be sent conforms to the target tag rule, the method further includes: Extract the first feature vector corresponding to the data to be sent and the second feature vector corresponding to the target label rule; Calculate the similarity between the first feature vector and the second feature vector; Based on the similarity, it is determined whether the data to be sent conforms to the target label rule.

4. The method according to claim 3, characterized in that, The step of determining whether the data to be sent conforms to the target tag rule based on the similarity includes: If the similarity is greater than the similarity threshold, the data to be sent is determined to conform to the target label rule.

5. The method according to claim 1, characterized in that, Sending the target encrypted data to the user terminal corresponding to the encrypted user identification information includes: The target encrypted data is encrypted using the public key of a fully homomorphic encryption algorithm to obtain homomorphic ciphertext; Package the encrypted user identification information and the homomorphic ciphertext into a target encrypted data packet; The target encrypted data packet is sent to the user terminal corresponding to the encrypted user identification information.

6. The method according to claim 5, characterized in that, Sending the target encrypted data packet to the user terminal corresponding to the encrypted user identification information includes: The target encrypted data packet is sent to the user terminal corresponding to the encrypted user identification information through the message sending platform; The message sending platform is used to decrypt the encrypted user identification information and the homomorphic ciphertext based on the private key of the fully homomorphic encryption algorithm to obtain user identification information and the target encrypted data, and to send the target encrypted data to the user terminal corresponding to the user identification information.

7. The method according to claim 5, characterized in that, When the data to be sent by the tag user includes multiple data packets, the step of sending the target encrypted data packet to the user terminal corresponding to the encrypted user identification information includes: Multiple target encrypted data packets corresponding to the data to be sent are sent to the user terminal corresponding to the encrypted user identification information in a preset sending order.

8. A tag sharing method, characterized in that, Applicable to label users, including: The target tag identification information corresponding to the target encrypted tag dataset is determined from the blockchain; wherein, the blockchain stores at least one encrypted tag dataset uploaded by the tag provider and the tag rules corresponding to each encrypted tag dataset; The data to be distributed and the target tag identification information corresponding to the target encrypted tag dataset are sent to the blockchain, so that the blockchain determines the target encrypted tag dataset and the target tag rule from the at least one encrypted tag dataset and the tag rule corresponding to each encrypted tag dataset based on the target tag identification information; the target tag rule is used to indicate whether the data to be distributed is distributed based on the target encrypted tag dataset.

9. The method according to claim 8, characterized in that, The step of sending the data to be distributed to the blockchain includes: The data to be sent is encrypted using the public key of a fully homomorphic encryption algorithm; The encrypted data to be sent is sent to the blockchain.

10. A tag sharing method, characterized in that, Applicable to label providers, including: At least one tag dataset is obtained by encrypting at least one tag dataset using the public key of a fully homomorphic encryption algorithm; At least one of the encrypted tag datasets, tag identification information corresponding to each of the encrypted tag datasets, and tag rules corresponding to each of the encrypted tag datasets are uploaded to the blockchain, so that the blockchain determines the target encrypted tag dataset and the target tag rule from the at least one encrypted tag dataset and the tag rule corresponding to each of the encrypted tag datasets based on the received target tag identification information; the target tag rule is used to indicate whether to distribute the data to be distributed based on the target encrypted tag dataset.

11. The method according to claim 10, characterized in that, The tag dataset includes user identification information and user public keys; The step of encrypting at least one tag dataset using the public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset includes: The user identification information in the tag dataset is encrypted using the public key of a fully homomorphic encryption algorithm to obtain encrypted user identification information; The encrypted user identification information and the user public key are stored as an encrypted tag dataset.

12. A tag sharing system, characterized in that, The tag sharing system includes: a blockchain, tag users, and tag providers; The tag user is used to determine the target tag identification information corresponding to the target encrypted tag dataset from the blockchain; the blockchain stores the encrypted tag dataset uploaded by the tag provider and the tag rules corresponding to the encrypted tag dataset; and sends the data to be distributed and the target tag identification information corresponding to the target encrypted tag dataset to the blockchain; The blockchain is used to receive data to be distributed and target tag identification information sent by the tag user; based on the target tag identification information, a target encrypted tag dataset and target tag rules are determined from at least one encrypted tag dataset and the tag rules corresponding to each encrypted tag dataset; wherein, the target encrypted tag dataset includes a user public key and encrypted user identification information; the target tag rules are used to indicate whether the data to be distributed is distributed based on the target encrypted tag dataset; if it is determined that the data to be distributed conforms to the target tag rules, the data to be distributed is encrypted using the user public key to obtain target encrypted data; and the target encrypted data is sent to the user terminal corresponding to the encrypted user identification information.

13. The tag sharing system according to claim 12, characterized in that, The tag provider is used to encrypt at least one tag dataset using a public key of a fully homomorphic encryption algorithm to obtain at least one encrypted tag dataset; and to upload at least one of the encrypted tag datasets, tag identification information corresponding to each of the encrypted tag datasets, and tag rules corresponding to each of the encrypted tag datasets to the blockchain; The blockchain is also used to receive and store at least one encrypted tag dataset uploaded by the tag provider, tag identification information corresponding to each encrypted tag dataset, and tag rules corresponding to each encrypted tag dataset.

14. The tag sharing system according to claim 12, characterized in that, The blockchain is used to send the target encrypted data to the user terminal corresponding to the encrypted user identification information, including: The target encrypted data is encrypted using the public key of a fully homomorphic encryption algorithm to obtain homomorphic ciphertext; Package the encrypted user identification information and the homomorphic ciphertext into a target encrypted data packet; The target encrypted data packet is sent to the user terminal corresponding to the encrypted user identification information.

15. The tag sharing system according to claim 14, characterized in that, The tag sharing system also includes: a message sending platform; The blockchain is also used to send the target encrypted data packet to the message sending platform; The message sending platform is used to decrypt the encrypted user identification information and the homomorphic ciphertext based on the private key of the fully homomorphic encryption algorithm to obtain user identification information and the target encrypted data, and to send the target encrypted data to the user terminal corresponding to the user identification information.

16. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the tag sharing method as described in any one of claims 1 to 11.

17. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the tag sharing method as described in any one of claims 1 to 11.

18. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including programs or instructions that, when executed, implement the steps of the tag sharing method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Multi-owner RFID authentication method based on block chain

    CN113407928A

  • User data processing method, device and system based on block chain

    CN115017532A