Multi-chain resource allocation technology based on neural network

By using neural network-based multi-chain resource allocation technology to dynamically adjust node deployment strategies, the problem of low resource utilization in multi-chain blockchain systems is solved, intelligent and optimal allocation of nodes is achieved, and the system's resource utilization and operating efficiency are improved.

CN121029376APending Publication Date: 2025-11-28GUANGZHOU CIVIL AVIATION INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510927977.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

In multi-chain blockchain systems, traditional static resource allocation methods cannot detect changes in node performance and sudden changes in chain demand in real time, resulting in low resource utilization and difficulty in achieving load balancing and optimization.

Method used

We employ a multi-chain resource allocation technology based on neural networks. Training data is prepared through a neural network training module. Adaptive optimization algorithms and early stopping mechanisms are used to adjust network parameters. Combined with graph neural networks, we handle changes in node topology and dynamically adjust node deployment strategies to achieve intelligent resource optimization.

Benefits of technology

It improves the resource utilization and operational efficiency of multi-chain blockchain systems, solves the problems of resource mismatch and system bottlenecks in traditional methods, and realizes intelligent and optimal allocation of nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029376A_ABST
    Figure CN121029376A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of resource allocation, particularly relates to a multi-chain resource allocation technology based on a neural network, and provides the following scheme that the multi-chain resource allocation technology comprises a block chain multi-chain system and further comprises the following steps: S1, preparing training data by using a neural network training module: preparing the training data by using the neural network training module; s2, training a node optimization distribution module: dynamically adjusting network parameters through an adaptive optimization algorithm based on the training data set processed by the neural network training module, and controlling an iteration process by adopting an early stop mechanism and a learning rate attenuation strategy until a loss function is converged to a preset threshold value, according to the method, node attributes and global load information are dynamically fused through the graph neural network, intelligent optimal distribution of nodes is achieved, meanwhile, the over-smoothing problem caused by multi-layer stacking can be avoided while light weight of the model is guaranteed, and through intelligent decision making and dynamic adaptation capacity, the optimal distribution of the nodes is achieved. And the problems of resource mismatching, system bottleneck and expansibility are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource allocation technology, and in particular to multi-chain resource allocation technology based on neural networks. Background Technology

[0002] With the development of blockchain technology, multi-chain architectures (such as sharded chains and parachains) have become an important solution to improve system scalability. However, in a multi-chain environment, differences in node performance (such as uneven computing power and network bandwidth), dynamic load fluctuations (such as sudden changes in inter-chain transaction volume), and the complexity of cross-chain interactions (such as frequent cross-chain communication) make traditional static resource allocation methods inefficient and difficult to achieve load balancing and optimized resource utilization.

[0003] Existing technologies, which typically employ fixed rules or simple heuristic algorithms for node allocation, still suffer from the following problems:

[0004] 1. It only optimizes a single objective (such as load balancing), but cannot coordinate conflicts between multiple objectives;

[0005] 2. At the same time, static rules and simple algorithms cannot perceive changes in node performance (such as bandwidth fluctuations) and sudden changes in chain demand (such as peak NFT minting periods) in real time, resulting in a lag in allocation strategies;

[0006] 3. Traditional machine learning methods are difficult to apply directly, while manual rules are difficult to cover complex scenarios.

[0007] Therefore, there is an urgent need for an intelligent dynamic resource allocation technology that can automatically optimize node deployment strategies based on real-time network status and business needs, thereby improving the resource utilization and operational efficiency of multi-chain blockchain systems. Summary of the Invention

[0008] This invention provides a multi-chain resource allocation technology based on neural networks, which overcomes the shortcomings of existing technologies.

[0009] This invention provides the following technical solution:

[0010] Multi-chain resource allocation technology based on neural networks, including multi-chain blockchain systems, also includes the following steps:

[0011] S1: Neural Network Training Module Prepares Training Data: Training data is prepared using the neural network training module;

[0012] S2: Training Node Optimization and Allocation Module: Based on the training dataset processed by the neural network training module, this module dynamically adjusts network parameters using an adaptive optimization algorithm. It employs an early stopping mechanism and a learning rate decay strategy to control the iterative process until the loss function converges to a predetermined threshold. The iterative optimization process simultaneously implements gradient accumulation and distributed training acceleration strategies, enabling the model to achieve optimal parameter configuration under computational resource constraints.

[0013] S3: Initial Deployment: The blockchain multi-chain system transmits the necessary information to the node optimization and allocation module. The optimization and allocation module calculates the optimal node deployment plan based on the received information, and the system completes the initial node network construction accordingly.

[0014] S4: Dynamic Node Adjustment: When a node topology change event (including node failure or expansion) is detected or the sliding time window threshold is reached, the system needs to provide the required information to the node optimization and allocation module. The node optimization and allocation module calculates the optimal node deployment plan based on the required information, and the blockchain multi-chain system adjusts the nodes according to this plan.

[0015] As a further embodiment of the present invention, S1 includes two stages: scene construction and strategy optimization;

[0016] Among them, scene construction: the neural network training module first needs to obtain scene information, including the number of network nodes, the number of logical chains, and the information used by the information collection part in the node optimization and allocation module;

[0017] Strategy optimization: Based on the scenario constructed, this stage generates the optimal resource allocation strategy as a monitoring signal under the given scenario.

[0018] As a further aspect of this invention, the scenario information in the scenario construction is a reproduction of a real-world scenario: It connects to a runtime monitoring system of a multi-chain system, collecting real-time physical node resource metrics (CPU / memory / bandwidth) and logical chain dynamic parameters (chain-level transaction throughput, storage resource utilization, resource requirements). Based on historical logs, it reconstructs a system snapshot at a specific moment, preserving key contextual information such as node topology connections and inter-chain dependency strength.

[0019] As a further aspect of the present invention, the scenario information in the scenario construction is generated randomly: within the constraint space of physical node configuration parameters and logical chain topology parameters, controllable random sampling is performed. A distribution model (uniform distribution or Poisson process) is established to generate abnormal operating conditions that exceed the existing design boundaries. Stress test scenarios are used to simulate injected node failure events and network partitioning faults to verify the robustness of the system under extreme conditions.

[0020] As a further aspect of the present invention, the strategy optimization is expert knowledge injection: domain experts formulate heuristic rules based on network dynamics principles to form a high-quality labeled dataset.

[0021] As a further aspect of the present invention, the strategy optimization is reinforcement learning exploration: exploring different resource allocation strategies in a simulated environment, evaluating the merits of the strategies according to a predefined reward function, and finally finding the optimal solution as training data;

[0022] 1) This module constructs a Markov decision process framework, where the state space is defined as a physical node resource allocation vector (CPU / memory / bandwidth), and the action space is mapped to the logical chain deployment decisions in a multi-chain topology (including those not mapped to any logical chain). During the policy optimization phase, an ε-greedy policy is used for exploration—utilizing balanced action sampling, and policy updates are implemented through a composite reward function (including cross-chain communication overhead and load balancing evaluation metrics). After multiple rounds of policy iteration, the optimal node deployment policy is output when the Q-value function converges.

[0023] 2) Reward Function: Design a multi-objective reward function, combining optimization objectives with constraints and penalties.

[0024] R t =ω1R util -ω2R delay -ω3R migrate

[0025] Where ω1+ω2+ω3=1, the weights can be dynamically adjusted according to business needs, and the specific calculation methods for each item are as follows: (when node i is assigned to chain j, a) ij =1 if true, 0 otherwise; M is the number of logical chains, N is the number of physical nodes);

[0026] Resource utilization rate reward

[0027]

[0028] Cross-chain delay penalty

[0029]

[0030] Inter-chain latency is the average latency between two nodes in the chain.

[0031] Quantifying the impact of dynamic migration costs on system stability

[0032]

[0033] This item is automatically disabled for newly deployed nodes to avoid interfering with the initial optimization process.

[0034] As a further embodiment of the present invention, S2 adopts an intelligent mapping architecture based on heterogeneous graph neural networks, which abstracts the node resource allocation problem in a multi-chain environment into a link prediction task in a topological network. By constructing a two-layer graph structure of physical nodes and logical chains, hierarchical representation learning of heterogeneous network features is realized, and finally the optimal node-chain matching relationship that meets the load balancing constraints is output. It includes three stages: information collection and feature modeling, graph neural network processing, and allocation result output.

[0035] Among them, information collection and feature modeling are achieved by constructing a multi-dimensional feature collection system to obtain the hardware indicators of physical nodes in real time, such as network bandwidth (Mbps), computing power (FLOPS), and storage capacity (GB), and to simultaneously monitor global load dynamic parameters (including chain-level transaction throughput, storage resource utilization, and resource requirements) and cross-chain dependency topology (data sharing volume and cross-chain transaction frequency), thus forming a complete heterogeneous network state perception system.

[0036] Graph neural network processing models the entire multi-chain system as a heterogeneous multi-relation graph neural network, uniformly representing physical nodes (servers) and logical chains (shard chains / parallel chains) as heterogeneous nodes, and defining two types of edge relationships: physical edges (physical connections between nodes) and logical edges (transactional associations between chains). The model employs an improved graph attention architecture, implementing a cross-type neighbor feature aggregation strategy during the message passing phase, dynamically allocating connection weights through an attention mechanism, and ultimately generating node embedding vectors containing the global topology structure, providing interpretable feature representations for subsequent node-chain matching decisions.

[0037] The allocation result output is a heterogeneous node embedding vector generated by a graph neural network. In this stage, the cosine similarity between physical nodes and logical chains in the feature space is calculated to predict the possibility of a link between physical nodes and logical chains. Physical nodes are then assigned to the chain with the highest probability to achieve optimal resource allocation.

[0038] As a further aspect of the present invention, physical node attribute collection: Let the set of physical nodes be P = {p1, p2, ..., p...} N}, each node p i The attribute vector is Logical chain attribute collection: Let the set of logical chains be L = {l1, l2, ..., l...} M}, each chain l j The attribute vector is Edge relationship attribute collection: Physical edges represent the connections between physical nodes. Logical edges represent inter-chain dependencies.

[0039]

[0040] As a further aspect of the present invention, graph neural network processing includes the following steps:

[0041] 1) Heterogeneous Graph Modeling: The entire multi-chain system is modeled as a heterogeneous graph, defining two types of node entities (physical nodes and logical chains) and three types of edge relationships: physical edges represent the actual network connections between nodes, logical edges describe the interaction dependencies between chains, and allocation edges represent the node-chain mapping relationship to be optimized. For deployed nodes, static, parameter-free allocation edges are established between the corresponding physical node and its logical chain, serving as topological constraints embedded in the model. A virtual logical chain node can be added to indicate that the corresponding physical node is not assigned to the logical chain.

[0042] 2) In view of the fully connected characteristics of the heterogeneous network constructed in the previous step (all physical nodes and logical chains are interconnected), this solution adopts a single-layer heterogeneous graph convolutional architecture and realizes feature fusion of cross-type nodes through global neighborhood heterogeneous message passing and aggregation mechanism;

[0043] 3) Heterogeneous message passing and aggregation: RGCN with attention mechanism is used to handle multiple types of edges.

[0044]

[0045] Where r represents the edge type (physical edge p, logical edge l, or assigned edge pl), and N(i) is the set of neighbors of node i under edge type r. Let α be a parameter matrix specific to type r. ij

[0046] Attention weights

[0047]

[0048] in Wp and W l Let be the projection matrix, and a be the attention parameter vector.

[0049] 4) After processing by the graph neural network, the node embedding z can be obtained.

[0050] As a further embodiment of the present invention, the output of the allocation result includes the following steps:

[0051] 1) Link probability prediction: For physical node P i and logical chain l j Calculate the distribution probability

[0052]

[0053] Where M is the learnable similarity matrix, y ij =1 indicates that node P i Assigned to logical chain l j .

[0054] 2) Resource allocation strategies: These can be divided into hard allocation strategies and soft allocation strategies. Hard allocation strategies allocate all CPU resources of a node to the chain with the highest allocation probability. Soft allocation strategies distribute resources to different chains according to their allocation probability ratios, where resource quotas...

[0055]

[0056] 3) Optimization objective: The optimization objective of this model is defined as a composite loss function, which includes supervised learning loss and dynamic transfer cost regularization term.

[0057]

[0058] in λ is the training label obtained in the neural network training module (1 when node i is assigned to chain j, and 0 otherwise); λ is an adjustable balance coefficient used to control the trade-off between classification accuracy and system stability. For migration indicator functions:

[0059]

[0060] For initial node deployment, the default... To avoid ineffective punishment.

[0061] The main loss function uses standard cross-entropy loss, optimizing classification accuracy based on the supervision signals from labeled samples. An auxiliary regularized migration indicator function applies a linear penalty when deployed nodes need to switch their logical chain affiliation, dynamically adjusting the weights of resource allocation efficiency and system stability through a balancing coefficient λ.

[0062] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit the invention.

[0063] In this invention, physical nodes and logical chains are uniformly represented as heterogeneous nodes through a heterogeneous multi-relationship graph neural network, and two types of edge relationships, physical edges and logical edges, are defined, which can effectively solve the technical bottleneck of traditional methods that are difficult to capture the complex interaction relationships of heterogeneous networks.

[0064] In this invention, for nodes deployed for the first time, the regularization term is automatically disabled to avoid interfering with the initial optimization process. This design is mathematically equivalent to a constrained optimization problem, ensuring that resource utilization is improved while minimizing runtime topology refactoring overhead.

[0065] In this invention, by optimizing the configuration of the node allocation module, it solves the problems of resource mismatch, system bottleneck and scalability through intelligent decision-making and dynamic adaptation capabilities.

[0066] In this invention, based on the characteristic that there are direct or indirect connections between any nodes in a fully connected topology, a single convolutional layer can complete the joint encoding of node features and global topology structure, ensuring the lightweight nature of the model while avoiding the oversmoothing problem caused by multiple layers stacking.

[0067] In this invention, node attributes and global load information are dynamically fused through a graph neural network to achieve intelligent optimal allocation of nodes. Attached Figure Description

[0068] Figure 1 This is a schematic diagram of the process structure of the neural network-based multi-chain resource allocation technology provided in an embodiment of the present invention;

[0069] Figure 2 This is a flowchart of the node optimization allocation module based on neural network multi-chain resource allocation technology provided in an embodiment of the present invention;

[0070] Figure 3 This is a flowchart of a neural network training module based on a multi-chain resource allocation technology for neural networks, provided in an embodiment of the present invention. Detailed Implementation

[0071] The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0072] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connection" and "installation" should be interpreted broadly. For example, "connection" can be a detachable connection or a non-detachable connection; it can be a direct connection or an indirect connection through an intermediate medium. Furthermore, "connection" can be a direct connection or an indirect connection through an intermediate medium. "Fixed" means that the devices are connected to each other and their relative positional relationship remains unchanged after the connection. The directional terms mentioned in the embodiments of the present invention, such as "inner," "outer," "top," and "bottom," are only for reference to the directions in the accompanying drawings. Therefore, the directional terms used are for better and clearer explanation and understanding of the embodiments of the present invention, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of the present invention.

[0073] References to "one embodiment" or "some embodiments" as used in this specification mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the invention. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically emphasized.

[0074] Example 1

[0075] Reference Figures 1-3 The neural network-based multi-chain resource allocation technology, including blockchain multi-chain systems, also includes the following steps:

[0076] S1: Neural Network Training Module Prepares Training Data: Training data is prepared using the neural network training module;

[0077] S2: Training Node Optimization and Allocation Module: Based on the training dataset processed by the neural network training module, this module dynamically adjusts network parameters using an adaptive optimization algorithm. It employs an early stopping mechanism and a learning rate decay strategy to control the iterative process until the loss function converges to a predetermined threshold. The iterative optimization process simultaneously implements gradient accumulation and distributed training acceleration strategies to ensure the model achieves optimal parameter configuration under computational resource constraints.

[0078] S3: Initial Deployment: The blockchain multi-chain system transmits the necessary information to the node optimization and allocation module. The optimization and allocation module calculates the optimal node deployment plan based on the received information, and the system completes the initial node network construction accordingly.

[0079] S4: Dynamic Node Adjustment: When a node topology change event (including node failure or expansion) is detected or the sliding time window threshold is reached, the system needs to provide the required information to the node optimization and allocation module. The node optimization and allocation module calculates the optimal node deployment scheme based on the required information. The blockchain multi-chain system adjusts the nodes according to this scheme. Since the node optimization and allocation module introduces dynamic migration costs, the node adjustment will not cause significant changes.

[0080] S1 of the present invention provides training samples for the neural network in the node optimization allocation module through a systematic data generation process, including two stages: scene construction and strategy optimization.

[0081] Among them, scene construction: the neural network training module first needs to obtain scene information, including the number of network nodes, the number of logical chains, and the information used by the information collection part in the node optimization and allocation module;

[0082] Strategy optimization: Based on the scenario constructed, this stage generates the optimal resource allocation strategy as a monitoring signal under the given scenario.

[0083] In this invention, the scenario information in scenario construction is a reproduction of a real scenario: it connects to the runtime monitoring system of a multi-chain system, and collects physical node resource indicators (CPU / memory / bandwidth) and logical chain dynamic parameters (chain-level transaction throughput, storage resource utilization, resource requirements) in real time. Based on historical logs, it restores a system snapshot at a specific moment, preserving key contextual information such as node topology connections and inter-chain dependency strength.

[0084] In particular, policy optimization is a reinforcement learning exploration: different resource allocation strategies are explored in a simulated environment, and the merits of the strategies are evaluated according to a predefined reward function, and finally the best solution is found as training data;

[0085] 1) This module constructs a Markov decision process framework, where the state space is defined as a physical node resource allocation vector (CPU / memory / bandwidth), and the action space is mapped to the logical chain deployment decisions in a multi-chain topology (including those not mapped to any logical chain). During the policy optimization phase, an ε-greedy policy is used for exploration—utilizing balanced action sampling, and policy updates are implemented through a composite reward function (including cross-chain communication overhead and load balancing evaluation metrics). After multiple rounds of policy iteration, the optimal node deployment policy is output when the Q-value function converges.

[0086] 2) Reward Function: Design a multi-objective reward function, combining optimization objectives with constraints and penalties.

[0087] R t =ω1R util -ω2R delay -ω3R migrate

[0088] Where ω1+ω2+ω3=1, the weights can be dynamically adjusted according to business needs, and the specific calculation methods for each item are as follows: (when node i is assigned to chain j, a) ij =1 if true, 0 otherwise; M is the number of logical chains, N is the number of physical nodes);

[0089] Resource utilization rate reward

[0090]

[0091] Cross-chain delay penalty

[0092]

[0093] Inter-chain latency is the average latency between two nodes in the chain.

[0094] Quantifying the impact of dynamic migration costs on system stability

[0095]

[0096] This item is automatically disabled for newly deployed nodes to avoid interfering with the initial optimization process.

[0097] In this invention, S2 adopts an intelligent mapping architecture based on heterogeneous graph neural networks, which abstracts the node resource allocation problem in a multi-chain environment into a link prediction task in a topological network. By constructing a two-layer graph structure of physical nodes and logical chains, it realizes hierarchical representation learning of heterogeneous network features and finally outputs the optimal node-chain matching relationship that meets the load balancing constraints. It includes three stages: information collection and feature modeling, graph neural network processing, and allocation result output.

[0098] Among them, information collection and feature modeling are achieved by constructing a multi-dimensional feature collection system to obtain the hardware indicators of physical nodes in real time, such as network bandwidth (Mbps), computing power (FLOPS), and storage capacity (GB), and to simultaneously monitor global load dynamic parameters (including chain-level transaction throughput, storage resource utilization, and resource requirements) and cross-chain dependency topology (data sharing volume and cross-chain transaction frequency), thus forming a complete heterogeneous network state perception system.

[0099] Graph neural network processing models the entire multi-chain system as a heterogeneous multi-relation graph neural network, uniformly representing physical nodes (servers) and logical chains (shard chains / parallel chains) as heterogeneous nodes, and defining two types of edge relationships: physical edges (physical connections between nodes) and logical edges (transactional associations between chains). The model employs an improved graph attention architecture, implementing a cross-type neighbor feature aggregation strategy during the message passing phase, dynamically allocating connection weights through an attention mechanism, and ultimately generating node embedding vectors containing the global topology structure, providing interpretable feature representations for subsequent node-chain matching decisions.

[0100] The allocation result output is a heterogeneous node embedding vector generated by a graph neural network. In this stage, the cosine similarity between physical nodes and logical chains in the feature space is calculated to predict the possibility of a link between physical nodes and logical chains. Physical nodes are then assigned to the chain with the highest probability to achieve optimal resource allocation.

[0101] In this invention, physical node attribute collection: Let the set of physical nodes be P = {p1, p2, ..., p...} N}, each node p i The attribute vector is Logical chain attribute collection: Let the set of logical chains be L = {l1, l2, ..., l...} M}, each chain l j The attribute vector is

[0102] Edge relationship attribute collection: Physical edges represent the connections between physical nodes. Logical edges represent inter-chain dependencies.

[0103] In particular, graph neural network processing includes the following steps:

[0104] 1) Heterogeneous Graph Modeling: The entire multi-chain system is modeled as a heterogeneous graph, defining two types of node entities (physical nodes and logical chains) and three types of edge relationships: physical edges represent the actual network connections between nodes, logical edges describe the interaction dependencies between chains, and allocation edges represent the node-chain mapping relationship to be optimized. For deployed nodes, static, parameter-free allocation edges are established between the corresponding physical node and its logical chain, serving as topological constraints embedded in the model. A virtual logical chain node can be added to indicate that the corresponding physical node is not assigned to the logical chain.

[0105] 2) In view of the fully connected characteristics of the heterogeneous network constructed in the previous step (all physical nodes and logical chains are interconnected), this solution adopts a single-layer heterogeneous graph convolutional architecture. It realizes feature fusion of cross-type nodes through global neighborhood heterogeneous message passing and aggregation mechanism. This design is based on the characteristic that there are direct or indirect relationships between any nodes in the fully connected topology. A single layer of convolution can complete the joint encoding of node features and global topology structure, which avoids the oversmoothing problem caused by multi-layer stacking while ensuring the lightweight nature of the model.

[0106] 3) Heterogeneous message passing and aggregation: RGCN with attention mechanism is used to handle multiple types of edges.

[0107]

[0108] Where r represents the edge type (physical edge p, logical edge l, or assigned edge pl), and N(i) is the set of neighbors of node i under edge type r. Let α be a parameter matrix specific to type r. ij Attention weights

[0109]

[0110] Among them W p and W l Let be the projection matrix, and a be the attention parameter vector.

[0111] 4) After processing by the graph neural network, the node embedding z can be obtained.

[0112] It should be noted that the allocation result output includes the following steps:

[0113] 1) Link probability prediction: For physical node P i and logical chain lj Calculate the distribution probability

[0114]

[0115] Where M is the learnable similarity matrix, y ij =1 indicates that node P i Assigned to logical chain l j .

[0116] 2) Resource allocation strategies: These can be divided into hard allocation strategies and soft allocation strategies. Hard allocation strategies allocate all CPU resources of a node to the chain with the highest allocation probability. Soft allocation strategies distribute resources to different chains according to their allocation probability ratios, where resource quotas...

[0117]

[0118] 3) Optimization objective: The optimization objective of this model is defined as a composite loss function, which includes supervised learning loss and dynamic transfer cost regularization term.

[0119]

[0120] in λ is the training label obtained in the neural network training module (1 when node i is assigned to chain j, and 0 otherwise); λ is an adjustable balance coefficient used to control the trade-off between classification accuracy and system stability. For migration indicator functions:

[0121]

[0122] For initial node deployment, the default... To avoid ineffective punishment.

[0123] The main loss function employs standard cross-entropy loss, optimizing classification accuracy based on supervised signals from labeled samples. An auxiliary regularized migration indicator function applies a linear penalty when deployed nodes need to switch logical chains. This penalty is dynamically adjusted by a balancing coefficient λ to weigh resource allocation efficiency against system stability. For newly deployed nodes, this regularization term is automatically disabled to avoid interfering with the initial optimization process. Mathematically, this design is equivalent to a constrained optimization problem, ensuring that resource utilization is improved while minimizing runtime topology refactoring overhead.

[0124] Example 2

[0125] In this scenario construction, the scenario information is generated randomly: within the constraint space of physical node configuration parameters and logical chain topology parameters, controllable random sampling is performed. A distribution model (uniform distribution or Poisson process) is established to generate abnormal operating conditions that exceed the existing design boundaries. Stress test scenarios are used to simulate injected node failure events and network partitioning faults to verify the robustness of the system under extreme conditions.

[0126] Example 3

[0127] Among them, strategy optimization involves injecting expert knowledge: domain experts formulate heuristic rules based on network dynamics principles to form a high-quality labeled dataset.

[0128] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. In the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A multi-chain resource allocation technology based on neural networks, including a blockchain multi-chain system, characterized in that, It also includes the following steps: S1: Neural Network Training Module Prepares Training Data: Training data is prepared using the neural network training module; S2: Training Node Optimization and Allocation Module: Based on the training dataset processed by the neural network training module, this module dynamically adjusts network parameters using an adaptive optimization algorithm. It employs an early stopping mechanism and a learning rate decay strategy to control the iterative process until the loss function converges to a predetermined threshold. The iterative optimization process simultaneously implements gradient accumulation and distributed training acceleration strategies, enabling the model to achieve optimal parameter configuration under computational resource constraints. S3: Initial Deployment: The blockchain multi-chain system transmits the necessary information to the node optimization and allocation module. The optimization and allocation module calculates the optimal node deployment plan based on the received information, and the system completes the initial node network construction accordingly. S4: Dynamic Node Adjustment: When a node topology change event (including node failure or expansion) is detected or the sliding time window threshold is reached, the system needs to provide the required information to the node optimization and allocation module. The node optimization and allocation module calculates the optimal node deployment plan based on the required information, and the blockchain multi-chain system adjusts the nodes according to this plan.

2. The multi-chain resource allocation technology based on neural networks according to claim 1, characterized in that, S1 includes two stages: scenario construction and strategy optimization. Among them, scene construction: the neural network training module first needs to obtain scene information, including the number of network nodes, the number of logical chains, and the information used by the information collection part in the node optimization and allocation module; Strategy optimization: Based on the scenario constructed, this stage generates the optimal resource allocation strategy as a monitoring signal under the given scenario.

3. The multi-chain resource allocation technology based on neural networks according to claim 2, characterized in that, The scenario information in the scenario construction is a reproduction of the real scenario: the runtime monitoring system of the multi-chain system is connected to collect physical node resource indicators (CPU / memory / bandwidth) and logical chain dynamic parameters (chain-level transaction throughput, storage resource utilization, resource requirements) in real time, restores the system snapshot at a specific moment based on historical logs, and retains key context information such as node topology connection relationship and inter-chain dependency strength.

4. The multi-chain resource allocation technology based on neural networks according to claim 2, characterized in that, The scenario information in the scenario construction is generated randomly: within the constraint space of physical node configuration parameters and logical chain topology parameters, controllable random sampling is performed. A distribution model (uniform distribution or Poisson process) is established to generate abnormal operating conditions that exceed the existing design boundaries. Stress test scenarios are used to simulate injected node failure events and network partitioning faults to verify the robustness of the system under extreme conditions.

5. The multi-chain resource allocation technology based on neural networks according to claim 2, characterized in that, The strategy optimization involves expert knowledge injection: domain experts formulate heuristic rules based on network dynamics principles to form a high-quality labeled dataset.

6. The multi-chain resource allocation technology based on neural networks according to claim 2, characterized in that, The strategy optimization is a reinforcement learning exploration: exploring different resource allocation strategies in a simulated environment, evaluating the merits of the strategies based on a predefined reward function, and finally finding the best solution as training data; S1: This module constructs a Markov decision process framework, where the state space is defined as a physical node resource allocation vector (CPU / memory / bandwidth), and the action space is mapped to the logical chain deployment decisions in a multi-chain topology (including those not mapped to any logical chain). During the policy optimization phase, an ε-greedy policy is used for exploration—utilizing balanced action sampling, and policy updates are implemented through a composite reward function (including cross-chain communication overhead and load balancing evaluation metrics). After multiple rounds of policy iteration, the optimal node deployment policy is output when the Q-value function converges. S2: Reward Function: Design a multi-objective reward function that combines optimization objectives with constraints and penalties. R t =ω1R util -ω2R delay -ω3R migrate Where ω1+ω2+ω3=1, the weights can be dynamically adjusted according to business needs, and the specific calculation methods for each item are as follows: (when node i is assigned to chain j, a) ij =1 if true, 0 otherwise; M is the number of logical chains, N is the number of physical nodes); Resource utilization rate reward Cross-chain delay penalty Where the inter-chain latency is the average latency between two inter-chain nodes; Quantifying the impact of dynamic migration costs on system stability This item is automatically disabled for newly deployed nodes to avoid interfering with the initial optimization process.

7. The multi-chain resource allocation technology based on neural networks according to claim 1, characterized in that, The S2 adopts an intelligent mapping architecture based on heterogeneous graph neural networks, which abstracts the node resource allocation problem in a multi-chain environment into a link prediction task in a topological network. By constructing a two-layer graph structure of physical nodes and logical chains, it realizes hierarchical representation learning of heterogeneous network features and finally outputs the optimal node-chain matching relationship that meets the load balancing constraints. It includes three stages: information collection and feature modeling, graph neural network processing, and allocation result output. Among them, information collection and feature modeling are achieved by constructing a multi-dimensional feature collection system to obtain the hardware indicators of physical nodes in real time, such as network bandwidth (Mbps), computing power (FLOPS), and storage capacity (GB), and to simultaneously monitor global load dynamic parameters (including chain-level transaction throughput, storage resource utilization, and resource requirements) and cross-chain dependency topology (data sharing volume and cross-chain transaction frequency), thus forming a complete heterogeneous network state perception system. Graph neural network processing models the entire multi-chain system as a heterogeneous multi-relation graph neural network, uniformly representing physical nodes (servers) and logical chains (shard chains / parallel chains) as heterogeneous nodes, and defining two types of edge relationships: physical edges (physical connections between nodes) and logical edges (transactional associations between chains). The model employs an improved graph attention architecture, implementing a cross-type neighbor feature aggregation strategy during the message passing phase, dynamically allocating connection weights through an attention mechanism, and ultimately generating node embedding vectors containing the global topology structure, providing interpretable feature representations for subsequent node-chain matching decisions. The allocation result output is a heterogeneous node embedding vector generated by a graph neural network. In this stage, the cosine similarity between physical nodes and logical chains in the feature space is calculated to predict the possibility of a link between physical nodes and logical chains. Physical nodes are then assigned to the chain with the highest probability to achieve optimal resource allocation.

8. The multi-chain resource allocation technology based on neural networks according to claim 7, characterized in that, Physical node attribute collection: Let the set of physical nodes be P = {p1, p2, ..., p...} N }, each node p i The attribute vector is Logical chain attribute collection: Let the set of logical chains be L = {l1, l2, ..., l...} M }, each chain l j The attribute vector is Edge relationship attribute collection: Physical edges represent the connections between physical nodes. Logical edges represent inter-chain dependencies.

9. The multi-chain resource allocation technology based on neural networks according to claim 7, characterized in that, Graph neural network processing includes the following steps: S1: Heterogeneous Graph Modeling: The entire multi-chain system is modeled as a heterogeneous graph, defining two types of node entities (physical nodes and logical chains) and three types of edge relationships: physical edges represent the actual network connections between nodes, logical edges describe the interaction dependencies between chains, and allocation edges represent the node-chain mapping relationship to be optimized. For deployed nodes, static, parameter-free allocation edges are established between the corresponding physical node and its logical chain, serving as topological constraints embedded in the model. A virtual logical chain node can be added to indicate that the corresponding physical node is not assigned to the logical chain. S2: In view of the fully connected characteristics of the heterogeneous network constructed in the previous step (all physical nodes and logical chains are interconnected), this solution adopts a single-layer heterogeneous graph convolutional architecture and realizes feature fusion of cross-type nodes through global neighborhood heterogeneous message passing and aggregation mechanism. S3: Heterogeneous Message Passing and Aggregation: RGCN with attention mechanism is used to handle multiple types of edges. Where r represents the edge type (physical edge p, logical edge l, or assigned edge pl), and N(i) is the set of neighbors of node i under edge type r. Let α be a parameter matrix specific to type r. ij Attention weights Among them W p and W l Let be the projection matrix, and a be the attention parameter vector. S4: After processing by the graph neural network, the node embedding z can be obtained.

10. The multi-chain resource allocation technology based on neural networks according to claim 7, characterized in that, The allocation result output includes the following steps: S1: Link probability prediction: For physical node P i and logical chain l j Calculate the distribution probability Where M is the learnable similarity matrix, y ij =1 indicates that node P i Assigned to logical chain l j . S2: Resource allocation strategy: This can be divided into hard allocation strategy and soft allocation strategy. The hard allocation strategy allocates all of a node's CPU resources to the chain with the highest allocation probability. The soft allocation strategy distributes resources to different chains according to their allocation probability ratios, where resource quotas are used. S3: Optimization Objective: The optimization objective of this model is defined as a composite loss function, which includes supervised learning loss and dynamic transfer cost regularization term: in λ is the training label obtained in the neural network training module (1 when node i is assigned to chain j, and 0 otherwise); λ is an adjustable balance coefficient used to control the trade-off between classification accuracy and system stability. For migration indicator functions: For initial node deployment, the default... To avoid ineffective punishment. The main loss function uses standard cross-entropy loss, optimizing classification accuracy based on the supervision signals from labeled samples. An auxiliary regularized migration indicator function applies a linear penalty when deployed nodes need to switch their logical chain affiliation, dynamically adjusting the weights of resource allocation efficiency and system stability through a balancing coefficient λ.

Citation Information

Cited By

  • Power grid business micro-service reconstruction and cross-isolation cooperation method based on neural network

    CN121578983A