Resilient city resource allocation method and system based on blockchain and edge computing
Through the resilient urban resource allocation method of blockchain and edge computing, dynamic adjustment of node trust weights and differential shear training, the delay and throughput problems of the urban resource allocation system in a high-concurrency environment are solved, and efficient and reliable allocation and learning synchronization of urban resources are achieved, thereby improving the responsiveness and security of urban public services.
Patent Information
- Application Number
- CN202511089090.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-05
AI Technical Summary
The existing urban resource allocation system has difficulty maintaining low latency and high throughput in high-concurrency or Byzantine environments, resulting in information chain breaks, model deviations, and resource mismatches, posing public safety risks, especially during emergencies.
A resilient urban resource allocation method based on blockchain and edge computing is adopted. Through adaptive decision-driven rolling optimization of cross-departmental resource rescheduling, node trust weights are dynamically adjusted, incremental patches are generated and differential shear training is performed to ensure efficient, reliable and dynamic synchronization of resource allocation.
It achieves efficient, reliable, dynamic allocation and sustainable learning of urban public resources in emergency scenarios, improves forward-looking insight and response consistency in emergencies, builds a safe and privacy-friendly city-level learning ecosystem, and ensures that resource allocation is tamper-proof and traceable.
Smart Images

Figure CN120579803B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of urban resource allocation, and specifically to a resilient urban resource allocation method and system based on blockchain and edge computing. Background Art
[0002] As cities around the world gradually move toward data-driven resilient governance, critical systems such as public transportation, electricity, drainage, and healthcare are beginning to deploy dense IoT terminals at the edge and leverage AI models for advanced predictions. To gain global insights without leaking raw data, pilot projects are deploying federated learning in roadside computing units and substation controllers, enhancing emergency response capabilities through collaborative training. Meanwhile, permissioned blockchains are being used to record predictions, authorization signatures, and dispatch instructions to ensure the integrity and traceability of multi-departmental collaboration. Recent research also proposes integrating edge computing and blockchain into digital twins or urban multi-agent frameworks, enabling real-time synchronization of physical and virtual systems and providing intervention plans before disasters occur.
[0003] However, most existing solutions are limited to a single scenario (such as traffic signals or energy consumption scheduling). Prediction models and execution feedback are often scattered across different chain networks or central servers, resulting in a broken information chain. At the same time, trust management between nodes and transaction priority sorting often use static configurations, making it difficult to maintain low latency and high throughput in high-concurrency or Byzantine environments.
[0004] In actual urban operations, after the deployment intention is triggered, execution subsystems such as drainage pumps, traffic lights, and distribution switches will return operating status and performance indicators; these receipts need to be accurately matched with the previous prediction window, model version, and structural fingerprint before they can be converted into the next round of training samples. If the query latency of the receipt on the chain is too high, or the content quality is uneven and there is a lack of unified weight quantization, the edge node will write noise or even wrong labels into the local state tensor, causing model offset; if the patch fusion strategy is too coarse, the prediction-execution-learning link will converge and stagnate due to frequent false triggering of training or excessive freezing of weights. More seriously, in the absence of dynamic trust adjustment and patch freshness decay mechanisms, malicious or inaccurate nodes may repeatedly upload high-weight receipts, gradually dragging down the entire network model, and ultimately leading to cross-departmental resource mismatches, delayed responses, and even public safety risks.
[0005] This problem is often magnified during periods of sudden heavy rain at night, delayed subway operations, or heavy passenger flow during holidays: the frequency of prediction and execution increases dramatically, but network jitter intensifies. Traditional centralized cleaning and static threshold strategies are unable to filter out erroneous receipts in real time, causing the next round of predictions to be distorted based on the latest operating conditions. This in turn accumulates deviations and triggers a chain of erroneous deployments, resulting in serious consequences such as insufficient drainage pump power, unbalanced traffic signals, or overload on the power grid.
[0006] To this end, the present invention provides a resilient city resource allocation method and system based on blockchain and edge computing. Summary of the Invention
[0007] (1) Technical problems solved
[0008] In response to the shortcomings of the existing technology, the present invention provides a resilient urban resource allocation method and system based on blockchain and edge computing, in which cross-departmental resource rescheduling is completed by rolling optimization of an adaptive decision-driven system; the execution receipt is mapped as an incremental patch written back to the local state tensor and the node trust weight is dynamically adjusted. When the coverage and weight increase meet the trigger strategy, differential shearing training is started and a new structural fingerprint and model signature are generated, which can ensure the efficient and reliable dynamic allocation of urban public resources in emergency scenarios and the synchronous evolution of sustainable learning, thereby solving the technical problems recorded in the background technology.
[0009] (2) Technical solution
[0010] To achieve the above objectives, the present invention is implemented through the following technical solutions: a blockchain-based and edge computing-based resilient city resource allocation method and system, including completing spatiotemporal alignment and semantic normalization processing of multi-source real-time data, generating a local state tensor containing self-checking metadata, and caching it in a ring buffer queue in a secure zone for persistent storage;
[0011] The gradient summary is formed by combining clipping gradient with differential privacy mask, and the dynamic trust weight is weighted and aggregated to synchronize the iterative model version signature and output the network-wide consistent weight vector for use in the next round;
[0012] The compressed prediction tuple is concatenated with the structural fingerprint and model signature to generate a prediction hash, which is broadcast in batches according to priority and written into the permission chain through Byzantine consensus to obtain a time stamp and synchronization mark;
[0013] A dual-threshold judgment is performed on the weighted risk curve within the sliding window. When the conditions are met, a multi-signature template is instantiated to generate a deployment intention and broadcasted to the sidechain message bus for real-time delivery.
[0014] Sharded documents are received through a zero-round-trip handshake, and the adaptive decision driver integrates multi-source state rolling optimization control sequences and issues them in parallel with cloud-based corrections, with performance receipts recorded on-chain.
[0015] The retrieval receipt calculates the quality score and generates incremental patch weights, which are then fused into a tensor. The patch coverage and trust weight increase are used to determine whether differential clipping training is triggered and the new fingerprint and version are cached for federated aggregation.
[0016] Furthermore, the timestamp of the external sensor message is corrected at the microsecond level through a constant temperature crystal oscillator, and the moving coordinates are dynamically patched in combination with the Kalman filter;
[0017] A semantic template with feedback is used to merge multiple vendor fields into a unified indicator, and the corrected data is then written into a ring buffer queue protected by a one-time key to ensure the spatiotemporal consistency and confidentiality integrity of the original state frame.
[0018] Furthermore, we use depthwise separable convolution combined with channel attention weights to filter out redundant features, and use gated recurrent units to fuse short-term fluctuations with long-term trends.
[0019] After stacking the continuous gated outputs into a local state tensor along the newly added time dimension, double hashing is performed to generate the structural fingerprint and a one-to-one mapping between the tensor and the fingerprint is cached locally.
[0020] Furthermore, when calculating the local gradient, a temperature modulation coefficient is introduced to enhance the gradient amplitude of rare high-impact samples. The gradient vector is amplitude clipped and then superimposed with differential privacy noise based on structural fingerprints. Threshold Huffman coding is used to generate byte-level gradient summaries.
[0021] Furthermore, the aggregation layer constructs a weighted cosine similarity matrix for the uploaded gradient summaries, detects abnormal nodes with angles exceeding the threshold, and lowers their trust weights;
[0022] After filtering, local averaging of homogeneous clusters and global fusion with soft gating are used to generate new weights, and rolling hashing is used to generate the model version signature sequence.
[0023] Furthermore, after loading the global weight inference on the local state tensor, the confidence interval is obtained through Monte Carlo sampling and compressed into a prediction tuple, which is then concatenated with the structural fingerprint and model signature to generate a prediction hash, and the transaction priority is set according to the trust weight.
[0024] Furthermore, the predicted hash transactions are batch packaged within the homogeneous cluster and enter the Byzantine fault tolerance process of the entire network through layered broadcasting; the voting rounds are automatically adjusted according to the transaction macro iteration flag, and the block hash is cross-checked after being written into the permission chain in parallel on the multi-shard accounting nodes.
[0025] Furthermore, the smart contract applies a nonlinear threshold function to the risk value of each scenario within a sliding window, accumulates the historical window with exponential decay, and then calculates the global risk score based on the scenario weights.
[0026] A trigger signal is generated when the score exceeds the set threshold and the slope is greater than the minimum growth rate.
[0027] Furthermore, the scenario-resource-action template is pre-deployed on the chain, which maps the risk threshold value to the resource demand ratio through a piecewise function and embeds a multi-signature permission tag.
[0028] The deployment intention is encapsulated as a seven-segment JSON-LD document, and the document hash is written to the permission chain to synchronize the side chain broadcast.
[0029] Furthermore, the sidechain node allocates the intention according to the MTU fragmentation and inserts the chain hash endorsement, uses a zero round-trip handshake to complete the identity negotiation and receive the target subsystem status message;
[0030] High-priority traffic uses an exponential backoff retransmission strategy, and low-priority traffic uses a linear backoff strategy.
[0031] Furthermore, the execution subsystem integrates local real-time telemetry, neighboring shared status and historical receipts to construct a state tensor, generates an influence coefficient matrix through a graph attention network, and rollingly optimizes multi-objective functions under the edge-cloud collaborative framework to form a control sequence, and records performance receipts on the chain after execution.
[0032] Furthermore, receipts are retrieved in the permission chain through a double-level index of Bloom filter and skip list, and an incremental patch is generated after calculating the new quality score and written into the local state tensor. At the same time, the node trust weight is dynamically adjusted according to the patch quality.
[0033] Furthermore, weighted deep separable convolution is used to fuse the most recent patches to form a new tensor, and the patch coverage and trust weight increase are used to determine whether differential shearing training is triggered. After training, the new structural fingerprint and model version signature are output and cached for subsequent federated aggregation.
[0034] The resilient city resource allocation system based on blockchain and edge computing includes:
[0035] The alignment and normalization module performs spatiotemporal alignment and semantic normalization on multi-source real-time data, generates a local state tensor containing self-checking metadata, and caches it in a ring buffer queue in the secure zone for persistent storage.
[0036] The gradient aggregation module forms a gradient summary by combining clipped gradients with differential privacy masks. After dynamic trust weighted aggregation, the model version is signed synchronously and iteratively, and a consistent weight vector for the entire network is output for use in the next round.
[0037] The hash consensus module concatenates the compressed prediction tuple with the structural fingerprint and model signature to generate a prediction hash, broadcasts it in batches according to priority, and writes it into the permission chain through Byzantine consensus to obtain a timestamp and synchronize the mark;
[0038] The risk assessment module runs a dual-threshold assessment on the weighted risk curve within the sliding window. When the conditions are met, it instantiates the multi-signature template to generate the deployment intention and broadcasts it to the sidechain message bus in real time.
[0039] The decision-making distribution module receives sharded documents through a zero-round-trip handshake. The adaptive decision driver integrates multi-source state rolling optimization control sequences and distributes them in parallel with cloud-based corrections, and records performance receipts on the chain.
[0040] The patch training module retrieves receipts, calculates quality scores, generates incremental patch weights, and fuses them into tensors. It triggers differential shear training based on patch coverage and trust weight increases, and caches new fingerprints and versions for federated aggregation.
[0041] (3) Beneficial effects
[0042] The present invention provides a method and system for allocating resilient urban resources based on blockchain and edge computing, which has the following beneficial effects:
[0043] With structural fingerprints, model version signatures and permission chain consensus as the main lines, data collection, prediction generation, risk assessment, deployment and implementation, and feedback learning are connected from beginning to end, forming a complete governance chain from on-site perception to on-chain decision-making to closed-loop self-evolution, greatly improving the forward-looking insight and response consistency of urban public services to emergencies.
[0044] The combination of lightweight extraction at the edge nodes and federated training enables massive terminals to continuously contribute incremental knowledge without exposing original information. The linkage of Byzantine filtering, structural fingerprinting, and dynamic trust weights not only suppresses malicious data but also incentivizes high-quality nodes, promoting high-trust collaboration in a decentralized environment and jointly building a secure and privacy-friendly city-level learning ecosystem.
[0045] The dual-layer mechanism of permissioned chain and side chain allows important decision-making transactions to be written into the main chain for evidence storage, while high-frequency control flows pass through the side chain at high speed; sharded parallel accounting, seven-segment document path and multi-signature permission cross-verification complement each other, ensuring the immutability and traceability of cross-departmental resource allocation, and reducing main chain congestion through flexible off-chain communication.
[0046] The adaptive threshold curve, coverage trigger strategy and differential shear training jointly construct a multi-layer dynamic tuning system: the risk assessment curve automatically bends according to the scenario to avoid false alarms, the patch trigger logic uses multiple indicators to prevent wasted computing power, and the model update adopts differential freezing to accelerate convergence and avoid forgetting. The three are connected to ensure that the system maintains low disturbance during daily stable periods and agile transitions during extreme shocks, reflecting the coordinated balance of resilience and stability.
[0047] Scenario templates, resource quantitative mapping and adaptive decision drivers jointly achieve the precise implementation of "intention-action"; template version hashing allows the allocation logic itself to enter the blockchain governance domain, and the resource segmentation function makes the allocation intensity and risk level linear-quadratic progressive. The adaptive driver then fine-tunes the execution amount according to the on-site status, and multi-layer gradient control avoids a one-size-fits-all approach.
[0048] The feedback receipt quality assessment function introduces vector norm and matrix projection, integrating error amplitude and directional consistency with only a single adjustable coefficient, effectively filtering out noise; patch weights incorporate freshness decay and are dynamically injected into the model through deep separable convolution, achieving a reasonable decrease in data value over time and continuous evolution of the model with the environment. Ultimately, the intelligence of the entire network increases cumulatively with the length of operation, presenting a long-term gain effect of cross-layer self-driving and collaborative optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flow chart of the resilient city resource allocation method of the present invention;
[0050] Figure 2 This is a schematic diagram of the results of the resilient city resource allocation system of the present invention. DETAILED DESCRIPTION
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0052] See also Figure 1 The present invention provides a method and system for allocating resilient urban resources based on blockchain and edge computing, including:
[0053] The real-time operation of resilient cities places extremely high demands on the integrity, timeliness, and credibility of information flows. Especially in extreme weather conditions or sudden surges in passenger flow, if key situational features cannot be captured and analyzed promptly at the source of the data, any subsequent federated training, on-chain consensus, and resource allocation will lose their accurate benchmarks. Therefore, this invention sets edge node feature extraction as the first checkpoint of the entire method. With the help of lightweight models and unified semantic templates, while ensuring privacy and computing power friendliness, the original multi-source data is upgraded to a local state tensor that can directly participate in downstream collaboration, laying a foundation for temporal and spatial consistency, semantic consistency, and security consistency for the entire link.
[0054] Step 1: After the edge node completes the spatiotemporal correction, semantic unification, and security isolation of the distributed and heterogeneous real-time observation stream, it lightweight compresses it to generate a unified and trusted local state tensor and caches it in the local security zone, laying a consistent and high-quality data foundation for subsequent federated training and blockchain collaboration.
[0055] The step 1 includes the following:
[0056] Step 101: Spatiotemporal semantic alignment and safe frame modeling
[0057] Aiming at spatiotemporal, semantic, and security alignment, the distributed perception sources are aggregated in real time, and traceable, highly consistent raw data orchestration is completed within the edge nodes, providing clean input for subsequent feature extraction. The following features are included:
[0058] City-level sensing networks often experience data fragmentation due to differences in device vendors, inconsistent messaging protocols, and clock drift, making it difficult for back-end algorithms to form a globally consistent view within millisecond windows. Edge nodes first utilize the highly stable reference clock provided by their local oven-controlled crystal oscillator to perform microsecond-level corrections on the raw timestamps of connected traffic flow meters, weather stations, and energy meters. Kalman filtering is also used to dynamically correct the coordinate differences between GPS tracks and fixed base station coordinates, ensuring sub-meter accuracy of trajectory data relative to the static reference coordinate system, thereby achieving consistent spatiotemporal annotation across sensors. Through dual hardware-algorithm alignment, clock and coordinate errors are prevented from interfering with subsequent feature window segmentation.
[0059] The corrected raw data vectors are automatically matched to a unified field through the semantic template mapping layer. For example, WindSpeed (km / h) is mapped to WS as a wind speed metric. Synonymous merging is then performed on anomalous fields. This process utilizes a weighted graph convolutional network with minimal storage and adaptively adjusts the field similarity threshold based on historical mapping confidence. This reduces template maintenance costs and allows for automatic scalability as devices are introduced. This allows for cross-vendor field semantic exchange without compromising privacy, eliminating naming ambiguity for feature extraction.
[0060] To prevent the leakage of original sensitive data, the node writes the corrected and mapped streaming data into a local security zone - this zone is encapsulated by a trusted execution environment, which uses a circular buffer queue and a one-time key encrypted storage, while only exposing the summary to the external monitoring process.
[0061] Data integrity is verified using Merkle tree incremental hashing, enabling even the slightest tampering to be diagnosed within milliseconds. Hard isolation combined with key rotation ensures confidentiality and integrity during data transfer at the edge, supporting subsequent hash fingerprint generation.
[0062] When the buffer queue accumulates to the set window, the node generates the original status frame in a unified format :
[0063]
[0064] Where: original data vector : Single sensor In time slice The correction vector of , whose value range is the upper limit of each index; used for subsequent convolution window processing;
[0065] Window number : Sliding window label; the value range is a positive integer; used for time series slicing;
[0066] Total number of sensors : The number of active sensing sources of the current node; the value range is a positive integer; used for column splicing boundaries
[0067] When used, multi-source observations are spliced into a unified high-dimensional frame, which facilitates the next step of directly extracting features according to the tensor dimension. Through the four-step continuous operation of spatiotemporal coupling, semantic mapping, security isolation, and frame modeling, highly heterogeneous and potentially distorted original streams are unified into a structured and reliable original state frame. , significantly reducing the first-frame latency of fragment analysis. Furthermore, a ring buffer and partition key rotation, combined with Merkle incremental hashing, create a data fidelity mechanism that relies solely on edge nodes, eliminating the need for centralized certificate distribution and reducing the management costs of large-scale urban deployments. Semantic templates, which rely on the self-growing knowledge graph, also automatically learn fields when new devices are online, eliminating manual data entry bottlenecks. This gives the city perception network "plug-and-play" elastic scalability, improving the overall efficiency and security of data source access.
[0068] Step 102: Lightweight feature compression and tensor generation
[0069] Based on the original state frame of the local safe zone, a lightweight convolution-attention hybrid network that can be afforded by low computing power is used to extract multi-scale spatiotemporal semantic features, which are finally assembled into a local state tensor as input for cross-node federated training. Directly inputting high-dimensional original frames into subsequent models not only consumes huge computing power, but may also write invalid noise into the chain, wasting bandwidth and storage. Therefore, information compression must be completed in advance at the edge node while retaining key prediction signals.
[0070] The node loads the depth-wise separable convolution to first scale the column channels and then pass the attention weights:
[0071]
[0072] Assign different significance to each channel, retain the top percentile channels and discard long-tail noise. This significantly reduces the feature dimension without introducing a large model, freeing up computing power for subsequent time series modeling.
[0073] Among them: channel attention weight : The value range is 0 to 1, used for channel screening; weight vector : Model trainable parameters, the value range is a real number vector; activation function : Use Swish activation; the output value range is positive real number, enhancing nonlinearity;
[0074] Applying gated recurrent units on compressed features, through the gate vector :
[0075]
[0076] Adaptively capture short-term fluctuations and slow trends and integrate them into memory units.
[0077] Gate Vector : Timing selection factor, the value range is , used to weigh fast and slow dynamics;
[0078] Fusion weight : A trainable scalar with a value range of , used to adjust memory decay;
[0079] Weight Matrix : Model parameters, the value range is a real number matrix, used to map feature dimensions;
[0080] Bias vector : Model parameter, the value range is real number, used to eliminate linear offset;
[0081] Thus, gating is used to suppress transient spike noise while preserving trend information, thereby enhancing the sensitivity of the tensor to early signs of extreme events.
[0082] Will continue The gated outputs are stacked along the newly added time dimension to obtain the local state tensor :
[0083]
[0084] Where: local state tensor : 3D tensor; dimension is ; used for federated training input;
[0085] Time Window : tensor time depth; the value range is a positive integer, which determines the length of short-term memory;
[0086] It is a tensor stacking operator that sequentially concatenates input vectors along the newly introduced time dimension, preserving the original channel layout and automatically adding metadata for subsequent verification by the morphology self-check module.
[0087] Number of compression channels : The number of channels retained after attention screening, the value range is a positive integer, which affects the feature density;
[0088] Among them, the tensor morphology self-check module ensures dimension alignment through metadata verification to prevent abnormal frames from causing subsequent training gradient explosion or convergence failure.
[0089] Double hashing of tensors to generate structural fingerprints :
[0090]
[0091] Where: structural fingerprint : Hash value, the value range is a fixed-length bit string, used for integrity verification before writing on the chain;
[0092] One-time hash function : Lightweight, high-speed asymmetric hashing (such as BLAKE3); secondary hashing function : A hash with higher collision resistance (such as SHA-3-256) will The output is hashed again as input;
[0093] When in use, a unique fingerprint is generated for quick comparison during subsequent permission chain consensus, reducing on-chain storage pressure while ensuring tensor consistency.
[0094] Through the spatiotemporal coupling-semantic mapping-security isolation-frame modeling chain operation in step 101, multi-source observations are quickly cleaned and merged into original state frames within the edge node, solving the dual hidden dangers of data fragmentation and privacy leakage; then, with the help of the channel attention compression-temporal gated embedding-tensor assembly-fingerprint encryption process in step 102, redundant high-dimensional data is compressed into a local state tensor with a unique structural fingerprint, providing high signal-to-noise ratio and traceable input for subsequent federated training.
[0095] The original state frame output by the previous step Become the next step to build the local state tensor Direct materials; structural fingerprint generated after the completion of the latter step With tensors This will be used as the gradient summary mapping benchmark in step S2 to ensure that the model iteration process corresponds to the data source.
[0096] Complete the original state frame under the limited computing power of the edge node The efficient compression removes redundant features while retaining key signals, reducing the communication burden and decoding time required for subsequent federated training. The gated recurrent unit introduces a trainable decay constant, giving the model self-regulation capabilities, reducing the memory burden during stable events, improving sensitivity during periods of imminent risk, and achieving dynamic allocation of computing resources. Morphological self-checking and meta-tag design ensure that local state tensors Quality is perceptible, allowing poor-quality data to be rejected early in the chain, avoiding garbage in and garbage out. The introduction of double hash fingerprints not only provides integrity verification but also reduces block size through short hash codes, improving permissioned chain throughput.
[0097] Resilient cities need to map the ever-changing on-the-ground situation into a coherent prediction model in real time, and the prediction model must evolve simultaneously in different neighborhoods without leaking any sensitive data, relying on federated training completed on the edge side.
[0098] Step two, the gradient summaries calculated by each edge node based on the local state tensor are safely converged, and a consistent iteration model version identifier is output within a short time window, laying a unified model foundation for subsequent on-chain evidence storage and intention evaluation.
[0099] Step two includes the following:
[0100] Step 201, gradient summary safe extraction and trust encoding
[0101] The number of city-level perception nodes is large and heterogeneous, and uploading complete gradients directly will consume network bandwidth and expose privacy, so there is an urgent need for a gradient summary mechanism that is both concise and secure; at the same time, the data distribution of different nodes is significantly different, and traditional mean aggregation is easily affected by the data dominance phenomenon of main roads or densely populated areas, so it needs to be suppressed by an interpretable weight. Therefore, the following method is adopted: each node takes the local state tensor as input, and constructs a loss function gradient queue through a micro-batch self-play strategy;
[0102] An adaptive temperature modulation coefficient is introduced at the end of the loss function chain to maintain sensitivity to rare but high-impact scenarios in the gradient direction. The gradient vector derived from this is subjected to coordinate clipping, retaining only components with amplitudes above the node's internal dynamic threshold, forming a preliminary screening gradient set:
[0103]
[0104] In the formula: is the gradient clipping operator. If the absolute value of any component of the input gradient exceeds the threshold , it is truncated to the threshold boundary, otherwise the original value is maintained; the clipped gradient vector : the clipped gradient calculated by the node in time slice ;
[0105] Loss function : the training objective (such as weighted cross-entropy or smoothed L1) set by the edge node for the local state tensor ;
[0106] Model layer weight : the parameter matrix or vector of the th layer of the federated model;
[0107] Clipping threshold : the amplitude lower bound adaptively set by the node.
[0108] To prevent attackers from reconstructing local data distribution through multiple rounds of gradients, nodes add Laplacian noise to the gradient vector Superimpose Laplacian noise and structure fingerprint Seed-driven pseudo-random generator to keep the same time slice noise statistically independent between different nodes; At the same time, use noise bidirectional compensation strategy to offset noise components at the subsequent aggregation end, and ensure the global convergence speed.
[0109] Nodes calculate trust weight coefficients according to their own historical consensus contribution, local data novelty and network latency; Then use threshold Huffman coding to compress the mask gradient exponentially, and only upload the sign and relative amplitude index pair to realize byte-level gradient summary. The compression result and weight combination are packaged as node gradient summary package and pushed to the upstream node of the ring interconnection topology for aggregation.
[0110] When used, it can reduce the computational burden of edge nodes, and for the first time in the edge federation scene, it explicitly injects "rare high-impact samples" into the gradient direction through temperature modulation, allowing the model to have a training opportunity in advance when facing extreme scenarios; The idea of binding differential privacy mask and structure fingerprint associates noise seed and data integrity, overcoming the inherent unverifiable problem caused by traditional independent noise generation; Threshold Huffman coding and trust weight are bidirectionally coupled, making communication compression and node contribution adjustment integrated, saving bandwidth and forming a self-driven incentive.
[0111] Step 202, Byzantine filtering and weight consistent aggregation
[0112] In a decentralized environment, it is difficult to ensure model consistency through node-to-node broadcast alone, and if robust aggregation is lacking, the influence of abnormal or malicious nodes will be amplified; Therefore, after the gradient summary stream enters the aggregation layer, stable merging is achieved through Byzantine filtering and weight tuning, and an iterative model version identifier is generated in real time;
[0113] Introduce a weighted cosine similarity matrix to compare gradient summary directions pair by pair, and mark a summary as suspicious if the angle between it and the weighted center vector is greater than a threshold; The node set automatically initiates a quick vote, and if two-thirds of the nodes agree, the summary is removed and its trust weight is reduced, ensuring that malicious or abnormal data cannot influence the model.
[0114] After filtering, according to the trust weight uploaded by each node, use a soft gating mechanism to assign aggregation coefficients, and perform hierarchical averaging: first make local average within homogeneous data clusters, then linearly fuse local results according to global weights to get new iteration weight vector :
[0115]
[0116] In the formula: new weight vector : This round of network-wide consistent model parameters; node weight : Soft gating coefficient after filtering adjustment; node weight vector :node The amount of weight update after decoding; the total number of nodes : The number of valid nodes participating in the current aggregation.
[0117] The aggregator adds the new weight vector Perform consecutive block hashing to generate a signature sequence of increasing length;
[0118] The node verifies the consistency of the model based on this, without having to compare all parameters, reducing communication costs. This signature is subtracted from the previous version signature. If the difference hash is lower than the threshold, it is marked as a micro-iteration; otherwise, it is marked as a macro-iteration, triggering the subsequent threshold evaluation function to re-adjust the threshold.
[0119] Finally, the aggregator broadcasts the signature sequence along with the version number and the generated timestamp to the entire network, and the node then sends the new weight vector Write the local model snapshot, update the local state machine, and record the difference between the previous version number and the current version number in the metadata, providing a complete genealogy for subsequent on-chain evidence storage and fault rollback.
[0120] When used, the model weights can still reach each node quickly and reliably under harsh network conditions and potential attacks, and digital signatures are used to ensure that any subsequent prediction summaries can be associated with a unique model version identifier.
[0121] This step 2 condenses the information contained in the local state tensor into a secure and exchangeable gradient summary through the computational compression and privacy masking of step 201. Then, in step 202, Byzantine filtering is used to ensure the credibility of the summary, a dynamic weighting strategy is used to balance the influence of nodes, and hash signatures are used to complete the consistent version broadcast. Finally, all nodes in the entire network synchronously obtain the iterative model version identifier.
[0122] When used, the phased penalty mechanism of Byzantine filtering changes the crude strategy of discovery and elimination, and reduces the misjudgment rate and the probability of benign nodes being accidentally damaged through continuous rounds of verification; the aggregation method of local averaging of homogeneous clusters and then global soft gating breaks the traditional single-layer weight averaging idea, making the data contribution of different areas of the city fairer and more in line with local reality; rolling hash signatures and macro-micro iteration distinctions achieve lightweight model version management and self-adjustment of event sensitivity, solving the problem that traditional models cannot quickly mark important transitions; differential patch snapshots ensure that the historical lineage of the model can be traced, while avoiding the storage explosion caused by frequent chain writes.
[0123] After federated training outputs model weights and version signatures that are consistent across the entire network in step 2, if the prediction information obtained by each edge node based on the new model reasoning cannot be written into the permission chain in a timely manner and a trusted time sequence is attached, then the on-chain smart contract will not be able to perform threshold assessment based on this, which will lead to a delay in the generation of deployment intentions and weaken the pre-emptive response capabilities of urban public services.
[0124] Step 3: The prediction summary generated based on the latest model weight inference and the model version signature are hashed and written into the permission chain, and the transaction is strictly time-stamped through the Byzantine fault-tolerant protocol to build a unified and tamper-proof prediction sequence across nodes.
[0125] The step three includes the following:
[0126] Step 301: Prediction summary packaging and transaction generation
[0127] The operating status of a city is highly dynamic. Only by allowing each edge node to perform real-time inference and generate a structured prediction summary based on the latest local model weights, and then securely encapsulate it into a transaction package, can the on-chain data maintain a high-fidelity mapping of the on-site situation. Therefore, this step revolves around four technical points: local reasoning, uncertainty quantification, hash encapsulation, and transaction generation.
[0128] Edge nodes load global weight parameters After that, the current local state tensor Perform forward inference to obtain the prediction vector:
[0129]
[0130] Monte Carlo Dropout is also used to sample the output distribution multiple times, calculate the predicted mean and quantile width, and obtain a confidence interval for downstream threshold assessment. This approach not only preserves the numerical prediction but also injects confidence information in advance, allowing the smart contract to dynamically adjust the judgment rules based on the confidence level.
[0131] Where: prediction vector : Quantitative prediction of future time periods by nodes;
[0132] Model Function : Load the inference graph of the latest weights. The function contains modules such as channel attention layer, gated recurrent unit, and fully connected mapping. It is encapsulated in an end-to-end mapping of input tensor → output prediction vector to ensure that the inference logic of different edge nodes is consistent under the same weight version.
[0133] To prevent on-chain storage redundancy, the node compresses the predicted mean and quantile width into two scalars through double exponential smoothing, and then combines the prediction time window length and geographic label to form a compressed tuple. This compression retains the main information but significantly reduces the amount of chain bytes written, providing bandwidth space for large-scale node concurrent writing.
[0134] The node compresses the tuple , structural fingerprint And the top hash of the model version signature sequence After splicing in a predetermined order, perform one-way hashing to generate a predicted hash :
[0135]
[0136] This hash is bound to the transaction number, and any subsequent node only needs to compare the predicted hash The consistency of data content, source fingerprint and model version can be verified at one time.
[0137] Where: Prediction Hash : transaction content integrity check value; compressed tuple : Predict mean, quantile width, time window and geographic label;
[0138] Eventually, the node will compress the tuple , structural fingerprint And the top hash of the model version signature sequence And the local node logo is packaged into a transaction, based on the trust weight Priority tags are set for transactions; the transaction header also carries a micro-iteration or macro-iteration flag to guide the next step in dynamically adjusting voting rounds in the consensus sorting.
[0139] When in use, step 301 completes the conversion from real-time data to verifiable on-chain transactions through the chain operation of local reasoning-compression-hash encapsulation-priority transaction, ensuring that the prediction summary still has the triple features of source traceability, version verification and priority perception at the minimum byte size.
[0140] When used, by introducing Monte Carlo sampling and double exponential smoothing compression on the edge node side, the solution quantifies uncertainty information into the prediction summary without increasing inference latency, making the on-chain data both numerical and confident.
[0141] The hash encapsulation brought by the binding of structural fingerprints and version signatures ensures that any transaction can be traced back to a specific data batch and model iteration, solving the pain point of traditional prediction write chains lacking clear version associations; priority labeling combines the dual factors of trust weight and scenario severity to provide a clear criterion for subsequent high-concurrency transaction sorting, avoiding the problem of key transactions being overwhelmed by simple FIFO queues in the past.
[0142] Step 302: Layered consensus and sequential write chain
[0143] Predictive summary transactions require rapid chain writing under strong Byzantine assumptions, otherwise they will block threshold evaluation. Traditional PBFT is prone to communication explosion in scenarios with many nodes and frequent messages, so this step reshapes the consensus process by layering four technical points: broadcast, threshold voting, timing lock, and multi-copy confirmation.
[0144] After entering the consensus network, the transaction is first batch-packaged according to node priority within the homogeneous cluster. The cluster transaction sorting uses local logical clock to avoid the synchronization clock overhead of the entire network. The batch threshold can be dynamically expanded, actively increasing the batch size when network load increases, reducing the number of broadcasts, and maintaining stable network delay.
[0145] After the cluster representative node broadcasts the batch transaction to the entire network, each node votes according to the coverage rate. When receiving more than a stable percentage of confirmation packets, it can enter the next round. If the transaction header identifier macro iteration, the system automatically increases a round of voting to prevent important model transition from being affected by malicious nodes.
[0146] By introducing a verifiable delay function, a timing lock is assigned to each batch of transactions to ensure that transactions cannot be queued before the earliest unlock point. At the same time, Byzantine filtering is performed on the transactions within the batch. If a predicted hash Contradicts the historical record, automatically mark the abnormal node and reduce its future voting weight.
[0147] When the batch passes the final voting, multiple accounting nodes write transactions in independent shards in parallel, and exchange block hashes with each other. Only when all shards return consistent hashes can the consensus end be declared and the block number and timing stamp be broadcast. This mechanism reduces the probability of single-chain congestion and enhances fault isolation capability.
[0148] In use, step 302 redesigns the Byzantine fault-tolerant process through four chain actions, ensuring the safety threshold while reducing communication complexity to a layered scale, achieving low-latency entry of high-concurrency predictive transactions into the chain. Layered broadcast uses dynamic batch scaling to respond to network fluctuations, reducing communication costs, while batch indexing and shard writing design allows nodes to maintain low-latency consensus even in the face of super-concurrent scenarios; threshold voting introduces confidence dimensions and macro iteration safety levels, allowing the algorithm to automatically enhance defense during important model transitions, reflecting the importance of scenario-awareness; the timing lock of the verifiable delay function and the version signature collation linkage block the pre-emptive attack and version rollback vulnerabilities; shard multi-copy writing and patch block mechanism further refine the fault isolation granularity to logical shards, significantly improving the continuous availability of permissioned chains in harsh networks or hardware failures.
[0149] Step three compresses the real-time prediction vector and merges it with the structural fingerprint and model version signature to generate a prediction hash, which is then packaged into a priority transaction; subsequently, in step 302, the transaction completes the Byzantine consensus through hierarchical batch broadcasting, multi-round threshold voting, time lock, and sharding multi-copy four-level protection and is written into the permissioned chain. As a result, a prediction summary of only a few dozen bytes is securely bound with its source data and model version, and obtains a consistent timestamp across the network.
[0150] Step three has already combined the prediction hash from each edge node, the model version signature, and the structural fingerprint Write into the permissioned chain in strict chronological order, thus forming a trusted prediction stream covering the real-time situation of the city. If the degree of change in these prediction streams cannot be evaluated on the chain and immediate cross-departmental deployment is triggered, it will only fall into an inefficient cycle of after-the-fact remediation. Step four takes the continuous prediction summary as input, fine-tunes the risk level through a threshold evaluation function, and then synthesizes a deployment intention with a verifiable path inside the smart contract, enabling traffic, energy, medical, and other execution subsystems to respond synchronously from the same trusted source. Due to the high diversity of urban scenarios, the threshold cannot be fixed; therefore, the following solution is adopted:
[0151] Step four, based on the continuous prediction summary in the permissioned chain, adaptively calculates the risk score, so that the smart contract generates a deployment intention with a verifiable path and submits a sidechain message bus when the threshold is triggered.
[0152] Step four includes the following:
[0153] Step 401, continuous prediction risk assessment and trigger determination
[0154] Single-point predictions are often affected by accidental noise. If the first anomaly is directly used as a trigger signal, it will cause frequent scheduling, and conversely, if the threshold is too high, it will miss the opportunity for disposal; therefore, it is necessary to integrate multi-window sequences, node trust weights, and scenario semantics to make stable and interpretable quantitative assessment of risks.
[0155] The on-chain smart contract first extracts a sliding window of length from the timestamp . Since is only a hash, the contract calls an external oracle to map it back to the compressed prediction tuple and trust weight . Each record in the window is sorted by node trust weight and archived in a homogeneous cluster sub-buffer, ensuring the stability and traceability of subsequent calculations. By clustering and archiving, complementary information is aggregated in advance, reducing the complexity of subsequent function operations.
[0156] The contract calculates the risk benchmark for each type of scenario (traffic, energy, security) in the window. Let the scenario weight The trust-weighted prediction mean is preset by the regulatory authority, and is calculated according to:
[0157]
[0158] The calculation result is input into a nonlinear threshold function:
[0159]
[0160] wherein, and are corrected online according to the season and time period;
[0161] The nonlinear threshold function output is the result of mapping the weighted prediction mean to the risk scale through an exponential curve, and is used for subsequent global risk accumulation and threshold comparison.
[0162] The number of scenario nodes, which is the number of nodes in the scenario The scenario The number of edge nodes that successfully upload the prediction summary and pass the filtering is a positive integer, which can change with the scenario and network state.
[0163] The scenario weighted prediction mean describes the overall risk level of the scenario in the time slice The scenario The weighted prediction mean of all valid edge nodes uploaded by the scenario (such as traffic, energy, security, etc.) is a comprehensive value after weighting according to the trust weight, reflecting the overall risk level of the scenario in the current window;
[0164] Trust weight : The soft gating weight determined in step two, with a value range of 0 to 1, used to reflect the prediction credibility; Prediction mean
[0165] : The smoothed prediction value of the node in the time slice ; a real number; used to evaluate the risk intensity; Scenario weight : The management priority of the scenario; a positive real number; used to multiply the risk value to enter the global synthesis;
[0166] : The upper limit risk coefficient of the scenario; a positive real number; used to control the saturation value at the top of the threshold;
[0167] : The sensitivity coefficient of the scenario; a positive real number; used to adjust the steepness of the curve;
[0168] : The sensitivity coefficient of the scenario; a positive real number; used to adjust the steepness of the curve;
[0169] When used, the nonlinear threshold curve allows the system to remain stable in low-risk sections and quickly approach the upper limit in high-risk sections, taking into account both stability and sensitivity.
[0170] Contract pair continuous window Perform weighted accumulation, where the historical window weight decays exponentially; at the same time, if a node has The trust weight of the item marked as abnormal by the Byzantine filter in this window will be linearly reduced and participate in this round of fusion, and the final global risk score is:
[0171]
[0172] Where: exponential decay coefficient : ;The impact of decaying memory on the long-term window;
[0173] Global risk score : Used to compare with the threshold to determine whether it is triggered; is the window length, is the lagging index;
[0174] For the scene In time slice Risk scale calculated by nonlinear threshold function;
[0175] When used, the dual weighting of dynamic trust and exponential decay can quickly respond to the latest situation without being misled by short-term anomalies.
[0176] When the global risk score Exceeding the scene threshold And the increase is higher than the slope threshold When the contract is triggered, it marks the trigger as established and records the trigger timestamp; at the same time, if the model version signature If it is different from the previous trigger event version, a model transition tag is added, and the trigger signal then enters step 402.
[0177] In use, dual threshold determination prevents slow drift triggering and avoids repeated on-off switching at the edge of oscillation. A three-layer buffering approach sorts the prediction sequence across multiple dimensions, both semantically and temporally, significantly enhancing the contextual integrity of risk assessment. The coordinated adaptation of dynamic weights and threshold curves allows the system to maintain a consistent match between urban rhythms and emergencies without manual intervention. The combination of exponential decay and a cool-off period lock algorithmically suppresses chained false triggering, resolving the issue of repeated alarms in noisy environments with traditional threshold systems.
[0178] Step 402: Multi-signature deployment intention generation and path proof
[0179] Once a trigger event is established, resources need to be coordinated across departments. However, different systems have very different requirements for resource units, scheduling delays, and execution permissions. Therefore, a structured deployment intention is needed that can not only embed quantified resource requirements but also come with multi-level permissions and verifiable paths to ensure that each execution subsystem is trusted and easy to parse.
[0180] Several scenario-resource-action ternary templates are pre-deployed on the chain. When the trigger signal enters the contract, the template is first located according to the scenario label, and then the global risk score is calculated. Fill in the resource demand percentage field; the contract queries the real-time resource balance through the interface to ensure that the generated demand does not exceed the current available limit. The template design ensures a unified output structure and is easy to parse across multiple systems.
[0181] Resource demand ratio According to the piecewise function:
[0182]
[0183] Map risk-exceeding threshold segments to linear or quadratic growth demands.
[0184] Where: Parameter : linear slope, positive real number, controls the initial response speed; parameter : quadratic coefficient, positive real number, controls the growth rate of high-risk sections; threshold expansion : The inflection point from the linear to quadratic segment is a positive real number that defines the boundary of the risk interval;
[0185] When used, segmented mapping allows resource scheduling to be gentle at low and medium risks, and quickly increased at high risks.
[0186] The contract embeds multi-level permission tags in the resource demand list: the municipal competent department has the main control right, and the district-level departments and enterprise operators have the coordination right; through the multi-signature mechanism on the chain, each type of resource must be signed by more than half of its permission set before it is broadcast on the side chain. This labeling process calls the node identity certificate and model version signature Verification ensures that the call chain is traceable. The multi-signature permission system prevents a single entity from accidentally triggering a large amount of resource waste.
[0187] The contract will allocate intention This is encapsulated as a JSON-LD document, containing a five-step path: source prediction hash, model version, threshold function, resource list, and permission signature. The document hash is written back to the permission chain and simultaneously pushed to the sidechain message bus. Upon receiving the message, the execution subsystem can quickly verify the document hash and permission signature on the permission chain to determine the execution order. This dual-write of the document and hash enhances the verifiability and persistence of deployment intent.
[0188] Asynchronous iteration of templates combined with version hashing allows the deployment logic itself to enter the blockchain traceability system, achieving equal credibility of processes and data; the segmented mapping of resource requirements and the feedback closed correction mechanism ensure that the deployment scale is gradually optimized with the actual execution results, rather than remaining unchanged; the multi-signature authority with an emergency proxy mechanism can maintain the flow of instructions in the event of large-scale failures or single department offline, reflecting resilience; the final seven-segment document path solidifies the source, logic, authority, and version into an indivisible whole, providing unprecedented transparency and verifiability for cross-system automatic execution.
[0189] Step 4: Couple the sliding window prediction sequence, node trust weight and scenario weight through step 401, and calculate the global risk score through the nonlinear threshold curve and exponential decay fusion. Then, step 402 instantiates the smart contract template based on the trigger signal and the model version signature, quantifies the resource requirements by segment mapping, injects multi-signature permission annotations, and finally forms a deployment intention including the source-logic-permission full chain path. This is simultaneously stored and broadcasted on the permissioned chain and sidechain. The model version signature and source prediction hash within the deployment intent directly allow the execution subsystem to trace back to the specific prediction window and weight iteration, thus maintaining two-way transparency of resource actions and algorithm evolution. A cross-authority mechanism ensures that no single point of misjudgment can monopolize the deployment process.
[0190] Allocation Intention The source prediction hash, model version signature, and multi-signature permissions are delivered to each execution subsystem through the sidechain message bus. However, if the subsystem cannot accurately re-arrange resources under real-time working conditions, legacy constraints, and cross-system coupling, instructions will be left hanging or execution deviations will occur, thereby weakening the resilience of the entire link.
[0191] Step 5: Transmit the allocation intention generated on the chain to each execution subsystem securely and with low latency, driving it to complete resource rescheduling and transmit the operating status back in real time, thus achieving allocation closure and leaving traces on the performance chain.
[0192] The step five includes the following:
[0193] Step 501: Robust fragment transmission and two-way handshake
[0194] The sidechain message bus connects numerous execution subsystems, including traffic signal controllers, smart distribution stations, drainage pump SCADA, and automated medical supply warehouses. These systems have significant differences in network protocols, clock accuracy, and security levels. Directly broadcasting deployment intentions can cause some subsystems to be unable to recognize or fail authentication. Therefore, a multi-layer message encapsulation and end-to-end confirmation mechanism are required to ensure that the intention reaches the target end intact and securely and is correctly interpreted.
[0195] After receiving the seven-segment document, the side chain node fragments the document according to the MTU, adds a sequential number and a fragment hash to each fragment, and inserts the overall document hash and a time label at the head and tail of each batch of fragments. This fragment tuple forms a directed fragment chain, and any missing fragments can be quickly located through missing number detection. The system uses linear redundancy based on Luby transcoding, so that even if a small number of fragments are lost, the target end can still reconstruct the original document. The fragment-redundancy chain can ensure message integrity in a wireless link jitter or multipath interference environment.
[0196] The execution subsystem initiates a zero-round handshake: the side chain node encrypts the first package of the deployment intention fragment with the subsystem public key, and the subsystem directly decrypts and verifies it with the private key after receiving it, without the traditional TLS multiple rounds; if the verification is passed, a state message containing the system clock-current load-expected delay is sent as a handshake confirmation. Zero-round handshake reduces the first connection delay, and the public and private keys ensure unique identity mapping.
[0197] The side chain node reads the priority flag according to the scenario label of the deployment intention: high-priority traffic uses a skewed exponential backoff strategy, with a shorter timeout period and allowing concurrent retransmission; ordinary traffic uses a linear backoff strategy to ensure that the bus is not overwhelmed by high-frequency retransmission. Hierarchical backoff prevents high-risk scenario information from being delayed by network congestion, and also prevents daily traffic from being starved.
[0198] After the subsystem reconstructs the document, it verifies the template version hash-permission signature-resource list item by item in the path segment; if any field fails the verification, it immediately feeds back a rejection to execute-reason code to the side chain node, and writes a veto reply in the permission chain for upstream supervision to intervene quickly. The two-way feedback chain ensures that there is on-chain evidence of failed events, avoiding silent failures.
[0199] The combination of multi-chain fragmentation endorsement and linear redundancy coding enables the message to be reconstructed once in a noisy or partially powered-down base station environment, significantly improving the survival rate of deployment commands in extreme scenarios. Zero-round handshake, with dynamic rate control through load feedback, enables communication handshake and resource sensing to be performed simultaneously, solving the burst congestion problem caused by traditional handshake ignoring the capacity differences of target ends; multi-level timeout and self-learning backoff enable dynamic self-regulation of all-weather traffic, fully embodying the adaptive and self-protecting characteristics. Secondary verification incorporates both logical and physical constraints into verification, ensuring not only document legality but also preventing instructions from falling on inoperable objects, improving system resilience.
[0200] Step 502, adaptive driving optimization and on-chain reply
[0201] The hardware topology, control strategy and resource constraints of each execution subsystem vary greatly. The fixed instructions issued by the traditional hub cannot adapt to dynamic working conditions. The adaptive decision-making driver needs to calculate the control sequence based on the intention on the chain and the local state, and at the same time evaluate the potential impact of the action on other systems. Ultimately, it executes resource rescheduling with the minimum coupling cost and fills the process indicators back into the chain to achieve closed-loop optimization.
[0202] The driver first pulls local real-time telemetry Share state with neighboring systems and get the most recent Round execution receipt , then construct the state fusion tensor :
[0203]
[0204] The cross-system coupling relationship is extracted through the graph attention network to obtain the influence coefficient matrix .
[0205] Where: Influence coefficient matrix : Describes the impact of resource actions on neighboring systems; the element range is 0 to 1 and is used for subsequent cost evaluation;
[0206] When used, tensors can be fused to create a panoramic view, providing a unified data base for subsequent optimization.
[0207] The driver solves the multi-objective function in the receding time domain:
[0208]
[0209] Constrained resource margin ; To predict the rolling step size, is the step index, is the time reference;
[0210] Control Sequence :future The step resource scheduling amount, the value range is given by the upper and lower bounds of resource availability;
[0211] Cost Items : related to the error of the allocation target indicator, a positive real number;
[0212] Cost Items : the energy cost of executing the action, a positive real number;
[0213] Cost Items : Cross-system interference penalty, calculated by the influence coefficient matrix;
[0214] Weight , , : Priority coefficient set by the manager, a positive real number;
[0215] When used, multi-objective optimization takes into account performance, energy consumption and coordination, and output operations can be implemented.
[0216] The local driver uses a heuristic greedy algorithm to generate an initial solution and quickly sends part of the control quantity to ensure timeliness; at the same time, the state fusion tensor When the initial solution is pushed to the cloud, the cloud asynchronously runs the mixed integer programming to make fine corrections to the remaining control variables and overwrite them in the next rolling window.
[0217] During the execution process, the embedded sampler collects key indicators in seconds, and the driver calculates the performance vector locally. and the proportion of resource requirements for deployment intention Calculating execution deviation , then 、 It is written into the permission chain together with the control sequence hash to form a tamper-proof receipt, and the trace left on the chain closes the execution process to the evaluation-optimization long chain.
[0218] In use, the fusion of tensor multimodal alignment and topological sparsification gating ensures accurate and low-redundancy coupling strength measurement, providing high signal-to-noise ratio input for multi-objective optimization. Switching penalties and on-chain adjustable weights organically combine the flexible control of daily operations and maintenance with the rigid requirements of extreme events. Edge-to-cloud hot start and metadata synchronization innovatively resolve the "edge first action, cloud optimization" timing conflict while ensuring that the correction sequence is not lagging behind. Execution monitoring utilizes a dual-alert strategy and on-chain receipts to effectively expose execution anomalies as early as possible and incorporate them into the next round of weight fine-tuning, achieving a continuous closed loop of evaluation, execution, and learning.
[0219] Step 5: Through step 501, a sharded redundant transmission, zero round-trip handshake, multi-level timeout and secondary verification mechanism is constructed for the multi-protocol execution subsystem to ensure that the deployment intention reaches the target end completely and safely in the complex network; then step 502 performs rolling optimization based on the multi-source state fusion tensor, generates an executable control sequence through edge-cloud collaborative solution, and locks the operation status and performance indicators with on-chain receipts, realizing a closed loop from intention to execution and then to feedback. The influence coefficient matrix generated during operation , execution deviation and performance vector It will directly provide data support for the next round of threshold curve adaptation and trust weight fine-tuning, thereby fully threading the allocation link and evaluation link on the permission chain, ensuring the long-term self-evolution and resilience improvement of the solution.
[0220] After completing the resource rescheduling, the execution subsystem writes the control sequence hash and performance vector through the chain receipt Deviation from execution . Without timely and reliable merging of these information into local state tensor and transforming into trainable samples, the prediction-execution-learn loop cannot be closed, and the federated training cannot be quickly adapted to the latest working conditions, thus the following solution is adopted:
[0221] Step six, map on-chain receipts to local state tensor delta patch and adaptively update model trust weight, then trigger a new round of micro-batch federated training at edge node, realize the coherent closure of prediction-execution-learn;
[0222] Step 601, high-quality receipt screening and patch construction
[0223] On-chain receipt stream contains multi-dimensional indicators from different execution subsystems, including direct performance vector , deviation value and control sequence hash. Edge node must quickly identify the receipts belonging to its own prediction window, evaluate their credibility, and write high-quality data to local patch queue; otherwise, federated training will mix in noise or even wrong labels, leading to model degradation.
[0224] Edge node retrieves receipts from permissioned chain through structure fingerprint-model version signature-time stamp three-index matching conditions:
[0225]
[0226] Add the receipts meeting the conditions to the candidate set ;
[0227] Wherein: , : structure fingerprint on time slice and , uniquely identifies the node's prediction data batch;
[0228] , : model version signature, corresponding to iterative model weight hash; is a logical and operator;
[0229] Time tolerance window : allows receipt delay range, positive integer seconds;
[0230] Calculate the quality score for each candidate receipt:
[0231]
[0232] If , discard;
[0233] Wherein: threshold value : discard threshold; quality score :scope ,The larger the value, the higher the credibility of the receipt, which is used to determine the patch weight;
[0234] Increment Vector : Dimension-by-dimensional error between the measured and predicted values, real number vector;
[0235] Two-norm : comprehensive measurement error magnitude, non-negative real number;
[0236] Execution Vector : Measured performance vector from on-chain receipts; real number vector;
[0237] Prediction vector : prediction results recorded locally by edge nodes; real number vector;
[0238] Scene projection matrix : A diagonal positive definite matrix whose elements are scene importance coefficients. It remains unchanged for a long time after offline configuration and is used to emphasize key indicators.
[0239] Adjustable coefficient : A positive real number (recommended 0.1~1), which controls the error suppression strength; the only newly introduced weight;
[0240] Sigmoid function : Ensure that the output falls between 0 and 1, and increase the resolution in the middle range;
[0241] For receipts that pass quality assessment, incremental vectors are extracted. The incremental patches provide positioning and strength information for error injection, where:
[0242]
[0243] And mapped to the local state tensor dimension to generate a patch . Patch comes with weights Used for subsequent convolution-attention integration.
[0244] Increment Vector : actual-prediction difference, real vector; patch weight : Receipt quality weight; range ;
[0245] Adjust the node trust weight based on the receipt credibility:
[0246]
[0247] in, is the mean quality within the window, is the learning rate, a positive real number, less than 1; 、 are the trust weights of new and old nodes respectively; The quality score of a single receipt;
[0248] When in use, the trust weight is adjusted in real time to provide more accurate node importance for the next round of federated training. Through the skip list-Bloom dual-level search and bucket-archive design, the receipt query is reduced from O(N) to an amortized approximation of O(logN), significantly improving the real-time performance of edge nodes under high chain load; the quality evaluation function integrates vector norm, matrix projection and Sigmoid, using only one adjustable coefficient. It simultaneously characterizes the error magnitude and directional alignment, significantly reducing parameter tuning costs while maintaining sensitivity; incremental patch mapping incorporates freshness decay, allowing data value to naturally decrease over time and suppressing the negative drag of outdated information on the model; Nesterov-style weight updates allow trust weights to quickly align with actual performance while avoiding rating fluctuations.
[0249] Step 602: Patch fusion training trigger and version preparation
[0250] After the patch is written into the local state tensor, if it is not fused through lightweight noise suppression and re-encoding, the measurement outliers will be amplified. At the same time, triggering a new round of micro-batch training requires determining the best start time based on the patch coverage and weight distribution to avoid wasting computing resources.
[0251] Edge nodes closest to Patches Perform weighted depthwise separable convolution, maintain the original tensor backbone and introduce error information to achieve dynamic calibration:
[0252]
[0253] Where: fusion tensor : The new input tensor after patch absorption; balance factor : ; is the patch weight;
[0254] It is a depth-wise separable convolution; For patches; is the window depth; is the step index;
[0255] Coverage is calculated to ensure that training starts when there are sufficient patches and node reputations change significantly, improving sample effectiveness, where:
[0256]
[0257] like And the highest trust weight increase in the window If so, trigger a new round of micro-batch self-play training.
[0258] In the formula: coverage threshold : positive real number; trust weight increase threshold : positive real number;
[0259] At the beginning of a new training round, the node will pass the past Round gradient mean As a reference, the current gradient Perform differential clipping to accelerate convergence and keep the model stable:
[0260]
[0261] In the formula: differential clipping gradient : remove stable direction noise; The clipping operator is;
[0262] After training, the node generates a new gradient summary and model version identifier At the same time, the fusion tensor Calculate the new structure fingerprint Cache them, and directly call them when step S2 federal aggregation is started to reduce delay, so as to prepare version signature and fingerprint in advance, ensuring seamless connection of the next round of process.
[0263] When used, the weighted depth separable convolution directly binds the convolution kernel size and patch quality, saving computing power and realizing dynamic information integration, embodying the combination of lightweight and self-adaptation; The three-state trigger finite state machine makes the training start time more interpretable, solving the problem of frequent false triggering or sluggishness of traditional fixed window or single threshold strategy in actual deployment; The differential clipping and frozen baseline double constraints make the model keep the historical stability while efficiently learning the latest deviation, reducing catastrophic forgetting; The hash adds the convolution kernel sparsity, so that the version signature naturally contains the model complexity measure, providing a new dimension index for predicting compression and consensus ranking.
[0264] Step 6 uses the structural fingerprint, model version, and time window ternary indexes in step 601 to precisely match the receipt. A quality assessment function is then used to filter noise, and the data is written to the local state tensor in the form of incremental patches. Node trust weights are dynamically corrected, allowing the feedback data to be purified and weighted first. Subsequently, through step 602, deep separable convolutional fusion, multi-metric triggering strategies, and differential shear training, the patch information is instantly converted into model weight update potential. A new structural fingerprint and version signature are generated in advance, caching the data for the next round of federated training. This connects the actual performance of the execution layer with the tensor input of the perception layer, forming a self-driven closed loop of continuous prediction, execution, and learning. Furthermore, dynamic trust weights self-correct with feedback, providing a more accurate contribution measurement for cross-node aggregation, ensuring that the synergistic benefits of the entire network accumulate over time rather than decay.
[0265] See also Figure 2 The present invention provides a resilient city resource allocation system based on blockchain and edge computing, including:
[0266] The alignment and normalization module performs spatiotemporal alignment and semantic normalization on multi-source real-time data, generates a local state tensor containing self-checking metadata, and caches it in a ring buffer queue in the secure zone for persistent storage.
[0267] The gradient aggregation module forms a gradient summary by combining clipped gradients with differential privacy masks. After dynamic trust weighted aggregation, the model version is signed synchronously and iteratively, and a consistent weight vector for the entire network is output for use in the next round.
[0268] The hash consensus module concatenates the compressed prediction tuple with the structural fingerprint and model signature to generate a prediction hash, broadcasts it in batches according to priority, and writes it into the permission chain through Byzantine consensus to obtain a timestamp and synchronize the mark;
[0269] The risk assessment module runs a dual-threshold assessment on the weighted risk curve within the sliding window. When the conditions are met, it instantiates the multi-signature template to generate the deployment intention and broadcasts it to the sidechain message bus in real time.
[0270] The decision-making distribution module receives sharded documents through a zero-round-trip handshake. The adaptive decision driver integrates multi-source state rolling optimization control sequences and distributes them in parallel with cloud-based corrections, and records performance receipts on the chain.
[0271] The patch training module retrieves receipts, calculates quality scores, generates incremental patch weights, and fuses them into tensors. It triggers differential shear training based on patch coverage and trust weight increases, and caches new fingerprints and versions for federated aggregation.
[0272] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0273] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0274] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only for some logical functions. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0275] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0276] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A resilient city resource allocation method based on blockchain and edge computing, characterized by: include, Complete spatiotemporal alignment and semantic normalization of multi-source real-time data, generate local state tensors containing self-checking metadata, and cache them in the ring buffer queue in the secure zone for persistent storage; The gradient summary is formed by combining clipping gradient with differential privacy mask, and the dynamic trust weight is weighted and aggregated to synchronize the iterative model version signature and output the network-wide consistent weight vector for use in the next round; The compressed prediction tuple is concatenated with the structural fingerprint and model signature to generate a prediction hash, which is broadcast in batches according to priority and written into the permission chain through Byzantine consensus to obtain a timestamp and synchronization mark. A dual-threshold judgment is performed on the weighted risk curve within the sliding window. When the conditions are met, a multi-signature template is instantiated to generate a deployment intention and broadcasted to the sidechain message bus for real-time delivery. Sharded documents are received through a zero-round-trip handshake, and the adaptive decision driver integrates multi-source state rolling optimization control sequences and issues them in parallel with cloud-based corrections, with performance receipts recorded on-chain. The retrieval receipt calculates the quality score and generates incremental patch weights, which are then fused into a tensor. The patch coverage and trust weight increase are used to determine whether differential clipping training is triggered and the new fingerprint and version are cached for federated aggregation.
2. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 1 is characterized by: The external sensor message timestamp is corrected in microseconds through a constant temperature crystal oscillator, and the moving coordinates are dynamically patched in conjunction with a Kalman filter. A semantic template with feedback is used to merge multiple vendor fields into a unified indicator, and the corrected data is then written into a ring buffer queue protected by a one-time key to ensure the spatiotemporal consistency and confidentiality integrity of the original state frame.
3. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 2 is characterized by: It uses depth-wise separable convolution combined with channel attention weights to filter out redundant features, and integrates short-term fluctuations and long-term trends through gated recurrent units. After stacking the continuous gated outputs into a local state tensor along the newly added time dimension, double hashing is performed to generate the structural fingerprint and a one-to-one mapping between the tensor and the fingerprint is cached locally.
4. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 3 is characterized by: When calculating the local gradient, a temperature modulation coefficient is introduced to enhance the gradient amplitude of rare high-impact samples. The gradient vector is amplitude clipped and then superimposed with differential privacy noise based on structural fingerprints. Threshold Huffman coding is used to generate byte-level gradient summaries.
5. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 4 is characterized by: The aggregation layer constructs a weighted cosine similarity matrix for the uploaded gradient summary, detects abnormal nodes with angles exceeding the threshold, and lowers their trust weights; After filtering, new weights are generated by local averaging of homogeneous clusters and global fusion of soft gating, and the model version signature sequence is generated by rolling hashing.
6. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 5 is characterized by: After loading the global weight inference on the local state tensor, the confidence interval is obtained through Monte Carlo sampling and compressed into a prediction tuple, which is then concatenated with the structural fingerprint and model signature to generate a prediction hash, and the transaction priority is set according to the trust weight.
7. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 6 is characterized by: Predicted hash transactions are batched within the homogeneous cluster and broadcasted in layers to enter the Byzantine fault tolerance process of the entire network; The voting rounds are automatically adjusted according to the transaction macro iteration flag, and the block hash is cross-checked after the multi-shard accounting nodes write to the permission chain in parallel.
8. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 7 is characterized by: The smart contract applies a nonlinear threshold function to the risk value of each scenario within a sliding window, accumulates the historical window with exponential decay, and then calculates the global risk score based on the scenario weight. A trigger signal is generated when the score exceeds the set threshold and the slope is greater than the minimum growth rate.
9. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 8 is characterized by: Pre-deploy scenario-resource-action templates on the chain, which use piecewise functions to map the risk threshold value to the resource demand ratio and embed multi-signature permission tags; The deployment intention is encapsulated as a seven-segment JSON-LD document, and the document hash is written to the permission chain to synchronize the side chain broadcast.
10. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 9 is characterized in that: The sidechain node allocates the intention according to the MTU fragmentation and inserts the chain hash endorsement, uses a zero round-trip handshake to complete the identity negotiation and receive the target subsystem status message; High-priority traffic uses an exponential backoff retransmission strategy, and low-priority traffic uses a linear backoff strategy.
11. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 10 is characterized in that: The execution subsystem integrates local real-time telemetry, neighboring shared status and historical receipts to construct a state tensor, generates an influence coefficient matrix through a graph attention network, and rollingly optimizes multi-objective functions under the edge-cloud collaborative framework to form a control sequence, and records performance receipts on the chain after execution.
12. The method for allocating resilient urban resources based on blockchain and edge computing according to claim 11 is characterized in that: Receipts are retrieved from the permission chain through a Bloom filter and skip list dual-level indexing. After calculating a new quality score, an incremental patch is generated and written into the local state tensor. At the same time, the node trust weight is dynamically adjusted based on the patch quality. Use weighted depthwise separable convolution to fuse the nearest patches to form a new tensor, and trigger differential shear training based on patch coverage and confidence weight increase. After training is completed, the new structure fingerprint and model version signature are output and cached for subsequent federated aggregation.
13. A resilient urban resource allocation system based on blockchain and edge computing, characterized by: include, The alignment and normalization module performs spatiotemporal alignment and semantic normalization on multi-source real-time data, generates a local state tensor containing self-checking metadata, and caches it in a ring buffer queue in the secure zone for persistent storage. The gradient aggregation module forms a gradient summary by combining clipped gradients with differential privacy masks. After dynamic trust weighted aggregation, the model version is signed synchronously and iteratively, and a consistent weight vector for the entire network is output for use in the next round. The hash consensus module concatenates the compressed prediction tuple with the structural fingerprint and model signature to generate a prediction hash, broadcasts it in batches according to priority, and writes it into the permission chain through Byzantine consensus to obtain a timestamp and synchronize the mark; The risk assessment module runs a dual-threshold assessment on the weighted risk curve within the sliding window. When the conditions are met, it instantiates the multi-signature template to generate the deployment intention and broadcasts it to the sidechain message bus in real time. The decision-making distribution module receives sharded documents through a zero-round-trip handshake. The adaptive decision driver integrates multi-source state rolling optimization control sequences and distributes them in parallel with cloud-based corrections, and records performance receipts on the chain. The patch training module retrieves receipts, calculates quality scores, generates incremental patch weights, and fuses them into tensors. It triggers differential shear training based on patch coverage and trust weight increases, and caches new fingerprints and versions for federated aggregation.
Citation Information
Patent Citations
Right and interest exchange verification and confirmation system
CN120337188A
Risk control credit monitoring method based on cloud computing
CN120338944A