Budget dynamic management and report automatic generation method and system

By using Morton encoding and generative adversarial networks in distributed ledgers, combined with quantum annealing and topological analysis, cross-ficial risk identification and minute-level decision support are achieved, data silos and tampering risks in the existing technology are solved, and the timeliness and accuracy of budget management is improved.

CN120258579BActive Publication Date: 2025-08-12BEIJING CTJ SOFTWARE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510744490.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-08-12
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

The existing technology has problems of data silos, tampering risks and inefficient timeliness in budget management, making it difficult to identify cross-financial nonlinear risks and minute-level decision support.

Method used

Dual signature-Morton encoding is used to write to the distributed ledger, combining generation adversarial networks, quantum annealing and topological analysis to generate cash flow prediction and risk summary, and realize dynamic budget management and report automation through multi-agent reinforcement learning and homomorphic encryption.

Benefits of technology

It realizes cross-departmental model sharing without leaking accounting details, improves budget prediction accuracy and decision-making timeliness, and ensures the immutability of capital flows and audit traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258579B_ABST
    Figure CN120258579B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of fund management, and in particular to a method and system for dynamic budget management and automatic report generation. The method comprises the following steps: business events are double-digitally signed and written into a distributed ledger according to a Morton index; cash flow tensors are extracted from a global event sequence, sensitivity spectra are calculated using generative adversarial networks (GANs) and quantum annealing, risk summaries are obtained by combining them with persistent coherence, and the summaries are input into a topological attention model to output budget forecasts under a differentially private federated framework; each node generates bid requests based on the forecasts and risk summaries through evolutionary reinforcement learning, matching priorities under flow conservation are solved using multi-head convolutional attention and accelerated projected gradients, funds are transferred using homomorphic encryption after approval, fund flows, priorities, and timestamps are recorded on-chain, and tamper-proof reports are automatically generated to achieve a cross-departmental, explainable, and privacy-secure real-time budget management closed loop.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fund management, and in particular to a method and system for dynamic budget management and automatic report generation. Background Art

[0002] In modern organizations, budgets are no longer static documents compiled once a year; instead, they are a dynamic process that must be rolled out in sync with business operations and disclosed immediately within regulatory windows. Dynamic budget management, combined with automated reporting, enables real-time monitoring of cash shortfalls during periods of high transaction volume, adjusting credit limits based on risk, and reducing the cycle costs of manual consolidation and multiple rounds of proofreading within the finance department. This is a key component of digital finance transformation. Existing technologies largely rely on a "central database + batch processing" paradigm: budget forecasts often rely on linear models built into ERP systems or on centralized deep learning models running offline in data warehouses. Settlement information is written to a single database and then exported to reports via RPA or BI tools. This model suffers from three drawbacks: data silos—difficulties encountered by departments in uploading detailed information due to compliance requirements, insufficient samples in the central model, and difficulty identifying cross-fiscal nonlinear risks; tampering risk—budget adjustments and fund transfer records are stored in writable databases, lacking chained immutable proofs and requiring additional verification during audits; and low timeliness—batch processing and manual reconciliation are typically performed on a daily or even weekly basis, failing to provide minute-by-minute decision-making during market fluctuations. Summary of the Invention

[0003] In response to the many problems existing in the above-mentioned existing technologies, the present invention provides a method and system for dynamic budget management and automatic report generation. The present invention first writes the business event sequence on the chain using a dual-signature-Morton encoding method; then uses a GAN-quantum-topological three-level pipeline to generate cash flow forecasts and risk summaries, and differential privacy federated aggregation ensures model sharing without leaking privacy; then multi-agent reinforcement learning outputs bid requests, and attention-projection gradients obtain the optimal match under flow conservation; the settlement amount is allocated and written on the chain using homomorphic encryption, and the report engine directly reads the on-chain log to generate real-time compliance reports, forming an automatic closed loop of "forecasting-matching-settlement-disclosure".

[0004] A method for dynamic budget management and automatic report generation includes the following steps:

[0005] Intercept business operation records, write them into the distributed ledger according to payment object identifier, region code and time window index, merge them with conflict-free replicable data types and synchronize them with logical vector clock sorting to form a global event sequence;

[0006] A cash flow tensor is extracted from the global event sequence, augmented with a generative adversarial network, and a sensitivity spectrum is calculated using a quantum annealing optimizer. A multi-scale topological analysis is performed to obtain a risk summary. The cash flow tensor and the risk summary are input into a topological attention time series prediction model, which is then updated in a differentially private federated aggregation to generate a local budget forecast.

[0007] The node state vector is constructed based on the local budget forecast, risk summary and global budget status. The bid request is generated through the multi-agent reinforcement learning model. The bipartite tensor is constructed and the matching priority is solved using the attention optimization algorithm to obtain the budget matching result. After approval, the funds are allocated using homomorphic encryption and the settlement results are recorded to generate a report.

[0008] Preferably, the generator of the generative adversarial network data expansion model adopts a combined structure of a convolutional network and a frequency domain transformation, and the discriminator performs adversarial training based on both the time domain error and the frequency domain amplitude difference until the generator output meets the discriminator confidence standard.

[0009] Preferably, the quantum annealing optimizer maps the expanded cash flow tensor data into the Ising Hamiltonian, uses the sample correlation coefficient as the coupling coefficient and the net cash increment bias as the local field intensity, and forms sensitivity spectrum data by statistically analyzing the spin flip frequency through multiple annealing sampling.

[0010] Preferably, the multi-scale topological analysis includes performing wavelet packet decomposition on the expanded cash flow tensor data and sensitivity spectrum data, constructing complexes at each scale and calculating persistent homological barcodes, and combining the birth time and death time pairs of the barcodes into a risk summary.

[0011] Preferably, the topological attention timing prediction model is composed of a recursive dilated convolutional encoder and a decoder, and the attention weight matrix is superimposed with a sparse adjacency matrix obtained according to the risk summary during calculation, and is trained using a loss function containing a structure-preserving regularization term.

[0012] Preferably, the differential privacy federated aggregation forms differential privacy weight differences by injecting Laplace noise into local model differentials, and aggregates the differential privacy weight differences using a federal averaging algorithm with momentum to update global model parameters.

[0013] Preferably, the multi-agent reinforcement learning model adopts a soft actor-critic architecture, uses genetic crossover and Gaussian mutation to form a strategy population, and iteratively evolves the strategy according to the comprehensive utility calculated based on returns, volatility and idle capital rate to generate bid requests.

[0014] Preferably, the attention optimization algorithm constructs a weight matrix based on the bid request binary tensor data, and uses multi-head convolutional attention and accelerated projected gradient method to solve the matching priority matrix subject to flow conservation constraints.

[0015] Preferably, the record of the settlement result is double-digitally signed on the event payload and indexed and written using Morton coding before being written into the distributed ledger. The settlement result is homomorphically encrypted and a report is automatically generated after recording the flow of funds, matching priority and approval timestamp through a hash time lock contract.

[0016] A budget dynamic management and report automatic generation system for implementing the method described above, the system comprising:

[0017] The ledger synchronization module is used to intercept business operation records, generate indexes for them according to payment object identifiers, region codes, and time windows, write them into the distributed ledger, and synchronize them across multiple nodes through conflict-free replicable data type merging and logical vector clock sorting to form a global event sequence;

[0018] a prediction analysis module for extracting a cash flow tensor from the global event sequence, performing data augmentation on the cash flow tensor using a generative adversarial network, calculating a sensitivity spectrum of the augmented cash flow tensor using a quantum annealing optimizer, performing multi-scale topological analysis on the cash flow tensor and the sensitivity spectrum to obtain a risk summary, inputting the cash flow tensor and the risk summary into a topological attention time series prediction model, and updating the prediction model under a differentially private federated aggregation mechanism to generate a local budget forecast;

[0019] The matching and settlement module is used to construct a node state vector based on the local budget forecast, the risk summary and the global budget state, generate bid requests based on multi-agent reinforcement learning, construct a bid-request bipartite tensor and use an attention optimization algorithm to solve the matching priority to obtain a budget matching result. After the budget matching result is approved, funds are allocated in a homomorphic encryption manner, settlement results are recorded, and a report is generated.

[0020] Compared with the prior art, the advantages and beneficial effects of the present invention are:

[0021] The present invention realizes tail risk sample augmentation and marginal risk quantification by linking the convolution-Fourier generative adversarial network with the quantum annealing sensitivity spectrum.

[0022] This paper generates risk summaries through multi-scale continuous coherence and embeds graph attention, achieving accurate capture of cross-scale collaborative features.

[0023] This invention uses differential privacy federation aggregation to achieve cross-departmental model sharing without leaking account details;

[0024] This invention achieves the optimization of matching efficiency under the condition of flow conservation by superimposing attention matching through evolutionary reinforcement learning.

[0025] This invention realizes confidential transfers and tamper-proof automated reporting through BFV homomorphic encryption combined with hash time lock contracts. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 Schematic diagram of the process of the present invention;

[0027] Figure 2 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION

[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure.

[0029] like Figure 1 As shown, a method for dynamic budget management and automatic report generation includes the following steps:

[0030] Intercept business operation records, write them into the distributed ledger according to payment object identifier, region code and time window index, merge them with conflict-free replicable data types and synchronize them with logical vector clock sorting to form a global event sequence;

[0031] This invention targets dynamic budget management across departments and regions. It first establishes an immutable and globally consistent event sequence at the underlying data level, laying the timing benchmark for subsequent quantum sensitivity analysis, topology-enhanced prediction, and multi-agent budget matching. The specific process involves four core steps: event capture, hybrid spatial-temporal indexing, conflict-free merging based on conflict-free, replicable data types, and logical vector clock sorting.

[0032] When budget adjustments and transfers occur in the business system, budget execution related operations are performed, and the interception hook in the message bus immediately monitors the transaction receipt and encapsulates it into an event object. The event object fields consist of event identifier (hash value), event type, event payload, logical vector clock Composition, also carries the payment object identifier , regional code , time window number The length of the logical vector clock is consistent with the total number of nodes. When an intercepted node generates an event locally, only its own component is incremented by one, while the remaining components maintain their previously synchronized values. This design can describe partial order relationships without relying on a globally unified physical clock.

[0033] In order to ensure that the physical order of events in the distributed ledger is friendly to continuous reading, the present invention uses Morton coding (also known as Z-curve) to convert the triples Mapped to monotonically increasing integer keys. The Morton encoding formula is as follows:

[0034]

[0035] in is the bit length of each dimension, Indicates right shift, Indicates left shift, This is a bitwise AND operation. After this mapping, events in adjacent departments, regions, and time windows remain continuous on the disk addresses, significantly improving the efficiency of sequential writing and sequential reading.

[0036] After writing is complete, each ledger node periodically exchanges the Bloom filter summary of the current voxel block. If the filter comparison finds that the other party has a local missing key, the node pulls the missing event block from the other end and performs a set-level merge. This invention introduces the observe-remove set (OR-Set) as the core conflict-free, replicable data type, and the merge operation is a union:

[0037]

[0038] in and Each represents the event key set for each node. New events are only inserted, not deleted. Therefore, any swap order converges to the same union, completely avoiding the risk of lost updates associated with the traditional "last write wins" strategy. The commutative, associative, and idempotent properties of OR-Set eliminate the need for additional conflict resolution during network partition recovery, making it a natural fit for cross-regional budget data exchange.

[0039] After merging, although the nodes hold the same event key set, they still lack a consistent order. To this end, the present invention uses a logical vector clock to determine the total order. and The vector clock satisfies:

[0040]

[0041] It is determined Before The algorithm first performs a topological sort to ensure that all comparable events are arranged in causal order; for mutually non-dominant (parallel) events, the original key-value order is preserved. The resulting sort is the global event sequence, which is consistent across all nodes and can be directly used as input for subsequent time series models.

[0042] Example: Assume that two nodes A and B generate three events in the same hour window. From A, time is 12:05, vector clock (1, 0); event From B, in sync to Then it is recorded at 12:10, vector clock (1, 1); then B writes the event again , vector clock (1, 2). Comparing the vector clocks, we can see , so the unique arrangement of the global event sequence is Once sorted, each event continues to serve the cash flow tensor construction and subsequent quantum sensitivity analysis, allowing all budget nodes to share the same historical view during algorithm execution.

[0043] Based on this mechanism, the present invention has the following effects:

[0044] First, data consistency. OR-Set's idempotence allows nodes to automatically recover to a consistent state after a network partition; when any single point of failure is restored, no manual intervention is required to resolve the conflict.

[0045] Second, sequential determinism. Logical vector clocks do not rely on hardware clock synchronization, avoiding the clock drift common in geographically distributed environments. They ensure the strict order of capital flows from a global perspective and provide a stable benchmark for quantum annealing sensitivity spectrum analysis.

[0046] Third, sequential writes bring improved throughput. Morton encoding mapping eliminates disk seeks caused by random writes, significantly improving sequential write speeds. The same benefits also apply to background batch sequential reads.

[0047] Fourth, audits are traceable. Each event is secured with a hash and dual signature, and its key value corresponds one-to-one to the physical block file and offset. The audit system can retrieve a specific event in milliseconds, achieving regulatory transparency.

[0048] Fifth, scalability. As the number of departments increases, the length of the vector clock also increases. This invention provides a hierarchical compression strategy: across multiple departments, regional nodes only store their own sub-vectors, while the root node stores the complete vector. This reduces the storage pressure imposed by vector length from linear growth to logarithmic growth, allowing the system to evolve smoothly as business scale expands.

[0049] A cash flow tensor is extracted from the global event sequence, augmented with a generative adversarial network, and a sensitivity spectrum is calculated using a quantum annealing optimizer. A multi-scale topological analysis is performed to obtain a risk summary. The cash flow tensor and the risk summary are input into a topological attention time series prediction model, which is then updated in a differentially private federated aggregation to generate a local budget forecast.

[0050] Each revenue and expenditure event obtained from the global event sequence is ordered according to the logical vector clock, allowing it to be directly aggregated into continuous time periods by the time window cropping module. The system sets a fixed window length and maps the net cash flow and business labels within the same window into a six-dimensional vector. This vector is then concatenated along the time dimension into a 24×6 cash flow tensor. This tensor maintains hourly resolution while incorporating discrete features such as currency, revenue and expenditure direction, and business type, providing a complete description of budget flows.

[0051] In a budget environment involving multiple departments, the probability of extreme tail events is much smaller than that of events near the mean, resulting in abnormal fluctuations often being diluted when directly training the time series model. The present invention expands the training set by generating adversarial networks: the generator adopts a stacked structure of alternating convolution and fast Fourier convolution, which can simultaneously simulate local strong cycles and cross-cycle jumps; the discriminator simultaneously examines the mean square error in the time domain and the energy spectrum difference in the frequency domain, and approximates the true distribution in an adversarial manner. The generator ultimately outputs an expanded tensor whose similarity with the original sample exceeds a preset threshold, and the two are combined as input for subsequent modeling. The expansion strategy significantly improves the prediction model's recognition sensitivity to long-tail cash flows and eliminates the damage to time series correlation caused by traditional oversampling.

[0052] The expanded tensor input quantum annealing module performs sensitivity spectrum calculation: First, the net cash increment at each time step is symbolized as a spin variable . Construct the coupling matrix through the sample correlation coefficient , construct the bias term with the mean difference of net cash increment , we get the Ising Hamiltonian:

[0053]

[0054] On a quantum annealing chip Perform multiple annealing samples with different spin flip frequencies Constitute the sensitivity spectrum, The higher the value, the greater the marginal contribution of that time point to the overall cash gap.

[0055] The cash flow tensor and sensitivity spectrum are then decomposed into the multi-scale domain by wavelet packet decomposition. At each scale, the filter coefficients are used as nodes to establish Complex and calculate the continuous homology barcode, the birth time of the barcode Time of death The duration between Describe the importance of topological features. The barcodes with the highest duration are retained and converted into a sparse adjacency matrix. , which depicts the potential resonant risk structure between different time periods, namely the “risk summary”.

[0056] The topological attention temporal prediction model uses recursive dilated convolution to extract multi-scale dependencies on the encoding side, and uses the standard self-attention structure on the decoding side. The weight calculation formula is:

[0057]

[0058] in is the query vector, is the key vector, is the dimension constant, is the topological weight coefficient. Finally, attention allocation will take into account both time series similarity and risk intensity, so the model can detect potential liquidity risks derived from high-persistence coherent barcodes in any detection window before sampling.

[0059] Each department node fine-tunes the topological attention model locally using its own expanded samples to obtain the local weight difference To protect the privacy of cash flow, the node uses the Laplace mechanism to Random noise is injected, with the noise amplitude set by the privacy budget. After the noisy weights are uploaded to the chain, the coordination server performs momentum-based federated averaging: all node contributions are weighted according to the historical model convergence, then combined with the momentum vector to generate new global parameters, which are then transmitted back. Differentially private federated aggregation maintains model performance while ensuring that sensitive cash sequences of individual nodes cannot be inferred from weight updates.

[0060] The updated model infers the latest window and outputs a local budget forecast vector. The forecast results include the net cash flow for each hour in the next window, the median risk quantile, and the confidence level for abnormal fluctuations. In practice, an organization compared traditional ARIMA with the proposed solution, using 90 days of historical data for training and a random 10-day validation. The mean absolute error of ARIMA on days with abnormally high spending was approximately twice that of normal days, while the error increase of the proposed solution was less than 20%, validating the advantages of topologically enhanced attention combined with the quantum sensitivity spectrum in capturing long-tail risks.

[0061] In addition to improving prediction accuracy, the present invention also achieves the following effects: First, the expansion of the generative adversarial network greatly reduces the reliance on manually labeled samples; second, the sensitivity spectrum obtained by quantum annealing is visualized and highly consistent with the periods of high incidence of funding gaps identified by the Ministry of Finance, providing a quantitative basis for risk interpretation; third, differential privacy federal aggregation allows departments to share model benefits within the legal compliance framework without having to disclose specific transaction details; fourth, the risk summary as a sparse edge weight matrix significantly reduces the computational complexity of the attention layer, and in a test where the finances of eight departments were trained simultaneously, the overall inference latency was reduced by about 30%.

[0062] In summary, this paper constructs an interpretable, scalable, and privacy-preserving budget forecasting method through the cascade pipeline of "GAN data expansion - quantum sensitivity spectrum - topological homology - attention prediction - differential privacy federated aggregation", providing a reliable forward-looking cash flow baseline for automated report generation and laying a data foundation for subsequent multi-agent game matching.

[0063] Preferably, the generator of the generative adversarial network data expansion model adopts a combined structure of a convolutional network and a frequency domain transformation, and the discriminator performs adversarial training based on both the time domain error and the frequency domain amplitude difference until the generator output meets the discriminator confidence standard.

[0064] The design goal of the generative adversarial network data augmentation model is to construct a sufficient number of long-tail samples in the historical cash flow tensor so that the subsequent topological attention time series prediction model can learn the rare extreme fluctuation patterns that affect budget security. Traditional generators based on one-dimensional convolution can only capture local trends in the time domain and cannot reproduce high-frequency jitter and cross-cycle resonance at the same time. The present invention inserts a discrete Fourier transform layer into the convolutional network backbone, maps the time domain features to the frequency domain and performs amplitude modulation, and then inverse transforms back to the time domain output, forming a "time-frequency dual-domain coupling" hybrid generator. The convolution branch is responsible for reconstructing the low-frequency baseline, and the frequency domain branch is responsible for injecting high-frequency energy. The residuals of the two are superimposed and activated by Tanh to obtain a candidate augmented tensor.

[0065] The discriminator uses a dual-path architecture: the time domain path inputs the time-step residual vector of the original tensor and the generated tensor and calculates the mean square error; the frequency domain path first performs a discrete Fourier transform, extracts the amplitude spectrum vector, and then calculates the amplitude difference. The overall discriminant loss is defined as:

[0066]

[0067] in represents the real cash flow tensor, represents the generated tensor, represents the Fourier transform operator, and are the time domain loss weight and the frequency domain loss weight. The generator is:

[0068]

[0069] The objective function is updated so that the generated tensor approaches the true distribution simultaneously along two paths. The training process iterates in an adversarial loop until the discriminator outputs a confidence score below a set threshold. At this point, the discriminator has difficulty distinguishing true from false, indicating that the generator has been able to reproduce the statistical properties of historical samples in both the time-frequency domain.

[0070] In dynamic budget management scenarios, extreme cash flow events occur infrequently but have a high risk impact. If the original sequence is used directly to train the forecasting model, long-tail patterns will be masked by frequent patterns, resulting in a lack of sensitivity to abnormal payments. The convolution-frequency domain hybrid generator specifically increases the sample density in the high-frequency region, improving the probability quality of the tail portion of the training set. Furthermore, the frequency-domain amplitude difference constraint of the discriminator ensures that the power spectrum of the generated samples is consistent with the real samples, eliminating the introduction of spurious energy. This prevents both the destruction of the time series structure by common noise injection methods and the generation of overly smoothed artifacts by temporal convolution alone.

[0071] Example: In an organization's financial dataset, based on half a year's cash flow, the proportion of single large expenditures (defined as exceeding three times the monthly average) in the real tensor accounted for approximately 1% of all samples. After 2,000 rounds of adversarial training using the generator-discriminator of the present invention, the proportion of large expenditure fragments in the expanded set increased to 15%. Subsequently, the topological attention time series prediction model was trained on the expanded set, and a backtest was performed on the cash gap for the next week. The results showed that the recall rate of the unexpanded version for large expenditures was 0.53, and the false alarm rate was 0.12; after expansion, the recall rate increased to 0.71, and the false alarm rate only slightly increased to 0.13. This comparison verifies that the time-frequency dual-domain expansion strategy can improve the ability to detect extreme events without significantly increasing false alarms, providing more reliable signals for dynamic budget locking.

[0072] The expanded sample was mapped to the Ising Hamiltonian using a quantum annealing module. The resulting sensitivity spectrum was sharper after annealing, with spin-flip frequencies at extreme time steps significantly increased relative to the average. Multi-scale topological analysis further amplified these differences, allowing the sparse adjacency matrix of the risk summary to more prominently identify high-risk periods. By embedding this matrix into attention weights, the model assigns higher query-key similarity to high-risk time steps, thereby preemptively reflecting signs of cash shortages in the local budget forecast output.

[0073] The generative adversarial network expansion module of the present invention is also scalable. The convolution-frequency domain hybrid architecture is equivalent to adding a learnable frequency domain gating layer after the standard one-dimensional convolutional network. The frequency domain branch only accounts for about 20% of the parameter amount, but the prediction accuracy and extreme recall performance are significantly improved, and the increase in computational cost is negligible. The generator-discriminator can still be deployed in the differential privacy scenario: because only local data is involved in training and gradients are not uploaded, the privacy budget is completely consumed in the subsequent federal aggregation stage, and the expansion process will not disclose the original cash details. In summary, this module undertakes the dual functions of "simulating rare cash flows and strengthening the model's perception of tail risks" in the budget dynamic management and report automation chain, providing more accurate demand-supply forecast input for multi-agent capital matching.

[0074] Preferably, the quantum annealing optimizer maps the expanded cash flow tensor data into the Ising Hamiltonian, uses the sample correlation coefficient as the coupling coefficient and the net cash increment bias as the local field intensity, and forms sensitivity spectrum data by statistically analyzing the spin flip frequency through multiple annealing sampling.

[0075] Before the expanded cash flow tensor enters the topologically enhanced prediction model, it is necessary to first determine which time periods have the greatest marginal impact on overall liquidity within the window. Traditional statistical methods typically use variance or range to measure single-point fluctuations, ignoring the coupling between time periods; classical correlation networks struggle to characterize nonlinear dependencies. This paper utilizes a quantum annealing optimizer to solve the near-ground state of the Ising model, transforming the high-dimensional correlation problem into a quantum energy minimization task. This generates a sensitivity spectrum, which serves as the weighting basis for subsequent topological analysis.

[0076] Ising Hamiltonian mapping, assuming a time window length of , the net cash flow increment sequence of the expanded cash flow tensor within the window is expressed as To be compatible with the binary spin system, the sequence is first symbolized:

[0077]

[0078] The above definition maps positive cash flows (surplus) and negative cash flows (gap) to the spin variable Then the coupling coefficient and local field strength are calculated based on the statistical characteristics of the sequence itself. The coupling coefficient uses the sample correlation coefficient:

[0079]

[0080] It is used to describe the synergistic relationship between the net cash flow increments at different time points. If the probability of a surplus or a gap occurring at two time points at the same time is high, then Take a positive value, otherwise take a negative value. The local field strength is given by the single-point bias term:

[0081]

[0082] in represents the positive incremental mean, Represents the negative incremental mean. This term reflects whether the time position is more inclined to a gap or a surplus within the overall window. The Ising Hamiltonian is constructed from this:

[0083]

[0084] The goal is to find the Since the coupling coefficient matrix in financial time series is often non-positive and has a large number of local minima, the classical annealing algorithm is prone to fall into local optimality, resulting in the sensitivity spectrum being insensitive to high-order co-movements. The present invention adopts quantum annealing: the above-mentioned , by using the quantum tunneling effect to search for configurations close to the ground state on the energy surface, it can cross high energy barriers and jump out of local traps.

[0085] Sensitivity spectrum generation, quantum annealing chip repeatedly samples under the same Hamiltonian. The spin configuration obtained for each sampling , count the number of spin flips. Order:

[0086]

[0087] in is the sampling round, is the initial spin (a symbolic sequence can be used), is the indicator function. Frequency The higher the The time bit tends to flip in multiple samplings, and the spin state is unstable, which means that the positive and negative directions of the cash increment are uncertain in various near-ground states and are sensitive to the overall energy (i.e., capital balance). That is, the "sensitivity spectrum".

[0088] Multi-scale topology analysis interface, the sensitivity spectrum is used as channel weight in the subsequent wavelet packet decomposition. Multiply by a diagonal matrix ( is the power index, used to amplify the difference), and then perform discrete wavelet packet decomposition. After the different scale coefficients are weighted with sensitivity, the fluctuation of high-risk time positions is more prominent, thus When complexing, high-dimensional holes are generated that are born earlier and last longer. In the persistent homology barcode, long bars correspond to high-risk clusters, ultimately forming a fine-grained risk summary.

[0089] With this invention, when the sensitivity spectrum shows a significant peak in a particular morning time period, the budget system will mark that time period as a potential liquidity shortage window. By setting up a capital buffer pool at the decision-making level, funds can be allocated before the window arrives, avoiding actual liquidity shortages.

[0090] Compared to purely black-box deep networks, the sensitivity spectrum provides quantitative scores at the time level, allowing finance personnel to intuitively understand "which hour cash flow is most unstable" and "whether the instability is caused by coupling with other time periods or by its own bias." This interpretability is particularly important during quarterly audits.

[0091] In a multi-department federated environment, each node uploads only the sensitivity spectrum, without revealing the original sequence. After aggregating the top peaks in the spectrum, a global risk notification can be issued, prompting each department to make early internal fund reallocations.

[0092] In this example, a set of tests selected cash flow data within a 24-hour window. Node A's expanded tensor showed two periods of extreme spending (early morning and afternoon), while Node B's expanded tensor showed significant revenue in the afternoon. After running quantum annealing sampling, Node A's sensitivity spectrum showed sharp peaks in the second and fourteenth hours; Node B's sensitivity spectrum showed a sharp peak in the tenth hour. Combining the two node sensitivity spectra using a federated average revealed a cash flow shock expected in the second hour of the business platform. By preemptively drawing on internal short-term loans, the organization avoided payment failures in the early trading session the following day. This demonstrates the direct value of sensitivity spectra for early warning.

[0093] In terms of performance, quantum annealing has a time complexity that is constant compared to hardware annealing time, and is approximately independent of window length. Compared to simulated annealing running on a CPU, it reduces sampling time by an order of magnitude. Even in a real-time budget system that triggers over 30 inferences per day, quantum annealing can still generate sensitivity spectra on time without becoming a bottleneck.

[0094] Preferably, the multi-scale topological analysis includes performing wavelet packet decomposition on the expanded cash flow tensor data and sensitivity spectrum data, constructing complexes at each scale and calculating persistent homological barcodes, and combining the birth time and death time pairs of the barcodes into a risk summary.

[0095] After undergoing two-stage processing, generative adversarial networks and quantum annealing, the expanded cash flow tensor contains both its original time-domain appearance and a numerical sensitivity spectrum. Traditional convolutional or recurrent networks alone struggle to capture these multi-resolution features and cross-scale coupling. To address this, this paper introduces a topological data analysis (TDA) framework: Wavelet packet decomposition is used to map the tensor into a multi-scale coefficient space. Persistent coherence barcodes are then computed at each scale, aggregating birth-death time pairs into a "risk summary." This summary serves as both an interpretable feature vector and a sparse adjacency matrix for the subsequent topological attention time series prediction model.

[0096] The role of wavelet packet decomposition in budget time series. Budget time series has both local peaks (minute-level payments) and periodic fluctuations (weekday and month-end patterns). Single-scale filtering is difficult to take both into account. Wavelet packet decomposition transforms the original sequence into The projection is:

[0097]

[0098] in For scale ,Location The wavelet packet basis. It is the local energy captured at this scale. The larger the scale, the lower the frequency. The present invention decomposes the "expanded cash flow tensor" and "sensitivity spectrum vector" respectively, and then splices them by column to obtain a multi-scale multi-channel coefficient matrix In this way, high-frequency anomalies and low-frequency seasonal information are aligned in the same scale system, which facilitates subsequent unified topological processing. ,Will is considered as a set of sample points. The distance between two points is defined as:

[0099]

[0100] For the The coefficient vector corresponding to the time bit. Increase from zero, gradually increase the distance to no more than Point connection generation Complex. With As the complex increases, high-dimensional connected branches (such as rings and holes) appear and disappear continuously. The evolution process on the axis is calculated to be continuous and homological, and a set of barcodes is obtained:

[0101]

[0102] Characterized by The birth threshold, is the death threshold, is the duration. The longer the duration, the more stable the topological feature exists within a wider threshold range, that is, there is a strong resonance relationship between the corresponding time bits.

[0103] In risk summary generation, if all barcodes are directly used, the subsequent attention matrix will be too dense. Therefore, the present invention sets a two-level screening: 1. Select the top barcodes ranked by duration length at each scale; 2. If the time bit groups involved in the barcodes do not overlap, all are retained; if there is any overlap, they are merged into hyperedges.

[0104] The filtered time-bit hyperedge set Convert to a sparse adjacency matrix :If the time is and At the same time, . and its mirror image Together with the diagonal zero elements, they form a “risk summary” that can be directly interpreted as high-risk couplings, and also as a weighted graph for topological attention models.

[0105] Topological barcodes extract nonlinear correlations, which have three effects in budget scenarios: wavelet packets map local anomalies and periodic patterns to a unified scale framework, while continuous coherence extracts cross-column correlations; the combination of the two naturally generates a common "risk language." This creates a persistent barcode, making it difficult for front-end filtering to occur, thus preventing occasional payments from being mistakenly labeled as systemic risk. Each barcode corresponds to a specific time period and persistence threshold. Reports can generate a "risk cluster map" to help financial decision makers understand periods of concentrated risk.

[0106] Take a department's weekly cash flow as an example: the expansion tensor showed an unusually large outflow on Wednesday afternoon, and the sensitivity spectrum showed a significant peak in the spin-flip frequency during the two afternoon hours. After wavelet packet decomposition, the corresponding coefficient energy in the high-frequency scale increased sharply, superimposing the energy of the low-frequency afternoon cycle. Complex at threshold Generate a one-dimensional ring and Disappearance, duration The risk summary records the ring, and the subsequent topological attention model is The afternoon time slot is given a higher weight. The model's prediction indicated that the cash shortfall exceeded the threshold on Wednesday afternoon. The system notified the fund dispatcher four hours in advance, preventing automatic payment failures and demonstrating the practical value of the risk summary.

[0107] Preferably, the topological attention timing prediction model is composed of a recursive dilated convolutional encoder and a decoder, and the attention weight matrix is superimposed with a sparse adjacency matrix obtained according to the risk summary during calculation, and is trained using a loss function containing a structure-preserving regularization term.

[0108] The topological attention time series forecasting model fulfills the core responsibility of transforming enhanced historical cash flow and risk summaries into future funding gap forecasts within the dynamic budget management chain. The model's design principles simultaneously capture three types of information: recursive temporal dependencies (cash flows exhibit stratified seasonality and sudden peaks and troughs); nonlinear interactions across time bins (reflected by multi-scale topological barcodes); and interpretability (outputs can be traced back to risk structures). To this end, the present invention employs a combined architecture of "recursive dilated convolution + graph-augmented self-attention" and incorporates a structure-preserving regularization term during the training phase, ensuring that the prediction layer naturally aligns with the topological patterns of the risk summary graph.

[0109] Encoder: Recursive dilated convolution extracts multi-scale recursive features. Traditional one-dimensional convolutional networks require a deep stack to cover long-range dependencies when processing long sequences, which easily leads to gradient vanishing. Although recursive neural networks can model long dependencies, their parallel efficiency is limited. This paper uses a recursive dilated convolution encoder (also known as "causal dilatedConv") as the first-level feature extractor. The dilation factor of each convolution kernel increases in power order: The layer void ratio is Causal convolution ensures that the convolution kernel only accesses historical time steps; the exponential growth of the dilation rate exponentially expands the receptive field, allowing it to cover the entire window without requiring a deep network. During recursive stacking, the output of each layer is propagated back to the shallower layers via residual connections to avoid degradation.

[0110] In practice, dilated convolution performs multi-resolution filtering on the original signal. For example, with a 24-hour window length, three layers with dilation rates of 1, 2, and 4 can cover the first 7 hours, the first 15 hours, and the full 24-hour window. This way, a single encoded feature map simultaneously captures short-term peaks, intraday trends, and overall equilibrium, providing ample context for subsequent attention layers.

[0111] Risk summary injection: Graph-enhanced self-attention. The standard self-attention layer maps the sequence itself to key, query, and value vectors, calculates the attention weights through dot products, and performs weighted summation. Its essence is to use inner product similarity to measure the "time step Pay attention to the time step However, in cash flows, coupling is often not simple similarity, but comes from the resonance structure revealed by the topological barcode - this is in the risk summary sparse adjacency matrix Already coded in.

[0112] Therefore, the present invention adds an additional term in the attention weight numerator , and get the corrected weight:

[0113]

[0114] in For the query vector for time steps, For the The key vector for each time step, is the channel dimension, is the topology weight coefficient. If two time steps are connected by a barcode ( ), its attention score will be positively boosted; if there is no connection, it is determined solely by the vector dot product. This operation directly transforms the "risk coupling" discovered in the TDA stage into the model calculation graph, which is equivalent to explicitly considering the risk structure when adaptively aligning features.

[0115] The decoder and structure maintain regularization terms. The context tensor output by the encoder-attention layer is fed into two decoding blocks. Each decoding block first mixes information through one-dimensional convolution, and then outputs the net cash flow forecast of the next time window through linear mapping, and finally obtains the prediction vector . The improved Huber loss is used in the training phase:

[0116]

[0117] in is the real future cash flow, is the turning point constant. Huber loss uses a quadratic penalty for small errors and a linear penalty for large errors, which ensures robustness to outliers while maintaining gradient continuity. To encourage the model output to be consistent with the risk summary topology, a structure-preserving regularization term is added to the loss function:

[0118]

[0119] in is the set of edges in the risk summary, The prediction vector The regularization term ensures that the model output remains locally smooth within the same hyperedge. If the hyperedge spans a high-risk time period, the model automatically closes the node prediction value, thereby aligning the peak and valley of funds at a macro level and reducing the risk of internal time mismatch. The final training loss is:

[0120]

[0121] is the regularization weight, which determines the impact of risk topology on training gradient.

[0122] Differential privacy federated training process: Since budget data is sensitive information, the model uses a federated training framework with differential privacy protection. Each department holds a complete copy of the dilated convolutional encoder, graph-enhanced attention, and decoder locally, and extracts the weight difference after several steps of iteration based on its own data. To meet -Differential privacy, this invention is Inject Laplace noise:

[0123]

[0124] is the upper bound of sensitivity. All noisy intermediate weights are encrypted and written to the chain, and the federation server performs momentum FedAvg fusion and distributes new parameters. Experiments show that when a reasonable choice In the case of privacy protection, the global convergence performance of the model is less than 5% lower than that of the non-privacy version, but it can effectively prevent member inference.

[0125] In test data from four departments of an organization, the topological attention model achieved a 12%–18% reduction in root mean square error (RMSE) for 24-hour forecasting tasks compared to pure Transformer, LSTM, and TCN models. More importantly, during quarterly audit meetings, the adjacency matrix provided by the risk summary can be directly rendered as a "cash risk cluster map." When the forecasting model identifies a funding gap in a certain time period, finance staff can quickly view the corresponding hyperedges and barcodes to understand whether the gap is caused by a large afternoon payment or cross-departmental payment and collection coupling, allowing them to formulate countermeasures. Traditional deep networks, by contrast, struggle to provide similar levels of explanation.

[0126] In an implementation example, assuming a 24-hour window length, Department A discovered during training that its risk summary contained a hyperedge spanning the 10th and 11th hours. After training, the model predicted a cash shortfall of 8 million yuan in the 10th hour on Friday. Model visualization showed a strong positive coupling between this shortfall and the 11th hour. Finance personnel discovered an internal prepayment accrual in the 11th hour and shifted the payment date to the previous night. Ultimately, the shortfall was reduced to 1 million yuan in actual settlement, avoiding a payment rejection. This case demonstrates that topological attention models not only output numerical values but also provide concrete, actionable guidance.

[0127] Preferably, the differential privacy federated aggregation forms differential privacy weight differences by injecting Laplace noise into local model differentials, and aggregates the differential privacy weight differences using a federal averaging algorithm with momentum to update global model parameters.

[0128] The differentially private federated aggregation mechanism resolves two major contradictions in cross-departmental budget collaboration: first, departments must share model benefits to achieve more accurate cash flow forecasts; second, the organization must ensure that the information uploaded by any single node is insufficient to infer local detailed ledgers. This paper proposes a compromise solution through "local noise injection + driven momentum federated averaging," mathematically satisfying ε\varepsilonε-differential privacy while maintaining the global convergence speed of the model.

[0129] First, each department iterates the topological attention time series prediction model on the local dataset, and calculates the local weight difference after completing a fine-tuning. Since the weight difference is directly related to the sample size and gradient norm, if it is directly published, the transaction density information will be leaked. Therefore, sensitivity trimming is done before uploading: set the threshold ,like Then scale to The clipped difference is regarded as the function output. - Sensitivity not exceeding , differential privacy noise can be injected according to the Laplace mechanism:

[0130]

[0131] in Budget for privacy, means the mean is zero and the scale is Laplace distribution of . After injecting noise, we get the differential privacy weight difference The Laplace mechanism ensures that for any data set that differs by one transaction record, the upload probability distribution is at most times difference, thus limiting the attacker's ability to infer a single transaction.

[0132] All nodes By writing the distributed ledger to the chain, the coordination server (which can be hosted or voted) periodically reads the chain record and performs the federated averaging with momentum:

[0133]

[0134] is the current global model parameter; is the global learning rate; is the momentum coefficient; For the The sample weight of each node (can be set according to the number of transactions or asset size); is the cumulative momentum vector.

[0135] The momentum term is equivalent to an exponential sliding average, which smooths the convergence direction in the presence of noise and reduces the bias of random noise on the gradient estimate. Since Laplace noise has zero mean, the global error theoretically decays with the number of nodes. Momentum further suppresses the residual variance, allowing the model to achieve performance close to that of centralized training within a limited number of communication rounds.

[0136] Example: Assume that there are four departments in the organization training at the same time. Each node prunes the local weight difference, injects Laplace noise and uploads it. The server reads four copies Then, momentum aggregation is performed, global parameters are updated and broadcast to each node. After ten consecutive communication rounds, the test root mean square error is only increased by less than 1% compared with the noiseless centralized model, while using the same The error of ordinary FedAvg with a privacy budget but no momentum term increases by more than 5%. It can be seen that momentum smoothing significantly improves the convergence quality under differential privacy constraints.

[0137] In terms of effectiveness, differential privacy federated aggregation brings three advantages to the budget dynamic management system: local noise injection is completed before each department uploads, meeting regulatory requirements for financial data confidentiality and minimum identifiability. Driven by volume aggregation, it offsets noise offset and maintains the forecast model's ability to fit seasonal cash demand. Together with the node signature, the chain is written to form an algorithm-level audit log; if abnormal predictions are found later, they can be traced back to the specific weight contribution and the problem node can be located.

[0138] The node state vector is constructed based on the local budget forecast, risk summary and global budget status. The bid request is generated through the multi-agent reinforcement learning model. The bipartite tensor is constructed and the matching priority is solved using the attention optimization algorithm to obtain the budget matching result. After approval, the funds are allocated using homomorphic encryption and the settlement results are recorded to generate a report.

[0139] The local budget forecast provides each budget node with a sequence of cash flows within the next time window. The risk summary records the risk clusters corresponding to high-persistence barcodes. The global budget status is aggregated in real time by the on-chain smart contract, including the unmatched fund pool balances, amounts under approval, and matched amounts for each node. In this invention, the three types of information are combined into a node state vector of fixed length: the first quarter dimension is the local budget forecast value, the next several dimensions are the embedded results of the risk summary, and the remaining dimensions store the global budget status. The risk summary embedding is performed by performing a random walk on its sparse adjacency matrix and sampling the node degree vector, which is then mapped to the same dimension as the predicted value via linear projection, thereby ensuring that different information sources are in the same numerical domain.

[0140] The state vector enters the multi-agent reinforcement learning environment. Each node instantiates a set of soft actor-critic policy bodies. The actor network outputs a continuous two-component action ,in is the bid ratio, mapped to the percentile of the available balance of this node, is the request ratio, corresponding to the percentile of the node’s prediction gap. The critic network evaluates the expected utility as follows:

[0141]

[0142] Indicates the The immediate utility of a node in an experience trajectory; The capital gain after successful matching; is the paired volatility loss; Penalties for idle funds; is a learnable positive coefficient. The actor updates its parameters by maximizing the value of the critic's output, while the critic aims to minimize the temporal difference error. The policy population maintains diversity through genetic crossover and Gaussian mutation to avoid falling into local optima.

[0143] All nodes write actions to the chain in the same window and assemble them into a bid-request binary tensor. The bidding node and Matchable values for request nodes:

[0144]

[0145] Representative Node The amount you are willing to transfer, for its balance; Representation node Required amount, To predict the gap. In order to seek the matching that maximizes the transferable utility in the global scope, the present invention will is sent to the attention optimizer. The optimizer first Calculate the multi-head convolution attention weight:

[0146]

[0147] in , Generated by convolutional features, is the hidden dimension. The weight matrix is The Hadamard product is used to obtain the priority tensor; the flow conservation constraint is then introduced to perform accelerated projected gradient iteration on the priority tensor to solve the matching priority matrix. The constraints require that the sum of the matching weights of each row does not exceed the bid amount, and the sum of each column does not exceed the request amount, ensuring that no node is overdrawn or overspent after allocation. When the gradient iteration terminates, The non-zero items are the flow of funds, and the node submits the approval for the amount associated with it.

[0148] The approval phase introduces a Byzantine fault-tolerant threshold voting mechanism. The supervisory node monitors the matching result event and submits a vote of approval or disapproval in the form of a digital signature. When the number of approval votes reaches the set ratio and the number of disapproval votes is less than the upper limit, the matching result is deemed to be passed. If a conflict occurs, the on-chain logic will fork the shadow of the result and initiate a review without blocking the main chain transaction. The approved matching relationship enters the homomorphic encryption settlement contract. The amount of each transfer is 100%. Encrypted into ciphertext using the BFV algorithm The settlement contract is in the ciphertext domain. The amount is compared with the encrypted threshold. If it is not less than the threshold, a hash time lock is generated and the payment channel is called to complete the transfer; otherwise, the transaction proceeds to the next window for rebalancing. Because the comparison and addition operations are completed within the homomorphic domain, the payment channel and external auditors cannot see the plaintext amount but can verify the correctness of the operation.

[0149] Once the transfer is complete, a settlement result event is automatically generated on-chain. This event contains the encrypted amount, the bid and request node identifiers, the approval timestamp, and the matching priority. The reporting engine regularly scans for newly generated events and uses the hash of the encrypted amount, approval status, and priority to generate a "Fund Flow Table," a "Risk Comparison Table," and an "Approval Time Distribution Chart." Because all fields are sourced from the immutable ledger, reports can be published directly without manual aggregation, maintaining a consistent view throughout the entire lifecycle.

[0150] Example: Twelve nodes were deployed during the month-end peak test. The system collected six hours of cash flow. The predictive model identified a large shortfall between two nodes and, through reinforcement learning, output a request ratio of 80%. The other ten nodes bid based on their balances. The attention optimizer converged after ten sampling attempts, generating a high-density matching graph: the total matching amount covered 93 percent of the shortfall. Byzantine approval took 38 seconds. Homomorphic encryption settlement completed all fund transfers within two minutes. Generated reports showed that the top ten percent of the priority edges in this matching round contributed 40 percent of the total fund flow, consistent with the attention weight fit. Compared to the previous solution, which required a four-hour manual reconciliation process to complete transfers, this invention significantly shortens reconciliation and transfer time. Reports can also be used to trace back unilateral transaction paths, facilitating audits.

[0151] The effectiveness of the algorithm is reflected in three aspects: first, reinforcement learning combined with the predicted value of the state vector and the risk summary can allocate funds in advance and reduce idleness; second, the attention optimization algorithm quickly approximates the maximum flow while ensuring flow conservation, keeping the matching rate at a high level; third, homomorphic encryption allocation is linked with on-chain events to provide an unalterable data source for automated reporting, enabling real-time transparent disclosure.

[0152] Preferably, the multi-agent reinforcement learning model adopts a soft actor-critic architecture, uses genetic crossover and Gaussian mutation to form a strategy population, and iteratively evolves the strategy according to the comprehensive utility calculated based on returns, volatility and idle capital rate to generate bid requests.

[0153] In the dynamic budget management process, each node needs to continuously generate bid requests to participate in fund matching based on its own funding status and the global shortfall. Directly applying single-strategy reinforcement learning can easily lead to the model becoming trapped in a local optimum, resulting in inadequate utilization of system-level liquidity. This paper introduces a multi-agent reinforcement learning framework and incorporates the concept of swarm evolution to maintain diversity in the strategy space, thereby balancing local self-interest with global coordination.

[0154] The Soft Actor-Critic (SAC) is the basic reinforcement learning architecture of this invention. It adopts the maximum entropy principle: maximizing the policy entropy while optimizing the expected return, mathematically encouraging the actor to maintain exploration in the early stage. The actor network outputs two-dimensional continuous actions based on the node state vector. ,in Indicates the bid ratio that the node is willing to provide, represents the proportion of funds the node expects to request; the critic network evaluates the soft value of the action in a given state. Traditional SAC relies solely on gradient updates for a single policy, making it difficult to avoid convergence to a local minimum. This method maintains several "strategy bodies" within each node, namely multiple actor-critic pairs; these policy bodies together form a population, and strategy diversity is maintained through genetic crossover and Gaussian mutation. The specific process is as follows:

[0155] First, the node repeatedly samples each strategy locally, performs an environmental interaction on it, and collects the benefits. , volatility and idle capital rate To unify the evaluation, the present invention provides a comprehensive utility function:

[0156]

[0157] in They are income weight, volatility penalty weight and idle penalty weight. Each weight is set at the system governance level. is the actual capital gain after this round of matching, is the logarithmic scale of the standard deviation of the node fund balance, is the proportion of unmatched and overdue funds. The meanings of the letters in the formula are clarified here. A higher overall utility indicates that the strategy improves resource utilization while controlling volatility, thus being more beneficial to the system as a whole.

[0158] Second, the population is After sorting, a number of high-utility strategies are selected as "parents," while others with low utility are eliminated. A single-point crossover is performed between the parents: a random slice of the weight tensor is taken, and these slices are exchanged to form "offspring." The offspring then undergo a Gaussian mutation step: zero-mean Gaussian noise is applied to their network weights, causing the parameters to drift randomly within a neighborhood. The crossover operation provides large-step search capabilities, while the mutation operation provides local fine-tuning capabilities. These two operations work together to prevent the population from lacking exploration due to early convergence.

[0159] Third, the new generation of policy agents reincorporates sampling interactions. Because the system utilizes entropy regularization, actors maintain a certain degree of randomness during sampling. Once the population size, crossover probability, and variation range are fixed, the policy agent automatically evolves toward high utility during operation, while retaining a small number of exploratory individuals to ensure rapid discovery of new optima despite environmental changes (such as sudden adjustments to the budget cap).

[0160] Unlike traditional evolutionary algorithms, this method continues to use gradient backpropagation in critic network training; evaluation values are derived not from evolutionary ranking but from a soft Q-network. Evolution and gradient updates proceed in parallel, maintaining progressive value learning while also providing swarm hopping capabilities. In short, gradients guide local direction, while evolution ensures global optimization.

[0161] After completing local evolution and determining the current best actor, all nodes upload their selected action sequence to the blockchain within the contracted timeframe. This action includes signatures, available balances, and requested gaps. The system then constructs a bid-request bipartite tensor and uses an attention optimization algorithm to determine matching priorities. After approval and homomorphically encrypted transfers, the settlement results are written back to the ledger. The nodes then use actual returns and volatility to feed back into the local experience pool, retraining the strategy, thus completing a closed-loop process.

[0162] Example: Department A maintains 32 strategies within a test window. Initially, the bid-to-ask ratios of each strategy hovered around 0.5, with significant volatility. After five generations of evolution, the 32 strategies differentiated into three categories: one favoring high bids and low requests to hedge surpluses; one favoring low bids and high requests to fill forecast gaps; and a third maintaining a balance to minimize transaction costs. The system simultaneously employs all three strategies within the same window, smoothing out multiple peaks in capital supply and demand. Compared to a single-strategy SAC benchmark experiment, the evolved population achieved an approximately 10% improvement in matching rate and a 20% reduction in idle capital for the same number of rows, demonstrating the importance of diversity.

[0163] Differential privacy still applies at this stage: nodes submit only action values and signatures to the chain, without gradients or weights; local experience pool data does not leave the network. Privacy threats can only arise from inferring balances by observing actions, but the system masks absolute amounts by adding noise, disclosing only proportional values to avoid revealing specific cash amounts.

[0164] From the perspective of dynamic budget management, multi-agent evolutionary reinforcement learning offers the following advantages. First, nodes can make adaptive decisions based on their own predictions and risk information, eliminating the need for central coordination. Second, the population mechanism diversifies bidding patterns, expands the scope of matching algorithms, and reduces fund mismatches caused by overall strategy homogeneity. Third, the comprehensive utility function explicitly incorporates idleness penalties, encouraging nodes to remain conservative in uncertain situations rather than blindly bidding high to seize liquidity. Regarding automated report generation, the system calculates the matching amounts and returns contributed by various strategy entities, presenting the algorithm's performance as readable indicators in daily fund reports, providing additional decision-making support for the finance department.

[0165] Preferably, the attention optimization algorithm constructs a weight matrix based on the bid request binary tensor data, and uses multi-head convolutional attention and accelerated projected gradient method to solve the matching priority matrix subject to flow conservation constraints.

[0166] The bid-request bipartite tensor describes the supply capacity and demand gap of all nodes in the same time window. Let the bidding node set be , the request node set is For any , bidding node The amount available is , request node The required amount is The node has output action coefficients during the multi-agent evolution process. , respectively, represent the ratio of willing bid to request. The binary tensor elements are recorded as:

[0167]

[0168] Its physical meaning is "if the node With node Fully matched, maximum funds transferable".

[0169] Traditional maximum flow or Hungarian algorithms often encounter two limitations when processing such matrices: First, they only consider the size of the amount, ignoring the cluster structure between nodes (e.g., organizations tend to match each other); second, under strict flow conservation constraints, the iterative convergence speed is hampered by the tensor dimensionality. To address this, this paper proposes a matching priority solution algorithm using "multi-head convolutional attention + accelerated projected gradients," which incorporates structural priors while maintaining a parallelizable numerical optimization path.

[0170] Multi-head convolution attention weights, first we need to determine the Priority of pairs. Define tensors As input, each row represents the supply distribution of a bidding node, and each column represents the demand distribution of a requesting node. Extract local complementary patterns, and set the convolution kernel size empirically based on the size of the capital cluster. The convolution output is mapped to the key matrix , the row vector is mapped to the query matrix A multi-head mechanism is used to measure multi-scale complementarity simultaneously. The attention score is calculated as

[0171]

[0172] in is a hidden dimension. Essentially, it searches for "local blocks of microscopically complementary amounts" within the tensor, which can be understood as soft connections based on the supply and demand graph. Multi-head convolutional attention can better exploit local spatial structure than a simple inner product. For example, if several bidding nodes are located within the same organization, the convolutional weights will amplify their interconnected weights.

[0173] The optimization goal of the traffic conservation constraint is that in actual matching, the funds of a bidding node cannot be repeatedly allocated, and the demand of a requesting node cannot be overfilled. Therefore, it is necessary to find the matrix ,satisfy:

[0174]

[0175] In the above feasible domain Maximize the weighted transfer amount:

[0176]

[0177] in" ” is the Hadamard product. The attention matrix It plays a weighting role, allowing high-potential pairs to get more traffic in the early stages of optimization.

[0178] To accelerate the projected gradient solution, the objective function is written as:

[0179]

[0180] Constraint Set is a closed convex set. Based on Nesterov accelerated gradient framework iteration:

[0181]

[0182]

[0183] in For The projection, is the adaptive learning rate, To accelerate the hyperparameter. about Linear, its gradient is ; The projection operation is equivalent to cropping each row and column separately, which can be achieved through parallel scanning Time. The introduction of historical momentum in the acceleration term significantly improves the convergence speed; the actual measurement is in the dimension Hundreds of iterations are enough to ensure that the capital conservation error is less than one thousandth.

[0184] Example, ten departments participated in the test, forming Tensor. Using multi-head convolutional attention initial weights, accelerating the projected gradient for 30 steps achieves a 98% fund matching rate. Using only the Hungarian algorithm on the same hardware would take nearly two minutes. However, because convolution and matrix multiplication can be parallelized on the GPU, the proposed solution takes less than ten seconds and achieves a slightly higher matching rate (by reusing attention weights to fine-tune internal organizational relationships).

[0185] The matching priority matrix not only outputs specific fund pairs but also serves as a key performance indicator (KPI): the system calculates the transaction volume contributed by the top 10% of prioritized edges in the final match. This metric, displayed as "High-Priority Fund Flow Contribution Rate" in automated reports, helps decision makers assess the appropriateness of the attention algorithm's weighting settings. A low contribution rate indicates that the convolution kernel or learning rate settings need adjustment.

[0186] Convolutional attention also supports online fine-tuning: when it is found that the total amount of matchmaking within an organization is lower than expected for a long time, the prior of the corresponding edge can be adjusted in the background. The new value automatically takes effect in the next window without retraining the entire model. The accelerated projected gradient iteration itself satisfies convex optimization and will find the optimal match under the new weights.

[0187] Preferably, the record of the settlement result is double-digitally signed on the event payload and indexed and written using Morton coding before being written into the distributed ledger. The settlement result is homomorphically encrypted and a report is automatically generated after recording the flow of funds, matching priority and approval timestamp through a hash time lock contract.

[0188] Before writing business operation events into the distributed ledger, the source must be trusted and the records must be non-repudiable. This invention uses double digital signatures to achieve this goal: first, perform Blake3 hashing on the event payload to obtain a digest. , then generate the first signature using the elliptic curve algorithm Ed25519 ; To be compatible with post-quantum security, a second signature is generated using hash-based XMSS The two signatures and the payload are encapsulated together as an information record. Any verifier only needs to hold the corresponding public key to independently verify the signature, thereby eliminating the risk of forgery or repudiation in future audits.

[0189] After the signature is completed, the system needs to write the record into the ledger efficiently and sequentially. To this end, a three-dimensional Morton index is constructed to identify the payment object. , regional code and time window number The binary bit interleaving of is mapped to a single-order number:

[0190]

[0191] in Respectively represent the corresponding dimension Bit, Shift the table left. Index A one-to-one correspondence between block file numbers and intra-block offsets ensures the physical proximity of events for the same payment object or in adjacent time periods. Sequential data flushing reduces disk seeks and improves batch read throughput.

[0192] After the funds are matched, a settlement instruction is generated. In order to disclose the transfer operation on the chain while hiding the amount, the present invention adopts BFV homomorphic encryption: Encoded as polynomial coefficients, encrypted with the public key Encrypted to ciphertext:

[0193]

[0194] The homomorphic property allows the contract to perform addition and comparison in the ciphertext domain without revealing the plaintext. The on-chain smart contract uses the hash time lock (HTLC) to ensure that the fund transfer and the account record are completed atomically: the transferor submits the hash value , the recipient has to pay within a limited time Provide random number To unlock, it will automatically roll back if overdue, ensuring that both parties can get a full refund.

[0195] When writing settlement events, the contract records three additional metadata items: fund flow (bid node address, request node address), match priority (derived from the normalized score of the attention matrix), and approval timestamp. The complete event content is double-signed and re-written to the chain using the Morton index, ensuring that the settlement log and the original business event are in the same address space, facilitating subsequent batch scanning.

[0196] The reporting engine traverses new settlement events on the chain at a preset frequency. For external regulatory nodes without decryption rights, the system directly displays the hash of the ciphertext amount, matching priority, and approval delay. For organizational audit accounts with decryption rights, a homomorphic summation of the ciphertext set is performed, followed by a single decryption to obtain the actual amount. The report template outputs three fixed components: a list of fund flows, a distribution of priority contributions, and an overview of approval times. These components are driven entirely by on-chain data, eliminating the need for manual compilation.

[0197] Example: On a peak day at the end of the month, 450,000 business events were written. Dual signatures and Morton indexing were implemented in the pipeline, achieving an average write rate of 1,200 transactions per second. The matching phase generated 12,800 transfer instructions. The ciphertext totals, after decryption using a single homomorphic summation, were consistent with the bank's ledger, with an error of less than one unit of measurement. The report engine rendered the templates and published them to the board portal within 20 seconds. Compared to the previous manual reconciliation solution, the overall cycle time was reduced from four hours to fifteen minutes. Furthermore, all hash and signature fields are traceable on-chain, significantly reducing audit and compliance costs.

[0198] Through the synergy of double signatures, Morton indexes, BFV homomorphic encryption, and HTLC contracts, this invention realizes a closed loop of "trusted on-chain access - private settlement - automatic disclosure" in the dynamic budget management scenario: it not only ensures the authenticity and sequentiality of accounting events and fund transfers, but also meets the regulatory requirements for real-time transparency and traceability without exposing transaction details. Ultimately, the automated report generation has the dual guarantees of legal effectiveness and technical credibility.

[0199] like Figure 2 As shown, a budget dynamic management and report automatic generation system is used to implement the method described above, and the system includes:

[0200] The ledger synchronization module intercepts business operation records, generates indexes for them based on payment object identifiers, region codes, and time windows, and writes them to the distributed ledger. This data is then synchronized across multiple nodes through conflict-free replicable data type merging and logical vector clock sequencing, forming a global event sequence. Event capture is performed in each business data center using microservice nodes equipped with 2 x 100GbE ERDMA network cards and a 32-core x86_64 CPU, ensuring post-transaction callback latency of less than 50µs. Each node is equipped with an 8TB NVMe SSD RAID 0 array to store three-dimensional Morton index files. The sequential write bandwidth is approximately 6GB / s, enabling sustained writes of millions of events per second during peak periods. Dual digital signing is performed using the onboard TPM 2.0 and a PCIe HSM card (supporting Ed25519 + XMSS), ensuring that cryptographic operations do not occupy the main cores. CRDT merging and logical vector clock sequencing reside in 512GB of DDR5 memory, and Bloom filters are exchanged between nodes via RoCE-v2. PTP timing ensures timing accuracy of less than 1µs across all data centers.

[0201] The predictive analysis module extracts a cash flow tensor from the global event sequence, performs data augmentation on the cash flow tensor using a generative adversarial network (GAN), calculates the sensitivity spectrum of the augmented cash flow tensor using a quantum annealing optimizer, performs multi-scale topological analysis on the cash flow tensor and the sensitivity spectrum to obtain a risk summary, and then inputs the cash flow tensor and the risk summary into a topological attention time series prediction model. The prediction model is updated under a differentially private federated aggregation mechanism to generate a local budget forecast. GAN augmentation and topological attention model training are performed on a 4x NVIDIA A100 GPU server (single-server 160GB HBM2e), with convolution-Fourier and dilated convolutions all parallelized within CUDA cores. Quantum annealing sensitivity spectrum calculation accesses a 5000-qubit D-Wave Advantage QPU in the cloud via a dedicated VPN. This is called once per window, with a round-trip latency of approximately 40ms. Wavelet packets and persistent coherence are batch-computed using GPU TensorCores. The risk summary sparse matrix is generated in GPU memory and fed into the Transformer with zero copy. Differential privacy federated aggregation uses a 24-core IceLake machine equipped with Intel SGX2.0. Weight differentials inject Laplace noise within the enclave; AVX-512 implements FedAvg vector operations with momentum.

[0202] The matching and settlement module constructs a node state vector based on the local budget forecast, risk summary, and global budget state. It generates bid requests based on multi-agent reinforcement learning, constructs a bid-request bipartite tensor, and employs an attention optimization algorithm to solve for matching priorities. This results in a budget matching result. After budget matching results are approved, funds are allocated using homomorphic encryption, settlement results are recorded, and a report is generated. Multi-agent policy inference batches state vectors on a 1x A100 GPU (or PCIe edge TensorCard), generating >50,000 bid requests per second. The bid-request bipartite tensor is computed using multi-head convolutional attention on a TPU-v4 or equivalent GPU. Accelerated projected gradients are run on a CPU AVX-512 for sparse matrix iteration, achieving 100 steps in <1 second for a 500×500 scale. The approval node utilizes a 3+2 BFT blockchain cluster with a 12-core CPU and NVMe log disk, achieving an average confirmation latency of <3 seconds. Fund transfer ciphertext is executed using BFV on a 64-core AMD Epyc server; hash time locks and ciphertext comparisons are accelerated by the SHA-256 / ECC unit built into the HSM card on the same server. Once the on-chain events are fully written, the reporting engine invokes GPU-accelerated SQLScan on a 1×32-core CPU node to generate JSON / HTML reports, which are then pushed to the financial portal via the Nginx reverse proxy.

[0203] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for dynamic budget management and automatic report generation, characterized in that: The following steps are involved: Intercept business operation records, write them into the distributed ledger according to payment object identifier, region code and time window index, merge them with conflict-free replicable data types and synchronize them with logical vector clock sorting to form a global event sequence; A cash flow tensor is extracted from the global event sequence, augmented with a generative adversarial network, and a sensitivity spectrum is calculated using a quantum annealing optimizer. A multi-scale topological analysis is performed to obtain a risk summary. The cash flow tensor and the risk summary are input into a topological attention time series prediction model, which is then updated in a differentially private federated aggregation to generate a local budget forecast. The node state vector is constructed based on the local budget forecast, risk summary and global budget status. The bid request is generated through the multi-agent reinforcement learning model. The bipartite tensor is constructed and the matching priority is solved using the attention optimization algorithm to obtain the budget matching result. After approval, the funds are allocated using homomorphic encryption and the settlement results are recorded to generate a report.

2. The method according to claim 1, characterized in that In the generative adversarial network expansion, the generator adopts a combination structure of convolutional network and frequency domain transformation, and the discriminator performs adversarial training based on time domain error and frequency domain amplitude difference at the same time until the generator output meets the discriminator confidence standard.

3. The method according to claim 1, characterized in that The quantum annealing optimizer maps the expanded cash flow tensor data into the Ising Hamiltonian, uses the sample correlation coefficient as the coupling coefficient and the net cash increment bias as the local field intensity, and forms sensitivity spectrum data by statistically analyzing the spin flip frequency through multiple annealing sampling.

4. The method according to claim 1, wherein The multi-scale topological analysis includes performing wavelet packet decomposition on the expanded cash flow tensor data and sensitivity spectrum data, constructing complexes at each scale and calculating persistent homological barcodes, and combining the birth time and death time pairs of the barcodes into a risk summary.

5. The method according to claim 1, wherein The topological attention temporal prediction model consists of a recursive dilated convolutional encoder and a decoder. The attention weight matrix is superimposed with a sparse adjacency matrix obtained according to the risk summary during calculation, and is trained using a loss function containing a structure-preserving regularization term.

6. The method according to claim 1, characterized in that The differential privacy federated aggregation forms differential privacy weight differences by injecting Laplace noise into local model differentials, and aggregates the differential privacy weight differences using a federal averaging algorithm with momentum to update global model parameters.

7. The method according to claim 1, characterized in that The multi-agent reinforcement learning model adopts a soft actor-critic architecture, uses genetic crossover and Gaussian mutation to form a strategy population, and iteratively evolves the strategy according to the comprehensive utility calculated based on return, volatility and idle fund rate to generate bid requests.

8. The method according to claim 1, characterized in that The attention optimization algorithm constructs a weight matrix based on the bid request binary tensor data, and uses multi-head convolutional attention and accelerated projected gradient method to solve the matching priority matrix subject to flow conservation constraints.

9. The method according to claim 1, characterized in that The settlement result record is double-digitally signed on the event payload before being written into the distributed ledger and indexed and written using Morton coding. The settlement result is homomorphically encrypted and records the flow of funds, matching priority and approval timestamp through a hash time lock contract, after which a report is automatically generated.

10. A budget dynamic management and report automatic generation system, used to implement the method according to any one of claims 1 to 9, characterized in that: The system includes: The ledger synchronization module is used to intercept business operation records, generate indexes for them according to payment object identifiers, region codes, and time windows, write them into the distributed ledger, and synchronize them across multiple nodes through conflict-free replicable data type merging and logical vector clock sorting to form a global event sequence; a prediction analysis module for extracting a cash flow tensor from the global event sequence, performing data augmentation on the cash flow tensor using a generative adversarial network, calculating a sensitivity spectrum of the augmented cash flow tensor using a quantum annealing optimizer, performing multi-scale topological analysis on the cash flow tensor and the sensitivity spectrum to obtain a risk summary, inputting the cash flow tensor and the risk summary into a topological attention time series prediction model, and updating the prediction model under a differentially private federated aggregation mechanism to generate a local budget forecast; The matching and settlement module is used to construct a node state vector based on the local budget forecast, the risk summary and the global budget state, generate bid requests based on multi-agent reinforcement learning, construct a bid-request bipartite tensor and use an attention optimization algorithm to solve the matching priority to obtain a budget matching result. After the budget matching result is approved, funds are allocated in a homomorphic encryption manner, settlement results are recorded, and a report is generated.

Citation Information

Patent Citations

  • Method and system for realizing electronic channel risk control disposal based on code insertion technology

    CN119538269A

  • Model encryption and privacy protection method oriented to artificial intelligence algorithm

    CN120068123A