Multi-block chain load balancing method, gateway and building construction data management system
By comprehensively considering the basic resources and transaction needs of nodes and dynamically adjusting transaction allocation priorities, the problem of node overload in traditional blockchain systems is solved, and efficient processing of high-concurrent transactions and data flow are achieved.
Patent Information
- Application Number
- CN202510911025.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-02
AI Technical Summary
Traditional blockchain transaction allocation methods cannot consider the actual affordability of nodes in real time, resulting in overloading of certain nodes during high concurrent transactions, affecting system efficiency, and may lead to delays in critical tasks in construction projects.
By weighted summing the basic resource utilization, network score and historical reliability of multi-blockchain nodes, combining the transaction queue waiting coefficient, calculate the dynamic weight and resource matching score of the node, comprehensively allocate priority, realize dynamic balanced allocation of transactions, and redistribute resources when necessary.
Ensure that transactions can be processed in a timely and effective manner, avoid node backlogs, ensure efficient flow of engineering data, and improve the efficiency of the overall blockchain system.
Smart Images

Figure CN120416246A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to blockchain, and more specifically, relates to a multi-blockchain load balancing method, a gateway, and a building construction data management system. Background Art
[0002] With the development of technology, blockchain, with its core features of data openness, transparency, traceability, and immutability, has become an important force in promoting the development of information technology in China. With the wide application of blockchain technology and the increasing complexity of actual business scenarios, especially in the field of construction engineering, the scale of information data in aspects such as people, machines, materials, methods, and environments involved has also been growing continuously. The blockchain system needs to have the ability to handle high-concurrency transactions to meet the growing business needs.
[0003] However, for high-concurrency transaction tasks, traditional transaction allocation methods based on static rules or simple algorithms cannot real-time consider the actual bearing capacity of blockchain nodes, which easily leads to overload of some nodes and affects the overall efficiency of the system. Moreover, for some important transaction tasks (such as engineering changes, fund payments, etc.), if not processed in time, it may lead to delays in key tasks, affecting project progress and cost control. Summary of the Invention
[0004] In view of the above defects or improvement requirements of the prior art, the present invention provides a multi-blockchain load balancing method, a gateway, and a building construction data management system, aiming to allocate corresponding nodes for transaction tasks according to the actual state of the nodes, achieve blockchain load balancing, and improve the overall efficiency.
[0005] To achieve the above object, in the first aspect of the present invention, a multi-blockchain load balancing method is provided, which includes: Performing weighted summation on multiple dimensions of metrics of node i in the multi-blockchain to obtain the comprehensive performance metric P of node i i ; the multiple dimensions of metrics include the basic resource availability rate, network score, and historical reliability of node i. Among them, the basic resource availability rate includes the processor availability rate, memory availability rate, and the proportion of the time when the disk has no read and write operations. The network score is negatively correlated with the network latency of the corresponding node, and the historical reliability is negatively correlated with the failure frequency of the corresponding node; i is the index of the currently selectable node; Taking 1 - T i / T max as the queue waiting coefficient of node i, and multiplying the comprehensive performance metric P of node i i by the queue waiting coefficient of node i to obtain the dynamic weight W of node i i , where T i is the current transaction queue length of node i, T maxis the current maximum transaction queue length among all optional nodes; Calculate the transaction tx j The matching degree between the required resource intensity and the existing resource intensity of each node i, and obtain the matching score S of node i for the transaction tx j ; j is the index of the transaction; ij ; j is the index of the transaction; Integrated dynamic weight W i and the matching score S ij , and obtain the comprehensive allocation priority F of node i for the transaction tx j ; F ij ; F ij is positively correlated with any one of the dynamic weight W i and the matching score S ij ; Allocate the corresponding transactions to the endorsing nodes according to the comprehensive allocation priorities of the transactions.
[0006] Optionally, calculating the matching degree between the required resources of the transaction tx j and the existing resources of each node i includes: Construct the required resource vector r of the transaction tx j : j : r j = [r j1 , r j2 , …, r jn ; Construct the existing resource vector c of node i i : c i = [c i1 , c i2 , …, c in ; Calculate the cosine similarity between the required resource vector r j and the existing resource vector c i to obtain the matching score S ij ; In the formula, r jk represents the required intensity of the transaction tx j for the k-th type of resource, and c ik represents the available intensity of node i for the k-th type of resource, and n is the number of resource categories.
[0007] Optionally, the calculation formula for the comprehensive allocation priority F ij is: F ij = W i ×S ij .
[0008] Optionally, allocating nodes for corresponding transactions according to the comprehensive allocation priority of each transaction includes: Allocating nodes for corresponding transactions according to the comprehensive allocation priority of each transaction and in combination with the consistent hashing ring mechanism.
[0009] Optionally, the method further includes: monitoring whether there is an overloaded node whose load exceeds its load threshold. If there is an overloaded node i, resource reallocation and dynamic adjustment are performed. The resource reallocation and dynamic adjustment include: Reallocating the transactions of node i that exceed its load threshold to other optional nodes that are not overloaded. The greater the current dynamic weight of other optional nodes, the greater the number of transactions reallocated to them.
[0010] Optionally, the formula for reallocation is: ; where ΔT is the number of transactions that node i needs to transfer to other nodes, and ΔT ij refers to the number of transactions transferred from node i to node j.
[0011] In a second aspect of the present invention, a gateway is provided, which includes a load balancing module. The load balancing module is used to execute the multi-blockchain load balancing method as described in any one of the above when receiving a transaction request.
[0012] Optionally, the gateway further includes: A user permission management module, which is used to submit a registration application to the corresponding blockchain and determine the permissions of the corresponding user according to the information feedback by the blockchain when receiving a user's registration request, and verify the user's permissions when receiving the user's access application to the blockchain; A data on-chain module, which is used to send the original data to be put on the chain to the corresponding storage space and obtain the download address of the original data in the storage space, generate a data digest of the original data, and submit the download address and the data digest to the blockchain; An information retrieval module, which is used to find the corresponding content according to the query keywords input by the user; A data verification module, which is used to recalculate the hash value of the downloaded data obtained by the user using the hash algorithm used for data on-chain, and compare whether the recalculated hash value is consistent with the hash value at the time of on-chain. If they are consistent, the verification is successful; otherwise, the verification fails; A data interaction and transmission module, which is used to implement information interaction between blockchain networks.
[0013] In a third aspect of the present invention, a blockchain-based construction data management system is provided, which includes: a blockchain system composed of blockchain networks and the gateway as described above, and each blockchain network has a corresponding gateway.
[0014] Optionally, the management system has a government blockchain system and a project blockchain system. The government blockchain system includes a government supervision blockchain network, and the project blockchain system includes multiple project blockchain networks. Different project blockchain networks are used to manage data of different projects in building construction. Each blockchain network contains multiple blockchains.
[0015] Generally speaking, compared with the prior art by the above technical solution conceived by the present invention, the present invention mainly has the following beneficial effects: For the multi-blockchain load balancing method proposed by the present invention, first, the comprehensive performance index of each node is calculated based on its basic resources. At the same time, the transaction queue situation of the node is also considered. Considering the transaction queue situation of the node and the comprehensive performance index of the node, the dynamic weight of the node is calculated. The higher the weight, the more suitable the node is to continue receiving and processing new data. In addition, the resource requirements of the transaction are matched with the resources of the node to obtain a matching score. The higher the resource matching degree, the higher the matching score, indicating that the node is more suitable for this transaction. Finally, considering the dynamic weight and the matching score comprehensively, the comprehensive allocation priority of the node for the transaction is obtained. Since the above process considers both the load situation of each node and the resource matching situation between the transaction and the node, based on this comprehensive allocation priority, the transaction can be allocated to the processing node, which can ensure that the data can be processed and uploaded to the chain in a timely and effective manner, avoid the backlog of transactions at a certain node, ensure the efficient flow of project data, achieve blockchain load balancing, and improve the overall efficiency. Description of the Drawings
[0016] Figure 1 It is a flowchart of the steps of the multi-blockchain load balancing method in an embodiment of the present invention.
[0017] Figure 2 It is a structural framework diagram of the gateway in an embodiment of the present invention.
[0018] Figure 3 It is an architecture diagram of the building construction data management system based on blockchain in an embodiment of the present invention.
[0019] Figure 4 It is a working flowchart of the load balancing module in the gateway in an embodiment of the present invention.
[0020] Figure 5 It is a working flowchart of the user permission management module in the gateway in an embodiment of the present invention.
[0021] Figure 6 It is a working flowchart of the data uploading module in the gateway in an embodiment of the present invention.
[0022] Figure 7It is the flowchart of the information retrieval module in the gateway in an embodiment of the present invention.
[0023] Figure 8 It is the flowchart of the data verification module in the gateway in an embodiment of the present invention.
[0024] Figure 9 It is the flowchart of the data interaction and transmission module in the gateway in an embodiment of the present invention. Detailed implementation manners
[0025] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0026] Embodiment 1 Taking construction projects as an example, all parties involved need to submit or process a large amount of data generated during the project through the blockchain. Therefore, the load conditions of each node in the blockchain will change in real time. Based on this, the present invention provides a multi-blockchain load balancing method, which allocates reasonable nodes for the current transaction volume according to the current load conditions of each node in the blockchain.
[0027] As Figure 1 shown is the step flowchart of the multi-blockchain load balancing method in an embodiment of the present invention. The main steps are introduced in detail below.
[0028] S1. Weighted sum the indicators of multiple dimensions of node i in the multi-blockchain to obtain the comprehensive performance indicator P of node i i ; the indicators of multiple dimensions include the basic resource availability rate, network score and historical reliability of node i. Among them, the basic resource availability rate includes the processor availability rate, memory availability rate and the proportion of the time when the disk has no read and write operations. The network score is negatively correlated with the network latency of the corresponding node, and the historical reliability is negatively correlated with the failure frequency of the corresponding node; i is the index of the currently selectable node.
[0029] Specifically, the utilization rate R of the basic resources of node i can be calculated first i , then the basic resource availability rate of node i is 1 - R i .
[0030] In an embodiment, the utilization rate R i is the weighted sum of the CPU utilization rate, memory utilization rate and IO utilization rate of node i. The calculation formula is as follows: R i =α CPU×U i CPU +α MEM ×U i MEM +α IO ×U i IO ; wherein, U i CPU , U i MEM , U i IO respectively represent the CPU utilization rate, memory utilization rate and I / O utilization rate of node i, and each weight coefficient satisfies α CPU +α MEM +α IO = 1.
[0031] Specifically, the network score of node i is negatively correlated with the network latency of node i.
[0032] In one embodiment, the network latency l of node i can be measured i , and the network score N of node i can be obtained by using an exponential decay function i , and the calculation formula is as follows: ; wherein, the sensitivity coefficient λ > 0 is a set value for adjusting the sensitivity of the network score N i changing with the network latency l i .
[0033] Specifically, the historical reliability of node i is negatively correlated with the failure frequency of node i.
[0034] In one embodiment, based on the historical performance of node i, its corresponding historical reliability index Rel i can be obtained, and the calculation formula is as follows: Rel i = (MTBF i ) / (MTBF i + MTTR i ); wherein, MTBF i refers to the mean time between failures of node i, and MTTR i refers to the mean time to repair of node i.
[0035] Based on the basic resource utilization rate R of node i i , network score N i and historical reliability index Rel i , the comprehensive performance index P of node i is obtained by fusion i , and the calculation formula is as follows: Pi =γ1·(1-R i )+γ2·N i +γ3·Rel i ; Among them, the weight coefficients γ1, γ2, and γ3 satisfy γ1+γ2+γ3=1.
[0036] S2, 1-T i / T max As the queue waiting coefficient of node i, the comprehensive performance index P of node i is i Multiplying it by the queue waiting coefficient of node i, we get the dynamic weight W of node i i , where T i is the current transaction queue length of node i, T max The current maximum transaction queue length among all selectable nodes.
[0037] Specifically, we need to further consider the transaction queue of node i and introduce the current transaction queue length T of node i. i , calculate the current queue waiting coefficient of node i 1-T i / T max , comprehensively considering the queue waiting coefficient of node i and the comprehensive performance index P of node i i , calculate the dynamic weight W of node i i , the calculation formula is as follows: W i =P i ·(1-T i / T max ); Among them, T i Represents the current transaction queue length of node i, T max Represents the maximum transaction queue length of all optional nodes at the current moment. When the current transaction queue of node i is short, the weight W i The higher it is, the more suitable it is to assign transactions to node i.
[0038] For example, when a construction unit frequently uploads construction logs or submits settlement monitoring data, the processing capabilities of these nodes will be evaluated and a corresponding weight will be assigned to each node. The node with the higher weight will be more suitable for continuing to receive and process new data.
[0039] S3. Calculate transaction tx j The matching degree between the required resource intensity and the existing resource intensity of each node i is used to obtain the node i’s response to transaction tx j The matching score S ij ; j is the index of the transaction.
[0040] For example, in a deep foundation pit project, the monitoring unit needs to regularly upload the foundation pit monitoring data, and the construction unit submits the daily construction progress report. The amount of data in the construction log is large, while the settlement monitoring data is relatively small and frequent. Therefore, it is necessary to calculate the matching score of each transaction with the node according to the processing requirements of the data type and the current load capacity of the node to ensure that the data is submitted to the most suitable node.
[0041] In one embodiment, the matching score S j of node i for transaction tx ij is specifically as follows: Construct the required resource vector r j of transaction tx j : r j = [r j1 , r j2 , …, r jn ; In the formula, r jk represents the demand intensity of transaction tx j for the k-th type of resource, n is the number of resource categories, and the resources referred to here include, for example, computing power, storage capacity, network bandwidth, processing delay, security level, and fault tolerance and reliability requirements, etc.; Construct the existing resource vector c i of node i: c i = [c i1 , c i2 , …, c in ; In the formula, c ik represents the available intensity of node i for the k-th type of resource; Calculate the cosine similarity between the required resource vector r j and the existing resource vector c i to obtain the matching score S ij ; its calculation formula is as follows: .
[0042] S4. Combine the dynamic weight W i and the matching score S ij to obtain the comprehensive allocation priority F j of node i for transaction tx ij ; F ij is positively correlated with any one of the dynamic weight W i and the matching score S ij .
[0043] Specifically, the present invention combines the dynamic weight W i and the matching score S ij, obtain the comprehensive allocation priority F of node i for transaction tx j for transaction tx ij . For example, when the construction unit and the monitoring unit upload and submit a large amount of data simultaneously (such as construction personnel information and settlement data), the present invention will evaluate the load conditions of each node in the blockchain, select a node with a lower load (i.e., a larger W i ) and a high resource matching degree (i.e., a higher matching score S ij ) to ensure that the data can be processed and uploaded to the chain in a timely and effective manner. This process avoids the backlog of transactions at a certain node and ensures the efficient flow of project data. In the actual calculation process, first calculate the dynamic weight W i based on the real-time load status of the node to reflect the current overall processing capacity of node i. At the same time, obtain the matching score S j between transaction tx ij and node i to quantify the adaptability between the two in terms of resource demand and supply. Finally, based on the two, obtain the comprehensive allocation priority F j of node i for transaction tx ij .
[0044] Among them, the comprehensive method of the dynamic weight W i and the matching score S ij can be either summation or multiplication or exponential operation. In principle, when any one of the dynamic weight W i and the matching score S ij increases, the comprehensive allocation priority F ij will increase.
[0045] In this embodiment, the method of multiplying the two is selected to calculate the comprehensive allocation priority F ij , and its calculation formula is as follows: F ij = W i × S ij .
[0046] S5. Allocate the corresponding transactions to the endorsement nodes according to the comprehensive allocation priorities of each transaction.
[0047] Specifically, for each current transaction, after obtaining the comprehensive allocation priorities of each node for this transaction, the allocation can be carried out based on this priority.
[0048] In some embodiments, the node with the highest comprehensive allocation priority can be directly allocated to the transaction, so that the allocation can be completed quickly.
[0049] In some embodiments, considering that the same node may be the node with the highest comprehensive allocation priority for multiple transactions simultaneously, if multiple transactions are all allocated to this node, it may cause the node to be instantaneously overloaded. Based on this, after obtaining the comprehensive allocation priorities of each transaction, this embodiment further introduces the following consistent hashing ring (HashRing) mechanism to achieve node allocation.
[0050] First, based on the comprehensive allocation priority, in the multi-chain, for transaction tx j initially screen out the top d nodes with the highest comprehensive allocation priority to form the candidate node set CN(t) of transaction tx j at the current moment t.
[0051] Second, for each node i in the candidate node set CN(t), calculate the number of virtual nodes V i (t) corresponding to this node i on the hashing ring. The calculation formula is as follows: ; In the formula, N total is the set total number of nodes (for example, 100 virtual nodes are allocated in each batch). Take the floor of the formula and then add one to ensure that at least one virtual node can be allocated.
[0052] Third, for each node i in the candidate node set CN(t), generate V i (t) unique identifiers (such as chainID_node_i_v1, chainID_node_i_v2, …) corresponding to the virtual nodes on the hashing ring. Calculate the hash value for each unique identifier of the virtual node, map it to the hashing ring space, and calculate the hash value H(tx j ) of transaction tx j . Similarly, map it to the hashing ring space.
[0053] Fourth, in the hashing ring space, clockwise search for the first virtual node greater than or equal to H(tx j ) and use the corresponding physical node as the endorsing node allocated for transaction tx j .
[0054] In one embodiment, considering that even if the consistent hashing ring (Hash Ring) mechanism is introduced, this mechanism brings certain random factors, and these random factors are uncontrollable. In some cases, node overload will still occur. Therefore, it is impossible to fully guarantee that nodes will not be overloaded. Based on this, this embodiment further introduces a resource reallocation and dynamic adjustment mechanism, that is: Monitor whether there are overloaded nodes whose load exceeds their load thresholds. If there is an overloaded node i, perform resource reallocation and dynamic adjustment. The resource reallocation and dynamic adjustment include: Transactions that exceed the load threshold of node i are reallocated to other optional nodes that are not overloaded. The greater the current dynamic weight of other optional nodes, the greater the number of transactions reallocated to them.
[0055] During the supervision process of deep foundation pit projects, the data submission frequency may change with the progress of construction and the increase in monitoring frequency. When it is detected that the load of a certain node is too high (for example, the monitoring unit frequently uploads settlement monitoring data, resulting in excessive pressure on a certain node), the resource reallocation and dynamic adjustment mechanism will be automatically triggered, and a part of the transactions will be reallocated to other nodes with lower loads. Specifically, if it is detected that the load of node i exceeds the load threshold (T i >T th ), the resource reallocation and dynamic adjustment are triggered. The migration volume can be allocated according to the proportion of the dynamic weights of other nodes. For example, if the monitoring unit frequently uploads settlement data, causing a certain node to be overloaded, part of the transactions will be migrated to idle nodes with higher weights: ΔT=T i -T th ; ; where ΔT is the number of transactions that node i needs to transfer to other nodes, and ΔT ij refers to the number of transactions transferred from node i to node j with a lower load.
[0056] Embodiment 2 Correspondingly, the present invention also claims to protect a gateway, which can be a hardware device or a software system, and at least includes a load balancing module, which is used to execute the multi-blockchain load balancing method introduced above when receiving a transaction request.
[0057] As Figure 2 shown in the structural framework diagram of the gateway in an embodiment of the present invention, in an embodiment, the gateway includes not only a load balancing module, but also a user permission management module, a data on-chain module, an information retrieval module, a data verification module, and a data interaction and transmission module.
[0058] Among them, the load balancing module is used to implement the multi-blockchain load balancing method in Embodiment 1.
[0059] When the user side initiates a multi-party high-concurrency transaction request, the load balancing module in the gateway will calculate the dynamic weights of each node based on the configuration of the blockchain and the current load conditions of each node, and calculate the matching scores of each node for the transaction. The best node for each transaction is selected by combining the dynamic weights and the matching scores. Further, the gateway will also monitor the load conditions of each node. If a node is overloaded, resource reallocation and dynamic adjustment will be performed.
[0060] The user permission management module is used to submit a registration application to the corresponding blockchain when receiving a user's registration request, determine the permissions of the corresponding user according to the information feedback by the blockchain, and verify the user's permissions when receiving the user's application to access the blockchain.
[0061] The data on-chain module is used to send the original data to be put on-chain to the corresponding storage space, obtain the download address of the original data in the storage space, generate the data digest of the original data, and submit the download address and the data digest to the blockchain.
[0062] The information retrieval module is used to find the corresponding content according to the query keywords input by the user.
[0063] The data verification module is used to recalculate the hash value of the downloaded data obtained by the user using the hash algorithm used for data on-chain, and compare whether the recalculated hash value is consistent with the hash value at the time of putting on-chain. If they are consistent, the verification is successful; otherwise, the verification fails.
[0064] The data interaction and transmission module is used to realize the information interaction between blockchain networks.
[0065] Among them, the specific working implementation methods of each module can refer to the following introduction.
[0066] Embodiment 3 Correspondingly, the present invention also claims to protect a blockchain-based building construction data management system, which consists of a blockchain system composed of blockchain networks and the gateway introduced above, and each blockchain network has a corresponding gateway.
[0067] In one embodiment, the management system has a government blockchain system and a project blockchain system. The government blockchain system includes a government supervision blockchain network, and the project blockchain system includes multiple project blockchain networks. Different project blockchain networks are used to manage the data of different projects in building construction, and each blockchain network includes multiple blockchains. The government blockchain system and the project blockchain system constitute a "1+N" multi-chain parallel blockchain system.
[0068] As Figure 3 shown is the architecture diagram of the blockchain-based building construction data management system in one embodiment of the present invention.
[0069] This management system includes a project blockchain system, a government supervision blockchain system, and a gateway.
[0070] The project blockchain system includes N project blockchain networks and is used to store relevant business data.
[0071] In the construction project scenario, the data required for supervision and the key data of each project are classified and stored to achieve the isolation and privacy protection of engineering data among different participants and different projects, and to ensure the security and integrity of the data. The project blockchain covers multiple nodes, allowing various participants such as the construction unit, design unit, construction unit, supervision unit, and third-party testing unit to register and join, providing a safe and reliable data exchange platform for engineering projects and promoting collaboration and information sharing among participants.
[0072] The government supervision blockchain system includes 1 supervision blockchain network for parallel processing of corresponding affairs.
[0073] In the construction project scenario, when the government supervision agency joins the government-led supervision blockchain network, it needs to complete the registration process. Subsequently, the government supervision department submits supervision requirements to the project blockchain network to obtain the necessary supervision data. In response, the project blockchain network will provide the corresponding supervision data file to support the supervision and review work of the supervision agency, helping the government supervision unit to achieve real-time dynamic monitoring of the construction process of deep foundation pit projects and effectively improving the supervision efficiency and the reliability of information sharing.
[0074] The gateway can not only manage users and data within the blockchain network, but also promote the interaction between multiple blockchain networks, acting as a "portal" between the two networks and allowing data to be transmitted between them. The functions of the gateway can be customized according to the specific requirements of the platform.
[0075] In this embodiment, in view of the diversity of engineering scenarios and their different requirements for engineering data management models, it is necessary to design multiple blockchain systems according to diverse scenario requirements. In the deep foundation pit supervision business, in response to the government's supervision requirements for multiple projects and the business independence between different projects, according to the design concept of dedicated chains for specific uses and coexistence of multiple chains, different functions or different stages in the business scenario are divided into different blockchains, and a government blockchain network and multiple independent project blockchain networks are respectively constructed to form a "1+N" multi-chain parallel consortium chain system. The government blockchain system realizes the supervision and audit of project compliance by putting forward supervision requirements to the project blockchain system and obtaining necessary supervision data. Each project blockchain network can record various information related to the project, covering multi-dimensional element information such as personnel, mechanical equipment, materials, processes, and the environment. The information is uploaded to the object storage service platform in the form of multi-modal data such as text, pictures, videos, audio, and BIM model files, and only the key information in the feedback is stored on the chain to achieve data traceability, forming a complete construction project management ecosystem. The management of personnel information not only includes checking whether special operation personnel have relevant certificates, but also covers whether the age of workers meets the maximum working age stipulated by law, and the records of staff transfers between different projects, ensuring that each staff member participating in the construction has the necessary qualifications and compliance. The information of mechanical equipment involves the status, performance, and in-and-out records of on-site operation equipment. For example, the in-and-out situations of mechanical equipment in each project are recorded to effectively track the usage efficiency and maintenance status of the equipment. The material information includes indicators such as the quality standards, specifications, and performance of building materials, ensuring that all used building materials comply with relevant specifications, and recording the relevant information on the treatment of construction waste, and detailing and uploading the information on the generation, classification, storage, transportation, and final treatment of construction waste to the project blockchain. The management of process information includes process flows, operation instructions, quality control plans, and inspection standards during the production process, ensuring that the entire construction process follows the established norms and standards. In terms of environmental information management, it is necessary to pay attention to the potential impacts of construction on surrounding buildings and the environment. For example, monitoring the settlement of the foundation pit to prevent potential impacts on surrounding buildings during urban construction, and regularly generating environmental monitoring reports for the review and evaluation of government supervision departments.
[0076] In one embodiment, each gateway integrates a user permission management module, a load balancing module, a data on-chain module, an information retrieval module, a data verification module, and a data interaction and transmission module.
[0077] The multi-chain load balancing module uses load balancing algorithms to intelligently determine which nodes on the blockchain to allocate transactions such as uploaded data and downloaded data to, in order to maintain the overall performance and stability of the system. The module monitors the load status of each chain node in real time (such as transaction queue backlog and resource occupancy rate), and combines transaction characteristics to analyze the node-task adaptability, so as to achieve transaction allocation. Further, it can further screen a set of high-potential candidate nodes based on dynamic weights and matching scores, and use the consistent hashing ring method for node selection to allocate transaction requests to appropriate nodes for processing. Further, when it detects that the node load deviates from the threshold, it triggers an elastic resource reallocation strategy to migrate overloaded tasks to low-load nodes.
[0078] Such as Figure 4 The figure shows the workflow diagram of the load balancing module in the gateway in an embodiment of the present invention.
[0079] In the actual business process, when each module of the gateway performs corresponding operations, the load balancing module can monitor the load status of each blockchain in real time, and intelligently determine to allocate transactions such as data upload to appropriate blockchain nodes based on the load balancing method introduced above. This process ensures that the system can still maintain the stability and fast response of operations under high load, and effectively avoids resource bottleneck problems.
[0080] The user permission management module may include two independent computing engines. One is responsible for managing the operation permissions of users within their respective blockchain networks, ensuring that users can only perform specific operations for which they have been granted permissions; the other engine is responsible for handling the permission interaction management of cross-network services. In the environment of multi-blockchain networks, business processes often need to span different networks. When cross-network service requirements arise, it can synchronize user permissions in the source network and the target network, acting as a bridge between different networks to ensure the permission consistency and security of users during cross-network operations.
[0081] Such as Figure 5 The figure shows the workflow diagram of the user permission management module in the gateway in an embodiment of the present invention.
[0082] Government regulatory departments, as well as project-related parties such as construction units, design units, construction units, and third-party testing units, submit applications for registering nodes to the corresponding blockchains through the gateway. The registration authority (Registration Authority, RA) on the blockchain will strictly review the identities of these users to verify whether the identity information they submitted is consistent with the identities they declared; After authentication, the registration authority forwards the user's certificate registration request to the Certificate Authority (CA). The CA is responsible for issuing digital certificates to each registered node and feeding them back to the gateway. These certificates contain the identity information of the certificate holders, such as name, organization, position, etc.
[0083] The gateway confirms the identity permissions of all participating parties based on the certificate content and determines the types of data that the participating parties can access and the operations that can be performed.
[0084] The data on-chain module is responsible for implementing the on-chain of data. The sources of on-chain data mainly include two categories, namely user-uploaded data and cross-blockchain network data. When the system directly receives the business data uploaded by internal users, it needs to first verify the user's identity permissions with the help of the internal user operation permission management engine of the user management permission module, and then perform preprocessing steps such as lightweight operation and hash calculation on the original data; when receiving data transmitted from other blockchain networks to this network, the data is already processed key data, and the attributes such as the data source and type can be directly marked. After completing the operations before on-chain for the two types of data respectively, the optimal on-chain method is calculated and selected through the multi-chain load balancing module to improve the performance of the data on-chain processing process.
[0085] Such as Figure 6 shown is the workflow diagram of the data on-chain module in the gateway in an embodiment of the present invention.
[0086] In a construction project, all participating parties (such as the construction unit, design unit, construction unit, and third-party inspection unit) send the original data to be on-chain to the gateway after passing the permission authentication, and then through the OSS object storage cloud service platform, upload the multi-dimensional and multi-modal original supervision data covering elements such as people, machines, materials, methods, and environments to the corresponding storage space (Bucket) in the form of an object (Object). After the upload is successful, the OSS platform will return the access domain name (Endpoint) of the data, that is, the URL used to store the data, as the unique location address for all parties to access the data in the subsequent stage; The gateway processes the original data using a hash algorithm (such as SHA-256) to generate a data digest; The gateway uploads the transaction containing the data digest and the URL stored in OSS and other key information to the project blockchain to ensure the security and traceability of the data. This information is stored on the blockchain, and only users who meet the permission requirements (such as government regulatory departments, construction units, or third-party inspection agencies) can access and verify this data.
[0087] In one embodiment, the key information includes the gateway ID, data digest, unique identifier, OSS storage URL, timestamp, and signature. Normalizing and encapsulating the key information forms a complete transaction proposal. For example, first, the original data is hashed using a hashing algorithm (such as SHA-256) to generate a data digest of a fixed length, ensuring the uniqueness and integrity of the data. Secondly, combining metadata such as the gateway ID (as the unique identifier of the data gateway), unique identifier, the URL address returned by the OSS storage platform (used to point to the storage location of the original data), and timestamp (recording the specific moment when the data is uploaded to the chain), these key information are structured and organized to build a standardized data structure. Subsequently, the data structure is signed using digital signature technology to generate a digital signature field (sign) to verify the legality of the data source and anti-tampering. Finally, the encapsulated data structure is uploaded to the blockchain network to form a transaction (Tx) with security, traceability, and immutability. The data structure of this transaction is shown in the aforementioned table, including core fields such as gateway ID, data digest, unique identifier, OSS storage URL, timestamp, and signature, ensuring the integrity, credibility, and subsequent efficient retrieval and verification of the data uploaded to the chain.
[0088] To achieve the lightweight upload of engineering data to the chain, only the above key information needs to be uploaded to the blockchain for storage to ensure the immutability and traceability of the data. Other information related to engineering data, such as other business extension fields (such as file name or file ID, data type, device label, etc.), chain ID (indicating which blockchain the engineering data is stored on), and transaction hash value (the unique key associated with the blockchain transaction), are sorted out and uploaded to the MySQL database for storage. During subsequent retrieval, by querying fields such as file name or data type, the user can obtain the corresponding transaction hash (tx_hash) and chain ID (chainID), thereby locating the specific blockchain where the data is stored. Based on the transaction hash, the user can retrieve transaction information, obtain the OSS storage address and data digest for subsequent integrity verification, meeting the requirements of the project for data traceability and query in different scenarios. The information retrieval module provides a powerful and secure query interface for users, enabling authorized users to retrieve various types of information stored on the chain, including but not limited to transaction records, smart contract execution results, permission certificates, data modification history, and user interaction logs. Before providing the query service, this module will closely cooperate with the user management permission module to verify the user's identity, thereby ensuring that only authorized users can access specific sensitive information As Figure 7 shown is the workflow diagram of the information retrieval module in the gateway in an embodiment of the present invention.
[0089] Authentication: Before the user starts the retrieval operation, authentication must be performed through the user privilege management module to verify their identity information and privilege level, and confirm whether all participating parties have the corresponding privileges to access the data on the project blockchain or the government supervision chain. If the verification is successful, the user privilege management module will grant a temporary access token to allow the user to perform subsequent operations; Submit a retrieval request: After completing the authentication, the user can submit a data retrieval request through the retrieval interface. The user can input various parameters according to their needs to retrieve information related to construction project items, such as keywords, date range of foundation pit monitoring reports, transaction hash values, etc. The retrieval request is sent to the information retrieval module for processing through the system interface or API, and supports multi-dimensional query combinations to improve the retrieval efficiency and accuracy.
[0090] When the user's retrieval request involves multiple blockchain networks, the information retrieval module can initiate a cross-chain retrieval coordination mechanism. By communicating with the gateways of different blockchain networks, the retrieval request is distributed to the relevant chains to initiate queries in multiple blockchain networks and correctly return the relevant data on each blockchain network.
[0091] The user will receive a summary display of the retrieval results and can view or download some or all of the required data.
[0092] The data verification module uses a hash calculation method to verify that the data downloaded by the user has not been tampered with during transmission and storage. When the user requests data verification, this module will require the user to provide the hash value attached to the data and recalculate the hash value of the downloaded data locally. By comparing the two hash values, the originality and reliability of the data are verified.
[0093] As Figure 8 shown is the workflow diagram of the data verification module in the gateway in an embodiment of the present invention.
[0094] After the user completes the data download, they can send a data verification request through the gateway interface to instruct the gateway to perform consistency verification on the downloaded data. The request needs to include necessary parameters such as the user's identity information and the identifier of the downloaded data (such as the data file ID) for the gateway to identify the verification object; After receiving the data verification request, the gateway will obtain a copy of the downloaded data from the user's device. And use the same hash algorithm (such as SHA-256) as when storing the data on the chain to process this data, read the entire data file, and calculate a new hash value; After the gateway completes the hash calculation of the data, it obtains the originally stored hash value attached to the data at the user side, and compares the newly generated hash value with the original hash value of the corresponding data record on the blockchain; the gateway provides feedback based on the comparison result. If the newly calculated hash value is the same as the original hash value, the gateway sends a confirmation message of successful verification to the user, including detailed information such as the verification time and data ID. If the hash values do not match, the gateway issues a warning indicating that the data may have been tampered with.
[0095] The data interaction and transmission module can be composed of two independently designed computing engines. One is dedicated to handling cross-chain data transmission within the blockchain network, and the other is used to handle data transmission across blockchain networks. Both of these engines are closely integrated with the computing engine in the user permission management module, using the verification mechanism of the latter to ensure the security and compliance of data transmission. At the same time, by monitoring and recording all data transmission activities, the integrity and traceability of the data can also be guaranteed. In addition, this module is also responsible for handling data encryption and decryption, as well as ensuring the compatibility and consistency of data across different blockchains.
[0096] As Figure 9 shown is the working flow chart of the data interaction and transmission module in the gateway in an embodiment of the present invention.
[0097] In deep foundation pit engineering projects, users (such as government regulatory departments, construction units, monitoring units, design units, construction units, etc.) must undergo identity verification through the user permission management module before conducting cross-chain data transmission. The identity verification module verifies whether the identity information matches the certificate information on the blockchain to verify whether the user has the permission to initiate cross-chain interaction and transmission of project data; After the user passes the identity verification and has the permission, the data interaction and transmission module will extract relevant key data information from the source blockchain network, including data summaries and the URL addresses stored in OSS, etc.; The data transmission module sends the encapsulated key data information to the target blockchain network. If the transmission is only within the blockchain network, the gateway can directly upload information such as the data summary and the URL address stored in OSS to the target blockchain through the data on-chain module. If cross-blockchain network transmission is involved, such as when construction workers are transferred between different projects or government regulatory departments need to view project-related information, the data needs to be transmitted from the project blockchain network to other project blockchain networks or the government regulatory blockchain network. The gateway of the source blockchain network communicates with the gateway of the network where the target blockchain is located, and then the gateway of the target blockchain network transmits the encapsulated key data information to the target blockchain; After the key data reaches the gateway of the target blockchain, the data on-chain module will be responsible for uploading this key information to the target blockchain. Since the data has been processed to include key information such as data digest and URL when performing the on-chain operation in the source chain, there is no need to preprocess it further. Only the information such as the source blockchain of the data needs to be marked.
[0098] In one embodiment, to meet the business requirements of cross-blockchain network interaction, based on the original data structure, it is extended and integrated with the original transaction data to form a unified cross-chain data structure. As shown in Table 2, key information such as the source blockchain gateway ID, source blockchain ID, target blockchain gateway ID, OSS storage address, unique identifier, file attribute, timestamp, data digest, and digital signature are encapsulated and packaged to provide a standardized format for cross-chain transmission of data, ensuring the normalized expression and storage of information between multiple blockchain networks.
[0099] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification. It should be noted that the "in one embodiment", "for example", "similarly" in the present invention are intended to illustrate the present invention, rather than to limit the present invention.
[0100] The above embodiments only represent several implementation manners of the present invention, and the description is relatively specific and detailed, but it should not be understood as a limitation to the scope of the patent application. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention.
Claims
1. A multi-blockchain load balancing method, characterized in that, Including: Perform a weighted sum of the metrics of multiple dimensions of node i in the multi-blockchain to obtain the comprehensive performance metric P of node i i ; The metrics of the multiple dimensions include the basic resource availability rate, network score, and historical reliability of node i. Among them, the basic resource availability rate includes the processor availability rate, memory availability rate, and the proportion of time when the disk is not performing read and write operations. The network score is negatively correlated with the network latency of the corresponding node, and the historical reliability is negatively correlated with the failure frequency of the corresponding node; i is the index of the currently selectable node; 1-T i / T max As the queue waiting coefficient of node i, the comprehensive performance index P of node i is i Multiplying it by the queue waiting coefficient of node i, we get the dynamic weight W of node i i , where T i is the current transaction queue length of node i, T max The current maximum transaction queue length among all optional nodes; Calculate transaction tx j The matching degree between the required resource intensity and the existing resource intensity of each node i, and obtain the matching score S of node i for transaction tx j ; j is the index of the transaction; ij ; j is the index of the transaction; Comprehensive dynamic weight W i and matching score S ij to obtain the comprehensive allocation priority F j of node i for transaction tx ij ; F ij is positively correlated with any one of the dynamic weight W i and the matching score S ij ; Allocating corresponding transactions to endorsement nodes according to the comprehensive allocation priorities of each transaction.
2. The multi-blockchain load balancing method according to claim 1, wherein: The calculation transaction tx j The matching degree between the required resources and the existing resources of each node i includes: Construct transaction tx j of the required resource vector r j : r j =[r j1 ,r j2 ,…,r jn ]; Construct the existing resource vector c of node i i : c i =[c i1 ,c i2 ,…,c in ; Calculate the cosine similarity between the required resource vector r j and the existing resource vector c i to obtain the matching score S ij ; where r jk represents the demand intensity of transaction tx j for the k-th type of resource, and c ik represents the available intensity of the k-th type of resource for node i, and n is the number of resource types.
3. The multi-blockchain load balancing method according to claim 1, wherein, Comprehensive allocation priority F ij The calculation formula is as follows: F ij =W i ×S ij 。 4. The multi-blockchain load balancing method according to claim 1, characterized in that, The allocating nodes for corresponding transactions according to the comprehensive allocation priorities of each transaction includes: Allocating nodes for corresponding transactions according to the comprehensive allocation priorities of each transaction in combination with the consistent hashing ring mechanism.
5. The multi-blockchain load balancing method according to claim 1, characterized in that, The method further includes: monitoring whether there is an overloaded node whose load exceeds its load threshold. If there is an overloaded node i, resource reallocation and dynamic adjustment are performed. The resource reallocation and dynamic adjustment include: Reallocating the transactions of node i that exceed its load threshold to other optional nodes that are not overloaded. The greater the current dynamic weight of other optional nodes, the more transactions are reallocated to them.
6. The multi-blockchain load balancing method according to claim 5, wherein, The formula for reallocation is: ; Among them, ΔT is the number of transactions that node i needs to transfer to other nodes, ΔT ij It refers to the number of transactions transferred from node i to node j.
7. A gateway, characterized in that, Including a load balancing module, which is used to execute the multi-blockchain load balancing method as described in any one of claims 1 to 6 when receiving a transaction request.
8. The gateway according to claim 7, characterized in that, The gateway further includes: A user permission management module, which is used to submit a registration application to the corresponding blockchain and determine the permissions of the corresponding user according to the information feedback by the blockchain when receiving a user registration request, and verify the user's permissions when receiving a user's application to access the blockchain; A data on-chain module, which is used to send the original data to be put on the chain to the corresponding storage space and obtain the download address of the original data in the storage space, generate a data digest of the original data, and submit the download address and the data digest to the blockchain; An information retrieval module, which is used to find corresponding content according to the query keywords input by the user; A data verification module, which is used to recalculate the hash value of the downloaded data obtained by the user using the hash algorithm used for data on-chain, and compare whether the recalculated hash value is consistent with the hash value at the time of on-chain. If they are consistent, the verification is successful; otherwise, the verification fails; A data interaction and transmission module, which is used to realize information interaction between blockchain networks.
9. A blockchain-based building construction data management system, characterized in that, Including: A blockchain system composed of blockchain networks and a gateway as described in claim 7 or 8, and each blockchain network has a corresponding gateway.
10. The construction data management system according to claim 9, characterized in that, The management system has a government blockchain system and a project blockchain system. The government blockchain system includes a government supervision blockchain network. The project blockchain system includes multiple project blockchain networks, and different project blockchain networks are used to manage data of different projects in building construction. Each blockchain network includes multiple blockchains.
Citation Information
Patent Citations
Real-time hierarchical distribution method for power cloud resources of digital power grid
CN119603304A
Blockchain-based method and system for immutable resource allocation in a cloud computing environment
US20190334726A1
Resource scheduling method and database
WO2024230706A1
Cited By
Data sharing method and system for multi-agent platform
CN120832328A
