Accounting right acquisition method and apparatus, electronic device, and computer readable medium

By comparing and broadcasting similarity among blockchain nodes, the node that obtains the right to record transactions is determined, and the reward is recorded in the new block. This solves the problem of competition for the right to record transactions and the distribution of rewards in the blockchain system, and achieves a reasonable allocation among nodes.

CN115859317BActive Publication Date: 2026-06-09CHINA UNITED NETWORK COMM GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2022-09-01
Publication Date
2026-06-09

Smart Images

  • Figure CN115859317B_ABST
    Figure CN115859317B_ABST
Patent Text Reader

Abstract

The application discloses a kind of accounting right acquisition method, device, electronic equipment and computer readable medium, belong to the field of blockchain technology.The method comprises: receiving first broadcast message from blockchain system, obtaining the image to be registered of user to be registered;With each historical user image stored locally in the node, the similarity of each historical user image is obtained, the similarity comparison result is generated, and the second broadcast message is sent to the blockchain system;If the sending time of the second broadcast message sent by the node is the earliest time in the sending time of all second broadcast messages in the blockchain system, it is determined that the node obtains the accounting right of the new block this time and generates the first new block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and more specifically to a method, apparatus, electronic device, and computer-readable medium for obtaining the right to record transactions. Background Technology

[0002] In the virtual world, if users need to register their images in a blockchain system, they need to cooperate to compare the images to be registered with the images in the historical records. Summary of the Invention

[0003] Therefore, the present invention provides a method, apparatus, electronic device, and computer-readable medium for obtaining the right to record transactions.

[0004] To achieve the above objectives, a first aspect of the present invention provides a method for acquiring the right to record transactions. The method includes: receiving a first broadcast message from a blockchain system; acquiring a user's image to be registered from the first broadcast message; comparing the image to be registered with each historical user image stored locally by the current node to obtain a similarity score for each historical user image; generating a similarity comparison result based on the acquired historical user images whose similarity scores meet predetermined conditions; and sending a second broadcast message generated based on the comparison result to the blockchain system; if the similarity comparison result contains a historical user image with a similarity score greater than a first similarity threshold, then determining that registration of the image to be registered has failed; if the sending time of the second broadcast message by the current node is the earliest among all second broadcast message sending times in the blockchain system, then determining that the current node has acquired the right to record transactions for the current new block and generating a first new block.

[0005] The image to be registered is the user image contained in the registration information used by the user to register in the blockchain system. The user to be registered is any user in the virtual system, and the user to be registered corresponds to a node in the blockchain system.

[0006] Receiving a first broadcast message from the blockchain system and obtaining the registration image of the user to be registered from the first broadcast message includes:

[0007] Within a predetermined time period, at least one first broadcast message is received from the blockchain system, and the user image of the user to be registered is obtained from each first broadcast message and used as the registration image of the user to be registered.

[0008] Before comparing the image to be registered with each historical user image stored locally on this node, the method further includes:

[0009] This node records the user images of all users throughout history;

[0010] If the total number of recorded user images exceeds the quantity threshold or the total size of the recorded user images exceeds the predetermined storage space size, then a portion of the images are selected from all the recorded user images and stored locally as each historical user image in this node.

[0011] The predetermined conditions include: the similarity is the maximum or the similarity is greater than the second similarity threshold, and the second similarity threshold is less than or equal to the first similarity threshold;

[0012] The step of generating a similarity comparison result based on historical user images whose similarity meets predetermined conditions, and sending a second broadcast message generated based on the comparison result to the blockchain system, includes:

[0013] Obtain the historical user image with the highest similarity in this similarity comparison, and use the historical user image with the highest similarity and the corresponding similarity as the comparison result of this node; or, use the historical user image with a similarity greater than the second similarity threshold as the first similar image, and use the number of the first similar images and the user identifier of the user corresponding to each first similar image as the comparison result of this node.

[0014] A second broadcast message is generated based on the comparison result of this node; the second broadcast message is signed using the private key of this node; and the second broadcast message carrying the signature of this node is sent to the blockchain system.

[0015] After determining that the node has obtained the right to record transactions for the new block and generating the first new block, the method further includes: recording the transaction reward information for the node itself in the first new block.

[0016] The blockchain system further includes at least one other node besides this node; the method further includes:

[0017] Historical user images whose similarity scores meet predetermined conditions, obtained by comparing the similarity scores of this node, are used as images to be verified.

[0018] The image to be verified is verified through the other nodes; wherein the verification steps include:

[0019] After receiving the second broadcast message sent by this node, the second node verifies the similarity comparison result of the image to be verified; wherein, the second node is any of the other nodes;

[0020] If the verification result is: there is no image with higher similarity in the historical user images stored in the second node, and the similarity between the image with higher similarity and the image to be registered is greater than the similarity between the image to be verified and the image to be registered, then the similarity comparison result of the image to be verified is approved.

[0021] If the second node determines that the accounting reward information recorded in the first newly added block meets the preset correctness verification conditions, it will approve the first newly added block so that the second node can compete for the right to record the next block in the blockchain system.

[0022] The verification step further includes:

[0023] If the verification result is that a higher similarity image exists in the historical user images stored in the second node, then a new block is regenerated;

[0024] The newly generated block records the higher similarity image, the first part of the reward information for this node, and the second part of the reward information for the second node; wherein the first part of the reward information and the second part of the reward information have a predetermined allocation ratio;

[0025] The image with higher similarity is used as a new image to be verified, and the other nodes verify the new image until each of the other nodes approves the newly generated block, so that each of the other nodes can compete for the right to record the next block in the blockchain system.

[0026] If the number of historical user images with a similarity greater than the first similarity threshold in the similarity comparison results is zero, the method further includes: recording the image to be registered in the blockchain system and determining that the image to be registered has been successfully registered.

[0027] A second aspect of the present invention provides an apparatus for acquiring the right to record transactions. The apparatus includes: a message receiving module for receiving a first broadcast message from a blockchain system and acquiring a user's image to be registered from the first broadcast message; an image comparison module for comparing the image to be registered with each historical user image stored locally by the node to obtain a similarity score for each historical user image; a result generation module for generating a similarity comparison result based on historical user images whose similarity scores meet predetermined conditions; a message sending module for sending a second broadcast message generated based on the comparison result to the blockchain system; a registration determination module for determining that registration of the image to be registered fails if the similarity comparison result contains a historical user image with a similarity score greater than a first similarity threshold; and a block generation module for determining that the node acquires the right to record transactions for the new block and generates a first new block if the sending time of the second broadcast message by the node is the earliest among all second broadcast message sending times in the blockchain system.

[0028] A third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory storing one or more programs thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the accounting right acquisition method of the present invention; and one or more I / O interfaces connected between the processors and the memory, configured to enable information interaction between the processors and the memory.

[0029] A fifth aspect of the present invention provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the above-described method for obtaining the right to keep accounts according to the present invention.

[0030] This invention has the following advantages: Nodes in the blockchain compare the similarity of each historical user image stored locally with the image to be registered, broadcast historical user images that meet the predetermined similarity conditions to the blockchain system, and if the node is the first to publish the historical user image that meets the predetermined similarity conditions to the blockchain system, then the node obtains the right to record the transaction in the new block and generates a new block, thereby solving the problem of how to determine the node that obtains the right to record the transaction and realizing that the node obtains the right to record the transaction based on the similarity comparison result. Attached Figure Description

[0031] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof.

[0032] Figure 1 A flowchart illustrating a method for obtaining the right to record transactions, as provided in an embodiment of the present invention;

[0033] Figure 2 A flowchart illustrating another method for obtaining the right to record transactions provided in an embodiment of the present invention;

[0034] Figure 3 A block diagram of an accounting right acquisition device provided in an embodiment of the present invention;

[0035] Figure 4 A block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0036] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0037] As used in this invention, the term "and / or" includes any and all combinations of one or more of the associated enumerated entries.

[0038] The terminology used in this invention is for describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0039] When the terms “comprising” and / or “made of” are used in this invention, they specify the presence of features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or groups thereof.

[0040] Embodiments of the present invention can be described with reference to plan views and / or cross-sectional views, using the ideal schematic diagrams of the invention. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances.

[0041] Unless otherwise specified, all terms used in this invention (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined by the invention.

[0042] In this embodiment of the invention, the metaverse is essentially a virtualization and digitization of the real world, requiring extensive modifications to content production, economic systems, user experience, and physical world content. The metaverse can provide immersive experiences based on extended reality technology, generate mirror images of the real world based on digital twin technology, and build an economic system based on blockchain technology, closely integrating the virtual and real worlds in terms of economic, social, and identity systems, while allowing each user to produce content and edit the world.

[0043] From a spatiotemporal perspective, the metaverse is a digital world that is virtual in the spatial dimension but real in the temporal dimension; from a realism perspective, the metaverse contains both digital replicas of the real world and creations of the virtual world; from an independence perspective, the metaverse is a parallel space that is both closely connected to the external real world and highly independent; from a connectivity perspective, the metaverse is a perpetual and widely covered virtual reality system that encompasses networks, hardware terminals, and users.

[0044] According to research by relevant scholars and records of technical data, the metaverse itself is not a technology, but a concept and idea. It needs to integrate different new technologies, such as 5G, 6G, artificial intelligence, big data, etc., and emphasizes the integration of the virtual and the real.

[0045] The metaverse primarily comprises the following core technologies: First, extended reality technologies, including Virtual Reality (VR) and Augmented Reality (AR). Extended reality technologies can provide immersive experiences. Second, digital twins, which can mirror the real world into the virtual world. Third, blockchain technology is used to build an economic system. As the metaverse further develops and its simulation of real society intensifies, resource exchange can be conducted within the metaverse, such as resource acquisition and allocation, as well as economic activities such as expenditures and revenues (e.g., spending money and making money), thus forming a resource system and economic system within the virtual world as well.

[0046] In some scenarios of this disclosure, when multiple different users register user images in the blockchain within the same time period, the blockchain nodes need to perform AI comparisons on each user image with user images in the historical records on the blockchain. In the later stages, due to the limited computing power of each node, it is often not possible to complete the comparison of the user image to be registered with all user images in the historical records. Instead, all nodes need to cooperate to complete the comparison, with each node only comparing the user image to be registered with a portion of user images in the historical records. Or, in other scenarios, a certain node may achieve the best result for comparing a certain user image. In the above scenarios, it is necessary to solve the problems of which node obtains the right to record transactions and how to distribute the rewards for recording transactions.

[0047] The authentication method, apparatus, and computer-readable medium of embodiments of the present invention are described in detail below with reference to the accompanying drawings. All of the following embodiments can be applied to the system architecture of this embodiment. For the sake of brevity, the following embodiments can be referenced and incorporated into each other.

[0048] The embodiments of this invention involve two parallel worlds in time and space: one is the real world (also called the real scene or the real world, which can correspond to the blockchain system), and the other is the virtual world of the metaverse (which can correspond to the metaverse system).

[0049] In a first aspect, embodiments of the present invention provide a method for obtaining the right to record transactions.

[0050] Figure 1 This is a flowchart illustrating a method for obtaining the right to record transactions according to an embodiment of the present invention. Figure 1 As shown, the method for obtaining the right to record transactions in this embodiment of the invention includes the following steps.

[0051] S110 receives the first broadcast message from the blockchain system and obtains the registration image of the user to be registered from the first broadcast message.

[0052] S120, compare the similarity of the image to be registered with each historical user image stored locally on this node to obtain the similarity of each historical user image.

[0053] S130: Based on the historical user images obtained that meet the predetermined similarity conditions, generate similarity comparison results, and send the second broadcast message generated based on the comparison results to the blockchain system.

[0054] S140, if the similarity comparison result contains historical user images with a similarity greater than the first similarity threshold, then it is determined that the registration of the image to be registered has failed.

[0055] S150, if the time when this node sends the second broadcast message is the earliest time among all the second broadcast messages in the blockchain system, then this node is determined to obtain the right to record the new block and generate the first newly added block.

[0056] According to the accounting right acquisition method of the present invention, a node in the blockchain compares the similarity of each historical user image stored locally with the image to be registered, broadcasts the historical user images that meet the predetermined similarity conditions to the blockchain system, and if the node is the first node to publish the historical user image that meets the predetermined similarity conditions to the blockchain system, then the node obtains the accounting right of the new block and generates a new block, thereby solving the problem of how to determine the node that obtains the accounting right.

[0057] In some embodiments, the image to be registered is a user image contained in the registration information used by the user to register in the blockchain system. The user to be registered is any user in the virtual system and corresponds to a node in the blockchain system.

[0058] In this embodiment, any user can register in the blockchain corresponding to the virtual system. The registration information used during registration includes at least one of the following items: user identifier, user public key, user name, and user image. The user name can be a nickname or alias; the user image can be, for example, a two-dimensional / three-dimensional image or portrait, used to convey the user's image and serve purposes such as beautification, commemoration, display, and promotion.

[0059] In some embodiments, step S110 may specifically include: receiving at least one first broadcast message from the blockchain system within a predetermined time period, and obtaining the user image of the user to be registered from each first broadcast message as the registration image of the user to be registered.

[0060] In this embodiment, if multiple users register their user images simultaneously within a certain time period, this node can receive multiple first broadcast messages, thereby obtaining the user images to be registered.

[0061] In some embodiments, before step S120, the method further includes: recording user images of all users in history on this node; if the total number of recorded user images is greater than a number threshold or the total size of recorded user images exceeds a predetermined storage space size, then selecting a portion of the recorded user images as each historical user image stored locally on this node.

[0062] For example, each historical user image is a registered image; different nodes may store different historical user images; for example, different nodes may store historical user images from different historical time periods, or different nodes may store historical user images from different storage locations. For example, the total number of historical user images stored by all nodes is equal to, for example, the sum of historical user images within a historical time period. This historical time period refers to a predetermined duration range prior to the current time, such as within 3 years, 5 years, or 10 years, and can be specifically set according to actual circumstances. This disclosure does not impose specific limitations on this embodiment.

[0063] In this embodiment, if the nodes in the blockchain system are located locally on the device, they can record user images of all users in history. If there are too many user images in history, exceeding a certain number threshold or a certain storage space size threshold, each node can choose to record only a portion of the historical user images, thereby saving storage space.

[0064] In some embodiments, the predetermined conditions include: the similarity is at its maximum or the similarity is greater than a second similarity threshold, and the second similarity threshold is less than or equal to a first similarity threshold.

[0065] In this embodiment, step S130 may specifically include the following steps.

[0066] S11, obtain the historical user image with the highest similarity in this similarity comparison, and use the historical user image with the highest similarity and the corresponding similarity as the comparison result of this node; or, use the historical user image with a similarity greater than the second similarity threshold as the first similar image, and use the number of first similar images and the user identifier of the user corresponding to each first similar image as the comparison result of this node.

[0067] S12, Generate a second broadcast message based on the comparison result of this node; Sign the second broadcast message using the private key of this node; Send the second broadcast message carrying the signature of this node to the blockchain system.

[0068] As one implementation of steps S11 and S12, after performing similarity comparison, the node can obtain the historical user image with the highest similarity to the image to be registered and the corresponding comparison result. After signing with private key, it can publish the result to the blockchain via broadcast message. The corresponding comparison result includes the similarity value between the historical user image with the highest similarity and the image to be registered.

[0069] As another implementation of steps S11 and S12, after performing similarity comparison, the node can obtain the number of historical user images that have a similarity greater than the second similarity threshold with the image to be registered from the historical user images participating in the comparison. After signing the number and the user identifier of the user corresponding to each historical user image that has a similarity greater than the second similarity threshold with the image to be registered with a private key, the node publishes it to the blockchain by broadcasting a message.

[0070] Through the above steps S11 and S12, this node can publish the similarity comparison result to the blockchain system. Other nodes in the blockchain system can obtain the historical user image with the highest similarity to the image to be registered published by this node from the second broadcast message of any implementation of the above steps S11 and S12.

[0071] In some embodiments, after determining that the node has obtained the right to record transactions for the new block and generating the first new block, the method further includes: recording the transaction reward information for the node itself in the first new block.

[0072] For example, the accounting reward information includes the reward quantity; the reward quantity can be a predetermined total number of rewards, or a portion of the predetermined total number of rewards. Specific settings can be customized according to actual needs, and this disclosure does not impose specific limitations.

[0073] In this embodiment, if this node is the first node to publish the historical user image that meets the predetermined similarity criteria to the blockchain system, then this node obtains the right to record the transaction in this new block, generates a new block, and includes a reward for itself in the new block, thereby solving the problems of how to determine the node that obtains the right to record the transaction and how to distribute the reward.

[0074] In some embodiments, the blockchain system further includes at least one other node besides the current node; the method further includes the following steps.

[0075] S21, the historical user images whose similarity meets the predetermined conditions obtained by similarity comparison at this node are used as images to be verified; S22, the images to be verified are verified by other nodes.

[0076] In this embodiment of the disclosure, the similarity comparison results published by this node to the blockchain need to be verified by other nodes.

[0077] In some embodiments, the verification steps of the similarity comparison result by other nodes include the following steps.

[0078] S31, after receiving the second broadcast message sent by this node, the second node verifies the similarity comparison result of the image to be verified; wherein, the second node is any of the other nodes.

[0079] S32, if the verification result is: there is no image with higher similarity in the historical user images stored in the second node, and the similarity between the image with higher similarity and the image to be registered is greater than the similarity between the image to be verified and the image to be registered, then the similarity comparison result of the image to be verified is accepted.

[0080] S33, if the second node determines that the accounting reward information recorded in the first newly added block meets the preset correctness verification conditions, it will approve the first newly added block so that the second node can compete for the right to record the next block in the blockchain system.

[0081] In this embodiment, if other nodes (e.g., the second node) approve the comparison result published by this node, they will begin to verify whether the new block record published by this node is correct. If the new block record is also verified to be correct, it means that other nodes approve the new block record published by this node. Based on this, the other node ends the accounting grabbing of the currently added block and proceeds to the accounting grabbing of the next block.

[0082] In some embodiments, the verification step of the similarity comparison result by other nodes further includes: S41, if the verification result is that there is a higher similarity image in the historical user images stored by the second node, then a new block is regenerated; S42, the higher similarity image, the first part of the reward information for this node, and the second part of the reward information for the second node are recorded in the newly generated block; wherein the first part of the reward information and the second part of the reward information have a predetermined allocation ratio.

[0083] Through the above steps S41 and S42, if any other node's local historical user image contains a higher similarity image, the new block can be ignored, and a new block can be regenerated. The higher similarity image is recorded in the new block. The regenerated new block contains a portion of the accounting reward for the other node itself and the accounting reward for the previous node (including the current node). The amount of accounting rewards for different nodes can be distributed according to a certain ratio.

[0084] S43, take the image with higher similarity as the new image to be verified, and verify the new image to be verified by other nodes until each of the other nodes approves the newly generated block, so that each of the other nodes can compete for the right to record the next block in the blockchain system.

[0085] In this step, more other nodes (such as nodes other than this node and the second node) obtain the higher similarity image based on the current newly added block, and continue to verify the higher similarity image until all nodes cannot find a higher similarity historical user image. This means that all nodes agree that the new block generated by the node with the highest similarity in the comparison result is acceptable, and on this basis, the right to record the next block will be contested.

[0086] Through the above steps S41-S43, if other nodes do not recognize the historical user image with the highest similarity currently published to the blockchain, and find an image with a higher similarity, a new block is regenerated. If other nodes recognize the new block, the competition for the next accounting right will be based on the new block.

[0087] In some embodiments, if the number of historical user images with a similarity greater than a first similarity threshold in the similarity comparison results is zero, the method further includes: recording the image to be registered in the blockchain system and determining that the image to be registered has been successfully registered.

[0088] In this embodiment, as long as the similarity between the historical user image and the image to be registered is not higher than a certain fixed threshold, the image to be registered can be used as the user image for this new registration, the user image for this new registration can be recorded in the blockchain system, and the registration can be determined to be valid.

[0089] In the accounting right acquisition method of this disclosure embodiment, each node in the blockchain system compares the similarity of its stored historical user images with the images to be registered, and publishes the similarity comparison results that meet the requirements to the blockchain; other nodes, as long as they find that the similarity between a certain portrait and the image to be registered is higher than the similarity between the historical user image and the image to be registered in the currently broadcast comparison results, that is, other nodes find historical user images with higher similarity, then broadcast it in the blockchain; based on the historical user image with the highest similarity currently broadcast, the node that published the historical user image with the highest similarity generates a new block, and the reward of the corresponding node is included in the new block; wherein, the corresponding node includes, for example, the node itself and the node that previously generated the new block in the current accounting right competition process; if other nodes recognize the historical user image with higher similarity and also recognize the record in the current new block, then the accounting right competition for the next block is carried out; if they do not recognize it and find other higher similarity, then a new block is regenerated, and if other nodes recognize the new block, then the competition for the next accounting right is carried out based on the new block.

[0090] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0091] Figure 2 This illustration shows a method for obtaining the right to record transactions according to an exemplary embodiment of this disclosure. For example... Figure 2 As shown, the method for acquiring the right to record transactions includes the following steps.

[0092] S201: Any user registers in the blockchain system and broadcasts the user image to be registered as the image to be registered to the blockchain.

[0093] In this step, any user registers on the blockchain. Registration information (or registration content) includes the user's public key, user identifier, nickname, and a 2D / 3D portrait (i.e., user image). Once a user generates a user image, this image is used as the image to be registered. This image is then signed with a private key on the blockchain, and the image carrying the private key signature is broadcast as a broadcast message. If multiple users register their user images on the blockchain system within a certain time period, each user image can correspond to its own broadcast message.

[0094] S202, each node in the blockchain system obtains historical user images.

[0095] In this step, nodes in the blockchain pre-record user images of all users in history (these users can be successfully registered users) locally. If there are too many user images in history, for example, the total number exceeds a certain threshold or the total size exceeds a certain storage space size threshold, each node can choose to record only a portion of the historical user images.

[0096] S203, nodes in the blockchain system perform similarity comparisons on images to be registered.

[0097] In this step, if any node in the blockchain is referred to as the first node, after receiving multiple registration broadcasts (hereinafter referred to as first broadcast messages) within a certain fixed time interval after the previous block in the blockchain is generated, the first node in the blockchain obtains the image to be registered from each registration broadcast, obtains multiple images to be registered, and performs the accounting right acquisition processing of this embodiment for each image to be registered.

[0098] Specifically, the private key signature of the image to be registered in the first broadcast message is verified. If the verification is successful, each image to be registered is compared with its own locally recorded historical user images using Artificial Intelligence (AI).

[0099] After the comparison is complete, for any image to be registered, the first node can take the historical user image with the highest similarity among all historical user images compared in this comparison, along with the comparison result, as the similarity comparison result. This similarity comparison result is then signed with a private key and published to the blockchain via a second broadcast message. The comparison result includes the similarity between the historical user image with the highest similarity and the image to be registered. Other nodes, upon receiving this second broadcast message, can directly obtain the historical user image with the highest similarity published by the first node.

[0100] Alternatively, the first node can use the number of images with similarity exceeding a threshold from all historical user images compared, along with the corresponding user's identification information, as the similarity comparison result. This result is then signed with a private key and published to the blockchain via a second broadcast message. Assuming the number of images exceeding the similarity threshold is N (N is greater than or equal to 1), after receiving the second broadcast message, other nodes can obtain these N historical user images with similarity exceeding the threshold using the corresponding user's identification information. They can then further compare these images to obtain the historical user image with the highest similarity published by the first node.

[0101] S204, in a blockchain system, nodes compete for the right to record transactions based on the similarity comparison results of images to be registered.

[0102] In this step, if the similarity is higher than a certain preset absolute threshold, the registration of the corresponding user's image is considered to have failed. The node that first publishes the similarity comparison results containing historical user images with similarity higher than the preset absolute threshold, or the node that first publishes the similarity comparison results containing the number of images with similarity exceeding the preset threshold (which is less than or equal to the preset absolute threshold) among all historical user images in this comparison, as well as the corresponding user's identification information, obtains the right to record the new block, generates a new block, and includes its own reward in the new block. At this time, the newly registered portrait is not recorded in the new block.

[0103] S205, other nodes verify the comparison result of the newly generated block. If they accept the comparison result, they will proceed to seize the accounting for the next block after verifying the correctness of the new block record.

[0104] In this step, other nodes verify the comparison results published by the node. If they accept the comparison results, they verify whether the new block record is correct. If it is correct, they proceed to seize the accounting for the next block based on this.

[0105] S206 If other nodes obtain images with higher similarity, they will regenerate new blocks.

[0106] In this step, if other nodes only partially approve, for example, if the similarity between a newly registered portrait and a historical user's image is not the highest, then that block is ignored, and a new block is replaced by a record with higher similarity from the node itself (the new block contains a portion of the reward for the node's own accounting and a portion of the reward for the previous node's accounting, distributed according to a certain ratio).

[0107] S207, other nodes continue verification until all nodes cannot find a historical user image with higher similarity, and then compete for the right to record the next block.

[0108] In this step, other nodes continue to search for images with higher similarity until all nodes cannot find historical user images with higher similarity. This indicates that all nodes agree that the new block generated by the node with the highest similarity in the comparison results is valid, and the right to record the next block is then contested based on this.

[0109] In this embodiment, as long as the similarity between the finally found historical user image and the image to be registered is not higher than a certain fixed threshold (such as the preset absolute threshold in the above embodiment), the newly registered portrait can be recorded in the blockchain, and this registration is valid.

[0110] The accounting right acquisition method of this disclosure can complete the similarity comparison of images to be registered through cooperation of all nodes. Based on the historical user image with the highest similarity currently broadcast, the node that publishes the historical user image with the highest similarity generates a new block and includes the reward of the corresponding node in the new block. If other nodes recognize the historical user image with a higher similarity and also recognize the record in the current new block, they will compete for the accounting right of the next block. If they do not recognize it and find other higher similarity, a new block will be regenerated. If other nodes recognize the new block, they will compete for the accounting right of the next block based on the new block.

[0111] Secondly, embodiments of the present invention provide a device for obtaining the right to record transactions.

[0112] Figure 3 A block diagram of an accounting right acquisition device according to an embodiment of this disclosure is shown. Figure 3 As shown, the accounting right acquisition device 300 includes the following modules.

[0113] The message receiving module 310 is used to receive the first broadcast message from the blockchain system and obtain the registration image of the user to be registered from the first broadcast message;

[0114] The image comparison module 320 is used to compare the similarity of the image to be registered with each historical user image stored locally on this node to obtain the similarity of each historical user image.

[0115] The result generation module 330 is used to generate similarity comparison results based on historical user images whose similarity meets predetermined conditions.

[0116] The message sending module 340 is used to send the second broadcast message generated based on the comparison result to the blockchain system;

[0117] The registration determination module 350 is used to determine that the registration of the image to be registered fails if the similarity comparison result contains a historical user image with a similarity greater than the first similarity threshold.

[0118] The block generation module 360 ​​is used to determine that if the time when this node sends the second broadcast message is the earliest time when all second broadcast messages are sent in the blockchain system, then this node will obtain the right to record the new block and generate the first new block.

[0119] In some embodiments, the image to be registered is a user image contained in the registration information used by the user to register in the blockchain system. The user to be registered is any user in the virtual system and corresponds to a node in the blockchain system.

[0120] The message receiving module 310 is specifically used to receive at least one first broadcast message from the blockchain system within a predetermined time period, and to obtain the user image of the user to be registered from each first broadcast message as the registration image of the user to be registered.

[0121] The accounting right acquisition device 300 also includes: a historical image acquisition module; before the image comparison module 320 compares the image to be registered with each historical user image stored locally in this node, the historical image acquisition module is used to: record user images of all users in history in this node; if the total number of recorded user images is greater than the number threshold or the total size of recorded user images exceeds the predetermined storage space size, then select a portion of the images from all the recorded user images as each historical user image stored locally in this node.

[0122] In some embodiments, the predetermined conditions include: the similarity is the maximum or the similarity is greater than a second similarity threshold, and the second similarity threshold is less than or equal to a first similarity threshold;

[0123] The result generation module 330 is specifically used to: obtain the historical user image with the highest similarity in this similarity comparison, and use the historical user image with the highest similarity and the corresponding similarity as the comparison result of this node; or, use the historical user image with a similarity greater than the second similarity threshold as the first similar image, and use the number of first similar images and the user identifier of the user corresponding to each first similar image as the comparison result of this node.

[0124] The message sending module 340 is specifically used for: generating a second broadcast message based on the comparison result of this node; signing the second broadcast message using the private key of this node; and sending the second broadcast message carrying the signature of this node to the blockchain system.

[0125] In some embodiments, the accounting right acquisition device 300 further includes an information recording module; after the block generation module 360 ​​determines that the node has obtained the accounting right of the new block and generates the first new block, the information recording module is used to record the accounting reward information for its own node in the first new block.

[0126] In some embodiments, the blockchain system further includes: at least one other node besides the current node; the accounting right acquisition device 300 further includes: a verification module, used to take historical user images whose similarity meets predetermined conditions obtained by similarity comparison of the current node as images to be verified; and to verify the images to be verified by other nodes.

[0127] Specifically, the verification module performs the following: After receiving the second broadcast message sent by its own node, the second node verifies the similarity comparison result of the image to be verified; the second node can be any of the other nodes; if the verification result is: there is no image with higher similarity in the historical user images stored by the second node, and the similarity between the image with higher similarity and the image to be registered is greater than the similarity between the image to be verified and the image to be registered, then the similarity comparison result of the image to be verified is accepted; if the second node determines that the accounting reward information recorded in the first newly added block meets the preset correctness verification conditions, it accepts the first newly added block, so that the second node can compete for the right to record the next block in the blockchain system.

[0128] In some embodiments, the verification module, when performing verification, is further configured to: if the verification result is that there is a higher similarity image among the historical user images stored by the second node, then regenerate a new block; record the higher similarity image, the first part of the reward information for this node, and the second part of the reward information for the second node in the regenerated new block; wherein the first part of the reward information and the second part of the reward information have a predetermined allocation ratio; use the higher similarity image as a new image to be verified, and verify the new image to be verified by other nodes until each of the other nodes approves the regenerated new block, so that each of the other nodes can compete for the right to record the next block in the blockchain system.

[0129] In some embodiments, if the number of historical user images with a similarity greater than a first similarity threshold in the similarity comparison results is zero, the accounting right acquisition device 300 further includes: a registration module, used to record the image to be registered in the blockchain system and determine that the image to be registered has been successfully registered.

[0130] The accounting right acquisition device of this disclosure can complete the similarity comparison of images to be registered through cooperation of all nodes. Based on the historical user image with the highest similarity currently broadcast, the node that publishes the historical user image with the highest similarity generates a new block and includes the reward of the corresponding node in the new block. If other nodes recognize the historical user image with a higher similarity and also recognize the record in the current new block, they will compete for the accounting right of the next block. If they do not recognize it and find other higher similarity, a new block will be regenerated. If other nodes recognize the new block, they will compete for the accounting right of the next block based on the new block.

[0131] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0132] It should be clarified that the present invention is not limited to the specific configurations and processes described in the above embodiments and shown in the figures. For the sake of convenience and brevity, detailed descriptions of known methods are omitted here, and the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

[0133] Reference Figure 4 This invention provides an electronic device comprising:

[0134] One or more processors 401;

[0135] The memory 402 stores one or more programs that, when executed by one or more processors, enable the one or more processors to implement any of the above-mentioned methods for acquiring the right to record transactions.

[0136] One or more input / output (I / O) interfaces 403 are connected between the processor 401 and the memory 402 and configured to enable information exchange between the processor 401 and the memory 402.

[0137] The processor 401 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 402 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as synchronous dynamic random access memory (SDRAM), double data rate (DDR) synchronous dynamic random access memory, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface 403 is connected between the processor 401 and the memory 402, enabling information exchange between the processor 401 and the memory 402, including but not limited to a data bus.

[0138] In some embodiments, the processor 401, memory 402, and I / O interface 403 are interconnected via a bus, and thus connected to other components of the computing device.

[0139] This embodiment also provides a computer-readable medium having a computer program stored thereon. When the program is executed by a processor, it implements the method provided in this embodiment. To avoid repetition, the specific steps of the method in this embodiment will not be repeated here.

[0140] Those skilled in the art will understand that all or some of the steps, systems, or apparatuses in the methods, systems, and apparatuses described above can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0141] 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. Unless otherwise specified, 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.

[0142] Those skilled in the art will understand that although some embodiments described herein include certain features that are included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of this embodiment and form different embodiments.

[0143] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A method for acquiring the right to record transactions, characterized in that, The method includes: Receive the first broadcast message from the blockchain system, and obtain the registration image of the user to be registered from the first broadcast message; The similarity of the image to be registered is compared with that of each historical user image stored locally on this node to obtain the similarity of each historical user image; Based on the historical user images obtained that meet the predetermined similarity conditions, a similarity comparison result is generated, and a second broadcast message generated based on the comparison result is sent to the blockchain system so that other nodes in the blockchain system can verify the similarity comparison result; different nodes store different historical user images, and the second broadcast message includes the historical user image or a user identifier corresponding to the historical user image; If the similarity comparison result contains historical user images with a similarity greater than the first similarity threshold, then it is determined that the registration of the image to be registered has failed. If the time when this node sends the second broadcast message is the earliest time among all the times when the second broadcast message is sent in the blockchain system, then this node is determined to obtain the right to record the new block and generate the first new block. If the verification result shows that there is a more similar image in the historical user images stored by the second node, it is determined that the second node has the right to record the new block and generates a second new block. The second new block includes a first part of the reward information for this node and a second part of the reward information for the second node. The first part of the reward information and the second part of the reward information have a predetermined allocation ratio. If the number of historical user images with a similarity greater than the first similarity threshold in the similarity comparison results is zero, the method further includes: recording the image to be registered in the blockchain system and determining that the registration of the image to be registered has been successful.

2. The method according to claim 1, characterized in that, The image to be registered is the user image contained in the registration information used by the user to register in the blockchain system. The user to be registered is any user in the virtual system, and the user to be registered corresponds to a node in the blockchain system. Receiving a first broadcast message from the blockchain system and obtaining the registration image of the user to be registered from the first broadcast message includes: Within a predetermined time period, at least one first broadcast message is received from the blockchain system, and the user image of the user to be registered is obtained from each first broadcast message and used as the registration image of the user to be registered. Before comparing the image to be registered with each historical user image stored locally on this node, the method further includes: This node records the user images of all users throughout history; If the total number of recorded user images exceeds the quantity threshold or the total size of the recorded user images exceeds the predetermined storage space size, then a portion of the images are selected from all the recorded user images and stored locally as each historical user image in this node.

3. The method according to claim 1, characterized in that, The predetermined conditions include: the similarity is the maximum or the similarity is greater than the second similarity threshold, and the second similarity threshold is less than or equal to the first similarity threshold; The step of generating a similarity comparison result based on historical user images whose similarity meets predetermined conditions, and sending a second broadcast message generated based on the comparison result to the blockchain system, includes: Obtain the historical user image with the highest similarity in this similarity comparison, and use the historical user image with the highest similarity and its corresponding similarity as the comparison result of this node; or, Historical user images with a similarity greater than the second similarity threshold are used as first similar images, and the number of first similar images and the user identifier of the user corresponding to each first similar image are used as the comparison result of this node. A second broadcast message is generated based on the comparison result of this node; the second broadcast message is signed using the private key of this node; and the second broadcast message carrying the signature of this node is sent to the blockchain system.

4. The method according to claim 1, characterized in that, After determining that the node has obtained the right to record transactions for the new block and generating the first new block, the method further includes: recording the transaction reward information for the node itself in the first new block.

5. The method according to claim 1, characterized in that, The blockchain system also includes: at least one other node besides this node; the method further includes: Historical user images whose similarity scores meet predetermined conditions, obtained by comparing the similarity scores of this node, are used as images to be verified. The image to be verified is verified through the other nodes; wherein the verification steps include: After receiving the second broadcast message sent by this node, the second node verifies the similarity comparison result of the image to be verified; wherein, the second node is any of the other nodes; If the verification result is: there is no image with higher similarity in the historical user images stored in the second node, and the similarity between the image with higher similarity and the image to be registered is greater than the similarity between the image to be verified and the image to be registered, then the similarity comparison result of the image to be verified is approved. If the second node determines that the accounting reward information recorded in the first newly added block meets the preset correctness verification conditions, it will approve the first newly added block so that the second node can compete for the right to record the next block in the blockchain system.

6. The method according to claim 5, characterized in that, The verification step also includes: If the verification result is that a higher similarity image exists in the historical user images stored in the second node, then a new block is regenerated; The newly generated block records the higher similarity image, the first part of the reward information for this node, and the second part of the reward information for the second node; wherein the first part of the reward information and the second part of the reward information have a predetermined allocation ratio; The image with higher similarity is used as a new image to be verified, and the other nodes verify the new image until each of the other nodes approves the newly generated block, so that each of the other nodes can compete for the right to record the next block in the blockchain system.

7. A device for acquiring the right to record transactions, characterized in that, The device includes: The message receiving module is used to receive the first broadcast message from the blockchain system and obtain the registration image of the user to be registered from the first broadcast message; The image comparison module is used to compare the image to be registered with each historical user image stored locally on this node to obtain the similarity of each historical user image; The result generation module is used to generate similarity comparison results based on historical user images whose similarity meets predetermined conditions. The message sending module is used to send a second broadcast message generated based on the comparison result to the blockchain system so that other nodes in the blockchain system can verify the similarity comparison result; different nodes store different historical user images, and the second broadcast message includes the historical user image or a user identifier corresponding to the historical user image; The registration determination module is used to determine that the registration of the image to be registered fails if the similarity comparison result contains a historical user image with a similarity greater than a first similarity threshold. The block generation module is used to determine that if the time when this node sends the second broadcast message is the earliest time when all second broadcast messages are sent in the blockchain system, then this node obtains the right to record the new block and generates the first new block. The verification module is used to determine that the second node has the right to record the new block and generate a second new block if the verification result shows that there is a higher similarity image in the historical user images stored by the second node. The second new block includes a first part of reward information for the node and a second part of reward information for the second node. The first part of reward information and the second part of reward information have a predetermined allocation ratio. The device is further configured to: if the number of historical user images with a similarity greater than a first similarity threshold in the similarity comparison results is zero, then record the image to be registered in the blockchain system and determine that the registration of the image to be registered is successful.

8. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method according to any one of claims 1-6; One or more I / O interfaces are connected between the processor and the memory and configured to enable information interaction between the processor and the memory.

9. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1-6.