Property security data storage method and device based on block chain, equipment and medium

By introducing property nodes and owner nodes with dynamic weight determination in the blockchain, consensus verification is carried out, the problem of centralization of property security data storage is solved, and the credibility and security of data storage are improved.

CN120074801AActive Publication Date: 2025-05-30LINJIU WISDOM (GUANGDONG) TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, there is a centralized problem in the storage of property security data, which leads to lack of credibility in data and is prone to loss of data when server hardware fails or is attacked.

Method used

By introducing property nodes and owner nodes with dynamic weight determination in the blockchain, consensus verification is carried out to reduce the centralization of blockchain and improve the credibility of data storage.

Benefits of technology

It realizes consensus verification between property nodes and owner nodes, improves the credibility of data storage, reduces the centralization of blockchain, and enhances data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074801A_ABST
    Figure CN120074801A_ABST
Patent Text Reader

Abstract

The invention provides a property security data storage method and device based on a block chain, equipment and a medium. The method comprises the following steps: constructing a first block according to a first hash value of target security data; determining an optional weight of a weight mapping table based on the number of the owner nodes and the vote gain value, and determining a first node weight by the property node according to the business index; the owner node determines a second node weight through election voting; and after determining at least one target property node and a target owner node based on the weight ratio, executing consensus verification and uplink on the first block. The method can flexibly adjust the weight mapping table according to the number of owner nodes, enables the two weight values to be the same in measurement, determines at least one target property node and target owner node through the weight ratio of the property nodes to the owner nodes, carries out the consensus verification through the two types of nodes, effectively reduces the centralization of a target block chain, and improves the verification efficiency. And the credibility of data evidence storage is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, with the development of intelligent property management, 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 management systems usually use centralized databases such as MySQL or Oracle to store all security data. Administrators can modify the data at will, resulting in a lack of credibility of the data. Moreover, data is easily lost when the server hardware fails or is attacked.

[0003] In related technologies, blockchain technology has been 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-style 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, and 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, reduce the centralization of the blockchain, and improve 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 Internet of Things devices. The storage system includes multiple candidate property nodes, multiple candidate owner nodes, and a target blockchain. The method 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 an optional weight 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 weight; 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; Determine the second node weight based on the number of votes obtained by each of the candidate owner nodes in the election voting, and sum the second node weights to obtain the second total weight; Determine 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 IoT device; Based on the target property node and the target owner node, perform consensus verification on the first block, and after the verification passes, chain the first block to the target blockchain.

[0006] According to some embodiments of the present invention, determining the second node weight based on the number of votes obtained by each of the candidate owner nodes in the election voting includes: Based on any one of the candidate owner nodes, randomly perform a voting operation among the remaining candidate owner nodes; Determine the candidate owner nodes with the number of votes greater than zero as 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.

[0007] 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 to the second total weight includes: Based on the ratio of the first total weight to the second total weight, determine the number of first nodes corresponding to the first total weight and the number of second nodes corresponding to the second total weight based on the number of target nodes; Determine the larger value and the smaller value among the number of first nodes and the number of second 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; 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 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 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.

[0008] According to some embodiments of the present invention, determining the optional weights of a preset weight mapping table based on the node quantity of the candidate owner nodes and a preset vote gain value includes: Determine a first reference weight based on the node quantity of the candidate owner nodes and the vote gain value; 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; Obtain 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, 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; 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.

[0009] According to some embodiments of the present invention, constructing a first block based on the first hash value of the target security data collected by any target Internet of Things device includes: 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.

[0010] 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: Based on each of the target property nodes and the target owner node, 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 previous block hash value of the first block, determine that the first block passes the consensus verification.

[0011] In a second aspect, an embodiment of the present invention provides a property security data storage and proof 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 so that the at least one control processor can execute the property security data storage and proof method based on a blockchain as described in the first aspect above.

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

[0013] 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 storage and proof method based on a blockchain as described in the first aspect above.

[0014] 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 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 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 of each candidate owner node for the election vote, 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 IoT 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, it is possible to determine the first node weights of each property node using the management scale, determine the weights of each owner node using the election vote, determine the optional weights of the weight mapping table according to the number of owner nodes, ensure the consistency of the measurement standards of the owner nodes and the property nodes, and determine at least one target property node and target owner node using the weights, so as to perform consensus verification through two types of nodes, effectively reduce the centralization of the target blockchain, and improve the credibility of data storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 FIG. 6 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; Figure 2 FIG. 9 is a flowchart of the method for storing property security data based on blockchain provided by another embodiment of the present invention; Figure 3 FIG. 12 is a complete flowchart of the method for storing property security data based on blockchain provided by another embodiment of the present invention; Figure 4 FIG. 15 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

[0016] 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 only for explaining the present invention and should not be construed as limiting the present invention.

[0017] In the description of the present invention, it should be understood that with regard to the orientation description, such as the orientations or positional relationships indicated by up, down, front, back, left, right, etc., are based on the orientations or positional relationships shown in the accompanying drawings. This 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.

[0018] 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.

[0019] 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. 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.

[0020] The embodiments of the present invention provide a method, device, equipment, 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 based on the number of votes of each candidate owner node in the election vote, 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 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 embodiments 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 vote, the optional weights of the weight mapping table can be determined according to the number of owner nodes, ensuring the consistency of the measurement standards 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.

[0021] The following is further elaboration on the technical solution of the embodiments of the present invention based on the schematic diagram of the principle shown in the appendix. Figure 1 As shown in the following principle schematic diagram, the technical solution of the embodiments of the present invention is further elaborated.

[0022] Refer to Figure 2 , Figure 2 As shown in the flowchart of a method for storing property security data based on a blockchain provided by the embodiments of the present invention, the method for storing property security data based on a blockchain includes but is not limited to the following steps: S10, constructing a first block based on the first hash value of the target security data collected by any target Internet of Things device.

[0023] 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 surveillance 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, and the specific types are not limited here.

[0024] 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.

[0025] 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 ledger-like manner, thereby realizing decentralized storage.

[0026] 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 relationships between multiple optional index value intervals and optional weights.

[0027] It should be noted that according to the description of the above embodiment, the first node weight is determined based on the numerical values of the business indicators. The business indicators 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.

[0028] 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.

[0029] 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.

[0030] It should be noted that, as Figure 1 shown, the deposit system includes multiple accounting nodes. The accounting nodes are divided into candidate property nodes (such as Figure 1 the hollow nodes in Figure 1 ) and candidate owner nodes (such as

[0031] the solid nodes in

[0032] ). 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.

[0033] It should be noted that in this embodiment, it is necessary to ensure that when performing consensus verification and accounting storage for the first block, it includes both candidate property nodes and candidate owner nodes. 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 out at least one target property node from multiple candidate property nodes and screen out at least one target owner node from multiple candidate owner nodes. Figure 1 Exemplarily, for the 6 candidate property nodes shown in

[0034] , 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.

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

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

[0036] It should be noted that the number of candidate owner nodes is relatively large. If the weights are determined according to the scale, a large number of duplicate weights will be caused, 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 weight in this embodiment cannot use the property scale of the owner, but uses the method of election voting. Each candidate owner node randomly casts a vote for another candidate property node. Using the random voting method can make the number of votes discrete 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 weight can be determined according to the number of votes of the nodes.

[0037] 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.

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

[0039] S50. Determine 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 target node number of the target IoT device.

[0040] 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 biometric characteristics or passwords of the owner, and the security requirements are relatively high. 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.

[0041] 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.

[0042] It should be noted that the first node weight and the second node weight in this embodiment are determined in different ways. 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 quantity of the first node weight is too large, the number of target property nodes determined according to the ratio will be much larger than that of the target owner nodes, resulting in a higher 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 in the same order of magnitude.

[0043] 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 fewer candidate owner nodes and the order of magnitude of the number of votes obtained is in single digits, 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.

[0044] 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 accounting, effectively decentralizing and improving the credibility of data.

[0045] 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.

[0046] 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.

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

[0048] 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 weights of the candidate property nodes are relatively fixed, the election voting of the candidate owner nodes is randomly performed 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.

[0049] In addition, in one embodiment, referring to Figure 3 , step S40 specifically includes but is not limited to the following steps: S41, based on any candidate owner node, randomly perform a voting operation among the remaining candidate owner nodes; S42, determine the candidate owner nodes with the number of votes of the node greater than zero as the representative owner nodes; 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.

[0050] 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 nodes with the number of votes of the node greater than zero are determined as the representative owner nodes.

[0051] 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.

[0052] Exemplarily, for the 8 candidate owner nodes as Figure 1 shown, 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.

[0053] In addition, in one embodiment, referring toFigure 3 , step S50 specifically includes but is not limited to the following steps: 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; S52, determine the larger value and the smaller value among the first number of nodes and the second number of nodes; 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; 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; 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; 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.

[0054] It should be noted that after determining the number of target nodes, in this embodiment, proportional allocation 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 weight, 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 executed; 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.

[0055] Exemplarily, taking the number of target nodes as 5, the first node weights as 400, 300, 200, 100, and 100, the second node weights as 400, 300, and 100, the first total weight as 11000, the second total weight as 800, and the ratio of the two as 11:8. After allocating 5 according to 11:8 and rounding up the first number of nodes and the second number of nodes, the first number of nodes is 3 and the second number of nodes is 2, that is, 3 target property nodes and 2 target owner nodes can be determined.

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

[0057] 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 significant. If the larger value is rounded up, it is very likely that 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 embodiment, in this case, the smaller value is used as the object for rounding up. For example, in the above example, after rounding up, the number of the second nodes remains 1, and the number of the first nodes is 5 - 1 = 4.

[0058] Again, 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. 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 off. In order to maintain the difference in values in this embodiment, the larger value is rounded up in this step to maintain the difference in 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.

[0059] Again, 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 to be 1, and then the larger value can be determined according to the number of target nodes and the smaller value.

[0060] It should be noted that after determining the number of the first nodes and the number of the 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 the first nodes, several candidate property nodes with the highest first node weights are selected as the target property nodes, and according to the number of the second nodes, several candidate owner nodes with the highest second node weights are selected as the target owner nodes.

[0061] In addition, in one embodiment, referring to Figure 3 , step S20 specifically includes but is not limited to the following steps: S21, determining a first reference weight based on the number of nodes and the vote gain value of the candidate owner nodes; S22. Determine the second reference weight and the third reference weight in the weight mapping table. 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. S23. Obtain the reference ratio preset for the target IoT device. 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. S24. 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 the fourth reference weight, determine the 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. S25. 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 the fifth reference weight, determine the 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.

[0062] It should be noted that according to the steps of the above embodiments, the first node weight is obtained by looking up the table in the weight mapping table. Since the business indicators do not change frequently, for example, the management area is usually fixed, and the property assets usually do not change by a large order of magnitude. However, the number of candidate owner nodes can change. For example, after introducing a new community in 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 greater than the first node weight, resulting in the number of target owner nodes being much greater 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 can be in the same order of magnitude.

[0063] It should be noted that in this embodiment, the first reference weight is first determined according to the number of nodes and the vote gain value of the candidate owner nodes, and the first reference weight is used as the theoretical maximum value of the second node weight. Then, the optional weight with the largest value is selected from the weight mapping table as the second reference weight, and the optional weight with the smallest value is used as the third reference weight. And a reference ratio is set for each optional IoT device, and the reference ratio represents the minimum ratio of the target property node to the target owner node required by 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 can be at least greater than the reference ratio.

[0064] 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.

[0065] In step S204, when the reference ratio is greater than 1, it can be determined that the number of target property nodes needs to be ensured to be greater than the number of target owner nodes, and 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 by the reference ratio. The fourth reference weight is the minimum first node weight required when the second node weight is the largest. Therefore, this embodiment uses the fourth reference weight as the new third reference weight, and uses the amplification factor of the fourth reference weight relative to the third reference weight as the first adjustment ratio, and equally increases the remaining optional weights 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 can still be greater than 1, ensuring that the quantity requirements of the target property nodes and the target owner nodes meet the target IoT devices.

[0066] 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 weight. 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, the fifth reference weight is first obtained by multiplying the first reference weight by the reference ratio. The fifth reference weight is the maximum first node weight required when the second node weight is the largest. Therefore, this embodiment uses the fifth reference weight as the new second reference weight, and uses the reduction factor of the fifth reference weight relative to the second reference weight as the second adjustment ratio, and equally reduces the remaining optional weights based on the second adjustment ratio. After the adjustment of this embodiment, even when the first node weight is the largest and the second node weight is the largest, the reference ratio can still be less than 1, ensuring that the quantity requirements of the target property nodes and the target owner nodes meet the target IoT devices.

[0067] It should be noted that the adjustment of this embodiment is based on the extreme values of the optional weights. The number of the first nodes and the second nodes calculated after the adjustment will change compared with 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 second nodes are both at least greater than or equal to 1, and no type of node will be missing.

[0068] In addition, in one embodiment, referring to Figure 3 , step S10 specifically includes but is not limited to the following steps: S11, obtain the first timestamp of the target security data; S12, 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; S13, 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.

[0069] 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. The first timestamp can be used to determine the order of different blocks and perform block verification from the time dimension.

[0070] It should be noted that when creating the first interval, first obtain the current latest second block from the target blockchain. If the second block does not exist, it can be determined that the target blockchain has no blocks, and the first block is the genesis block of the target blockchain. After initializing the genesis block, it is determined as the first block.

[0071] It should be noted that after obtaining the first block, this embodiment further calculates the block hash value of the first block as the second hash value, and determines the first hash value, the first timestamp, and the second hash value 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.

[0072] 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, this embodiment obtains the third hash value of the second block and uses the third hash value 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.

[0073] In addition, in one embodiment, referring to Figure 3 , step S60 specifically includes but is not limited to the following steps: 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; 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.

[0074] 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, the 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.

[0075] As Figure 4 shown, Figure 4 is a structural diagram of a blockchain-based property security data deposit and proof device provided by an embodiment of the present invention. The present invention also provides a blockchain-based property security data deposit and proof device, including: A processor 401, which can be implemented by using 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 by the embodiments of the present application; A memory 402, which 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). The memory 402 can store an operating system and other application programs. When implementing the technical solutions provided by 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 proof method of the embodiments of the present application; An input / output interface 403, which is used to implement information input and output; A communication interface 404, which is used to implement communication interaction between this device and other devices, and can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as mobile network, WIFI, Bluetooth, etc.); A bus 405, which 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); Among them, the processor 401, the memory 402, the input / output interface 403, and the communication interface 404 are communicatively connected to each other inside the device through the bus 405.

[0076] An embodiment of the present application further provides an electronic device, including the blockchain-based property security data deposit and certification device as described above.

[0077] An embodiment of the present application further provides 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.

[0078] 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 memories remotely disposed relative to the processor, and these remote memories may 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, and the units described as separate components may or may not be physically separated, and may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0079] Those of ordinary skill in the art will appreciate that all or some of the steps and systems disclosed above in the methods can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the 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 as hardware, or 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 cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically 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.

[0080] 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 storage method based on blockchain, characterized in that: Applied to a proof storage system, the proof storage system is communicatively connected with a plurality of optional IoT devices, the proof storage system includes a plurality of candidate property nodes, a plurality of candidate owner nodes and a target blockchain, and the method includes: Building a first block based on a first hash value of target security data collected by any target IoT device; Determine the optional weights of a preset weight mapping table based on the number of nodes of the candidate owner nodes and a preset vote gain value, wherein the weight mapping table records a mapping relationship between multiple optional indicator value intervals and the optional weights; Determine the first node weights corresponding to the candidate property nodes based on the business indicators of the candidate property nodes and the weight mapping table, and sum the first node weights to obtain a first total weight, wherein the business indicators are used to indicate the management scale corresponding to the candidate property nodes; Determine a second node weight based on the number of votes obtained by each of the candidate owner nodes in performing election voting, and sum the second node weights to obtain a second total weight; Determine 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, wherein the sum of the target property nodes and the target owner nodes is equal to the number of target nodes of the target IoT device; Consensus verification is performed on the first block based on the target property node and the target owner node, and the first block is linked to the target blockchain after the verification passes.

2. The property security data storage method based on blockchain according to claim 1 is characterized in that: Determining the second node weight based on the number of votes obtained by each of the candidate owner nodes in performing election voting includes: Based on any of the candidate owner nodes, randomly perform a voting operation among the remaining candidate owner nodes; Determine the candidate owner node whose number of votes is greater than zero as the representative owner node; Based on any of the representative owner nodes, the product of the number of votes of the node and the vote gain value is determined as the second node weight.

3. The property security data storage method based on blockchain according to claim 2 is characterized in that: 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 includes: Based on the ratio of the first total weight to the second total weight, and based on the target number of nodes, determine the number of first nodes corresponding to the first total weight and the number of second nodes corresponding to the second total weight; Determine the larger and smaller of 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, the smaller value is rounded up, and the larger value is updated based on the difference between the target node number and the smaller value; 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, the larger value is rounded up, and the smaller value is updated based on the difference between the target node number and the larger value; When the value of the smaller value is less than 1, the value of the smaller value is determined to be 1, and the larger value is updated based on the difference between the number of target nodes and the smaller value; At least one target property node is determined based on the first node quantity and the first node weight, and at least one target owner node is determined based on the second node quantity and the second node weight.

4. The property security data storage method based on blockchain according to claim 2 is characterized in that: Determining the optional weights of the preset weight mapping table based on the number of nodes of the candidate owner nodes and the preset vote gain value includes: Determine a first reference weight based on the number of nodes of the candidate owner nodes and the vote gain value; Determine a second reference weight and a third reference weight in the weight mapping table, wherein 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; Acquire a reference ratio preset for the target IoT device, wherein the reference ratio is used to indicate a 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; When the reference ratio is greater than 1, and the first reference weight is greater than or equal to the second reference weight, the product of the first reference weight and the reference ratio is determined as a fourth reference weight, a first adjustment ratio is determined based on the fourth reference weight and the third reference weight, the fourth reference weight is determined as a new third reference weight, and the remaining optional weights in the weight mapping table are updated 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, the product of the first reference weight and the reference ratio is determined as the fifth reference weight, a second adjustment ratio is determined based on the fifth reference weight and the second reference weight, the fifth reference weight is determined as the new second reference weight, and the remaining optional weights in the weight mapping table are updated based on the second adjustment ratio.

5. The property security data storage method based on blockchain according to claim 1 is characterized in that: Building a first block based on a first hash value of target security data collected by any target IoT device includes: Obtaining a 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 a second hash value of the first block, and determine the first hash value, the first timestamp, and the second hash value as block data of the first block, wherein the second block is the latest block of the target blockchain; When the second block is obtained, the first block is constructed, the second hash value of the first block is calculated, the third hash value of the second block is obtained, the third hash value is determined as the previous block hash value, and the first hash value, the second hash value, the previous block hash value and the first timestamp are determined as block data of the first block.

6. The property security data storage method based on blockchain according to claim 5 is characterized in that: Performing consensus verification on the first block based on the target property node and the target owner node includes: 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 previous block hash value of the first block, it is determined that the first block passes the consensus verification.

7. A property security data storage device based on blockchain, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the blockchain-based property security data storage method as described in any one of claims 1 to 6.

8. An electronic device, characterized in that: Including the blockchain-based property security data storage device as described in claim 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the blockchain-based property security data storage method as described in any one of claims 1 to 6.

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

  • Target node acquisition method and device based on block chain, electronic equipment and medium

    CN115801336A

  • Data processing method and apparatus based on blockchain, and device and medium

    WO2025007540A1