Blockchain network-based voting method, voting information storage method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2026-08-11
AI Technical Summary
[0066]在本申请实施例中,通过将投票信息存储于区块头之中,可在提升投票信息的安全性时便于投票信息的获取和查找,提升投票信息的获取效率,并可对投票信息进行溯源的投票存储方式,适用性高。
Smart Images

Figure CN116226818B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a voting method, voting information storage method and apparatus based on a blockchain network. Background Technology
[0002] With the continuous advancement of technology, voting mechanisms are often needed in daily life for researching or making decisions. Current voting methods typically involve applications directly providing users with voting options, followed by the aggregation and analysis of the voting results.
[0003] However, in existing voting methods, voting information and results are often directly stored on the server or database corresponding to the application that provides the voting. The voting information and results are not public or transparent, and are easily tampered with by others, resulting in low security and stability of voting information and results. Summary of the Invention
[0004] This application provides a voting method, voting information storage method and apparatus based on a blockchain network, which can improve the security and stability of voting information during the voting process and has high applicability.
[0005] On one hand, embodiments of this application provide a voting method based on a blockchain network, the method comprising:
[0006] Determine the target object characteristics, and based on these characteristics, generate a blockchain verification identifier for the target object.
[0007] Based on the blockchain verification identifier of the aforementioned target object, target voting information that the aforementioned target object has voting qualifications is determined from the blockchain network. The aforementioned target voting information is stored in the block header of a block in the aforementioned blockchain network. When the aforementioned target voting information is stored in the block header, it is the voting information with the highest reward resources in the voting information pool of the aforementioned blockchain network. The reward resources corresponding to each voting information in the aforementioned voting information pool are provided by the corresponding voting initiator when initiating the voting information.
[0008] The aforementioned target voting information is sent to the display terminal so that the aforementioned target object votes based on the aforementioned target voting information displayed on the display terminal.
[0009] On the other hand, embodiments of this application provide a method for storing voting information, the method comprising:
[0010] The reward resources corresponding to each voting information in the voting information pool of the blockchain network are determined, and the reward resources corresponding to each of the above voting information are provided by the voting initiator corresponding to the voting information when initiating the voting information;
[0011] The first vote information with the highest reward resources is determined, and a target block is generated through the target node. The first vote information is stored in the block header of the target block.
[0012] The aforementioned target block is added to the aforementioned blockchain network, and the reward resources corresponding to the aforementioned first voting information are provided to the aforementioned target nodes.
[0013] On the other hand, embodiments of this application provide a voting device based on a blockchain network, the device comprising:
[0014] The identifier generation module is used to determine the target object characteristics of the target object and generate a blockchain verification identifier for the target object based on the target object characteristics.
[0015] The information determination module is used to determine the target voting information that the target object has voting qualifications from the blockchain network based on the blockchain verification identifier of the target object. The target voting information is stored in the block header of a block in the blockchain network. When the target voting information is stored in the block header, it is the voting information with the highest reward resources in the voting information pool of the blockchain network. The reward resources corresponding to each voting information in the voting information pool are provided by the corresponding voting initiator when initiating the voting information.
[0016] The sending module is used to send the target voting information to the display terminal so that the target object can vote based on the target voting information displayed on the display terminal.
[0017] Optionally, the above-mentioned identifier generation module is used for:
[0018] Determine the matching degree between each object feature in the object feature library and the above target object features;
[0019] The object feature corresponding to the highest matching degree and a matching degree greater than a preset threshold is determined as the first object feature that matches the above target object feature, and the object identifier corresponding to the above first object feature is determined as the target object identifier of the above target object.
[0020] Based on the aforementioned target object identifier and characteristics, a blockchain verification identifier for the aforementioned target object is generated.
[0021] Optionally, the above-mentioned identifier generation module is used for:
[0022] Based on the above target object identifier and above target object characteristics, generate the feature code corresponding to the above target object;
[0023] The above feature encoding is hashed, and the private key of the target object is determined based on the hash value of the above feature encoding;
[0024] The public key of the target object is determined based on the aforementioned private key;
[0025] Based on the public key of the aforementioned target object, the blockchain verification identifier of the aforementioned target object is determined.
[0026] Optionally, the above information determination module is used for:
[0027] Determine the valid voting information among the various voting information stored in the blockchain network;
[0028] For each of the above valid voting information, the authentication script corresponding to the valid voting information is obtained from the block header corresponding to the valid voting information;
[0029] The authentication script corresponding to each of the above valid voting information is used to verify the target blockchain verification identifier, so as to determine the target voting information of the target object with voting information from each of the above valid voting information.
[0030] Optionally, the above information determination module is used for:
[0031] The above-mentioned blockchain verification identifier is verified based on the authentication script corresponding to each of the above-mentioned valid voting information. The valid voting information corresponding to the authentication script when the above-mentioned blockchain verification identifier meets the preset conditions is determined as candidate voting information.
[0032] Each of the aforementioned candidate voting information is identified as the target voting information for which the target object is eligible to vote.
[0033] The aforementioned blockchain verification identifier must meet at least one of the following preset conditions:
[0034] The creation time of the aforementioned blockchain verification identifier meets the preset creation requirements;
[0035] The historical vote count of the target object corresponding to the above blockchain verification identifier meets the preset number requirement;
[0036] The transferred resources of the target object corresponding to the aforementioned blockchain verification identifier meet the preset resource quantity requirements.
[0037] Optionally, the above-mentioned sending module is also used for:
[0038] Obtain the target voting results from the aforementioned target objects regarding the aforementioned target voting information;
[0039] The target voting result is sent to the blockchain network so that the blockchain network stores the target voting result when it determines that the target voting result is a valid voting result. The target voting result is stored in the block body of any block in the blockchain network.
[0040] Optionally, the above-mentioned sending module is also used for:
[0041] The target voting results are hashed to obtain the first digest of the target voting results.
[0042] The first digest is encrypted using the private key of the target object to obtain a digital signature of the target voting result.
[0043] The aforementioned digital signature and the public key of the aforementioned target object are sent to the aforementioned blockchain network so that the aforementioned blockchain network can determine the validity of the aforementioned target voting result based on the aforementioned digital signature and the aforementioned public key.
[0044] On the other hand, embodiments of this application provide a voting information storage device, which includes:
[0045] The resource determination module is used to determine the reward resources corresponding to each voting information in the voting information pool of the blockchain network. The reward resources corresponding to each of the above voting information are provided by the voting initiator corresponding to the voting information when initiating the voting information.
[0046] The block generation module is used to determine the first voting information with the highest reward resources, generate the target block through the target node, and store the first voting information in the block header of the target block.
[0047] The resource processing module is used to add the target block to the blockchain network and provide the target node with the reward resources corresponding to the first voting information.
[0048] Optionally, the block generation module described above is also used for:
[0049] Obtain the target voting results for the target voting information, wherein the target voting information is the valid voting information among the various voting information stored in the blockchain network;
[0050] If the target voting result is determined to be a valid voting result by the verification nodes in the aforementioned blockchain network, then the target voting result is stored, wherein the target voting result is stored in the block body of any block in the aforementioned blockchain network.
[0051] Optionally, the above-mentioned block generation module is used for:
[0052] Obtain the digital signature of the aforementioned target voting result, and the public key of the aforementioned target object;
[0053] The target voting result, the digital signature, and the public key are broadcast to each verification node in the blockchain network, so that each verification node performs a hash calculation on the target voting result to obtain a second digest of the target voting result, decrypts the digital signature based on the public key to obtain a first digest of the target voting result, and compares the first digest with the second digest.
[0054] If the first and second summaries of the verification nodes with a predetermined proportion are consistent, then the target voting result is determined to be a valid voting result.
[0055] Optionally, the resource processing module described above is also used for:
[0056] Provide preset reward resources to the aforementioned target groups.
[0057] Optionally, the block generation module described above is also used for:
[0058] Determine the longest blockchain containing the target block mentioned above;
[0059] Determine the latest block of the longest blockchain at any point in time after the target block is added;
[0060] If the height difference between the latest block height and the target block height is less than or equal to the preset block height, then the first voting information in the target block is determined to be valid voting information at that moment.
[0061] On the other hand, embodiments of this application provide an electronic device, including a processor and a memory, which are interconnected;
[0062] The aforementioned memory is used to store computer programs;
[0063] The processor described above is configured to execute the voting or voting information storage method based on a blockchain network provided in the embodiments of this application when the computer program described above is invoked.
[0064] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program that is executed by a processor to implement the voting or voting information storage method based on a blockchain network provided in embodiments of this application.
[0065] On the other hand, embodiments of this application provide a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the voting or voting information storage method based on a blockchain network provided in embodiments of this application.
[0066] In this embodiment of the application, by storing voting information in the block header, the security of voting information can be improved while facilitating the acquisition and retrieval of voting information, thereby improving the efficiency of acquiring voting information and enabling traceability of voting information. This voting storage method has high applicability. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 This is a schematic diagram of the network architecture provided in the embodiments of this application;
[0069] Figure 2 This is a flowchart illustrating the voting method based on a blockchain network provided in an embodiment of this application;
[0070] Figure 3 This is a schematic diagram illustrating a scenario for obtaining object information provided in an embodiment of this application;
[0071] Figure 4 This is a schematic diagram of a scenario for determining object features provided in an embodiment of this application;
[0072] Figure 5 This is a schematic diagram illustrating a scenario for determining a blockchain verification identifier, as provided in an embodiment of this application.
[0073] Figure 6 This is a flowchart illustrating the process of determining the characteristics of a target object according to an embodiment of this application;
[0074] Figure 7a This is the structure of the block header provided in the embodiments of this application;
[0075] Figure 7b This is a schematic diagram of the block structure provided in the embodiments of this application;
[0076] Figure 8 This is a schematic diagram of the blockchain structure provided in the embodiments of this application;
[0077] Figure 9 This is a schematic diagram of a scenario for determining Merkel tree roots provided in an embodiment of this application;
[0078] Figure 10 This is a schematic diagram illustrating a scenario for obtaining valid voting information provided in an embodiment of this application;
[0079] Figure 11 This is a schematic diagram of a scenario for displaying voting information provided in an embodiment of this application;
[0080] Figure 12 This is a flowchart illustrating the voting information storage method provided in an embodiment of this application;
[0081] Figure 13 This is a schematic diagram of the structure of the voting device based on a blockchain network provided in an embodiment of this application;
[0082] Figure 14 This is a schematic diagram of the structure of the voting information storage device provided in the embodiments of this application;
[0083] Figure 15 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0084] 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, and 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.
[0085] See Figure 1 , Figure 1 This is a schematic diagram of the network architecture provided in the embodiments of this application. Figure 1 The network architecture shown includes server 11, display terminal 12, and blockchain network 13.
[0086] Among them, server 11 can be the server corresponding to display terminal 12, or the server corresponding to the application running on display terminal 12, such as the server corresponding to payment application, etc. The specific server can be determined based on the actual application scenario requirements, and there are no restrictions here.
[0087] When voting services are required to be provided through display terminal 12, server 11 can determine the target object characteristics of the target object and generate a blockchain verification identifier for the target object based on these characteristics. Specifically, server 11 can obtain object information of the target object through display terminal 12 and determine the target object characteristics based on this information, or it can determine the object information of the target object through other means and then determine the target object characteristics based on this information.
[0088] Furthermore, server 11 can determine the target voting information of the target object with voting qualifications from blockchain network 13 based on the blockchain verification identifier of the target object, and then send the target voting information to display terminal 12 so that the target object can vote based on the target voting information displayed on display terminal 12.
[0089] The blockchain network 13 may include multiple nodes, and the server 11 may determine the target voting information of the target object with voting qualifications from the block header of each block of the blockchain corresponding to any node in the blockchain network (such as any one of node 1, node 2, node 3 and node 4).
[0090] Optionally, server 11 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Display terminal 12 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle terminal, smart TV, etc., but is not limited to these. Display terminal 12 and server 11 can be directly or indirectly connected via wired or wireless communication, without limitation.
[0091] Optionally, server 11 and display terminal 12 can also be related devices in the Internet of Things (IoT). For example, display terminal 12 is a payment terminal with display function in the IoT, and server 11 is a server in the IoT used to process data.
[0092] The Internet of Things (IoT) is an extension and expansion of the internet, forming a vast network that combines various information sensing devices with the internet to achieve interconnection and interoperability between people, machines, and things anytime, anywhere. The IoT is an important component of the next generation of information technology, connecting various devices to the internet according to agreed-upon protocols for information exchange and communication.
[0093] Optionally, the server 11 and the display terminal 12 can be related devices in the cloud IoT, which aims to connect the information sensed and the instructions received by the sensing devices in the traditional Internet of Things to the Internet, truly realize networking, and realize massive data storage and computing through cloud computing technology and cloud storage technology.
[0094] See Figure 2 , Figure 2 This is a flowchart illustrating the voting method based on a blockchain network provided in this application embodiment. Figure 2 The voting method based on a blockchain network shown can be applied to a server and may specifically include the following steps:
[0095] Step S21: Determine the target object characteristics and generate a blockchain verification identifier for the target object based on the target object characteristics.
[0096] In some feasible implementations, the target object features can be determined based on the target object's object information. That is, the object information of the target object is obtained, and the target object features are determined after feature processing of the object information.
[0097] The target object's information includes, but is not limited to, the target object's biometric information and other relevant information that can prove the target object's identity, such as an ID card number. The aforementioned biometric information can be fingerprint information, facial images, iris information, or voiceprint information, etc., and the specific information can be determined based on the actual application scenario requirements; no restrictions are imposed here.
[0098] Specifically, the object information of the target object can be obtained through a display terminal connected to the server. For example, the display terminal can collect the object information of the target object through a bio-information collection device (camera, microphone, etc.). The server obtains the object information of the target object from the display terminal and determines the target object characteristics of the target object based on the object information.
[0099] The display terminal can acquire object information of the target object by triggering an information collection operation based on the target object, and then send the object information to the server, so that the server can acquire the object information of the target object.
[0100] For example, see Figure 3 , Figure 3 This is a schematic diagram of a scenario for obtaining object information provided in an embodiment of this application. Figure 3 The display terminal shown can be a payment terminal. When the target object determines to make a payment via facial recognition, the display terminal can capture the target object's facial image and use it as the target object's object information. The server can then obtain the target object information sent by the display terminal to determine the target object's characteristics based on that information.
[0101] Optionally, the server may respond to an information collection operation triggered by the target object based on the display terminal, and determine the identity information of the target object based on the operation, and then determine the target object characteristics of the target object from the server's storage space or the storage space associated with the server based on the identity information of the target object.
[0102] The aforementioned information collection operation can be a confirmation voting operation triggered by the target object based on the display terminal, or a prediction operation of the target object detected by the display terminal when the target object has given prior consent to obtain its object information, such as a face recognition payment or fingerprint recognition payment operation triggered by the target object through the display terminal.
[0103] For example, if the display terminal is a payment terminal, the object information of the target object obtained by the server from the display terminal may be the object information obtained by the display terminal after scanning the payment code presented by the target object or after determining that the target object has scanned the payment code displayed on the display terminal.
[0104] For example, if the display terminal is running an application, the object information of the target object obtained by the server from the display terminal can be the object information obtained by the display terminal when the application is at the target program node. This target program node can be a preset program node for payment end program node, comment end program node, etc., and there are no restrictions here.
[0105] It is understood that the object information and target object identifiers involved in the embodiments of this application, as well as other data related to the target object, require the permission or consent of the target object when applied to specific products or technologies, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0106] In some feasible implementations, when generating a blockchain verification identifier for a target object based on its characteristics, the feature code corresponding to the target object can be generated based on the target object's characteristics.
[0107] One approach is to take the absolute value of the target object's features to obtain the feature code corresponding to the target object.
[0108] Alternatively, the absolute value of the target object's features can be processed and then scaled by a certain ratio, such as by 100 times, to obtain the feature code corresponding to the target object.
[0109] Alternatively, the target object features can be reduced in dimensionality to obtain low-dimensional target object features, and then feature processing can be performed on the low-dimensional target object features, such as taking absolute values and / or taking absolute values and then performing numerical scaling to obtain the feature encoding of the target object.
[0110] Furthermore, a hash calculation is performed on the feature encoding of the target object, and the private key of the target object is determined based on the hash value of the feature encoding. Alternatively, the hash value of the feature encoding can be directly used as the private key of the target object, or the first 128 bits of the hash value can be retained to obtain the private key. The specific method can be determined based on the actual application scenario requirements, and no restrictions are imposed here.
[0111] Furthermore, the public key of the target object can be determined based on its private key. For example, the public key of the target object can be obtained by calculating its private key using the Elliptic Curve Digital Signature Algorithm (ECDSA).
[0112] Furthermore, based on the public key of the target object, a blockchain verification identifier for the target object can be determined. For example, the public key of the target object can be hashed, and the hash value of the public key can be used as the blockchain verification identifier for the target object. The Hash160 algorithm can be used to calculate the public key, or other hash algorithms can be used; the specific method depends on the actual application scenario requirements and is not limited here.
[0113] Among them, the blockchain verification identifier of the target object is used to determine the target voting information for which the target object is eligible to vote from the blockchain network. That is, the blockchain network can determine whether the target object is eligible to vote for each voting information through the blockchain verification identifier of the target object.
[0114] In some feasible implementations, when generating the blockchain verification identifier of the target object based on the target object characteristics, the target object identifier of the target object can also be determined based on the target object characteristics of the target object, and then the blockchain verification identifier of the target object can be generated based on the target object identifier and the target object characteristics.
[0115] The target object identifier of the aforementioned target object is an encoding that can uniquely identify the target object. For example, the server can assign a unique object identifier to each object, or it can assign an object encoding to the target object in the corresponding application on the server, such as an account or ID. There are no restrictions here.
[0116] Specifically, when determining the target object identifier of the target object, the matching degree between each object feature in the object feature library and the target object feature can be determined. The object feature corresponding to the matching degree with the highest degree and greater than a preset threshold is determined as the first object feature that matches the target object feature. That is, the first object feature is also an object feature of the target object, and then the object identifier corresponding to the first object feature is determined as the target object identifier of the target object.
[0117] The matching degree between any object feature in the object feature library and the target object feature can be the feature similarity between the object feature and the target object feature, such as cosine similarity, etc. The specific value can be determined based on the actual application scenario requirements, and there are no restrictions here.
[0118] The process of determining the target object identifier of the target object described above can be regarded as the process of verifying the identity of the target object. That is, after determining the identity of the target object, the target object identifier of the target object can be determined.
[0119] Furthermore, the target object identifier and target object features can be fused to obtain the feature code of the target object.
[0120] In this process, the absolute value of the target object's feature can be processed and then concatenated with the target object's identifier to obtain the target object's feature code.
[0121] Alternatively, the absolute value of the target object's features can be processed, and then the values can be scaled up by a certain ratio (such as by 100 times) before being concatenated with the target object's identifier to obtain the target object's feature code.
[0122] Alternatively, the target object's identifier and features can be fused using neural networks in artificial intelligence to obtain the target object's feature code. Artificial intelligence is the theory, methods, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. Based on artificial intelligence, neural networks capable of fusing object identifiers and object features can be trained.
[0123] The above implementation method for determining feature encoding based on target object identifier and target object features is only an example. The specific implementation method can be determined based on the actual application scenario requirements, and no restrictions are imposed here.
[0124] Furthermore, a hash calculation is performed on the feature encoding of the target object, and the private key of the target object is determined based on the hash value of the feature encoding. Alternatively, the private key of the target object can be obtained by retaining the first 128 bits of the hash value of the feature encoding.
[0125] Furthermore, the public key of the target object can be determined based on its private key. Similarly, the public key of the target object can be obtained by calculating its private key using ECDSA.
[0126] Furthermore, based on the target object's public key, the target object's blockchain verification identifier can be determined. For example, the Hash160 algorithm can be used to calculate the target object's blockchain verification identifier.
[0127] As an example, combined with Figure 4 , Figure 4 This is a schematic diagram of a scenario for determining object features provided in an embodiment of this application. The server acquires a face image of the target object, determines the facial feature points in the face image, and converts the pixel values or pixel coordinates corresponding to each facial feature point into corresponding feature vectors to obtain the target object features of the face image [-0.23, -0.54, ..., 0.15, 0.27]. Alternatively, after converting the pixel values or pixel coordinates corresponding to each facial feature point into corresponding feature vectors, dimensionality reduction processing is performed, such as mapping a high-dimensional vector of 224×224×3 obtained based on facial feature points to a low-dimensional vector of 512×1 to obtain the target object features of the target object.
[0128] Furthermore, such as Figure 5 As shown, Figure 5 This is a schematic diagram illustrating a scenario for determining a blockchain verification identifier, as provided in an embodiment of this application. Assuming... Figure 5 The payment terminal shown is Figure 4 The display terminal and payment terminal can acquire the facial image of the target object during the facial recognition process and send the facial image to the server. The server can acquire the facial image of the target object sent by the payment terminal, determine the target object's characteristics based on the facial image, and use this to determine the target object's public and private key pair and blockchain verification identifier.
[0129] The process of determining the target object characteristics described above can also be performed by the display terminal, that is, the server can directly obtain the target object characteristics from the display terminal, which will not be elaborated here.
[0130] In some feasible implementations, in order to accurately determine the target object characteristics and target object identifier, when acquiring the target object's object information, object information that meets preset acquisition requirements can be acquired, and the final object information of the target object can be determined from multiple object information that meet the preset requirements.
[0131] As an example, when the target object's information is its biometric information, multiple biometric information of the target object can be acquired if the biometric information acquisition requirements are met. For example, if the contact area between the fingerprint area of the target object and the fingerprint acquisition device meets a certain requirement, and if the target object's facial image can be completely acquired, multiple fingerprint information or facial images of the target object can be acquired.
[0132] Furthermore, for multiple object information that meet preset requirements, the object information with the highest information quality can be selected to determine the target object features. For example, the clearest face image or fingerprint information can be selected from multiple fingerprint information or multiple face images to determine the target object features.
[0133] For example, see Figure 6 , Figure 6 This is a schematic diagram of the process for determining the characteristics of a target object provided in an embodiment of this application. For example... Figure 6As shown, before acquiring the target object's facial image through the display terminal, the server can first detect the target object's face to ensure that the acquired image is indeed the target object's face image. During the detection process, the face is registered to ensure it is within the facial capture range. Furthermore, the server can use the display terminal to determine the currently available facial image and perform liveness detection. By observing combinations of actions such as blinking, opening the mouth, shaking the head, and nodding, the server can confirm that the current facial image is being captured by a real, living person. This prevents other individuals from participating in facial image acquisition using common attack methods such as photos, face swapping, masks, occlusion, and screen capture.
[0134] Furthermore, after passing the liveness detection, the server can acquire multiple facial images of the target object through the display terminal, and select the target facial image with the highest image quality that best reflects the facial features of the target object as the final facial image, and then perform image recognition processing on it to obtain the target object features.
[0135] The server can determine the image attributes of the acquired multiple face images. The image attributes of each face image include at least one of the following: face size, face disinfection, image contrast, image brightness, and image sharpness. It may also include other attributes used to characterize image quality, such as the proportion of face occlusion area and the proportion of face area, etc., which are not limited here.
[0136] Furthermore, the server can determine the final face image from each face image based on its image attributes. Specifically, for each face image, the server can determine the attribute score for each image attribute, and the sum of the attribute scores for each image is used to determine the image quality score for that face image. The face image with the highest image quality score is then determined as the final face image. Alternatively, for each face image, the server can determine the attribute score for each image attribute and the weight of each image attribute. For each image attribute, the server can determine its attribute score based on the attribute score and corresponding weight, and the sum of the attribute scores for each image is used to determine the image quality score for that face image. The face image with the highest image quality score is then determined as the final face image.
[0137] In some feasible implementations, after determining the target object identifier based on the target object's characteristics, the target object identifier or other information related to the target object, such as application accounts or payment accounts, can be sent to the display terminal so that the target object can confirm the relevant information displayed on the display terminal. After the target object is confirmed, the server can determine that the target object identifier determined based on the target object's characteristics is accurate.
[0138] Furthermore, when the display terminal is a payment terminal, after the target object confirms the relevant information displayed on the display terminal, it can obtain the transaction request sent by the display terminal, and the server can then complete the deduction operation for the target object, such as completing the target object's facial recognition payment operation. The server can also send payment details, such as payment invoices and payment amounts, to the display terminal for display to the target object.
[0139] Step S22: Based on the blockchain verification identifier of the target object, determine the target voting information from the blockchain network that the target object has voting qualifications.
[0140] In some feasible implementations, the target voting information is stored in the block header of a block in the blockchain network. When the target voting information is stored in the corresponding block header, it is the voting information with the highest reward resources in the voting information pool of the blockchain network.
[0141] In other words, for each block in the blockchain network, the block header stores at least one voting information, and the block body stores the voting results of other voting information.
[0142] Each voting information (including target voting information) stored in the blockchain network may include voting content and corresponding voting identifier. Voting content includes specific voting descriptions, voting requirements, and voting options. Voting identifiers are used to uniquely identify the corresponding voting information, such as the number of the corresponding voting information or the corresponding voting initiator. The specific identifiers can be determined based on the actual application scenario requirements and are not limited here.
[0143] The voting information pool includes voting information initiated by multiple voting initiators. When each voting initiator initiates a voting information, it can simultaneously provide reward resources for that voting information. This is so that when a target node in the blockchain network stores any voting information in the block header of a block, the reward resources corresponding to that voting information are provided to the target node.
[0144] In some feasible implementations, when determining the target voting information that a target object is eligible to vote from the blockchain network, the voting information stored in the block headers of each block of the blockchain network can be used to determine the valid voting information.
[0145] For any voting information stored in the block header, the valid time interval or deadline of the voting information can be determined based on the voting content of the voting information. If the current time is within the valid time interval or before the deadline, the voting information can be determined to be valid.
[0146] Alternatively, the validity of each vote can be determined based on the block height of each block in the blockchain. For example, for any given vote, the block height of the block containing the vote and the block height of the latest block in the blockchain containing that block can be determined. If the difference between the block height of the given vote and the block height of the latest block is greater than or equal to a preset block height, then the vote is not valid. Otherwise, the vote is considered valid.
[0147] Since the generation time of each block in the blockchain network is consistent, for any voting information, if the difference between the block height of the block containing the voting information and the block height of the latest block is less than the preset block height, it means that the voting information was stored in the corresponding block within the preset time interval from the current time, and thus it can be said that the voting information is valid.
[0148] Furthermore, after identifying multiple valid voting information from the blockchain network, for each valid voting information, the authentication script corresponding to the valid voting information can be obtained from the block header of the valid voting information, and the blockchain verification identifier of the target object can be verified based on the authentication script corresponding to the valid voting information.
[0149] The authentication script for any valid vote will be stored in the same block header when the valid vote is packaged into the block header.
[0150] For each valid vote, the blockchain verification identifier of the target object can be verified based on the authentication script corresponding to that valid vote. If the blockchain verification identifier meets preset conditions, it indicates that the target object is qualified to vote on that valid vote, and the valid vote is identified as a candidate vote. Based on this method, at least one candidate vote that meets the preset conditions can be identified from all valid votes.
[0151] Furthermore, any candidate voting information in each candidate voting information can be determined as the target voting information for which the target object is eligible to vote. Alternatively, the candidate voting information with the smallest or highest block height in the corresponding block can be determined as the target voting information for which the target object is eligible to vote. In addition, the candidate voting information in each candidate voting information whose voting initiator matches the target object can be determined as the target voting information for which the target object is eligible to vote. For example, the candidate voting information for which the voting initiator has no interest relationship with the target object can be determined as the target voting information for which the target object is eligible to vote.
[0152] The above-described method for determining target voting information from candidate voting information is merely an example. The specific implementation can be determined based on the actual application scenario requirements, and no restrictions are imposed here.
[0153] Specifically, the aforementioned blockchain verification identifier meeting the preset conditions can be defined as the creation time of the blockchain verification identifier meeting preset creation requirements. The creation time of the blockchain verification identifier can be considered as the time when the target object votes. The preset creation requirement can be that the time interval between the creation time and the current time is less than a preset time interval. Therefore, if the creation time of the blockchain verification identifier meets the preset creation requirements, it can be assumed that the target object has not left the display terminal and is eligible to vote on the current voting information.
[0154] The aforementioned preset creation requirements can also include other requirements for limiting the creation time of blockchain verification identifiers, such as the time interval between the creation time and the current time being greater than a preset time interval. The specific requirements can be determined based on the actual application scenario and are not limited here.
[0155] Optionally, the aforementioned blockchain verification identifier meeting a preset condition can be defined as the target object corresponding to the blockchain verification identifier having a preset number of historical votes. This preset number requirement can be less than a preset number; that is, if the target object's historical vote count is less than the preset number, it indicates that the target object's voting results have high reference value, and thus the target object can be determined to be eligible to vote on the current voting information. Alternatively, the preset number requirement can be greater than the preset number; that is, if the target object's historical vote count is greater than the preset number, it indicates that the target object's voting participation is high, and thus the target object can be determined to be eligible to vote on the current voting information.
[0156] The aforementioned preset number requirement may also include other requirements to limit the historical number of votes for the target object, such as limiting the historical number of votes for the target object to a preset number, etc. The specific requirements can be determined based on the actual application scenario, and are not limited here.
[0157] Optionally, the aforementioned blockchain verification identifier meeting preset conditions can be determined by whether the transferred resources of the target object corresponding to the blockchain verification identifier meet a preset resource quantity requirement. Specifically, the preset resource quantity requirement can be greater than a preset resource quantity; that is, if the transferred resources of the target object exceed the preset resource quantity, it indicates that the target object has high personal credit, and thus the target object is deemed eligible to vote for the current voting information. Alternatively, the preset resource quantity requirement can be within a preset resource quantity range; that is, if the transferred resources of the target object fall within the preset resource quantity range, it indicates that the target object's personal circumstances match the target demographic of the current voting information, such as middle-income individuals, and thus the target object is deemed eligible to vote for the current voting information.
[0158] The aforementioned preset resource quantity requirement may also include other requirements to limit the amount of resources transferred to the target object, such as the amount of resources transferred to the target object being less than the preset resource quantity. The specific requirements can be determined based on the actual application scenario and are not limited here.
[0159] It should be noted that the above-mentioned blockchain verification identifier meeting the preset conditions is only an example. For example, it is also possible to determine whether the target object is eligible to vote for the current voting information by determining the geographical location of the target object corresponding to the blockchain verification identifier. The specific determination can be based on the actual application scenario requirements and is not limited here.
[0160] The preset conditions corresponding to the authentication scripts of any two voting information can be the same or different, and there is no restriction here.
[0161] The blockchain network provided in this application refers to a system for data sharing between nodes. This data sharing system may include multiple nodes, which can refer to various clients within the system. Each node, during normal operation, receives voting results and maintains shared data within the system based on the received input information. To ensure information exchange within the data sharing system, information connections can exist between each node, allowing for information transmission. For example, when any node in the data sharing system receives a voting result, other nodes in the system obtain that result according to a consensus algorithm and store it as part of the shared data, ensuring consistency of data stored on all nodes in the system.
[0162] Each node in a blockchain network has a corresponding node identifier, and each node can store the node identifiers of other nodes. This allows for the broadcasting of generated blocks to other nodes in the blockchain network based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. The table below uses IP addresses as an example.
[0163] Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N xx.xx.xx.xx
[0164] In a blockchain network, each node stores an identical copy of the blockchain. A blockchain consists of multiple blocks. See also... Figure 7a , Figure 7aThis is the block header structure provided in the embodiments of this application. Each block's header stores the Merkle root, version number, timestamp, parent block's block header feature value, difficulty value, voting information (vote content and vote identifier), and the corresponding authentication script. See also... Figure 7b , Figure 7b This is a schematic diagram of the block body provided in an embodiment of this application. The block body stores the voting results, which contain other voting information.
[0165] The next block after the genesis block is the parent block of the genesis block. The next block also includes a block header and a block body. See [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of the blockchain structure provided in the embodiments of this application. The block header of each block stores the Merkle root of the current block, the block header feature value of the parent block, the version number, the timestamp, the difficulty value, as well as voting information and the corresponding authentication script, and so on, so that the block data stored in each block in the blockchain is related to the block data stored in the parent block, ensuring the security of the input information in the block.
[0166] When storing voting information, any target node in the blockchain network can verify the voting results of other voting information that needs to be stored in the block body. After verification, it updates the hash tree used for the voting results and obtains the Merkle root of the hash tree. Then, the target node updates the timestamp to the time it received the voting results and tries different random numbers to perform feature value calculations multiple times, ensuring that the calculated feature values satisfy the following formula:
[0167] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET
[0168] Wherein, SHA256 is the feature value algorithm used to calculate the feature value; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the current block; merkle_root is the value of the Merkle root; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value for a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the feature value threshold, which can be determined based on nbits.
[0169] Thus, when a random number satisfying the above formula is calculated, the voting information (vote content and vote identifier) and the corresponding authentication script can be stored in the block header, and the received voting results can be stored in the block body. A new block is then generated based on the block header and block body. Subsequently, the target node sends the newly generated block to other nodes according to their node identifiers in the blockchain network. The other nodes verify the newly generated block and, after verification, add it to their stored blockchain.
[0170] For any given block, the Merkle root in the block header is determined based on the voting results stored in the block body. Specifically, the hash value of each voting result is determined, the hash values of two adjacent voting results are merged to obtain a merged hash value, and then two adjacent merged hash values are merged again, and so on, until the final hash value is determined as the Merkle root in the block header.
[0171] Combination Figure 9 , Figure 9 This is a schematic diagram of the scenario for determining Merkel tree roots provided in an embodiment of this application. Figure 9 The block body of the block shown includes voting result 1, voting result 2, voting result 3, and voting result 4. First, the hash values of voting result 1, voting result 2, voting result 3, and voting result 4 are determined: hash value 1, hash value 2, hash value 3, and hash value 4, respectively. Further, hash value 1 and hash value 2 are merged to obtain hash value 12, and hash value 3 and hash value 4 are merged to obtain hash value 34. Finally, hash value 12 and hash value 34 are merged to obtain hash value 1234, and hash value 1234 is determined as the Merkle root in the block header.
[0172] In some feasible implementations, the blockchain network provided in this application includes full nodes and light nodes. Full nodes store the complete blockchain, including block headers and block bodies, while light nodes store the block headers of each block in the blockchain. The server in this application can be a light node or a full node in the blockchain network, or a server connected to any one or more nodes in the blockchain network; no limitation is placed here. That is, the server can obtain the voting information and corresponding authentication scripts stored in the block headers of the blockchain from the light nodes in the blockchain network, or it can obtain the complete blockchain from the full nodes in the blockchain network and then obtain the voting information and corresponding authentication scripts from the block headers.
[0173] For example, the server provided in this application embodiment can act as a light node in a blockchain network to store the block headers of each block in the blockchain when storage space is limited.
[0174] like Figure 10 As shown, Figure 10 This is a schematic diagram illustrating a scenario for obtaining valid voting information provided in an embodiment of this application. When determining the valid voting information among the various voting information stored in the blockchain network, the server can obtain the block headers of the complete blockchain from the light nodes in the blockchain network, resulting in a continuous linked list composed of block headers. Then, it traverses forward from the end to determine the voting information and authentication script stored in each block header, such as determining the voting information and authentication script in the block headers of blocks 1 to 4.
[0175] Furthermore, the valid voting information in each voting message can be determined. Assuming the determined valid voting information is the valid voting information stored in block header 1 and block header 4, the blockchain identifier of the target object can be verified based on the authentication scripts in block header 1 and block header 4, respectively. If only the authentication script in block header 1 meets the corresponding preset conditions when verifying the blockchain verification identifier, then the voting information in block header 1 can be determined as the target voting information for which the target object is qualified to vote.
[0176] In some feasible implementations, after determining the valid voting information from each block header, the server can also call a smart contract to verify the blockchain verification identifier of the target object, and determine the target voting information from the valid voting information that the target object is qualified to vote.
[0177] Among them, the authentication script can also make a judgment on the preset requirements when verifying the blockchain verification identifier based on the smart contract, which will not be elaborated here.
[0178] Step S23: Send target voting information to the display terminal so that the target object can vote based on the target voting information displayed on the display terminal.
[0179] In some feasible implementations, after the server determines the target voting information that the target object is eligible to vote, it can send the target voting information to the display terminal so that the target object can vote based on the target voting information displayed on the display terminal.
[0180] See Figure 11 , Figure 11 This is a schematic diagram illustrating a scenario for displaying voting information provided in an embodiment of this application. The server can send target voting information to the display terminal, enabling the target user to select their preferred city based on the target voting information displayed on the display terminal.
[0181] In some feasible implementations, the server can obtain the target voting result of the target object for the target voting information from the display terminal and send the target voting result to the blockchain network so that the blockchain network can store the target voting result when it determines that the target voting result is a valid voting result, such as storing it in the block body of any block.
[0182] Specifically, the server can send the target voting result to multiple verification nodes in the blockchain network. These nodes will then verify the validity of the target voting result, such as whether it meets the voting requirements corresponding to the target voting information. No restrictions are placed on this. If a certain number of verification nodes determine that the target voting result is valid, then the target voting result is deemed valid.
[0183] Optionally, the server may perform a hash calculation on the target voting result to obtain a first digest of the target voting result, and encrypt the first digest based on the private key of the target object to obtain a digital signature of the target voting result.
[0184] Furthermore, the server can send the digital signature of the target voting result, the target voting result itself, and the public key of the target object to each verification node in the blockchain network. Each verification node can then determine whether the target voting result has been tampered with during transmission based on the digital signature of the target voting result and the private key of the target object. If a certain number of verification nodes determine that the target voting result has not been tampered with, the target voting result can be considered valid.
[0185] The server can send the digital signature of the target voting result, the target voting result, and the public key of the target object to the routing node in the blockchain network. The routing node then sends the digital signature of the target voting result, the target voting result, and the public key of the target object to the verification nodes in the blockchain network.
[0186] In some feasible implementations, if the target voting result is a valid voting result, the server can obtain reward resources from the initiator of the target voting request and provide reward resources to the target object to attract the target object to participate in voting again.
[0187] The server can send reward resources to the target's default account or storage address, or obtain the target's input account or storage address through a display terminal and then send reward resources to that account or storage address.
[0188] See Figure 12 , Figure 12 This is a flowchart illustrating the voting information storage method provided in an embodiment of this application. Figure 12 As shown in the embodiments of this application, the voting information storage method can be applied to a blockchain network, and may specifically include the following steps:
[0189] Step S121: Determine the reward resources corresponding to each vote in the voting information pool of the blockchain network.
[0190] In some feasible implementations, the blockchain network includes a voting information pool, which is a data structure in the blockchain network used to store voting information provided by each voting initiator that has not been packaged into blocks, and is maintained in the memory of the blockchain network.
[0191] Each voting initiator, when submitting a voting message to the voting information pool, will simultaneously provide corresponding reward resources for that voting message. These resources are used to reward the target node that generates the block after the voting message is stored in the block header of a block, and can also improve the information security in the blockchain network.
[0192] Each voting initiator can be a node in the blockchain network or another device connected to the blockchain network; there are no restrictions on this.
[0193] In this process, when each voting initiator provides a voting message to the voting information pool, the blockchain network broadcasts the voting message to the entire network via P2P before storing it in the voting information pool. Broadcasting the voting message to the entire network allows nodes across the network to participate in verifying the voting message, thereby ensuring that the voting message meets storage and security requirements.
[0194] Step S122: Determine the first vote information with the highest reward resources, and generate the target block through the target node.
[0195] In some feasible implementations, when storing any voting information in the blockchain, the blockchain network can identify a target node with the ability to package voting information, and the target node can perform the storage of voting information, that is, the target node can generate a target block and store the voting information in the block header of the target block.
[0196] The blockchain network can determine the target node with the ability to package voting information from among the nodes based on the Proof-of-Work (PoW) mechanism or other proof mechanisms, such as the Proof-of-Stake mechanism, without any restrictions.
[0197] Furthermore, after identifying the target node capable of packaging voting information, a target block can be generated through the target node, and the voting information with the highest reward resources in the current voting information pool can be packaged and stored in the target block. That is, the blockchain network can identify the first voting information with the highest reward resources in the voting information pool, generate a target block through the target node, and store the first voting information in the block header of the target block.
[0198] Meanwhile, when the blockchain network stores the first voting information in the block header of the target block through the target node, it can also obtain the authentication script corresponding to the first voting information and store the authentication script corresponding to the first voting information in the block header as well.
[0199] The first vote result can be stored in the block header as a hash.
[0200] Furthermore, the blockchain network can store the voting results of other objects regarding other voting information in the block body of the target block through the target node, and determine the Merkle root in the block header through each voting result information. After determining the version number, timestamp, block header feature value of the parent block, and difficulty value, these, together with the first voting information and the corresponding authentication script, constitute the block header of the target block. The first voting information also includes the corresponding voting content and voting identifier, which will not be elaborated further here.
[0201] The method for generating the target block can be found in [reference needed]. Figure 1 The relevant explanations shown will not be repeated here.
[0202] In some feasible implementations, the blockchain network can obtain the target voting results sent by the server for the target voting information and verify the validity of the target voting results. If the target voting results are determined to be valid, the target nodes in the blockchain network are allowed to store the target voting results in the block body of a new block when generating a new block.
[0203] Specifically, the blockchain network can broadcast the target voting result to multiple verification nodes within the network. These nodes then verify the validity of the target voting result, such as verifying whether it meets the voting requirements corresponding to the target voting information; no restrictions are imposed on this. The blockchain network obtains the verification results from each verification node. If a certain number of verification nodes determine that the target voting result is valid based on their verification results, then the target voting result is deemed valid.
[0204] Optionally, the blockchain network can obtain the digital signature of the target voting result, the target voting result, and the public key of the target object sent by the server, and send the digital signature of the target voting result, the target voting result, and the public key of the target object to each verification node in the blockchain network through the routing node.
[0205] The digital signature of the target voting result is obtained by the server hashing the target voting result to obtain the first digest of the target voting result, and then encrypting the first digest based on the private key of the target object.
[0206] Furthermore, the blockchain network can verify whether the target voting result has been tampered with during transmission through each verification node. Specifically, each verification node in the blockchain network can perform a hash calculation on the target voting result to obtain a second digest of the target voting result, and simultaneously decrypt the digital signature based on the target object's public key to obtain a first digest of the target voting result. The first and second digests are then compared. If the first and second digests match, the verification node determines that the target voting result has not been tampered with; if the first and second digests do not match, the verification node determines that the target voting result has been tampered with.
[0207] The blockchain network determines the target voting result as valid if a certain number of verification nodes confirm that the target voting result has not been tampered with, based on the verification results of each verification node.
[0208] Furthermore, the server can send the digital signature of the target voting result, the target voting result itself, and the public key of the target object to each verification node in the blockchain network. Each verification node can then determine whether the target voting result has been tampered with during transmission based on the digital signature of the target voting result and the private key of the target object. If a certain number of verification nodes determine that the target voting result has not been tampered with, the target voting result can be considered valid.
[0209] When storing any voting result in the block body of any block, one or more of the following can be stored together with the voting result: object information (such as object address, ID, public / private key pair, etc.), blockchain verification identifier, voting information corresponding to the voting result, or digital signature corresponding to the voting result, to facilitate information retrieval.
[0210] Step S123: Add the target block to the blockchain network and provide the target node with the reward resources corresponding to the first voting information.
[0211] In some feasible implementations, after the target node generates a target block storing the first voting information, the target block can be sent to other nodes in the blockchain network. These other nodes then verify the target block and add it to their stored blockchain. Following this, the blockchain network can provide the target node with reward resources corresponding to the first voting information to encourage active participation in the voting information storage process.
[0212] Meanwhile, after the target block node is added to the blockchain, the blockchain network can obtain the preset reward resources from the voting initiator corresponding to the first voting information, and send the preset reward resources to the server so that the server can provide the preset reward resources to the target object.
[0213] In some feasible implementations, when providing voting information to the voting information pool, the voting initiator can also provide the authentication script corresponding to the voting information. The blockchain network can invoke a smart contract to verify the security and validity of the authentication script. After successful verification, the script is added to the voting information pool. This ensures that when any node generates a new block and stores the voting information in the block header, the authentication script corresponding to the voting information is also stored in the block header.
[0214] Optionally, the blockchain network can obtain the authentication script provided by the voting initiator and send it to various nodes via P2P broadcast. If more than a certain number of nodes receive the authentication script and determine that the authentication script has passed security and validity verification, the blockchain network will allow the voting information of the authentication script object to be stored in the block header, and will store the authentication script together with it in the same block header.
[0215] In some feasible implementations, since each node in the blockchain network stores a blockchain, and the time delay between nodes can cause the lengths of the blockchains stored by each node to be not exactly the same, in this case, the target block generated by the target node may not be recognized by the blockchain network.
[0216] Therefore, the blockchain network can determine the longest blockchain in the blockchain containing the target block, and determine the latest block of the longest blockchain at any time after the target block is added. In other words, the blockchain network can determine the longest chain in the blockchain containing the target block and the latest block of the longest chain at any given time.
[0217] Furthermore, determine the height difference between the latest block and the target block. If the height difference is greater than or equal to the preset block height, it indicates that there are already enough blocks between the target block and the latest block, thus indicating that the target block is a valid block in the blockchain network.
[0218] Furthermore, since the generation time of each block in the blockchain network is consistent, if the height difference is greater than or equal to the preset block height, it indicates that the target block stores the target voting information.
[0219] Alternatively, the validity of each vote can be determined based on the block height of each block in the blockchain. For example, for any given vote, the block height of the block containing the vote and the block height of the latest block in the blockchain containing that block can be determined. If the difference between the block height of the given vote and the block height of the latest block is greater than or equal to a preset block height, then the vote is not valid. Otherwise, the vote is considered valid.
[0220] Since the generation time of each block in the blockchain network is consistent, for any voting information, if the height difference between the target block where the first voting information is located and the latest block is less than or equal to the preset block height, it means that the time interval between the first voting information being stored in the target block and the current time is short. Therefore, it is determined that the first voting information is within the valid voting time, which means that the first voting information is valid at that moment.
[0221] If the difference between the block height of the target block containing the first voting information and the block height of the latest block of the longest chain is greater than the preset block height, it means that the time interval between the first voting information being stored in the target block and the current time is too long. Therefore, the first voting information is determined to be invalid voting information, and other nodes are not allowed to store the first voting information in the block header of any block again. At the same time, the first voting information can also be deleted from the voting information pool without restriction.
[0222] The data processing involved in the embodiments of this application, such as feature processing of target objects and calculation of block height, can be performed based on computer technology and cloud computing. Cloud computing is a product of the integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. Based on cloud computing, the data processing and calculation efficiency in the embodiments of this application can be improved.
[0223] In this embodiment, storing voting information in the block header enhances the security of voting information while facilitating its retrieval and improving efficiency. Simultaneously, storing voting results in the block body makes them more transparent, tamper-proof, and highly secure. Furthermore, storing both voting information and results within the blockchain network facilitates traceability and retrieval, and provides rewards to voters, increasing participation and demonstrating high applicability.
[0224] See Figure 13 , Figure 13 This is a schematic diagram of the structure of a blockchain-based voting device provided in an embodiment of this application. The blockchain-based voting device provided in this embodiment includes:
[0225] The identifier generation module 131 is used to determine the target object characteristics of the target object and generate a blockchain verification identifier for the target object based on the target object characteristics.
[0226] The information determination module 132 is used to determine the target voting information that the target object has voting qualifications from the blockchain network based on the blockchain verification identifier of the target object. The target voting information is stored in the block header of a block in the blockchain network. When the target voting information is stored in the block header, it is the voting information with the highest reward resources in the voting information pool of the blockchain network. The reward resources corresponding to each voting information in the voting information pool are provided by the corresponding voting initiator when initiating the voting information.
[0227] The sending module 133 is used to send the target voting information to the display terminal so that the target object can vote based on the target voting information displayed on the display terminal.
[0228] In some feasible implementations, the above-mentioned identifier generation module 131 is used for:
[0229] Determine the matching degree between each object feature in the object feature library and the above target object features;
[0230] The object feature corresponding to the highest matching degree and a matching degree greater than a preset threshold is determined as the first object feature that matches the above target object feature, and the object identifier corresponding to the above first object feature is determined as the target object identifier of the above target object.
[0231] Based on the aforementioned target object identifier and characteristics, a blockchain verification identifier for the aforementioned target object is generated.
[0232] In some feasible implementations, the above-mentioned identifier generation module 131 is used for:
[0233] Based on the above target object identifier and above target object characteristics, generate the feature code corresponding to the above target object;
[0234] The above feature encoding is hashed, and the private key of the target object is determined based on the hash value of the above feature encoding;
[0235] The public key of the target object is determined based on the aforementioned private key;
[0236] Based on the public key of the aforementioned target object, the blockchain verification identifier of the aforementioned target object is determined.
[0237] In some feasible implementations, the information determination module 132 described above is used for:
[0238] Determine the valid voting information among the various voting information stored in the blockchain network;
[0239] For each of the above valid voting information, the authentication script corresponding to the valid voting information is obtained from the block header corresponding to the valid voting information;
[0240] The authentication script corresponding to each of the above valid voting information is used to verify the target blockchain verification identifier, so as to determine the target voting information of the target object with voting information from each of the above valid voting information.
[0241] In some feasible implementations, the information determination module 132 described above is used for:
[0242] The above-mentioned blockchain verification identifier is verified based on the authentication script corresponding to each of the above-mentioned valid voting information. The valid voting information corresponding to the authentication script when the above-mentioned blockchain verification identifier meets the preset conditions is determined as candidate voting information.
[0243] Each of the aforementioned candidate voting information is identified as the target voting information for which the target object is eligible to vote.
[0244] The aforementioned blockchain verification identifier must meet at least one of the following preset conditions:
[0245] The creation time of the aforementioned blockchain verification identifier meets the preset creation requirements;
[0246] The historical vote count of the target object corresponding to the above blockchain verification identifier meets the preset number requirement;
[0247] The transferred resources of the target object corresponding to the aforementioned blockchain verification identifier meet the preset resource quantity requirements.
[0248] In some feasible implementations, the above-mentioned sending module 133 is further configured to:
[0249] Obtain the target voting results from the aforementioned target objects regarding the aforementioned target voting information;
[0250] The target voting result is sent to the blockchain network so that the blockchain network stores the target voting result when it determines that the target voting result is a valid voting result. The target voting result is stored in the block body of any block in the blockchain network.
[0251] In some feasible implementations, the above-mentioned sending module 133 is further configured to:
[0252] The target voting results are hashed to obtain the first digest of the target voting results.
[0253] The first digest is encrypted using the private key of the target object to obtain a digital signature of the target voting result.
[0254] The aforementioned digital signature and the public key of the aforementioned target object are sent to the aforementioned blockchain network so that the aforementioned blockchain network can determine the validity of the aforementioned target voting result based on the aforementioned digital signature and the aforementioned public key.
[0255] In specific implementation, the above-mentioned device can perform the above-described actions through its built-in functional modules. Figure 2 The implementation methods provided for each step are detailed in the above-mentioned implementation methods and will not be repeated here.
[0256] See Figure 14 , Figure 14 This is a schematic diagram of the voting information storage device provided in an embodiment of this application. The voting information storage device provided in an embodiment of this application includes:
[0257] The resource determination module 141 is used to determine the reward resources corresponding to each voting information in the voting information pool of the blockchain network. The reward resources corresponding to each of the above voting information are provided by the voting initiator corresponding to the voting information when initiating the voting information.
[0258] The block generation module 142 is used to determine the first voting information with the highest reward resources, generate a target block through the target node, and store the first voting information in the block header of the target block.
[0259] Resource processing module 143 is used to add the target block to the blockchain network and provide the target node with reward resources corresponding to the first voting information.
[0260] In some feasible implementations, the block generation module 142 described above is further used for:
[0261] Obtain the target voting results for the target voting information, wherein the target voting information is the valid voting information among the various voting information stored in the blockchain network;
[0262] If the target voting result is determined to be a valid voting result by the verification nodes in the aforementioned blockchain network, then the target voting result is stored, wherein the target voting result is stored in the block body of any block in the aforementioned blockchain network.
[0263] In some feasible implementations, the block generation module 142 described above is used for:
[0264] Obtain the digital signature of the aforementioned target voting result, and the public key of the aforementioned target object;
[0265] The target voting result, the digital signature, and the public key are broadcast to each verification node in the blockchain network, so that each verification node performs a hash calculation on the target voting result to obtain a second digest of the target voting result, decrypts the digital signature based on the public key to obtain a first digest of the target voting result, and compares the first digest with the second digest.
[0266] If the first and second summaries of the verification nodes with a predetermined proportion are consistent, then the target voting result is determined to be a valid voting result.
[0267] In some feasible implementations, the resource processing module 143 described above is further used for:
[0268] Provide preset reward resources to the aforementioned target groups.
[0269] In some feasible implementations, the block generation module 142 described above is further used for:
[0270] Determine the longest blockchain containing the target block mentioned above;
[0271] Determine the latest block of the longest blockchain at any point in time after the target block is added;
[0272] If the height difference between the latest block height and the target block height is less than or equal to the preset block height, then the first voting information in the target block is determined to be valid voting information at that moment.
[0273] In specific implementation, the above-mentioned device can perform the above-described actions through its built-in functional modules. Figure 12 The implementation methods provided for each step are detailed in the above-mentioned implementation methods and will not be repeated here.
[0274] See Figure 15 , Figure 15 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 15As shown, the electronic device 1500 in this embodiment may include: a processor 1501, a network interface 1504, and a memory 1505. Furthermore, the electronic device 1500 may also include: a user interface 1503, and at least one communication bus 1502. The communication bus 1502 is used to enable communication between these components. The user interface 1503 may include a display screen and a keyboard; optionally, the user interface 1503 may also include a standard wired interface or a wireless interface. The network interface 1504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1504 may be a high-speed RAM or non-volatile memory (NVM), such as at least one disk storage device. The memory 1505 may optionally be at least one storage device located remotely from the aforementioned processor 1501. Figure 15 As shown, the memory 1505, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.
[0275] exist Figure 15 In the illustrated electronic device 1500, the network interface 1504 provides network communication functionality; the user interface 1503 is primarily used to provide an input interface for the user; and the processor 1501, when acting as a server, can be used to call the device control application stored in the memory 1505 to achieve:
[0276] Determine the target object characteristics, and based on these characteristics, generate a blockchain verification identifier for the target object.
[0277] Based on the blockchain verification identifier of the aforementioned target object, target voting information that the aforementioned target object has voting qualifications is determined from the blockchain network. The aforementioned target voting information is stored in the block header of a block in the aforementioned blockchain network. When the aforementioned target voting information is stored in the block header, it is the voting information with the highest reward resources in the voting information pool of the aforementioned blockchain network. The reward resources corresponding to each voting information in the aforementioned voting information pool are provided by the corresponding voting initiator when initiating the voting information.
[0278] The aforementioned target voting information is sent to the display terminal so that the aforementioned target object votes based on the aforementioned target voting information displayed on the display terminal.
[0279] In some feasible implementations, the processor 1501 described above is used for:
[0280] Determine the matching degree between each object feature in the object feature library and the above target object features;
[0281] The object feature corresponding to the highest matching degree and a matching degree greater than a preset threshold is determined as the first object feature that matches the above target object feature, and the object identifier corresponding to the above first object feature is determined as the target object identifier of the above target object.
[0282] Based on the aforementioned target object identifier and characteristics, a blockchain verification identifier for the aforementioned target object is generated.
[0283] In some feasible implementations, the processor 1501 described above is used for:
[0284] Based on the above target object identifier and above target object characteristics, generate the feature code corresponding to the above target object;
[0285] The above feature encoding is hashed, and the private key of the target object is determined based on the hash value of the above feature encoding;
[0286] The public key of the target object is determined based on the aforementioned private key;
[0287] Based on the public key of the aforementioned target object, the blockchain verification identifier of the aforementioned target object is determined.
[0288] In some feasible implementations, the processor 1501 described above is used for:
[0289] Determine the valid voting information among the various voting information stored in the blockchain network;
[0290] For each of the above valid voting information, the authentication script corresponding to the valid voting information is obtained from the block header corresponding to the valid voting information;
[0291] The authentication script corresponding to each of the above valid voting information is used to verify the target blockchain verification identifier, so as to determine the target voting information of the target object with voting information from each of the above valid voting information.
[0292] In some feasible implementations, the processor 1501 described above is used for:
[0293] The above-mentioned blockchain verification identifier is verified based on the authentication script corresponding to each of the above-mentioned valid voting information. The valid voting information corresponding to the authentication script when the above-mentioned blockchain verification identifier meets the preset conditions is determined as candidate voting information.
[0294] Each of the aforementioned candidate voting information is identified as the target voting information for which the target object is eligible to vote.
[0295] The aforementioned blockchain verification identifier must meet at least one of the following preset conditions:
[0296] The creation time of the aforementioned blockchain verification identifier meets the preset creation requirements;
[0297] The historical vote count of the target object corresponding to the above blockchain verification identifier meets the preset number requirement;
[0298] The transferred resources of the target object corresponding to the aforementioned blockchain verification identifier meet the preset resource quantity requirements.
[0299] In some feasible implementations, the processor 1501 is further configured to:
[0300] Obtain the target voting results from the aforementioned target objects regarding the aforementioned target voting information;
[0301] The target voting result is sent to the blockchain network so that the blockchain network stores the target voting result when it determines that the target voting result is a valid voting result. The target voting result is stored in the block body of any block in the blockchain network.
[0302] In some feasible implementations, the processor 1501 is further configured to:
[0303] The target voting results are hashed to obtain the first digest of the target voting results.
[0304] The first digest is encrypted using the private key of the target object to obtain a digital signature of the target voting result.
[0305] The aforementioned digital signature and the public key of the aforementioned target object are sent to the aforementioned blockchain network so that the aforementioned blockchain network can determine the validity of the aforementioned target voting result based on the aforementioned digital signature and the aforementioned public key.
[0306] Processor 1501 can be used to invoke device control applications stored in memory 1505 to enable blockchain networks:
[0307] The reward resources corresponding to each voting information in the voting information pool of the blockchain network are determined, and the reward resources corresponding to each of the above voting information are provided by the voting initiator corresponding to the voting information when initiating the voting information;
[0308] The first vote information with the highest reward resources is determined, and a target block is generated through the target node. The first vote information is stored in the block header of the target block.
[0309] The aforementioned target block is added to the aforementioned blockchain network, and the reward resources corresponding to the aforementioned first voting information are provided to the aforementioned target nodes.
[0310] In some feasible implementations, the processor 1501 is further configured to:
[0311] Obtain the target voting results for the target voting information, wherein the target voting information is the valid voting information among the various voting information stored in the blockchain network;
[0312] If the target voting result is determined to be a valid voting result by the verification nodes in the aforementioned blockchain network, then the target voting result is stored, wherein the target voting result is stored in the block body of any block in the aforementioned blockchain network.
[0313] In some feasible implementations, the processor 1501 described above is used for:
[0314] Obtain the digital signature of the aforementioned target voting result, and the public key of the aforementioned target object;
[0315] The target voting result, the digital signature, and the public key are broadcast to each verification node in the blockchain network, so that each verification node performs a hash calculation on the target voting result to obtain a second digest of the target voting result, decrypts the digital signature based on the public key to obtain a first digest of the target voting result, and compares the first digest with the second digest.
[0316] If the first and second summaries of the verification nodes with a predetermined proportion are consistent, then the target voting result is determined to be a valid voting result.
[0317] In some feasible implementations, the processor 1501 is further configured to:
[0318] Provide preset reward resources to the aforementioned target groups.
[0319] In some feasible implementations, the processor 1501 is further configured to:
[0320] Determine the longest blockchain containing the target block mentioned above;
[0321] Determine the latest block of the longest blockchain at any point in time after the target block is added;
[0322] If the height difference between the latest block height and the target block height is less than or equal to the preset block height, then the first voting information in the target block is determined to be valid voting information at that moment.
[0323] It should be understood that in some feasible implementations, the processor 1501 described above may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information.
[0324] In specific implementation, the aforementioned electronic device 1500 can perform the above-described actions through its built-in functional modules. Figure 2 and / Figure 12 The implementation methods provided for each step are detailed in the above-mentioned implementation methods and will not be repeated here.
[0325] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor to implement... Figure 2 and / Figure 12 The methods provided in each step are detailed in the implementation methods provided in the above steps, and will not be repeated here.
[0326] The aforementioned computer-readable storage medium can be an internal storage unit of the apparatus or electronic device provided in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device. The aforementioned computer-readable storage medium can also include magnetic disks, optical disks, read-only memory (ROM), or random access memory (RAM), etc. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the electronic device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0327] This application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, the voice playback method provided in this application is executed. Figure 2 and / Figure 12 The methods provided for each step in the process.
[0328] The terms "first," "second," etc., used in the claims, description, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or electronic device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or electronic devices. References to "embodiment" herein mean that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The presentation of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" as used in this application's description and appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0329] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
[0330] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A voting method based on a blockchain network, characterized in that, The method includes: Determine the target object characteristics of the target object, and generate a blockchain verification identifier for the target object based on the target object characteristics; Based on the blockchain verification identifier of the target object, target voting information that the target object is qualified to vote is determined from the blockchain network. The target voting information is stored in the block header of a block in the blockchain network. When the target voting information is stored in the block header, it is the voting information with the highest reward resources in the voting information pool of the blockchain network. The reward resources corresponding to each voting information in the voting information pool are provided by the corresponding voting initiator when initiating the voting information. The target voting information is sent to the display terminal so that the target object votes based on the target voting information displayed on the display terminal.
2. The method according to claim 1, characterized in that, The step of generating a blockchain verification identifier for the target object based on the target object's characteristics includes: Determine the matching degree between each object feature in the object feature library and the target object feature; The object feature corresponding to the highest matching degree that is greater than a preset threshold is determined as the first object feature that matches the target object feature, and the object identifier corresponding to the first object feature is determined as the target object identifier of the target object; Based on the target object identifier and the target object characteristics, a blockchain verification identifier for the target object is generated.
3. The method according to claim 2, characterized in that, The step of generating a blockchain verification identifier for the target object based on the target object identifier and the target object characteristics includes: Based on the target object identifier and the target object features, generate the feature code corresponding to the target object; Perform a hash calculation on the feature encoding, and determine the private key of the target object based on the hash value of the feature encoding; Determine the public key of the target object based on the private key; Based on the public key of the target object, determine the blockchain verification identifier of the target object.
4. The method according to claim 1, characterized in that, The method of determining target voting information from the blockchain network based on the blockchain verification identifier of the target object to confirm the target object's voting eligibility includes: Determine the valid voting information among the various voting information stored in the blockchain network; For each valid voting information, the authentication script corresponding to the valid voting information is obtained from the block header corresponding to the valid voting information; The blockchain verification identifier of the target object is verified based on the authentication script corresponding to each of the valid voting information, so as to determine the target voting information in which the target object has the right to vote from each of the valid voting information.
5. The method according to claim 4, characterized in that, The step of verifying the blockchain verification identifier of the target object based on the authentication script corresponding to each of the valid voting information, in order to determine the target voting information from the valid voting information that the target object has voting qualifications, includes: The blockchain verification identifier is verified based on the authentication script corresponding to each valid voting information, and the valid voting information corresponding to the authentication script when the blockchain verification identifier meets the preset conditions is determined as candidate voting information. Each candidate voting information among the aforementioned candidate voting information is determined as the target voting information for which the target object is eligible to vote; The blockchain verification identifier must meet at least one of the following preset conditions: The creation time of the blockchain verification identifier meets the preset creation requirements; The historical vote count of the target object corresponding to the blockchain verification identifier meets the preset number requirement; The transferred resources of the target object corresponding to the blockchain verification identifier meet the preset resource quantity requirements.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the target voting result of the target object in response to the target voting information; The target voting result is sent to the blockchain network so that the blockchain network stores the target voting result when it determines that the target voting result is a valid voting result, wherein the target voting result is stored in the block body of any block in the blockchain network.
7. The method according to claim 6, characterized in that, The method further includes: A hash calculation is performed on the target voting results to obtain a first digest of the target voting results; The first digest is encrypted using the private key of the target object to obtain a digital signature of the target voting result; The digital signature and the public key of the target object are sent to the blockchain network so that the blockchain network can determine the validity of the target voting result based on the digital signature and the public key.
8. A method for storing voting information, characterized in that, The method includes: The reward resources corresponding to each voting information in the voting information pool of the blockchain network are determined, and the reward resources corresponding to each voting information are provided by the voting initiator corresponding to the voting information when initiating the voting information; The first voting information with the highest reward resources is determined, and a target block is generated through the target node. The first voting information is stored in the block header of the target block. The target block is added to the blockchain network, and the reward resources corresponding to the first voting information are provided to the target node.
9. The method according to claim 8, characterized in that, The method further includes: Obtain the target voting result for the target object in response to the target voting information, wherein the target voting information is the valid voting information among the various voting information stored in the blockchain network; If the target voting result is determined to be a valid voting result by each verification node in the blockchain network, the target voting result is stored, wherein the target voting result is stored in the block body of any block in the blockchain network.
10. The method according to claim 9, characterized in that, The target voting result is determined to be a valid voting result by each verification node in the blockchain network, including: Obtain the digital signature of the target voting result and the public key of the target object; The target voting result, the digital signature, and the public key are broadcast to each verification node in the blockchain network, so that each verification node performs a hash calculation on the target voting result to obtain a second digest of the target voting result, decrypts the digital signature based on the public key to obtain a first digest of the target voting result, and compares the first digest and the second digest. If the verification nodes of a preset proportion determine that the corresponding first digest and second digest are consistent, then the target voting result is determined to be a valid voting result.
11. The method according to claim 9, characterized in that, After storing the target voting results, the method further includes: Preset reward resources are provided to the target object.
12. The method according to claim 9, characterized in that, The method further includes: Determine the longest blockchain containing the target block; Determine the latest block of the longest blockchain at any time after the target block is added; If the height difference between the latest block height and the target block height is less than or equal to the preset block height, then the first voting information in the target block is determined to be valid voting information at that moment.
13. A voting device based on a blockchain network, characterized in that, The device includes: The identifier generation module is used to determine the target object characteristics of the target object and generate a blockchain verification identifier for the target object based on the target object characteristics. The information determination module is used to determine the target voting information that the target object has voting qualifications from the blockchain network based on the blockchain verification identifier of the target object. The target voting information is stored in the block header of a block in the blockchain network. When the target voting information is stored in the block header, it is the voting information with the highest reward resources in the voting information pool of the blockchain network. The reward resources corresponding to each voting information in the voting information pool are provided by the corresponding voting initiator when initiating the voting information. The sending module is used to send the target voting information to the display terminal so that the target object can vote based on the target voting information displayed on the display terminal.
14. A voting information storage device, characterized in that, The device includes: The resource determination module is used to determine the reward resources corresponding to each voting information in the voting information pool of the blockchain network. The reward resources corresponding to each voting information are provided by the voting initiator corresponding to the voting information when initiating the voting information. The block generation module is used to determine the first voting information with the highest reward resources, generate a target block through the target node, and store the first voting information in the block header of the target block; The resource processing module is used to add the target block to the blockchain network and provide the target node with the reward resources corresponding to the first voting information.
15. An electronic device, characterized in that, It includes a processor and a memory, which are interconnected; The memory is used to store computer programs; The processor is configured to perform the method as described in any one of claims 1 to 12 when the computer program is invoked.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method of any one of claims 1 to 12.
17. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the method described in any one of claims 1 to 12.
Citation Information
Patent Citations
Voting and registering method, device and system
CN108711212A
Systems and methods for blockchain administration
US20200334674A1