Internet of Things data storage method and system based on BCH code

By constructing a partially connected storage network topology and performing chain-based verification using a BCH code-based data storage method, the efficiency and reliability issues of data storage and integrity verification in the Internet of Things (IoT) are solved, achieving efficient data storage and fast integrity verification.

CN121907863AInactive Publication Date: 2026-04-21ANHUI OCCUPATIONAL COLLEGE OF CITY MANAGEMENT
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI OCCUPATIONAL COLLEGE OF CITY MANAGEMENT
Filing Date
2026-01-28
Publication Date
2026-04-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the Internet of Things (IoT) environment, existing technologies struggle to efficiently and reliably store data and verify its integrity in distributed networks. This is especially true in complex or unreliable environments, where traditional error correction coding and data integrity verification methods suffer from single-point-of-failure risks, high communication overhead, low efficiency, and inefficient verification processes due to a lack of logical connections between nodes.

Method used

A BCH-based data storage method is adopted to construct a partially connected storage network topology, define the logical relationships between relay nodes, distribute data fragments and generate verification information, perform integrity verification through a chained verification path, and improve verification efficiency by combining encoding fault tolerance and topological distributed storage.

Benefits of technology

It improves the reliability and verification efficiency of IoT data storage, reduces communication overhead, and enables rapid data recovery and integrity verification in the event of node failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907863A_ABST
    Figure CN121907863A_ABST
Patent Text Reader

Abstract

The invention provides an Internet of Things data storage method and system based on a BCH code, and belongs to the technical field of data processing, and the method comprises the steps: firstly obtaining and coding an original data packet, and generating a BCH coding data block; then, constructing a storage network topology comprising a plurality of relay nodes and aggregation nodes, and pre-defining a logic association relationship for forming an incomplete connection graph structure for each relay node; distributing the data blocks to the selected part of relay nodes for storage; generating verification information fusing the storage content, the fragment identifier and the associated node information for each storage node; generating a verification path passing through at least two relay nodes based on the topology and logic association relationship; and sequentially acquiring verification information or data fragments of each node along the path, and executing chained verification on the BCH coded data block to complete integrity verification. Through the combination of coding fault tolerance, topological distributed storage and relevance chained verification, the reliability and verification efficiency of data storage of the Internet of Things are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to an IoT data storage method and system based on BCH codes. Background Technology

[0002] In the Internet of Things (IoT) environment, massive numbers of terminal devices continuously generate data. A key challenge is how to reliably and efficiently store this data across distributed network nodes and easily verify its integrity. IoT nodes are often deployed in complex or unreliable environments, making them susceptible to data errors or loss due to interference, node failures, or damaged storage media. While error-correcting coding techniques (such as BCH codes) can provide some fault tolerance for data blocks, traditional applications often focus on single-point storage or simple copy redundancy, failing to fully leverage the deep integration of coding characteristics with network topology to achieve a better balance between reliability and storage efficiency.

[0003] Meanwhile, existing distributed storage solutions often employ centralized indexing or full-replica comparison for data integrity verification. Centralized indexing carries the risk of single point of failure, and its maintenance overhead becomes enormous as the number of nodes increases. Full-replica comparison, on the other hand, incurs high communication overhead and is inefficient, making it particularly unsuitable for resource-constrained IoT networks. There is a lack of a lightweight, traceable verification mechanism that can follow the inherent network structure. Furthermore, most methods treat data storage nodes as isolated storage units, lacking pre-defined logical connections between nodes for verification purposes. This results in the verification process requiring communication with a large number of nodes or relying on external coordination, failing to form an efficient and orderly verification flow, and making it difficult to quickly locate and verify relevant data when some nodes fail. Summary of the Invention

[0004] This application provides an IoT data storage method and system based on BCH codes to improve the above-mentioned problems.

[0005] To achieve the above objectives, this application adopts the following technical solution: In a first aspect, embodiments of this application propose an IoT data storage method based on BCH codes, comprising: The original data packet to be stored is obtained and encoded based on the preset BCH encoding parameters to generate a BCH encoded data block containing data bits and parity bits. Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, predefine its logical association with at least one other relay node in the topology. The logical association constitutes a non-fully connected graph structure. The BCH-encoded data block is divided into N data segments, and a corresponding segment identifier is generated for each data segment. N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, where the target relay nodes are a subset of M relay nodes, and M > L ≥ 1; Verification information is generated for each target relay node that stores data fragments. The verification information is generated based at least on the data fragments stored in the corresponding target relay node, the fragment identifier, and the relevant information of at least one other relay node that has a logical relationship with the target relay node. When the integrity verification of the original data packet is triggered, a verification path is generated based on the storage network topology and logical association. Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and the BCH encoded data block is chained for verification to complete the integrity verification of the BCH encoded data block.

[0006] In conjunction with the first aspect, in some implementations, based on the verification path, verification information or stored data fragments corresponding to each node on the path are sequentially obtained, and chain verification is performed on the BCH-encoded data block, including: Select any relay node from the relay nodes that store any data segment of BCH encoded data blocks as the starting verification node; Based on logical association, the next node is selected from the relay nodes directly associated with the current verification node as the subsequent verification node to form a skip verification path. Obtain the data fragment stored in the current verification node and calculate its first hash value; Obtain the second verification tag generated based on the current verification node ID and the expected data fragment from the previous verification node that is logically associated with the current verification node; By comparing the first hash value with the expected hash value parsed from the second verification label, progressive verification is performed until the verification path is traversed.

[0007] In conjunction with the first aspect, in some implementations, a storage network topology is constructed. This topology includes multiple nodes, comprising M relay nodes and at least one aggregation node. For each relay node, a logical association relationship is predefined with at least one other relay node in the topology. This logical association relationship forms a partially connected graph structure, including: Based on the physical deployment location of relay nodes, historical communication link quality indicators, or preset logical grouping strategies, logical associations are dynamically determined and updated. In these logical associations, each relay node is directly associated only with a subset of other relay nodes in the storage network topology, forming a defined local connection graph.

[0008] In conjunction with the first aspect, in some implementations, the method further includes: When the original data packet changes, the target data segment that needs to be updated and at least one target relay node where it is stored are determined; Obtain the updated data fragments and fragment identifiers, and distribute them to the corresponding target relay nodes; After completing local data updates, the target relay node updates relevant verification information to all relay nodes directly associated with the target relay node based on logical relationships.

[0009] In conjunction with the first aspect, in some implementations, the method further includes: Assign a globally incrementing version number to each update to the original data packet; The version number, along with the updated data fragment and fragment identifier, is distributed to the target relay node for storage. During verification, the version numbers of the data segments stored on each node along the verification path are checked synchronously to ensure consistency.

[0010] In conjunction with the first aspect, in some implementations, the method further includes: When a node failure is detected, the storage network topology is scanned to identify the failed node storing the failed data fragment; Based on logical relationships, identify at least one valid associated node that is directly related to the failed node; Based on the verification information obtained from the valid associated nodes, the invalid data fragments are reconstructed; The reconstructed data fragments are stored in a new relay node in the storage network topology, and the logical relationships and verification information are updated.

[0011] In conjunction with the first aspect, in some implementations, N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, wherein the target relay nodes are a subset of M relay nodes, and M > L ≥ 1, including: Obtain the minimum number of target relay nodes, Lmin; Based on the current available storage space, processing load, and communication link status of each relay node, at least Lmin nodes are selected from the M relay nodes as target relay nodes, where L≥Lmin.

[0012] Secondly, this application proposes an IoT data storage system based on BCH codes, the system being configured as follows: The original data packet to be stored is obtained and encoded based on the preset BCH encoding parameters to generate a BCH encoded data block containing data bits and parity bits. Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, predefine its logical association with at least one other relay node in the topology. The logical association constitutes a non-fully connected graph structure. The BCH-encoded data block is divided into N data segments, and a corresponding segment identifier is generated for each data segment. N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, where the target relay nodes are a subset of M relay nodes, and M > L ≥ 1; Verification information is generated for each target relay node that stores data fragments. The verification information is generated based at least on the data fragments stored in the corresponding target relay node, the fragment identifier, and the relevant information of at least one other relay node that has a logical relationship with the target relay node. When the integrity verification of the original data packet is triggered, a verification path is generated based on the storage network topology and logical association. Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and the BCH encoded data block is chained for verification to complete the integrity verification of the BCH encoded data block.

[0013] In conjunction with the second aspect, in some implementations, the system is configured as follows: Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and chain verification is performed on the BCH-encoded data blocks, including: Select any relay node from the relay nodes that store any data segment of BCH encoded data blocks as the starting verification node; Based on logical association, the next node is selected from the relay nodes directly associated with the current verification node as the subsequent verification node to form a skip verification path. Obtain the data fragment stored in the current verification node and calculate its first hash value; Obtain the second verification tag generated based on the current verification node ID and the expected data fragment from the previous verification node that is logically associated with the current verification node; By comparing the first hash value with the expected hash value parsed from the second verification label, progressive verification is performed until the verification path is traversed.

[0014] In conjunction with the second aspect, in some implementations, the system is configured as follows: Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one sink node. For each relay node, predefine its logical associations with at least one other relay node in the topology. These logical associations form a partially connected graph structure, including: Based on the physical deployment location of relay nodes, historical communication link quality indicators, or preset logical grouping strategies, logical associations are dynamically determined and updated. In these logical associations, each relay node is directly associated only with a subset of other relay nodes in the storage network topology, forming a defined local connection graph.

[0015] In conjunction with the second aspect, in some implementations, the system is configured as follows: The method also includes: When the original data packet changes, the target data segment that needs to be updated and at least one target relay node where it is stored are determined; Obtain the updated data fragments and fragment identifiers, and distribute them to the corresponding target relay nodes; After completing local data updates, the target relay node updates relevant verification information to all relay nodes directly associated with the target relay node based on logical relationships.

[0016] In conjunction with the second aspect, in some implementations, the system is configured as follows: The method also includes: Assign a globally incrementing version number to each update to the original data packet; The version number, along with the updated data fragment and fragment identifier, is distributed to the target relay node for storage. During verification, the version numbers of the data segments stored on each node along the verification path are checked synchronously to ensure consistency.

[0017] In conjunction with the second aspect, in some implementations, the system is configured as follows: The method also includes: When a node failure is detected, the storage network topology is scanned to identify the failed node storing the failed data fragment; Based on logical relationships, identify at least one valid associated node that is directly related to the failed node; Based on the verification information obtained from the valid associated nodes, the invalid data fragments are reconstructed; The reconstructed data fragments are stored in a new relay node in the storage network topology, and the logical relationships and verification information are updated.

[0018] In conjunction with the second aspect, in some implementations, the system is configured as follows: N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage. The target relay nodes are a subset of M relay nodes, where M > L ≥ 1, including: Obtain the minimum number of target relay nodes, Lmin; Based on the current available storage space, processing load, and communication link status of each relay node, at least Lmin nodes are selected from the M relay nodes as target relay nodes, where L≥Lmin.

[0019] A third aspect of this invention provides an electronic device, which includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method proposed in the first aspect of the present invention.

[0020] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in the first aspect of the present invention.

[0021] In summary, the above methods and systems have the following technical effects: This application proposes a BCH-based IoT data storage method and system. First, raw data packets are acquired and encoded to generate BCH-encoded data blocks. Then, a storage network topology containing multiple relay nodes and a aggregation node is constructed, and logical associations forming a partially connected graph structure are predefined for each relay node. Next, the data blocks are distributed to selected relay nodes for storage. Then, verification information is generated for each storage node, integrating its stored content, fragment identifiers, and associated node information. Based on the topology and logical associations, a verification path passing through at least two relay nodes is generated. Along this path, verification information or data fragments from each node are sequentially acquired, and chain verification is performed on the BCH-encoded data blocks to complete integrity verification. By combining encoding fault tolerance, topologically distributed storage, and associated chain verification, the reliability and verification efficiency of IoT data storage are improved. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating an IoT data storage method based on BCH codes proposed in an embodiment of this application. Detailed Implementation

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

[0024] This application proposes an IoT data storage method based on BCH codes. Please refer to [link to relevant documentation]. Figure 1 The method includes the following steps: S101: Obtain the original data packet to be stored, and encode the original data packet based on the preset BCH encoding parameters to generate a BCH encoded data block containing data bits and parity bits.

[0025] Understandably, step S101 is the basic preprocessing stage of the data storage method. Its core is applying BCH encoding to the raw IoT data to construct a data unit with inherent fault tolerance. First, the system receives the raw data packets to be stored from the IoT environment, such as binary data collected by a set of sensors. Then, based on pre-configured BCH encoding parameters that define the balance between error correction capability and data redundancy, the system executes the encoding algorithm. The algorithm takes the raw data as input and generates and appends a series of check bits through mathematical operations based on a specific generator polynomial. The final output is a structurally complete BCH-encoded data block, which contains both the original data information bits and the newly added check bits used for error detection and correction.

[0026] S102: Construct a storage network topology. The storage network topology includes multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, a logical association relationship between it and at least one other relay node in the topology is predefined. The logical association relationship constitutes a non-fully connected graph structure.

[0027] It is understood that this application does not establish physical communication links, but rather defines and organizes a logical relationship model between various nodes participating in data storage.

[0028] Specifically, the model is presented in an abstract topology structure, clearly containing two types of functional nodes: M relay nodes, whose core function is to be responsible for the actual storage of data segments; and at least one aggregation node, which usually serves as the control entry point or coordination center for data storage and retrieval.

[0029] Understandably, the core operation of topology construction is to pre-define the logical relationships between each relay node and one or more other relay nodes in the topology. These relationships are similar to specific links established between nodes, and their configuration can be based on geographical location, communication history, or management policies.

[0030] Specifically, in this embodiment, logical associations can be dynamically determined and updated based on the physical deployment location of relay nodes, historical communication link quality indicators, or preset logical grouping strategies. In the logical associations, each relay node is directly associated only with some other relay nodes in the storage network topology, forming a defined local connection graph.

[0031] For example, suppose in a smart agriculture IoT scenario there is one aggregation node, such as a server located in the farm control center, and nine relay nodes, N1 to N9, which are IoT gateways or enhanced sensor nodes with computing and storage capabilities distributed in the fields.

[0032] First, all 10 nodes can be identified. S is explicitly designated as the sink node, and N1 to N9 are relay nodes (i.e., M=9). It's understood that not all 9 relay nodes are directly interconnected; rather, each relay node is assigned a few logical neighbors according to a predefined strategy. For example, based on its physical location partitioning or communication optimization strategy, the following association rules can be defined: N1 is related to N2 and N4. N2 is related to N1, N3, and N5. N3 is related to N2 and N6. N4 is related to N1, N5, and N7. N5 is related to N2, N4, N6, and N8. N6 is related to N3, N5, and N9. N7 is related to N4 and N8. N8 is related to N5, N7, and N9. N9 is related to N6 and N8. That is, there are specific logical neighbor relationships between the sink node S, relay nodes N1-N9, and relay node 2. This topology is a partially connected graph. Subsequent data segments will be distributed to selected nodes (such as N1, N4, N5) based on this relationship, and verification paths will be generated along the associated edges defined in the graph (for example, a verification path might be N1->N2->N5->N8). All relay nodes and their logical relationships together constitute a partially connected graph structure. This means that not every relay node is directly associated with all other nodes; the entire topology presents a selective, locally connected network pattern, rather than a mesh structure where all nodes are interconnected pairwise.

[0033] S103: Divide the BCH-encoded data block into N data segments, and generate a corresponding segment identifier for each data segment.

[0034] Understandably, based on a predetermined strategy, such as fixed-size or logical partitioning adapted to the data structure, the entire BCH-encoded data block is divided into N smaller, independently processable data fragments. This division operation decomposes the originally single data entity into a set of data fragments. Simultaneously, a unique and identifiable fragment identifier is created for each generated data fragment. This identifier acts like a digital fingerprint or tag for the fragment, and its form can be a sequence number, a hash value, or an encoded string containing metadata.

[0035] S104: Distribute N data segments and their corresponding N segment identifiers to L selected target relay nodes for storage, where the target relay nodes are a subset of M relay nodes, and M > L ≥ 1.

[0036] Understandably, based on some selection strategy, such as node load, geographical location, or reliability assessment, L target relay nodes are selected from all M available relay nodes. Then, N data fragments and their corresponding N fragment identifiers are sent and stored on these L selected target relay nodes.

[0037] It should be noted that M>L indicates that not all relay nodes in the network will be used to store the current data; the system only utilizes a portion of the node resources. The specific distribution of the data fragment across the L target nodes can be varied. For example, a data fragment may be stored on only one node, or copies of the same fragment may be stored on multiple nodes for redundancy.

[0038] As one implementation method, for an adaptive node selection mechanism, under the premise of meeting the minimum reliability requirements of data storage, the set of nodes with the best performance is intelligently selected to perform the storage task. Specifically, S104 may include the following steps: S1041: Obtain the minimum number of target relay nodes, Lmin.

[0039] For example, suppose the BCH encoding and segmentation strategy allows for recovery even if any two data segments are lost, and the system requires that a single node failure does not affect data availability. Then, to ensure that the segments on the remaining nodes still meet the recovery conditions when any one node fails, it may be necessary to store the data on at least Lmin = 3 nodes.

[0040] S1042: Based on the current available storage space, processing load and communication link status of each relay node, determine no less than Lmin nodes from the M relay nodes as target relay nodes, where L≥Lmin.

[0041] After defining the minimum quantity requirements, this step performs actual, real-time-based optimization. For example, evaluation dimensions primarily include: currently available storage space, processing load, and communication link status, etc., without limitation. Understandably, available storage space ensures nodes have sufficient capacity to accept new data. Processing load measures the node's CPU and memory utilization, avoiding assigning tasks to overloaded nodes. Communication link status assesses the connection latency, bandwidth, and stability between the node and the aggregation node or network backbone.

[0042] Continuing the previous example: Lmin is calculated to be 3. Subsequently, it detects that out of 10 nodes (M=10), 7 nodes are in good condition, while 3 nodes have high load or insufficient storage space. Therefore, the system selects the 4 nodes with the highest overall score from the 7 good nodes (e.g., nodes A, C, F, and H) as the target relay nodes for this operation, i.e., L=4. This selection satisfies the minimum requirement of L≥Lmin (4≥3) and improves overall storage performance and data access efficiency through optimal selection.

[0043] S105: Generate verification information for each target relay node that stores data fragments, wherein the verification information is generated based at least on the data fragments stored in the corresponding target relay node, the fragment identifier, and relevant information of at least one other relay node that has a logical relationship with the target relay node.

[0044] Understandably, each target relay node that actually stores the data fragment generates a unique verification message. This message is not an isolated data digest, but a credential that reflects the node's specific relationship in a predefined network topology.

[0045] Specifically, generating verification information requires integrating the node's own stored content, the fragment's unique identifier, and the relevant information of associated nodes. Understandably, the node's own stored content refers to the original content of the specific data fragment held by the target relay node. The fragment's unique identifier is the fragment identifier permanently bound to that data fragment. The relevant information of associated nodes refers to the logical association relationship constructed according to step S102 above, with information from at least one other relay node directly logically associated with the node being included in the calculation. This relevant information is typically the identity identifier of the associated node, such as a node ID; in some designs, it may also include the associated node's state or public key, etc., which is not limited in this application.

[0046] S106: When the integrity verification of the original data packet is triggered, a verification path is generated based on the storage network topology and logical association relationship, passing through at least two relay nodes.

[0047] Understandably, when verifying data integrity, an effective inspection route needs to be planned. Understandably, this route is not random or involves traversing all storage nodes, but rather intelligently generates a specific verification sequence based on a predetermined network logic structure.

[0048] Specifically, once an integrity verification request is triggered due to periodic auditing, pre-read data verification, or anomaly alarms, the verification process begins. At this time, the system invokes the storage network topology and its core components, namely the logical relationships between relay nodes, which were constructed in step S102.

[0049] Based on the graph structure defined by this relationship, a verification path can be generated. This path is essentially an ordered sequence of relay nodes. It starts from a node that stores a data fragment, and then, according to logical associations, jumps to another connected node that also stores related data, and so on. The path must pass through at least two relay nodes, which ensures that verification is a cross-check involving multiple storage locations.

[0050] For example, data fragments are stored in nodes N1, N4, and N5, with logical relationships as described above; for instance, N1 is associated with N2 and N4, and N4 is associated with N1, N5, and N7. After verification is triggered, the system may, based on certain rules (such as random selection or initiation from a specific node), use the relationship graph to generate a verification path such as N1→N4→N5. The feasibility of this path is entirely guaranteed by the pre-defined logical relationships, such as N1 connecting to N4, and N4 connecting to N5.

[0051] S107: Based on the verification path, sequentially obtain the verification information or stored data fragments corresponding to each node on the path, and perform chain verification on the BCH encoded data block to complete the integrity verification of the BCH encoded data block.

[0052] Understandably, an ordered checking process, namely chained verification, is implemented along the verification path generated by the preceding steps to ultimately confirm the integrity of the BCH-encoded data blocks in the distributed storage. Specifically, starting from the starting node of the verification path, each relay node on the path is visited sequentially. When visiting each node, depending on the verification algorithm design, the choice is made to retrieve either the original data fragment stored at that node or the verification information pre-generated for that node.

[0053] For example, in this application, step S107 may include the following steps: S1071: Select any relay node from the relay nodes that store any data segment of the BCH encoded data block as the starting verification node.

[0054] Understandably, the verification process begins by randomly or arbitrarily selecting one of the relay nodes that stores any fragment of the data as the starting verification node. This design's characteristic of having a variable starting point increases the unpredictability of the verification process.

[0055] S1072: Based on logical association, select the next node from the relay nodes directly associated with the current verification node as the subsequent verification node to form a skip verification path.

[0056] Understandably, the extension of the verification path is dynamically determined by the logical relationships within the network topology. Starting from the current verification node, the system selects one of its directly related logical neighbors as the next verification node to be visited. By repeating this rule of selecting the next node from the current node's related nodes, the verification path leaps forward in the topology graph, thus forming a skip verification path. This path is generated in real-time, rather than a fixed route that is statically set beforehand.

[0057] S1073: Obtain the data fragment stored in the current verification node and calculate its first hash value.

[0058] When accessing each currently verified node on the access path, the original data fragment stored by that node can be read, and the first hash value of that fragment can be calculated using a hash function. This hash value serves as a unique digital fingerprint of the data actually stored by that node.

[0059] S1074: Obtain the second verification tag generated based on the current verification node ID and the expected data fragment from the previous verification node that is logically associated with the current verification node.

[0060] Understandably, to verify the fingerprint's correctness, a credential called a second verification tag is obtained not from the local node, but from the logically preceding verification node. This tag is pre-generated and saved by the preceding node during the data storage phase, and its content is a cryptographic result calculated based on the current verification node's identity and the theoretically expected data fragments that should be stored.

[0061] S1075: By comparing the first hash value with the expected hash value parsed from the second verification label, progressive verification is performed until the verification path is traversed.

[0062] Understandably, the core operation of verification is to compare the first hash value with the expected hash value decrypted or parsed from the second verification tag. If the two are completely identical, it proves that the data fragment stored by the current node is complete and correct, and the verification passes. At this point, the current node becomes a verified node, and the verification process will proceed to the next node, repeating the process from S1073 to S1075. This chained process continues until the entire jump verification path has been completely traversed.

[0063] To ensure that all relevant data fragments in the distributed storage network are updated synchronously when the original data packets change, optionally, in some implementations, the following steps may also be included: S201: Assign a globally incrementing version number for each update to the original data packet.

[0064] Understandably, when the original data packet needs updating, it doesn't directly overwrite the old data. Instead, it first assigns a globally incrementing version number to this update event. This version number is unique and monotonically increasing within the system, like a sequence counter that increments by 1 with each update. Its core function is to act as a unique, ordered timestamp or logical marker for this update operation, enabling the system to unambiguously distinguish data states at different times.

[0065] S202: Distribute the version number, the updated data fragment, and the fragment identifier to the target relay node for storage.

[0066] When performing a data update operation, the newly generated version number is bound to the updated data fragment and its fragment identifier to form an update package containing complete version information. This package is then distributed to the target relay nodes that need to be updated. These nodes must synchronously store this global version number when storing new data content. This means that each data fragment is closely associated with its global version number during physical storage.

[0067] S203: During verification, synchronously check whether the version numbers of the data segments stored on each node along the verification path are consistent.

[0068] When integrity verification is triggered and executed, the verification logic, in addition to checking data integrity, synchronously verifies whether the version numbers of the data fragments stored at each node along the verification path are consistent. That is, when the verifier retrieves data fragments or verification information along the path, it simultaneously reads and compares the version numbers reported by all nodes along the way. If the version numbers reported by all nodes on the path are exactly the same, it indicates that the data fragments they store belong to the same update, and the data state is consistent. If the version numbers are inconsistent, even if each fragment itself is complete and error-free, it indicates that there is a data state split in the system, such as some nodes not having completed their updates. The verification will fail and trigger an alarm or repair process.

[0069] Furthermore, to ensure persistent data availability in the event of a storage node failure in the network, some implementations may include the following steps: S301: When a node failure is detected, scan the storage network topology to determine the failed node that stored the failed data segment.

[0070] Understandably, when a node failure is detected through mechanisms such as heartbeat detection, timeout response, or proactive inspection (e.g., a relay node is unresponsive for an extended period or returns an error), the recovery process is triggered. First, the existing storage network topology can be scanned, and the mapping between node status and data distribution can be compared to accurately identify which nodes are failed, with particular attention paid to those storing valuable data fragments.

[0071] S302: Based on logical association, determine at least one valid associated node that is directly associated with the failed node.

[0072] Understandably, based on the network graph, all valid associated nodes that are directly connected to the failed node, i.e., those with logical relationships, can be identified. These nodes are not only in a working state themselves, but also, due to predefined logical relationships, their stored verification information or data fragments contain verification data or association context related to the failed node.

[0073] S303: Based on the verification information obtained from the valid associated nodes, reconstruct the invalid data fragments.

[0074] Specifically, the lost original data fragment can be reconstructed from the verification information combined with the error correction and decoding algorithm of the BCH code. Because the verification information contains sufficient data verification metadata, the content of the lost fragment can be calculated when combined with relevant data from other surviving nodes.

[0075] S304: Store the reconstructed data fragment to a new relay node in the storage network topology, and update the logical associations and verification information.

[0076] Understandably, the reconstructed data fragments are stored in a new relay node in the topology, which could be a backup node or an existing node with a lower load to replace the storage function of the original failed node. Then, the logical relationships in the entire storage network topology can be updated, and all affected verification information can be regenerated or updated to ensure the logical consistency of the entire system and the validity of subsequent verification paths.

[0077] This application proposes a BCH-based IoT data storage method. First, raw data packets are acquired and encoded to generate BCH-encoded data blocks. Then, a storage network topology containing multiple relay nodes and a aggregation node is constructed, and logical associations forming a partially connected graph structure are predefined for each relay node. Next, the data blocks are distributed to selected relay nodes for storage. Then, verification information is generated for each storage node, integrating its stored content, fragment identifiers, and associated node information. Based on the topology and logical associations, a verification path passing through at least two relay nodes is generated. Along this path, verification information or data fragments from each node are sequentially acquired, and chain verification is performed on the BCH-encoded data blocks to complete integrity verification. This invention improves the reliability and verification efficiency of IoT data storage by combining encoding fault tolerance, topologically distributed storage, and associated chain verification.

[0078] Based on the same inventive concept, embodiments of this application also propose an IoT data storage system based on BCH codes, the system being configured as follows: The original data packet to be stored is obtained and encoded based on the preset BCH encoding parameters to generate a BCH encoded data block containing data bits and parity bits. Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, predefine its logical association with at least one other relay node in the topology. The logical association constitutes a non-fully connected graph structure. The BCH-encoded data block is divided into N data segments, and a corresponding segment identifier is generated for each data segment. N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, where the target relay nodes are a subset of M relay nodes, and M > L ≥ 1; Verification information is generated for each target relay node that stores data fragments. The verification information is generated based at least on the data fragments stored in the corresponding target relay node, the fragment identifier, and the relevant information of at least one other relay node that has a logical relationship with the target relay node. When the integrity verification of the original data packet is triggered, a verification path is generated based on the storage network topology and logical association. Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and the BCH encoded data block is chained for verification to complete the integrity verification of the BCH encoded data block.

[0079] In some implementations, the system is configured as follows: Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and chain verification is performed on the BCH-encoded data blocks, including: Select any relay node from the relay nodes that store any data segment of BCH encoded data blocks as the starting verification node; Based on logical association, the next node is selected from the relay nodes directly associated with the current verification node as the subsequent verification node to form a skip verification path. Obtain the data fragment stored in the current verification node and calculate its first hash value; Obtain the second verification tag generated based on the current verification node ID and the expected data fragment from the previous verification node that is logically associated with the current verification node; By comparing the first hash value with the expected hash value parsed from the second verification label, progressive verification is performed until the verification path is traversed.

[0080] In some implementations, the system is configured as follows: Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one sink node. For each relay node, predefine its logical associations with at least one other relay node in the topology. These logical associations form a partially connected graph structure, including: Based on the physical deployment location of relay nodes, historical communication link quality indicators, or preset logical grouping strategies, logical associations are dynamically determined and updated. In these logical associations, each relay node is directly associated only with a subset of other relay nodes in the storage network topology, forming a defined local connection graph.

[0081] In some implementations, the system is configured as follows: The method also includes: When the original data packet changes, the target data segment that needs to be updated and at least one target relay node where it is stored are determined; Obtain the updated data fragments and fragment identifiers, and distribute them to the corresponding target relay nodes; After completing local data updates, the target relay node updates relevant verification information to all relay nodes directly associated with the target relay node based on logical relationships.

[0082] In some implementations, the system is configured as follows: The method also includes: Assign a globally incrementing version number to each update to the original data packet; The version number, along with the updated data fragment and fragment identifier, is distributed to the target relay node for storage. During verification, the version numbers of the data segments stored on each node along the verification path are checked synchronously to ensure consistency.

[0083] In some implementations, the system is configured as follows: The method also includes: When a node failure is detected, the storage network topology is scanned to identify the failed node storing the failed data fragment; Based on logical relationships, identify at least one valid associated node that is directly related to the failed node; Based on the verification information obtained from the valid associated nodes, the invalid data fragments are reconstructed; The reconstructed data fragments are stored in a new relay node in the storage network topology, and the logical relationships and verification information are updated.

[0084] In some implementations, the system is configured as follows: N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage. The target relay nodes are a subset of M relay nodes, where M > L ≥ 1, including: Obtain the minimum number of target relay nodes, Lmin; Based on the current available storage space, processing load, and communication link status of each relay node, at least Lmin nodes are selected from the M relay nodes as target relay nodes, where L≥Lmin.

[0085] Based on the same inventive concept, embodiments of this application also propose an electronic device, which includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the BCH code-based Internet of Things data storage method of the present application embodiments.

[0086] Furthermore, to achieve the above objectives, embodiments of this application also propose a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the IoT data storage method based on BCH codes according to embodiments of this application.

[0087] The following is a detailed introduction to the various components of the electronic device: In this context, the processor is the control center of the electronic device. It can be a single processor or a collective term for multiple processing elements. For example, a processor can be one or more central processing units (CPUs), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0088] Alternatively, the processor can perform various functions of the electronic device by running or executing software programs stored in memory and by calling data stored in memory.

[0089] The memory is used to store the software program that executes the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can be referred to the above method embodiment, which will not be repeated here.

[0090] Optionally, the memory can be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory can be integrated with the processor or exist independently and coupled to the processor through an interface circuit of an electronic device; the embodiments of the present invention do not specifically limit this.

[0091] A transceiver is used to communicate with network devices or with terminal devices.

[0092] Optionally, the transceiver may include a receiver and a transmitter. The receiver is used to implement the receiving function, and the transmitter is used to implement the sending function.

[0093] Optionally, the transceiver can be integrated with the processor or exist independently and coupled to the processor through the router's interface circuit. This embodiment of the invention does not specifically limit this.

[0094] Furthermore, the technical effects of the electronic device can be referred to the technical effects of the data transmission method in the above method embodiments, and will not be repeated here.

[0095] It should be understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0096] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0097] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. Semiconductor media can be solid-state drives.

[0098] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0099] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0100] It should be understood that, in various embodiments of the present invention, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0101] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

Claims

1. A method for storing Internet of Things (IoT) data based on BCH codes, characterized in that, include: The original data packet to be stored is obtained and encoded based on the preset BCH encoding parameters to generate a BCH encoded data block containing data bits and parity bits. Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, a logical association relationship between it and at least one other relay node in the topology is predefined, and the logical association relationship constitutes a non-fully connected graph structure. The BCH-encoded data block is divided into N data segments, and a corresponding segment identifier is generated for each data segment. The N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, wherein the target relay nodes are a subset of the M relay nodes, and M > L ≥ 1; Verification information is generated for each target relay node that stores a data fragment, wherein the verification information is generated based at least on the data fragment stored by the corresponding target relay node, the fragment identifier, and relevant information of at least one other relay node that has a logical association with the target relay node; When the integrity verification of the original data packet is triggered, a verification path is generated based on the storage network topology and the logical association relationship, passing through at least two of the relay nodes; Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and the BCH encoded data block is subjected to chain verification to complete the integrity verification of the BCH encoded data block.

2. The IoT data storage method based on BCH code according to claim 1, characterized in that, Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and chain verification is performed on the BCH encoded data block, including: From the relay nodes that store any data segment of the BCH encoded data block, select any one of the relay nodes as the starting verification node; Based on the logical association, the next node is selected from the relay nodes directly associated with the current verification node as the subsequent verification node to form a skip verification path. Obtain the data fragment stored in the current verification node and calculate its first hash value; Obtain the second verification tag generated based on the current verification node ID and the expected data fragment from the previous verification node that is logically associated with the current verification node; By comparing the first hash value with the expected hash value parsed from the second verification tag, progressive verification is performed until the verification path is traversed.

3. The IoT data storage method based on BCH code according to claim 1, characterized in that, A storage network topology is constructed, comprising multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, a logical association relationship is predefined between it and at least one other relay node in the topology. This logical association relationship constitutes a partially connected graph structure, including: Based on the physical deployment location of the relay node, historical communication link quality indicators, or a preset logical grouping strategy, the logical association relationship is dynamically determined and updated. In the logical association relationship, each relay node is directly associated only with some other relay nodes in the storage network topology, forming a defined local connection graph.

4. The IoT data storage method based on BCH code according to claim 1, characterized in that, The method further includes: When the original data packet changes, determine the target data segment that needs to be updated and at least one target relay node where it is stored; Obtain the updated data fragment and its identifier, and distribute them to the corresponding target relay node; After completing local data updates, the target relay node updates relevant verification information to all relay nodes directly associated with the target relay node according to the logical association.

5. The IoT data storage method based on BCH code according to claim 4, characterized in that, The method further includes: Assign a globally incrementing version number to each update of the original data packet; The version number, along with the updated data fragment and the fragment identifier, are distributed to the target relay node for storage. During verification, the version numbers of the data segments stored at each node on the verification path are simultaneously checked to ensure they are consistent.

6. The IoT data storage method based on BCH code according to claim 1, characterized in that, The method further includes: When a node failure is detected, the storage network topology is scanned to determine the failed node storing the failed data fragment; Based on the logical association, at least one valid associated node is determined that is directly associated with the failed node; Based on the verification information obtained from the valid associated nodes, the invalid data fragments are reconstructed; The reconstructed data fragment is stored in the new relay node in the storage network topology, and the logical association and the verification information are updated.

7. The IoT data storage method based on BCH code according to claim 1, characterized in that, The N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, wherein the target relay nodes are a subset of the M relay nodes, and M > L ≥ 1, including: Obtain the minimum number of target relay nodes, Lmin; Based on the current available storage space, processing load, and communication link status of each relay node, at least Lmin nodes are selected from the M relay nodes as the target relay nodes, where L ≥ Lmin.

8. The IoT data storage system based on BCH code according to claim 1, characterized in that, The system is configured as follows: The original data packet to be stored is obtained and encoded based on the preset BCH encoding parameters to generate a BCH encoded data block containing data bits and parity bits. Construct a storage network topology, which includes multiple nodes, including M relay nodes and at least one aggregation node. For each relay node, a logical association relationship between it and at least one other relay node in the topology is predefined, and the logical association relationship constitutes a non-fully connected graph structure. The BCH-encoded data block is divided into N data segments, and a corresponding segment identifier is generated for each data segment. The N data segments and their corresponding N segment identifiers are distributed to L selected target relay nodes for storage, wherein the target relay nodes are a subset of the M relay nodes, and M > L ≥ 1; Verification information is generated for each target relay node that stores a data fragment, wherein the verification information is generated based at least on the data fragment stored by the corresponding target relay node, the fragment identifier, and relevant information of at least one other relay node that has a logical association with the target relay node; When the integrity verification of the original data packet is triggered, a verification path is generated based on the storage network topology and the logical association relationship, passing through at least two of the relay nodes; Based on the verification path, the verification information or stored data fragments corresponding to each node on the path are obtained sequentially, and the BCH encoded data block is subjected to chain verification to complete the integrity verification of the BCH encoded data block.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; And, a memory communicatively connected to at least one of the processors; The memory stores instructions that can be executed by at least one processor, which are executed by at least one processor to enable the at least one processor to perform the IoT data storage method based on BCH code as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements an IoT data storage method based on BCH codes as described in any one of claims 1-7.