Blockchain-based Property Security Data Depositing Method, Device, Equipment, and Medium

The method addresses inefficiencies in managing diverse property data by using dynamic weight determination and consensus verification on a blockchain, enhancing data credibility and decentralization for improved security.

CN120074801BActive Publication Date: 2025-07-15LINJIU WISDOM (GUANGDONG) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510542861.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-07-15
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

In the prior art, property data storage is centralized, data control rights are concentrated on the property side, and the owner side cannot verify the authenticity of data, and the credibility of data storage is not high.

Method used

The property node and owner node are determined through dynamic weighting, and the two types of nodes are used for consensus verification, reducing the centralization of blockchain and improving the credibility of data storage.

Benefits of technology

It realizes decentralized storage of property security data, improves the credibility of data storage, ensures that the weights and measures of owner nodes and property nodes are consistent, and enhances the credibility of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074801B_ABST
    Figure CN120074801B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment, and medium for storing property security data based on blockchain. The method includes: constructing a first block according to the first hash value of target security data; determining optional weights of a weight mapping table based on the number of owner nodes and the vote gain value, and a property node determining the first node weight according to service metrics; the owner nodes determining the second node weight through an election vote; after determining at least one target property node and target owner node based on the weight ratio, performing consensus verification on the first block and uploading it to the chain. It can flexibly adjust the weight mapping table according to the number of owner nodes, making the measurement units of the two weight values the same, and determining at least one target property node and target owner node using the weight ratio of the property node and the owner node, so as to perform consensus verification through two types of nodes, effectively reducing the centralization of the target blockchain and improving the credibility of data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and particularly to a method, device, equipment, and medium for storing property security data based on blockchain. Background Art

[0002] Currently, with the development of smart property, the types of property data are increasing and the data volume is getting larger. Data such as access card swiping records and surveillance videos have high requirements for security. Traditional property systems usually use centralized databases such as MySQL or Oracle to store all security data, and administrators can modify the data at will, resulting in a lack of credibility of the data. Moreover, data is easily lost when server hardware fails or is attacked.

[0003] In related technologies, blockchain technology has begun to be introduced. In the blockchain, multiple property entities (such as communities or office buildings) are used as block nodes. After any block node collects property security data, multiple block nodes use the accounting-based voting and consensus verification mechanism to save the property security data to a new block on the chain. Although distributed storage is achieved, all block nodes are still property entities, the centralized platform still exists, the data control right is concentrated on the property side, and the owner side cannot verify the authenticity of the data, so the credibility of data storage is not high. Summary of the Invention

[0004] The present invention aims to at least solve one of the technical problems existing in the prior art. For this purpose, the present invention provides a method, device, equipment, and medium for storing property security data based on blockchain, which can determine property nodes and owner nodes through dynamic weights, and perform consensus verification through two types of nodes, reducing the centralization of the blockchain and improving the credibility of data storage.

[0005] In a first aspect, an embodiment of the present invention provides a method for storing property security data based on blockchain, which is applied to a storage system. The storage system is communicatively connected to multiple optional IoT devices. The storage system includes multiple candidate property nodes, multiple candidate owner nodes, and a target blockchain. The method includes:

[0006] Construct a first block based on the first hash value of the target security data collected by any target IoT device;

[0007] Determine the optional weights of a preset weight mapping table based on the number of candidate owner nodes and a preset vote gain value, where the weight mapping table records the mapping relationship between multiple optional index value ranges and the optional weights;

[0008] Determine the respective first node weights based on the business metrics of each of the candidate property nodes and the weight mapping table, and sum the first node weights to obtain the first total weight, where the business metrics are used to indicate the management scale corresponding to the candidate property nodes;

[0009] Determine the second node weights based on the node vote counts of each of the candidate owner nodes performing an election vote, and sum the second node weights to obtain the second total weight;

[0010] Determine at least one target property node and at least one target owner node based on the ratio of the first total weight and the second total weight, where the sum of the target property node and the target owner node is equal to the target node number of the target IoT device;

[0011] Perform consensus verification on the first block based on the target property node and the target owner node, and after passing the verification, chain the first block to the target blockchain.

[0012] According to some embodiments of the present invention, determining the second node weights based on the node vote counts of each of the candidate owner nodes performing an election vote includes:

[0013] Based on any one of the candidate owner nodes, randomly perform a voting operation among the remaining candidate owner nodes;

[0014] Determine the candidate owner nodes with the node vote counts greater than zero as representative owner nodes;

[0015] Based on any one of the representative owner nodes, determine the product of the node vote count and the vote gain value as the second node weight.

[0016] According to some embodiments of the present invention, determining at least one target property node and at least one target owner node based on the ratio of the first total weight and the second total weight includes:

[0017] Based on the ratio of the first total weight to the second total weight, determine the first node number corresponding to the first total weight and the second node number corresponding to the second total weight based on the target node number;

[0018] Determine the larger value and the smaller value among the first node number and the second node number;

[0019] When both the smaller value and the larger value are greater than or equal to 1, and the value of the smaller value is less than or equal to half of the larger value, after rounding up the smaller value, update the larger value based on the difference between the target node number and the smaller value;

[0020] Alternatively, when both the smaller value and the larger value are greater than or equal to 1, and the value of the smaller value is greater than half of the larger value, after rounding up the larger value, update the smaller value based on the difference between the target node quantity and the larger value;

[0021] When the value of the smaller value is less than 1, determine the value of the smaller value as 1, and update the larger value based on the difference between the target node quantity and the smaller value;

[0022] Determine at least one of the target property nodes based on the first node quantity and the first node weight, and determine at least one of the target owner nodes based on the second node quantity and the second node weight.

[0023] According to some embodiments of the present invention, determining the optional weights of the preset weight mapping table based on the node quantity of the candidate owner nodes and a preset vote gain value includes:

[0024] Determine a first reference weight based on the node quantity of the candidate owner nodes and the vote gain value;

[0025] Determine a second reference weight and a third reference weight in the weight mapping table, where the second reference weight is the optional weight with the largest value, and the third reference weight is the optional weight with the smallest value;

[0026] Obtain a reference ratio preset for the target IoT device, where the reference ratio is used to indicate the minimum ratio of the target property node to the target owner node, and the reference ratios of at least two of the optional IoT devices are different from each other;

[0027] When the reference ratio is greater than 1, and the first reference weight is greater than or equal to the second reference weight, determine the product of the first reference weight and the reference ratio as a fourth reference weight, determine a first adjustment ratio based on the fourth reference weight and the third reference weight, determine the fourth reference weight as the new third reference weight, and update the remaining optional weights in the weight mapping table based on the first adjustment ratio;

[0028] When the reference ratio is less than 1, and the first reference weight is less than or equal to the third reference weight, determine the product of the first reference weight and the reference ratio as a fifth reference weight, determine a second adjustment ratio based on the fifth reference weight and the second reference weight, determine the fifth reference weight as the new second reference weight, and update the remaining optional weights in the weight mapping table based on the second adjustment ratio.

[0029] According to some embodiments of the present invention, constructing a first block based on a first hash value of target security data collected by any target Internet of Things device includes:

[0030] Obtaining a first timestamp of the target security data;

[0031] When the second block cannot be obtained from the target blockchain, constructing a genesis block, determining the genesis block as the first block, calculating a second hash value of the first block, and determining the first hash value, the first timestamp, and the second hash value as the block data of the first block, where the second block is the current latest block of the target blockchain;

[0032] When the second block is obtained, constructing the first block, calculating the second hash value of the first block, obtaining a third hash value of the second block, determining the third hash value as the previous block hash value, and determining the first hash value, the second hash value, the previous block hash value, and the first timestamp as the block data of the first block.

[0033] According to some embodiments of the present invention, performing consensus verification on the first block based on the target property node and the target owner node includes:

[0034] Based on each of the target property nodes and the target owner node, respectively obtaining the third hash value and the second timestamp of the second block;

[0035] When the first timestamp is after the second timestamp and the third hash value matches the previous block hash value of the first block, determining that the first block passes the consensus verification.

[0036] In a second aspect, an embodiment of the present invention provides a property security data deposit and evidence device based on a blockchain, including at least one control processor and a memory communicatively connected to the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the property security data deposit and evidence method based on a blockchain as described in the first aspect above.

[0037] In a third aspect, an embodiment of the present invention provides an electronic device including the property security data deposit and evidence device based on a blockchain as described in the second aspect above.

[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions for executing the property security data deposit and evidence method based on a blockchain as described in the first aspect above.

[0039] The method for storing property security data based on blockchain according to an embodiment of the present invention has at least the following beneficial effects: constructing a first block based on the first hash value of the target security data collected by any target IoT device; determining the optional weights of a preset weight mapping table based on the number of candidate property owner nodes and a preset vote gain value, where the weight mapping table records the mapping relationship between multiple optional index value ranges and the optional weights; determining the respective first node weights of each candidate property node based on the business indicators of each candidate property node and the weight mapping table, and summing the first node weights to obtain a first total weight, where the business indicators are used to indicate the management scale corresponding to the candidate property node; determining the second node weights based on the number of votes obtained by each candidate property owner node in the election voting, and summing the second node weights to obtain a second total weight; determining at least one target property node and at least one target property owner node based on the ratio of the first total weight and the second total weight, where the sum of the target property node and the target property owner node is equal to the target node number of the target IoT device; performing consensus verification on the first block by the target property node and the target property owner node, and after the verification passes, uploading the first block to the target blockchain. According to the technical solution of the embodiment of the present invention, it is possible to determine the first node weights of each property node by using the management scale, determine the weights of each property owner node by using the election voting, determine the optional weights of the weight mapping table according to the number of property owner nodes, ensure the consistency of the measurement standards of the property owner nodes and the property nodes, and determine at least one target property node and target property owner node by using the weights, so as to perform consensus verification through two types of nodes, effectively reducing the centralization of the target blockchain and improving the credibility of data storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a schematic diagram of the principle of the method for storing property security data based on blockchain provided by an embodiment of the present invention;

[0041] Figure 2 is a flowchart of the method for storing property security data based on blockchain provided by another embodiment of the present invention;

[0042] Figure 3 is a complete flowchart of the method for storing property security data based on blockchain provided by another embodiment of the present invention;

[0043] Figure 4 is a structural diagram of the device for storing property security data based on blockchain provided by another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where like or similar reference numerals denote like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only for explaining the present invention, and should not be construed as limiting the present invention.

[0045] In the description of the present invention, it should be understood that with regard to the orientation description, such as the orientation or positional relationship indicated by up, down, front, back, left, right, etc., is based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as limiting the present invention.

[0046] In the description of the present invention, the meaning of "a number of" is one or more, the meaning of "a plurality of" is two or more. Understandings such as "greater than", "less than", "exceeding", etc. do not include the recited number, and understandings such as "above", "below", "within", etc. include the recited number. If there is a description of "first" and "second", it is only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.

[0047] In the description of the present invention, unless otherwise clearly defined, words such as "set", "installed", "connected", etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the present invention in combination with the specific content of the technical solution.

[0048] An embodiment of the present invention provides a method, apparatus, device, and medium for storing property security data based on a blockchain. The method for storing property security data based on a blockchain includes: constructing a first block based on the first hash value of the target security data collected by any target Internet of Things device; determining the optional weights of a preset weight mapping table based on the number of candidate owner nodes and a preset vote gain value, where the weight mapping table records the mapping relationship between multiple optional index value intervals and optional weights; determining the respective first node weights of each candidate property node based on the business indicators of each candidate property node and the weight mapping table, and summing the first node weights to obtain a first total weight, where the business indicators are used to indicate the management scale corresponding to the candidate property node; determining the second node weights of each candidate owner node based on the number of votes obtained by the nodes in the election voting, and summing the second node weights to obtain a second total weight; determining at least one target property node and at least one target owner node based on the ratio of the first total weight and the second total weight, where the sum of the target property node and the target owner node is equal to the target node number of the target Internet of Things device; performing consensus verification on the first block by the target property node and the target owner node, and after the verification passes, uploading the first block to the target blockchain. According to the technical solution of the embodiment of the present invention, the first node weights of each property node can be determined by using the management scale, the weights of each owner node can be determined by using the election voting, the optional weights of the weight mapping table can be determined according to the number of owner nodes, ensuring the consistency of the measurement scales of the owner nodes and the property nodes, and determining at least one target property node and target owner node by using the weights, so as to perform consensus verification through two types of nodes, effectively reducing the centralization of the target blockchain and improving the credibility of data storage.

[0049] The following is based on the attached Figure 1 schematic diagram of the principle shown, and the technical solution of the embodiment of the present invention will be further elaborated.

[0050] Refer to Figure 2 , Figure 2 is a flowchart of a method for storing property security data based on a blockchain provided by an embodiment of the present invention. The method for storing property security data based on a blockchain includes but is not limited to the following steps:

[0051] S10, constructing a first block based on the first hash value of the target security data collected by any target Internet of Things device.

[0052] It should be noted that this embodiment includes multiple optional Internet of Things devices, and the optional Internet of Things devices are Internet of Things devices in the property field scenario, such as video monitoring devices, access control devices, etc., which can collect property security data and upload it to the storage node through the network. The property security data in this embodiment includes data such as video data, access control card swiping data, and owner data. The specific types are not limited here.

[0053] It should be noted that each optional Internet of Things device is communicatively connected to the evidence storage system. Therefore, during their respective operations, property security data is uploaded to the evidence storage system in real time. For example, after an owner completes a fingerprint unlocking operation on the access control device, the access control device encapsulates the owner's fingerprint and unlocking information as target security data and uploads it to the evidence storage system. Another example is that the video surveillance device intercepts a segment of the surveillance video stream according to the set duration and uploads this segment as target security data to the evidence storage system in real time.

[0054] It should be noted that after obtaining the target security data, the first hash value of the target security data can be calculated according to the conventional hash value calculation method. This embodiment does not elaborate on the hash value calculation method. After obtaining the first hash value, a new block is constructed as the first block, and the target security data is stored in the first block in a bookkeeping manner, thereby achieving decentralized storage.

[0055] S20. Determine the optional weights of the preset weight mapping table based on the number of candidate owner nodes and the preset vote gain value, where the weight mapping table records the mapping relationship between multiple optional index value intervals and optional weights.

[0056] It should be noted that according to the description of the above embodiment, the first node weight is determined based on the numerical value of the business indicator. The business indicator can include multiple types, such as management area, property assets, etc. The numerical dimensions of different business indicators are different. To ensure the dimensional consistency of the first node weight and the second node weight, this embodiment presets a weight mapping table in the evidence storage system. The weight mapping table records multiple optional index value intervals, and each optional index value interval corresponds to an optional weight with a fixed dimension. When determining the first node weight, determine the node index value of the business indicator, and determine the target index value interval from multiple optional index value intervals based on the node index value; determine the optional weight corresponding to the target index value interval as the first node weight.

[0057] Exemplarily, referring to the above example where the business indicator is the management area, the management area is the node index value of the candidate property node. For example, the weight value corresponding to the management area interval [0, 500] is 100, the weight value corresponding to the management area interval (500, 2000] is 200, the weight value corresponding to the management area interval (2000, 4000] is 300, and the weight value corresponding to the management area interval (4000, 5000] is 400. Then the first node weights of the above candidate property nodes are 400, 300, 200, 100, and 100 in sequence. The above numerical values are only principle examples and do not limit the numerical values of the first node weight and the business indicator.

[0058] S30. Determine the respective first node weights based on the business metrics and weight mapping table of each candidate property node, and sum the first node weights to obtain the first total weight. Here, the business metrics are used to indicate the management scale corresponding to the candidate property node.

[0059] It should be noted that, as Figure 1 shown, the evidence storage system includes multiple accounting nodes, and the accounting nodes are divided into candidate property nodes (such as the hollow nodes in Figure 1 ) and candidate owner nodes (such as the solid nodes in Figure 1 ). Each candidate property node corresponds to a property entity. For example, a property management enterprise includes multiple communities and office buildings, and each community and office building serves as a property entity. The candidate owner node corresponds to an owner in each property entity. For example, the number of candidate owner nodes in a community is equal to the total number of households in the community.

[0060] It should be noted that in this embodiment, it is necessary to ensure that both candidate property nodes and candidate owner nodes are included when performing consensus verification and accounting storage for the first block. In the case of a large number of accounting nodes, not all accounting nodes can be used for accounting. Therefore, this embodiment needs to screen at least one target property node from multiple candidate property nodes and screen at least one target owner node from multiple candidate owner nodes.

[0061] It should be noted that in this embodiment, the first node weight is determined based on the business metrics of the candidate property node. The business metrics are used to indicate the management scale of the candidate property node. The business metrics can be quantifiable index values such as the management area of the property entity or the management assets of the property entity, and the business metrics increase with the increase in the scale of the property entity, so that candidate property nodes with a larger management scale have a greater weight. It is only necessary to ensure that the same business metrics are used for each candidate property node.

[0062] Exemplarily, for the 6 candidate property nodes shown in Figure 1 , taking the business metric as the management area as an example, the management areas are 5000㎡, 3000㎡, 2000㎡, 1000㎡, 500㎡, and 500㎡ respectively. The numerical values of the business metrics can be directly used as the first node weights, and the corresponding first node weights are 5000, 3000, 2000, 1000, 500, and 500 in sequence.

[0063] It should be noted that after obtaining each first node weight, the first total weight can be obtained by simple summation.

[0064] S40. Determine the second node weights based on the number of votes obtained by each candidate owner node in the election voting, and sum the second node weights to obtain the second total weight.

[0065] It should be noted that the number of candidate owner nodes is relatively large. If the weights are determined according to the scale, it will lead to a large number of duplicate weights, and it is difficult to determine multiple target owner nodes through numerical comparison. For example, taking the property area of the business as the weight, the number of households with the same area in the same community is large, resulting in the same second-node weights for a large number of candidate owner nodes. When keeping accounts, only a small number of target owner nodes are needed, and it is difficult to distinguish them through the second-node weights. Therefore, the second-node weights in this embodiment cannot use the property scale of the owner, but use the method of election voting. Each candidate owner node randomly casts a vote for another candidate property node. Using the method of random voting can make the number of votes dispersed as soon as possible and reduce the probability that the number of votes of candidate property nodes with more votes is the same. After the election voting is completed, the second-node weights can be determined according to the number of votes of the nodes.

[0066] It should be noted that this embodiment does not limit that each candidate owner node can obtain votes. The second-node weight of the candidate property node that is not voted is 0, so it will not be selected as the target owner node.

[0067] It should be noted that after obtaining the respective second-node weights, the second total weight can be obtained through simple summation.

[0068] S50. Determine at least one target property node and at least one target owner node based on the ratio of the first total weight and the second total weight, where the sum of the target property node and the target owner node is equal to the target node number of the target IoT device.

[0069] It should be noted that the data security requirements of different types of optional IoT devices are different. For example, access control data involves the biometrics or passwords of the owners and has relatively high security requirements. The security requirements of video surveillance data are lower than those of access control data. For data with higher security requirements, more accounting nodes are required for data verification. Therefore, this embodiment presets the target node number for each optional IoT device, so as to realize the flexible adjustment of the accounting nodes for different types of property security data. After the evidence storage system obtains the target security data, it can directly obtain the target node number of the target IoT device. The target node numbers of different target IoT devices can be different.

[0070] Exemplarily, as Figure 1 shown, when the target IoT device is an access control device, the target node number obtained by the evidence storage system according to the device type of the access control device is 10. When the target IoT device is a video surveillance device, the target node number obtained by the evidence storage system according to the device type of the video surveillance device is 5.

[0071] It should be noted that the first node weight and the second node weight in this embodiment are determined by different methods. Therefore, it is necessary to ensure that the dimensions of the first node weight and the second node weight are the same to avoid excessive numerical differences caused by different dimensions. For example, when the number of the first node weights is too large, the number of target property nodes determined according to the ratio will be much larger than the number of target owner nodes, resulting in a relatively high degree of centralization. Based on this, in this embodiment, the coefficients during weight calculation can be adjusted to make the first node weight and the second node weight at the same order of magnitude.

[0072] Exemplarily, taking the determination of the first node weight within the above numerical range as an example, the order of magnitude is hundreds. After the candidate owner nodes conduct an election vote and the order of magnitude of the number of votes obtained is hundreds, the number of votes obtained can be directly used as the second node weight. If there are few candidate owner nodes and the order of magnitude of the number of votes obtained is a single digit, a vote gain value can be introduced to adjust the order of magnitude of the second node weight to hundreds, as long as it can ensure that the dimensions of the first node weight and the second node weight are the same.

[0073] It should be noted that after determining the number of target nodes, the number of target nodes is allocated according to the ratio of the first total weight and the second total weight. And this embodiment ensures that there is at least one target property node and at least one target owner node, ensuring that there are two types of nodes during subsequent consensus verification and bookkeeping, effectively decentralizing and improving the credibility of data.

[0074] It should be noted that after determining the number of target property nodes and target owner nodes, the target property nodes can be determined from the candidate property nodes according to the first node weight from high to low. For example, in the above example, the top 3 candidate property nodes with the first node weight can be selected as the target property nodes, and the same applies to the target owner nodes.

[0075] S60. Perform consensus verification on the first block based on the target property nodes and target owner nodes. After the verification passes, chain the first block to the target blockchain.

[0076] It should be noted that after determining at least one target property node and target owner node, performing consensus verification and chaining processing on the first block are well-known techniques to those skilled in the art and will not be elaborated here.

[0077] It should be noted that after each acquisition of the target security data in this embodiment, the operations of this embodiment are executed once, and the number of target nodes is dynamically determined according to the different types of target property devices. Although the first node weight of the candidate property nodes is relatively fixed, the candidate owner nodes conduct election voting randomly each time. Therefore, the target owner nodes are dynamic. Thus, after each determination of the first block, consensus verification can be performed according to different accounting nodes, and both property nodes and owner nodes are available, realizing decentralized accounting storage and improving the credibility of data.

[0078] In addition, in one embodiment, referring to Figure 3 , step S40 specifically includes but is not limited to the following steps:

[0079] S41, based on any candidate owner node, randomly perform a voting operation among the remaining candidate owner nodes;

[0080] S42, determine the candidate owner nodes with the number of votes of the node greater than zero as the representative owner nodes;

[0081] S43, based on any representative owner node, determine the product of the number of votes of the node and the vote gain value as the second node weight.

[0082] It should be noted that when voting among the candidate owner nodes in this embodiment, each candidate owner node performs a voting operation, and the voting is random. The voting object is any candidate owner node other than itself. After the voting is completed, the number of votes of the node is counted, and the candidate owner nodes with the number of votes of the node greater than zero are determined as the representative owner nodes.

[0083] It should be noted that for each representative owner node, it is necessary to ensure that the dimension of the second node weight is the same as that of the first node weight. In this embodiment, the vote gain value is dynamically configured according to the total number of candidate owner nodes. For example Figure 1 as shown, the number of candidate nodes is 8. Referring to the above example of the management area, the first node weight is 400. If the number of votes of the node is used as the second node weight, it will cause a large numerical difference between the first node weight and the second node weight, resulting in the situation that the property nodes account for a large weight and the accounting storage is centered around the property nodes. Based on this, the vote gain value in this embodiment can be set to 100, and the product of the number of votes of the node and the vote gain value is used as the second node weight.

[0084] Exemplarily, for the 8 candidate owner nodes as shown in Figure 1 , the number of votes obtained in the election voting are 4, 3, 1, 0, 0, 0, 0, 0 in sequence, then the corresponding number of votes of the nodes are 4, 3, and 1 in sequence. In order to have the same dimension as the first node weight, each second node weight can be multiplied by the vote gain value of 100, so that the second node weights are 400, 300, and 100 in sequence.

[0085] In addition, in one embodiment, with reference to Figure 3 , step S50 specifically includes but is not limited to the following steps:

[0086] S51, based on the ratio of the first total weight to the second total weight, determine the first number of nodes corresponding to the first total weight and the second number of nodes corresponding to the second total weight based on the number of target nodes;

[0087] S52, determine the larger value and the smaller value among the first number of nodes and the second number of nodes;

[0088] S53, when both the smaller value and the larger value are greater than or equal to 1, and the value of the smaller value is less than or equal to half of the larger value, after rounding up the smaller value, update the larger value based on the difference between the number of target nodes and the smaller value;

[0089] S54, when both the smaller value and the larger value are greater than or equal to 1, and the value of the smaller value is greater than half of the larger value, after rounding up the larger value, update the smaller value based on the difference between the number of target nodes and the larger value;

[0090] S55, when the value of the smaller value is less than 1, determine the value of the smaller value as 1, and update the larger value based on the difference between the number of target nodes and the smaller value;

[0091] S56, determine at least one target property node based on the first number of nodes and the first node weight, and determine at least one target owner node based on the second number of nodes and the second node weight.

[0092] It should be noted that after determining the number of target nodes, in this embodiment, proportional distribution is performed according to the first total weight and the second total weight, so as to determine the first number of nodes corresponding to the property node and the second number of nodes corresponding to the owner node. Since the ratio is determined based on the node weights, it is very likely that the first number of nodes and the second number of nodes are not integers. If both are integers, the subsequent operations can be directly performed; if both are not integers, in this embodiment, the larger value and the smaller value are first determined to determine the rounding strategy, ensuring that the first number of nodes and the second number of nodes are integers and the sum of the two is the number of target nodes.

[0093] Exemplarily, taking the number of target nodes as 5 as an example, taking the first node weights as 400, 300, 200, 100, and 100 as an example, the second node weights as 400, 300, and 100 as an example, the first total weight is 11000, the second total weight is 800, and the ratio of the two is 11:8. Based on 11:8, 5 is allocated. After rounding the number of the first nodes and the number of the second nodes, the number of the first nodes is 3 and the number of the second nodes is 2, that is, 3 target property nodes and 2 target owner nodes can be determined.

[0094] It should be noted that after adjusting the larger value or the smaller value, in this embodiment, the number of the other party is obtained by subtracting the party that is adjusted first from the number of target nodes.

[0095] For example, in step S43, when both the smaller value and the larger value are greater than 1, it can be determined that at least one target property node and one target owner node can be allocated. To avoid the situation of lacking one type of node, if the value of the smaller value is less than or equal to half of the larger value, the number of nodes corresponding to the larger value is larger and the difference between the two is larger. If the larger value is rounded up, it is very likely that the value of the smaller value will be 0. For example, the ratio of the first total weight to the second total weight is 6.5:1.5. When the number of target nodes is 5, the calculated number of the first nodes is 4.3 and the number of the second nodes is 1. If 4.3 is rounded up to 5, the number of the second nodes is adjusted to 0, resulting in no target owner nodes. Therefore, in this case, in this embodiment, the smaller value is taken as the object of rounding up. For example, in the above example, after rounding up, the number of the second nodes is still 1, and the number of the first nodes is 5 - 1 = 4.

[0096] Another example, in step S44, if the larger value is not an integer, when the value of the smaller value is greater than half of the larger value, the difference between the two values is small, and rounding up the larger value will not cause the value of the smaller value to be zero. At this time, if the smaller value is rounded up, the difference between the larger value and the smaller value will be further reduced or even leveled. In order to maintain the difference of the values, in this step of this embodiment, the larger value is rounded up to maintain the difference of the values. For example, the number of the first nodes is 3.3 and the number of the second nodes is 1.7. In this embodiment, the number of the first nodes is rounded up to 4, and the number of the second nodes is updated to 1.

[0097] Another example, in step S45, if the smaller value is less than 1, to ensure at least one target property node and one target owner node, the smaller value is directly determined as 1, and then the larger value can be determined according to the number of target nodes and the smaller value.

[0098] It should be noted that after determining the number of first nodes and the number of second nodes and adjusting them to integers, the corresponding bookkeeping nodes can be determined according to the weight sorting respectively. For example, according to the number of first nodes, several candidate property nodes with the highest first node weights are selected as target property nodes, and according to the number of second nodes, several candidate owner nodes with the highest second node weights are selected as target owner nodes.

[0099] In addition, in one embodiment, with reference to Figure 3 , step S20 specifically includes but is not limited to the following steps:

[0100] S21, determining a first reference weight based on the number of nodes and the vote gain value of the candidate owner nodes;

[0101] S22, determining a second reference weight and a third reference weight in the weight mapping table, where the second reference weight is the optional weight with the largest value, and the third reference weight is the optional weight with the smallest value;

[0102] S23, obtaining a reference ratio preset for the target IoT device, where the reference ratio is used to indicate the minimum ratio of the target property node to the target owner node, and the reference ratios of at least two optional IoT devices are different from each other;

[0103] S24, when the reference ratio is greater than 1 and the first reference weight is greater than or equal to the second reference weight, determining the product of the first reference weight and the reference ratio as the fourth reference weight, determining a first adjustment ratio based on the fourth reference weight and the third reference weight, determining the fourth reference weight as the new third reference weight, and updating the remaining optional weights in the weight mapping table based on the first adjustment ratio;

[0104] S25, when the reference ratio is less than 1 and the first reference weight is less than or equal to the third reference weight, determining the product of the first reference weight and the reference ratio as the fifth reference weight, determining a second adjustment ratio based on the fifth reference weight and the second reference weight, determining the fifth reference weight as the new second reference weight, and updating the remaining optional weights in the weight mapping table based on the second adjustment ratio.

[0105] It should be noted that according to the steps of the above embodiments, the first node weight is obtained by looking up the weight mapping table. Since business metrics do not change frequently, for example, the management area is usually fixed, and the number of property assets usually does not change by a large order of magnitude. However, the number of candidate owner nodes can change. For example, when a new community is introduced into the evidence storage system, a candidate property node is added, but a large number of candidate owner nodes will be added. If the optional weights in the weight mapping table are fixed values, it is very likely that when the number of votes of the candidate owner nodes increases significantly, the second node weight is much larger than the first node weight, resulting in the number of target owner nodes being much larger than the number of target property nodes. Therefore, in this embodiment, the optional weights in the weight mapping table are dynamically configured to ensure that the first node weight and the second node weight are in the same order of magnitude.

[0106] It should be noted that in this embodiment, the first reference weight is first determined according to the number of candidate owner nodes and the vote gain value, and the first reference weight is used as the theoretical maximum value of the second node weight. Then, the largest optional weight is selected from the weight mapping table as the second reference weight, and the smallest optional weight is used as the third reference weight. A reference ratio is set for each optional IoT device, and the reference ratio represents the minimum ratio of the target property nodes to the target owner nodes required for this type of target security data, ensuring that after adjusting the optional weights, the finally determined number of the first nodes and the number of the second nodes are at least greater than the reference ratio.

[0107] For example, the reference ratio of the video surveillance device can be set to 3:2 to ensure that the property nodes are dominant, and the reference ratio of the access control device can be set to 1:2 to ensure that the owner nodes are dominant. Specific values are not limited here.

[0108] In step S204, when the reference ratio is greater than 1, it can be determined that it is necessary to ensure that the number of target property nodes is greater than the number of target owner nodes. The first reference weight is the theoretical maximum value of the second node weight. Therefore, it is necessary to ensure that the reference ratio can still be satisfied when applying the third reference weight and the first reference weight. In this embodiment, the fourth reference weight is first obtained by multiplying the first reference weight and the reference ratio. The fourth reference weight is the minimum first node weight required when the second node weight is the largest. Therefore, in this embodiment, the fourth reference weight is used as the new third reference weight, and the amplification factor of the fourth reference weight relative to the third reference weight is used as the first adjustment ratio, and the remaining optional weights are increased proportionally based on the first adjustment ratio. After the adjustment of this embodiment, even when the first node weight is the smallest and the second node weight is the largest, the reference ratio is still greater than 1, ensuring that the number requirements of the target property nodes and the target owner nodes meet the target IoT devices.

[0109] Similarly, in step S205, when the reference ratio is less than 1, it can be determined that the number of target property nodes needs to be ensured to be less than the number of target owner nodes, and the second reference weight is the maximum value of the first node weights. Therefore, it is necessary to ensure that the reference ratio can still be satisfied when applying the second reference weight and the first reference weight. In this embodiment, first, the fifth reference weight is obtained by multiplying the first reference weight by the reference ratio. The fifth reference weight is the maximum first node weight that needs to be achieved when the second node weight is the largest. Therefore, in this embodiment, the fifth reference weight is used as the new second reference weight, and the reduction coefficient of the fifth reference weight relative to the second reference weight is used as the second adjustment ratio, and the remaining optional weights are reduced proportionally based on the second adjustment ratio. After the adjustment of this embodiment, when the first node weight is the largest and the second node weight is the largest, the reference ratio can still be satisfied to be less than 1, ensuring that the quantity requirements of the target property nodes and the target owner nodes meet the target IoT devices.

[0110] It should be noted that the adjustment of this embodiment is based on the extreme values of the optional weights. After the adjustment, the calculated number of the first nodes and the number of the second nodes will change compared with those before the adjustment. Under the compensation mechanism of steps S41 to S45, it can be ensured that the number of the first nodes and the number of the second nodes are both at least greater than or equal to 1, and no type of node will be missing.

[0111] In addition, in one embodiment, referring to Figure 3 , step S10 specifically includes but is not limited to the following steps:

[0112] S11, obtaining the first timestamp of the target security data;

[0113] S12, when the second block cannot be obtained from the target blockchain, constructing a genesis block, determining the genesis block as the first block, calculating the second hash value of the first block, and determining the first hash value, the first timestamp, and the second hash value as the block data of the first block, where the second block is the current latest block of the target blockchain;

[0114] S13, when the second block is obtained, constructing the first block, calculating the second hash value of the first block, obtaining the third hash value of the second block, determining the third hash value as the previous block hash value, and determining the first hash value, the second hash value, the previous block hash value, and the first timestamp as the block data of the first block.

[0115] It should be noted that when constructing the first block, it is necessary to determine the block data of the first block. The block data is used for subsequent consensus verification and blockchain on-chain. In this embodiment, the first timestamp of the target security data is recorded in the block data. Through the first timestamp, the sequence order of different blocks can be determined, and block verification can be performed from the time dimension.

[0116] It should be noted that when creating the first interval, first obtain the current latest second block from the target blockchain. If there is no second block, it can be determined that there are no blocks in the target blockchain, and the first block is the genesis block of the target blockchain. After initializing the genesis block, it is determined as the first block.

[0117] It should be noted that after obtaining the first block, in this embodiment, the block hash value of the first block is further calculated as the second hash value, and the first hash value, the first timestamp, and the second hash value are determined as the block data of the first block. The second hash value can be used as the previous block hash value of the next block for consensus verification of the next block.

[0118] It should be noted that when the second block is obtained, it can be determined that the target blockchain already has blocks. According to the above description, when performing consensus verification, the previous block hash value needs to be used. Therefore, in this embodiment, the third hash value of the second block is obtained, and the third hash value is used as the previous block hash value of the first block, that is, the block data of the first block includes the first hash value, the second hash value, the previous block hash value, and the first timestamp.

[0119] In addition, in one embodiment, with reference to Figure 3 , step S60 specifically includes but is not limited to the following steps:

[0120] S61, based on each target property node and target owner node, respectively obtain the third hash value and the second timestamp of the second block;

[0121] S62, when the first timestamp is after the second timestamp and the third hash value matches the previous block hash value of the first block, determine that the first block passes the consensus verification.

[0122] It should be noted that when performing consensus verification, each target property node and target owner node can obtain the third hash value and the second timestamp of the second block from the target blockchain, and verify the time validity of the first block through the first timestamp and the second timestamp. When the first timestamp is after the second timestamp, it can be determined that the time validity of the first block passes the verification. At the same time, in this embodiment, block verification is performed through the third hash value and the previous block hash value of the first block. When the third hash value is the same as the previous block hash value, it can be determined that the first block is after the second block, and it is determined that the continuity verification of the first block passes.

[0123] As Figure 4 shown, Figure 4 is the structural diagram of a property security data deposit and proof device based on blockchain provided by an embodiment of the present invention. The present invention also provides a property security data deposit and proof device based on blockchain, including:

[0124] The processor 401 can be implemented in the form of a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0125] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 402 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 402 and are called by the processor 401 to execute the blockchain-based property security data deposit and certification method in the embodiments of the present application;

[0126] The input / output interface 403 is used to implement information input and output;

[0127] The communication interface 404 is used to implement communication interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or through wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0128] The bus 405 transmits information between various components of the device (such as the processor 401, the memory 402, the input / output interface 403, and the communication interface 404);

[0129] Among them, the processor 401, the memory 402, the input / output interface 403, and the communication interface 404 achieve communication connections with each other inside the device through the bus 405.

[0130] The embodiments of the present application also provide an electronic device, including the blockchain-based property security data deposit and certification device as described above.

[0131] The embodiments of the present application also provide a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned blockchain-based property security data deposit and certification method.

[0132] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The device embodiments described above are merely illustrative, where the units described as separate components may or may not be physically separated, and may be located in one place, or may also be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0133] Those of ordinary skill in the art will understand that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or can be implemented as hardware, or can be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cartridges, tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium generally includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.

[0134] The above is a specific description of the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present invention.

Claims

1. A property security data deposit method based on blockchain, characterized in that, Applied to an evidence storage system, the evidence storage system is communicatively connected to a plurality of optional Internet of Things devices. The evidence storage system includes a plurality of candidate property nodes, a plurality of candidate owner nodes, and a target blockchain. The method includes: Constructing a first block based on a first hash value of target security data collected by any one of the target Internet of Things devices; Determining an optional weight of a preset weight mapping table based on the number of nodes of the candidate owner nodes and a preset vote gain value, where the weight mapping table records a mapping relationship between a plurality of optional index value ranges and the optional weights; Determining respective corresponding first node weights for each of the candidate property nodes based on the service indicators of the candidate property nodes and the weight mapping table, and summing the first node weights to obtain a first total weight, where the service indicators are used to indicate the management scale corresponding to the candidate property nodes; Determining second node weights based on the number of votes obtained by each of the candidate owner nodes during the election voting, and summing the second node weights to obtain a second total weight; Determining at least one target property node and at least one target owner node based on the ratio of the first total weight to the second total weight, where the sum of the target property node and the target owner node is equal to the number of target nodes of the target Internet of Things device; Performing consensus verification on the first block based on the target property node and the target owner node, and after the verification passes, uploading the first block to the target blockchain; Determining an optional weight of a preset weight mapping table based on the number of nodes of the candidate owner nodes and a preset vote gain value, including: Determining a first reference weight based on the number of nodes of the candidate owner nodes and the vote gain value; Determining a second reference weight and a third reference weight in the weight mapping table, where the second reference weight is the largest optional weight and the third reference weight is the smallest optional weight; Obtaining a reference ratio preset for the target Internet of Things device, where the reference ratio is used to indicate the minimum ratio of the target property node to the target owner node, and the reference ratios of at least two of the optional Internet of Things devices are different from each other; When the reference ratio is greater than 1 and the first reference weight is greater than or equal to the second reference weight, determining the product of the first reference weight and the reference ratio as a fourth reference weight, determining a first adjustment ratio based on the fourth reference weight and the third reference weight, determining the fourth reference weight as the new third reference weight, and updating the remaining optional weights in the weight mapping table based on the first adjustment ratio; When the reference ratio is less than 1 and the first reference weight is less than or equal to the third reference weight, determining the product of the first reference weight and the reference ratio as a fifth reference weight, determining a second adjustment ratio based on the fifth reference weight and the second reference weight, determining the fifth reference weight as the new second reference weight, and updating the remaining optional weights in the weight mapping table based on the second adjustment ratio.

2. The method for storing property security data based on blockchain according to claim 1, wherein Determining second node weights based on the number of votes obtained by each of the candidate owner nodes during the election voting, including: Based on any one of the candidate owner nodes, perform a voting operation randomly once among the remaining candidate owner nodes; Determine the candidate owner nodes with the number of votes of the nodes greater than zero as the representative owner nodes; Based on any one of the representative owner nodes, determine the product of the number of votes of the node and the vote gain value as the second node weight.

3. The method for storing property security data based on blockchain according to claim 2, wherein Determine at least one target property node and at least one target owner node based on the ratio of the first total weight and the second total weight, including: Based on the ratio of the first total weight to the second total weight, determine the first number of nodes corresponding to the first total weight and the second number of nodes corresponding to the second total weight based on the number of target nodes; Determine the larger value and the smaller value among the first number of nodes and the second number of nodes; When both the smaller value and the larger value are greater than or equal to 1, and the value of the smaller value is less than or equal to half of the larger value, after rounding up the smaller value, update the larger value based on the difference between the number of target nodes and the smaller value; Or, when both the smaller value and the larger value are greater than or equal to 1, and the value of the smaller value is greater than half of the larger value, after rounding up the larger value, update the smaller value based on the difference between the number of target nodes and the larger value; When the value of the smaller value is less than 1, determine the value of the smaller value as 1, and update the larger value based on the difference between the number of target nodes and the smaller value; Determine at least one of the target property nodes based on the first number of nodes and the first node weight, and determine at least one of the target owner nodes based on the second number of nodes and the second node weight.

4. The method for storing property security data based on blockchain according to claim 1, wherein Construct a first block based on the first hash value of the target security data collected by any target IoT device, including: Obtain the first timestamp of the target security data; When the second block cannot be obtained from the target blockchain, construct a genesis block, determine the genesis block as the first block, calculate the second hash value of the first block, and determine the first hash value, the first timestamp, and the second hash value as the block data of the first block, where the second block is the current latest block of the target blockchain; When the second block is obtained, construct the first block, calculate the second hash value of the first block, obtain the third hash value of the second block, determine the third hash value as the previous block hash value, and determine the first hash value, the second hash value, the previous block hash value, and the first timestamp as the block data of the first block.

5. The method for storing property security data based on blockchain according to claim 4, characterized in that, Perform consensus verification on the first block based on the target property node and the target owner node, including: Based on each of the target property nodes and the target owner nodes, respectively obtain the third hash value and the second timestamp of the second block; When the first timestamp is after the second timestamp and the third hash value matches the hash value of the previous block of the first block, it is determined that the first block passes the consensus verification.

6. A property security data deposit and certification device based on blockchain, characterized in that, Comprising at least one control processor and a memory for communicatively connecting with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the blockchain-based property security data deposit method according to any one of claims 1 to 5.

7. An electronic device, characterized in that, Comprising the blockchain-based property security data deposit device according to claim 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to execute the blockchain-based property security data deposit method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Weight-based block chain consensus method and system, storage medium and electronic equipment

    CN109559120A

  • Alliance chain cross-chain distributed governance method and device and server

    CN114328666A