Budget dynamic management and report automatic generation method and system
By using technologies such as dual signature-Morton encoding and generative adversarial networks in distributed ledgers, combined with quantum annealing and topological attention models, the data silos and tampering risks of budget management in the existing technology are solved, real-time budget dynamic management and automated report generation across departments are realized, and budget prediction accuracy and decision-making efficiency are improved.
Patent Information
- Application Number
- CN202510744490.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-05
AI Technical Summary
The existing technology has problems such as data silos, tampering risks and inefficiency in budget management, making it difficult to realize real-time monitoring and decision-making support for dynamic budget management and automated reports.
Dual signature-Morton encoding is used to write to the distributed ledger, combining the generation of adversarial networks, quantum annealing and topological attention models for cash flow prediction and risk summary, and through multi-agent reinforcement learning and homomorphic encryption, dynamic budget management and report automation are achieved to ensure data consistency, privacy protection and real-timeness.
It realizes cross-department data sharing without leaking account details, improves budget prediction accuracy and timeliness of report generation, reduces manual intervention costs, and provides untampered automated decision-making support.
Smart Images

Figure CN120258579A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fund management, and particularly to a method and system for dynamic budget management and automatic report generation. Background Art
[0002] In modern organizations, the budget is no longer a static document prepared once a year, but a dynamic process that needs to roll synchronously with the business and be instantaneously disclosed within the regulatory window. Dynamic budget management combined with automated reports can monitor cash gaps in real time during peak trading periods, adjust credit limits according to risks, and at the same time reduce the cycle costs of manual consolidation and multiple rounds of proofreading by the finance department, which is a key link in the digital financial transformation. Most existing technologies follow the "central database + batch processing" paradigm: budget forecasting mostly relies on the built-in linear model of the ERP or runs centralized deep networks offline in the data warehouse; settlement information is written into a single-point database and then reports are exported through RPA or BI tools. This mode has three defects: data silos - it is difficult for each department to upload details due to compliance requirements, the central model has insufficient samples, and it is difficult to identify cross-fiscal non-linear risks; risk of tampering - budget adjustment and fund transfer records are stored in a writable database, lacking chain immutable proof, and additional verification is required during audits; low efficiency - batch processing and manual reconciliation usually operate at a granularity of "days" or even "weeks", and minute-level decision-making basis cannot be provided during sudden market fluctuations. Summary of the Invention
[0003] In view of the many problems existing in the above-mentioned prior art, 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 in a chained manner using the double-signature - Morton coding method; then uses a three-stage pipeline of GAN - quantum - topology to generate cash flow forecasts and risk summaries, and differential privacy federated aggregation ensures model sharing without privacy leakage; subsequently, multi-agent reinforcement learning outputs bid requests, and attention - projection gradients obtain the optimal match under flow conservation; the settlement amount is transferred through homomorphic encryption and written into the chain, and the report engine directly reads the on-chain logs to generate real-time compliance reports, forming a full-automatic closed loop of "forecast - matching - settlement - disclosure".
[0004] A method for dynamic budget management and automatic report generation includes the following steps: Intercept business operation records, write them into a distributed ledger according to the payment object identifier, geographical coding, and time window index, and merge them with a conflict-free replicated data type and synchronize them with logical vector clock sorting to form a global event sequence; Extract a cash flow tensor from the global event sequence, expand it through a generative adversarial network and calculate the sensitivity spectrum using a quantum annealing optimizer, perform multi-scale topological analysis to obtain a risk summary, input the cash flow tensor and the risk summary into a topological attention time series prediction model, and update the model in differential privacy federated aggregation to generate a local budget forecast; Construct a node state vector from local budget forecasts, risk summaries, and global budget statuses. Generate bid requests through a multi-agent reinforcement learning model. Construct a bipartite tensor and solve for the matching priority using an attention optimization algorithm to obtain the budget matching result. After approval, allocate funds using homomorphic encryption and record the settlement result, and generate a report.
[0005] Preferably, the generator of the generative adversarial network data augmentation model adopts a combined structure of a convolutional network and a frequency-domain transformation. The discriminator performs adversarial training based on both time-domain errors and frequency-domain amplitude differences until the generator output meets the discriminator confidence standard.
[0006] Preferably, the quantum annealing optimizer maps the augmented cash flow tensor data to an Ising Hamiltonian, uses the sample correlation coefficient as the coupling coefficient, and the net cash increment bias as the local field strength. After multiple annealing samplings, the spin flip frequency is statistically calculated to form sensitivity spectrum data.
[0007] Preferably, the multi-scale topological analysis includes performing wavelet packet decomposition on the augmented cash flow tensor data and sensitivity spectrum data, constructing complexes at each scale and calculating persistent homology barcodes, and combining the birth time and death time pairs of the barcodes into a risk summary.
[0008] Preferably, the topological attention time series prediction model consists of a recursive dilated convolutional encoder and a decoder. The attention weight matrix is calculated by superimposing the sparse adjacency matrix obtained from the risk summary, and a loss function containing a structure-preserving regularization term is used for training.
[0009] Preferably, the differential privacy federated aggregation forms differential privacy weight differences by injecting Laplace noise into the local model differentials, and uses the federated average algorithm with momentum to aggregate the differential privacy weight differences to update the global model parameters.
[0010] Preferably, the multi-agent reinforcement learning model adopts a soft actor-critic architecture, forms a population of policy bodies using genetic crossover and Gaussian mutation, and iteratively evolves the policy bodies according to the comprehensive utility calculated based on revenue, volatility, and capital idle rate to generate bid requests.
[0011] Preferably, the attention optimization algorithm constructs a weight matrix based on the bid request bipartite tensor data, and uses multi-head convolutional attention and the accelerated projection gradient method to solve the matching priority matrix subject to flow conservation constraints.
[0012] Preferably, the recording of the settlement result performs double digital signatures on the event payload before writing to the distributed ledger and indexes and writes it using Morton encoding. The settlement result is processed by homomorphic encryption and records the fund flow, matching priority, and approval timestamp through a hash time lock contract and automatically generates a report.
[0013] A budget dynamic management and report automatic generation system for implementing the method described above. The system includes: A ledger synchronization module, which is used to intercept business operation records, generate indexes for the business operation records according to payment object identifiers, geographical codes, and time windows, write them into a distributed ledger, and perform multi-node synchronization through conflict-free replicated data type merging and logical vector clock sorting to form a global event sequence; A prediction and analysis module, which is used to extract a cash flow tensor from the global event sequence, perform data augmentation on the cash flow tensor using a generative adversarial network, calculate the sensitivity spectrum of the augmented cash flow tensor using a quantum annealing optimizer, perform multi-scale topological analysis on the cash flow tensor and the sensitivity spectrum to obtain a risk summary, input the cash flow tensor and the risk summary into a topological attention time series prediction model, and update the prediction model under a differential privacy federated aggregation mechanism to generate a local budget prediction; A matching and settlement module, which is used to construct a node state vector based on the local budget prediction, the risk summary, and the global budget status, generate a bid request 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 transferred in a homomorphic encryption manner and the settlement result is recorded to generate a report.
[0014] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows: The present invention realizes the augmentation of tail risk samples and the quantification of marginal risks through the linkage of a convolutional-Fourier generative adversarial network and a quantum annealing sensitivity spectrum; The present invention realizes the precise capture of cross-scale co-moving features by generating a risk summary through multi-scale persistent homology and embedding graph attention; The present invention realizes cross-departmental model sharing without disclosing account details through differential privacy federated aggregation; The present invention realizes the optimization of the matching efficiency under the condition of traffic conservation through the superposition of evolutionary reinforcement learning and attention matching; The present invention realizes encrypted transfer and an immutable automatic report through BFV homomorphic encryption combined with a hash time lock contract. Description of the Drawings
[0015] Figure 1 It is a schematic flow chart of the method of the present invention; Figure 2 It is a structural block diagram of the system of the present invention. Detailed Embodiments
[0016] 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 the sake of explanation, numerous specific details are set forth in order to provide a comprehensive understanding of the embodiments of the present disclosure.
[0017] As Figure 1 shown, a method for budget dynamic management and report automatic generation includes the following steps: Intercept business operation records, write them into a distributed ledger according to the payment object identifier, geographical code, and time window index, and merge them with a conflict-free replicated data type and synchronize them with logical vector clock sorting to form a global event sequence; The present invention aims at the budget dynamic management across departments and regions. First, an immutable and globally consistent event sequence is established at the underlying data level, laying a timing benchmark for subsequent quantum sensitivity analysis, topology enhanced prediction, and multi-agent budget matching. The specific process includes four core links: event interception, space-time hybrid indexing, conflict-free merging based on conflict-free replicated data types, and logical vector clock sorting.
[0018] When budget adjustments and transfers occur in the business system and budget execution-related operations are carried out, the interception hook in the message bus immediately listens for transaction receipts and encapsulates them as event objects. The event object fields consist of an event identifier (hash value), event type, event payload, and logical vector clock and carry the payment object identifier , geographical code , time window number as index metadata. The length of the logical vector clock is the same as the total number of nodes. When the intercepted node generates an event locally, only its own component is incremented by one, and the other components maintain the previously synchronized values. This design can describe the partial order relationship without relying on a globally unified physical clock.
[0019] To ensure that the physical disk write order of events in the distributed ledger is friendly to consecutive reads, the present invention uses Morton coding (also known as the Z-curve) to map the triple to a monotonically increasing integer key. The Morton coding formula is as follows:
[0020] Where is the bit length of each dimension, represents right shift, represents left shift, is the bitwise AND operation. After this mapping, events in adjacent departments, regions, and time windows are continuous in disk addresses, and the efficiency of sequential writing and sequential reading is significantly improved.
[0021] After the writing is completed, each ledger node regularly exchanges the Bloom filter summaries of the current voxel blocks. If the filter comparison finds that the other party has keys missing locally, the node pulls the missing event blocks from the other end and performs a set-level merge. The present invention introduces an Observed-Removed Set (OR-Set) as the core conflict-free replicated data type, and the merge operation is a union:
[0022] where and represent the event key sets of the two nodes respectively. New events only perform insertions and do not delete existing elements. Therefore, any exchange order will converge to the same union, completely avoiding the risk of lost updates brought by the traditional "last write wins" strategy. The commutative, associative, and idempotent properties of OR-Set make it unnecessary for additional conflict resolution during network partition recovery and are naturally adapted to cross-regional budget data exchange.
[0023] After the merge, although the nodes hold the same event key set, they still lack a consistent order. For this reason, the present invention uses a logical vector clock to determine the total order. If the event and 's vector clocks satisfy:
[0024] then it is determined that precedes . The algorithm first performs a topological sort to ensure that all comparable events are arranged in causal order; for non-dominant (parallel) events, the key-value original order is retained. The sorting result is the global event sequence, whose order is consistent across all nodes and can be directly used as the input for the subsequent time series model.
[0025] Example illustration: Suppose two nodes A and B generate three events within the same hour window. Event comes from A, at 12:05, with a vector clock of (1, 0); event comes from B and is recorded at 12:10 after synchronizing to , with a vector clock of (1, 1); immediately afterwards, B writes event with a vector clock of (1, 2). Comparing the vector clocks, it can be seen that , so the unique arrangement of the global event sequence is . Once the sorting is completed, each event will continue to serve the construction of the cash flow tensor and subsequent quantum sensitivity analysis, enabling all budget nodes to share the same historical view during the algorithm execution.
[0026] Based on this mechanism, the present invention has the following effects: First, data consistency. The idempotent feature of the OR-Set allows nodes to automatically recover to a consistent state after experiencing network partitioning; when any single point of failure reconnects, there is no need for manual intervention in case of conflicts.
[0027] Second, sequential determinism. The logical vector clock does not rely on hardware clock synchronization, which can avoid the common clock drift problem in geographically distributed environments, ensure the strict order of fund flows from a global perspective, and provide a stable benchmark for quantum annealing sensitivity spectrum analysis.
[0028] Third, throughput improvement brought by sequential disk writing. The Morton coding mapping eliminates disk seek caused by random writing, and the sequential writing speed is significantly improved; the same advantage can also be enjoyed during background batch sequential reading.
[0029] Fourth, audit traceability. Each event is fixed with a hash and a dual signature, and its key value corresponds one-to-one to the physical block file and offset. The audit system can retrieve the specified event in milliseconds, achieving regulatory penetration.
[0030] Fifth, scalability. When the number of departments increases, the length of the vector clock expands accordingly. The present invention provides a hierarchical compression strategy: among multiple departments, the regional nodes only save the sub-vectors of their own departments, and the root node saves the complete vector, thereby reducing the storage pressure caused by the vector length from linear growth to logarithmic growth, and the system can evolve smoothly when the business scale expands.
[0031] Extract the cash flow tensor from the global event sequence, expand it through a generative adversarial network and calculate the sensitivity spectrum using a quantum annealing optimizer, perform multi-scale topological analysis to obtain a risk summary, input the cash flow tensor and the risk summary into a topological attention time series prediction model, and update the model in differential privacy federated aggregation to generate a local budget prediction; Each revenue and expenditure event obtained from the global event sequence has been sorted according to the logical vector clock, so it can be directly aggregated by the time window clipping module according to continuous time periods. The system sets a fixed window length, maps the net cash flow and business labels within the same window into a six-dimensional vector, and then stitches them along the time dimension into a cash flow tensor with a size of 24×6. This tensor not only retains the hourly resolution but also includes discrete features such as currency, revenue and expenditure direction, and business type, and has a complete descriptive power for budget flows.
[0032] In a budget environment involving multiple departments, the probability of extreme tail events is much lower than that of events near the mean, resulting in the dilution of abnormal fluctuations when directly training a time series model. The present invention expands the training set through a generative adversarial network: the generator adopts a stacked structure of alternating convolution and fast Fourier convolution, capable of simultaneously simulating local strong cycles and cross-cycle jumps; the discriminator examines both the time-domain mean square error and the frequency-domain energy spectrum difference, and approximates the true distribution in an adversarial manner. The generator finally outputs an augmented tensor whose similarity to the original sample exceeds a preset threshold, and the two are combined as the input for subsequent modeling. The augmentation strategy significantly improves the recognition sensitivity of the prediction model to long-tail cash flows and eliminates the damage to time series correlation caused by traditional oversampling.
[0033] The augmented tensor is input into the quantum annealing module for sensitivity spectrum calculation: first, the net cash increment at each time step is symbolized as a spin variable . A coupling matrix is constructed through the sample correlation coefficient , and a bias term is constructed based on the mean difference of the net cash increment to obtain the Ising Hamiltonian:
[0034] On the quantum annealing chip, is subjected to multiple annealing samplings, and different spin flip frequencies constitute the sensitivity spectrum, and a higher value indicates a greater marginal contribution of this time position to the overall cash gap.
[0035] The cash flow tensor and the sensitivity spectrum then enter the multi-scale domain through wavelet packet decomposition. At each scale, a complex is established with the filtering coefficients as nodes and the persistent homology barcode is calculated. The persistence length between the birth time and the death time of the barcode describes the importance of topological features. The barcodes with the top-ranked persistence durations are retained and translated into a sparse adjacency matrix , which depicts the potential resonance risk structure between different time periods, namely the "risk summary".
[0036] The topological attention time series prediction model uses recursive dilated convolution to extract multi-scale dependencies at the encoding end and a standard self-attention structure at the decoding end. The weight calculation formula is:
[0037] where is the query vector, is the key vector, is the dimension constant, is the topological weight coefficient. Add After that, the attention allocation will take into account both the time series similarity and the risk intensity, so that the model can detect potential liquidity risks derived from high-persistence homology barcodes from the prediction window to the pre-sampling detection.
[0038] Each department node fine-tunes the topological attention model with its own augmented samples locally to obtain the local weight difference. . To protect the privacy of the cash flow, the node uses the Laplace mechanism to inject random noise, and the noise amplitude is set by the privacy budget. After the noisy weights are uploaded to the chain, the federated average with momentum is performed by the coordination server: all node contributions are weighted according to the historical model convergence degree, and then combined with the momentum vector to generate new global parameters and send them back. Differential privacy federated aggregation not only maintains the model performance but also ensures that the sensitive cash sequences of individual nodes cannot be inferred from the weight updates.
[0039] The updated model infers the latest window to output the local budget prediction vector, and the prediction results include the net cash flow, median risk quantile, and abnormal fluctuation confidence level for each hour within the next window. In practice, when an organization compares the traditional ARIMA with the solution of the present invention, it uses 90-day historical data for training and randomly selects 10 days for verification. The average absolute error of ARIMA on days with abnormally high expenditures is about twice that of normal days, while the error increase of the present invention is less than 20%, verifying the advantage of topological enhanced attention combined with quantum sensitivity spectrum in capturing long-tail risks.
[0040] In addition to the improvement in prediction accuracy, the present invention also obtains the following effects: First, the generation of adversarial network augmentation greatly reduces the dependence on manually labeled samples; second, the sensitivity spectrum obtained by quantum annealing is highly consistent with the high-incidence period of the capital gap identified by the finance department after visualization, providing a quantitative basis for risk interpretation; third, differential privacy federated aggregation allows each department to share the model benefits within the legal compliance framework without exposing specific transaction details; fourth, the risk summary, as a sparse edge weight matrix, significantly reduces the computational amount of the attention layer, and the overall inference latency is reduced by about 30% in the test of simultaneous training of the finances of eight departments.
[0041] In summary, the present invention constructs an interpretable, scalable, and privacy-protected budget prediction method through the cascaded pipeline of "GAN data augmentation - quantum sensitivity spectrum - topological homology - attention prediction - differential privacy federated aggregation", provides a reliable forward-looking cash flow baseline for the automated generation of financial statements, and lays a data foundation for subsequent multi-agent game matching.
[0042] Preferably, the generator of the generative adversarial network data augmentation 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 output of the generator meets the discriminator confidence standard.
[0043] The design goal of the generative adversarial network data augmentation model is to construct a sufficient amount of long-tail samples in the historical cash flow tensor, enabling the subsequent topological attention time series prediction model to learn the extreme fluctuation patterns that are rare but affect budget security. Traditional one-dimensional convolutional generators can only capture local trends in the time domain and cannot reproduce high-frequency jitters and cross-cycle resonances simultaneously. In the present invention, a discrete Fourier transform layer is inserted into the backbone of the convolutional network to map time domain features to the frequency domain, perform amplitude modulation, and then inverse transform back to the time domain for output, forming a hybrid generator with "time-frequency dual-domain coupling". The convolutional branch is responsible for reconstructing the low-frequency baseline, and the frequency domain branch is responsible for injecting high-frequency energy. After the residuals of the two are superimposed and activated by Tanh, a candidate augmentation tensor is obtained.
[0044] The discriminator adopts a dual-path architecture: the time domain path inputs the residual vectors of the original tensor and the generated tensor at each time step and calculates the mean square error; the frequency domain path first performs a discrete Fourier transform to extract the amplitude spectrum vector and then calculates the amplitude difference. The overall discriminant loss is defined as:
[0045] where 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 respectively. The generator is updated with:
[0046] as the objective function, so that the generated tensor approximates the real distribution simultaneously on both paths. The training process is iterated in the adversarial loop until the discriminator output confidence is lower than the set threshold. At this time, the discriminator is difficult to distinguish between true and false, indicating that the generator has been able to reproduce the statistical characteristics of historical samples in the time-frequency two domains.
[0047] In the budget dynamic management scenario, the occurrence frequency of extreme cash flow events is low but the risk impact is high. If the original sequence is directly used to train the prediction model, the long-tail pattern will be masked by the frequent pattern, resulting in the prediction lacking sensitivity to abnormal payments. The convolutional-frequency domain hybrid generator specifically expands the sample density in the high-frequency part, improving the tail probability mass of the training set; at the same time, the frequency domain amplitude difference constraint of the discriminator ensures that the power spectrum of the generated samples is consistent with that of the real samples and does not introduce false energy. This not only avoids destroying the time series structure by ordinary noise injection methods but also avoids generating overly smooth pseudo-samples relying only on time convolution.
[0048] Example: On an organizational financial dataset, with the semi-annual cash flow as the benchmark, the proportion of single extremely large expenditures (defined as exceeding three times the monthly average) in the real tensor accounts for about 1% of all samples. After two thousand rounds of adversarial training of the generator-discriminator of the present invention, the proportion of extremely large expenditure segments in the augmented set increases to 15%. Subsequently, the topology attention time series prediction model is trained with the augmented set to conduct a retrospective test on the cash gap in the next week. The results show that the recall rate of the non-augmented version for extremely large expenditures is 0.53, and the false alarm rate is 0.12; after augmentation, the recall rate increases to 0.71, and the false alarm rate only slightly increases to 0.13. This comparison verifies that the time-frequency dual-domain augmentation strategy can improve the detection ability of extreme events without significantly increasing false alarms, providing a more reliable signal for dynamic budget locking.
[0049] The augmented samples are mapped to the Ising Hamiltonian by the quantum annealing module. The sensitivity spectrum obtained after annealing is sharper, and the spin flip frequency of the extreme time steps increases significantly relative to the average value. The multi-scale topology analysis further amplifies this difference, and the sparse adjacency matrix of the risk summary thus more prominently marks the high-risk time periods. After embedding this matrix into the attention weights, the model assigns higher query-key similarity to the high-risk time steps, thereby reflecting the signs of cash shortage in advance in the local budget prediction output.
[0050] The generative adversarial network augmentation module of the present invention also has scalability. The convolutional-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 accounts for only about 20% of the parameter quantity, 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 participates in the training and does not upload gradients, the privacy budget is completely consumed in the subsequent federated aggregation stage, and the original cash details will not be leaked during the augmentation process. Generally speaking, 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 prediction inputs for multi-agent fund matching.
[0051] Preferably, the quantum annealing optimizer forms sensitivity spectrum data by mapping the augmented cash flow tensor data to the Ising Hamiltonian, using the sample correlation coefficient as the coupling coefficient and the net cash increment bias as the local field strength, and statistically calculating the spin flip frequency through multiple annealing samplings.
[0052] Before the augmented cash flow tensor enters the topological enhanced prediction model, it is necessary to first extract "which time positions have the most marginal impact on the overall liquidity within the window". Traditional statistical methods usually use variance or range to measure single-point fluctuations, ignoring the coupling between time positions; while classical correlation networks are difficult to characterize non-linear dependencies. The present invention uses 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, thereby generating a sensitivity spectrum and using it as the weight basis for subsequent topological analysis.
[0053] Ising Hamiltonian mapping. Let the length of a time window be , and the net cash flow increment sequence of the augmented cash flow tensor within this window is denoted as . To be compatible with the binary spin system, first perform symbolization on the sequence:
[0054] The above definition maps the positive cash flow (surplus) and negative cash flow (gap) to the spin variable . Then, calculate the coupling coefficient and local field strength based on the statistical characteristics of the sequence itself. The coupling coefficient uses the sample correlation coefficient:
[0055] to describe the co-movement relationship of the net cash flow increments at different time positions; if the probability of simultaneous occurrence of surplus or gap at two time positions is high, then takes a positive value, otherwise takes a negative value. The local field strength is given by the single-point bias term:
[0056] where represents the mean of positive increments, represents the mean of negative increments. This term reflects whether the time position is more inclined to gap or surplus within the overall window. Thus, the Ising Hamiltonian is constructed:
[0057] The goal is to find the spin configuration that can minimize . Since the coupling coefficient matrix in financial time series is often non-positive definite and there are a large number of local minima, the classical annealing algorithm is prone to falling into local optima, resulting in the sensitivity spectrum being insensitive to high-order co-movements. The present invention uses quantum annealing: load the above on the hardware qubits, and use the quantum tunneling effect to search for the configuration close to the ground state on the energy surface, which can cross the high energy barrier and jump out of the local trap.
[0058] Sensitivity spectrum generation. The quantum annealing chip samples repeatedly under the same Hamiltonian. For the spin configuration obtained from each sampling, count the number of spin flips. Let:
[0059] where is the sampling round, is the initial spin (optionally a symbolized sequence), is the indicator function. The higher the frequency , it indicates that the -th time bit tends to flip in multiple samplings, and the spin state is unstable, indicating that the positive and negative directions of the cash increment have a large uncertainty among various near-ground states and are sensitive to the contribution to the overall energy (i.e., the fund balance). The sequence is the "sensitivity spectrum".
[0060] For the multi-scale topological analysis interface, the sensitivity spectrum is used as the channel weight in the subsequent wavelet packet decomposition. The specific approach is to multiply the cash flow tensor by the diagonal matrix ( is the power exponent used to amplify the difference), and then perform the discrete wavelet packet decomposition. After the different scale coefficients are weighted by the sensitivity, the fluctuations of the high-risk time bits are more prominently shown, thereby generating higher-dimensional holes that are born earlier and last longer when constructing complexes. In the persistent homology barcode, the long bars correspond to high-risk clusters, and finally a fine-grained risk summary is formed.
[0061] Through the present invention, when there is an obvious peak in the sensitivity spectrum in a certain morning time band, the budget system will mark this time band as a potential liquidity shortage window. By setting up a fund buffer pool at the decision-making level, funds can be scheduled before the window arrives to avoid an actual gap.
[0062] Compared with the pure black-box deep network, the sensitivity spectrum gives a quantitative score at the time bit level, and financial personnel can intuitively understand "which hour has the most unstable cash behavior" and "whether the instability is caused by the coupling with other time bits or its own bias". This interpretability is particularly important during quarterly audits.
[0063] In a multi-departmental federated environment, each node uploads only the sensitivity spectrum without leaking the original sequence. After aggregating the top peaks in the summary spectrum, a global risk notification can be issued to prompt each department to make internal fund reallocation in advance.
[0064] Embodiment: A set of tests selected cash flow data within a 24-hour window. The expanded tensor of node A shows two extreme expenditures (early morning and afternoon), and the expanded tensor of node B shows a large amount of income in the afternoon. After running quantum annealing sampling, the sensitivity spectrum of node A has spikes in the second hour and the fourteenth hour; the sensitivity spectrum of node B has a spike in the tenth hour. After synthesizing the sensitivity spectra of the two nodes according to the federal average, it is identified that the business platform will have a cash flow shock in the second hour. By calling internal short-term loans in advance, the organization avoided the payment failure in the early trading of the next day. Practice has proved that the sensitivity spectrum has direct value for early warning.
[0065] In terms of performance, the time complexity of quantum annealing is a constant-level hardware annealing time, which is approximately independent of the window length; compared with simulated annealing running on the CPU, the sampling time is shortened by an order of magnitude. Even in a real-time budget system that triggers more than 30 inferences per day, quantum annealing can still generate sensitivity spectra on time and will not become a bottleneck.
[0066] Preferably, the multi-scale topological analysis includes performing wavelet packet decomposition on the expanded cash flow tensor data and the 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.
[0067] After the expanded cash flow tensor is processed by the generative adversarial network and quantum annealing, it contains both the original time domain and a numerical sensitivity spectrum. It is difficult to capture such multi-resolution features and cross-scale coupling simultaneously with traditional convolutional or recurrent networks. For this reason, the present invention introduces the topological data analysis (TDA) framework: the tensor is mapped to a multi-scale coefficient space using wavelet packet decomposition, and then the continuous homology barcode is calculated at each scale to summarize the birth-death time pairs into a "risk summary". This summary is both an interpretable feature vector and a sparse adjacency matrix for the subsequent topological attention time series prediction model.
[0068] The role of wavelet packet decomposition in budget time series. Budget time series has both local peaks (payments at the subsecond level) and periodic fluctuations (weekday and month-end rules). Single-scale filtering is difficult to take both into account. Wavelet packet decomposition transforms the original sequence The projection is:
[0069] 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, the high-frequency anomalies and low-frequency seasonal information are aligned in the same scale system, facilitating subsequent unified topological processing. II. Complex construction and persistent homology At each scale , take as the sample point set. Define the distance between two points as:
[0070] is the coefficient vector corresponding to the th time position. As the threshold increases from zero, gradually connect the points with a distance not exceeding to generate complexes. As increases, high-dimensional connected components (such as loops, holes) continuously appear and disappear. Calculate the persistent homology for the evolution process of the complex on the axis to obtain the barcode set:
[0071] is the birth threshold of the feature , is the death threshold, is the persistence length. The longer the persistence time, the more stable the topological feature exists within a wider threshold range, that is, there is a strong resonance relationship between the corresponding time positions.
[0072] Risk summary generation. If all barcodes are directly used, it will lead to an overly dense subsequent attention matrix. The present invention sets two-level screening: 1. Select the barcodes with the top several persistence lengths at each scale; 2. If the time position groups involved in the barcodes do not overlap, keep all; if there is an intersection, merge them into a hyperedge.
[0073] The set of time position hyperedges obtained after screening is converted into a sparse adjacency matrix : If the time positions and appear in a certain hyperedge at the same time, then . and its mirror image together with the diagonal zero elements constitute the "risk summary", which can be directly interpreted as high-risk coupling and also serves as the weighted graph of the topological attention model.
[0074] Topological barcode extraction is nonlinearly correlated, bringing three effects in the budget scenario: Wavelet packets map local anomalies and periodic patterns to a unified scale framework, while persistent homology extracts cross-column correlations; the combination of the two naturally generates the same "risk language". Brief jitters require a sufficiently large To form a continuous barcode, it is difficult to enter the front-end screening, thus avoiding mislabeling accidental payments as system risks. Each barcode corresponds to a specific set of time positions and a continuous threshold, and the report can generate a "risk cluster diagram" to help financial decision-makers understand the risk concentration period.
[0075] Taking the weekly cash flow of a certain department as an example: an abnormal large disbursement occurred in the expanded tensor on Wednesday afternoon, and the sensitivity spectrum was significant for the peak value of the spin flip frequency in the two hours after noon. After wavelet packet decomposition, the energy of the corresponding coefficients in the high-frequency scale increased steeply and was superimposed on the energy of the low-frequency afternoon period. The complex at the threshold generates a one-dimensional loop and at disappears, and the continuous length ranks first in the same scale. The risk summary records this loop, and subsequently, the topological attention model assigns higher weights to the afternoon time positions. The model prediction value shows that the cash gap on Wednesday afternoon exceeds the threshold; the system notifies the fund scheduling four hours in advance, avoiding automatic payment failures and verifying the practical value of the risk summary.
[0076] Preferably, the topological attention time series prediction model is composed of a recursive dilated convolutional encoder and a decoder. The attention weight matrix is superimposed with a sparse adjacency matrix obtained from the risk summary during calculation, and a loss function containing a structure-preserving regularization term is used for training.
[0077] The topological attention time series prediction model undertakes the core responsibility of "converting the enhanced historical cash flow and risk summary into future fund gap predictions" in the entire budget dynamic management chain. The design principle of this model is to capture three types of information simultaneously: one is recursive time dependence (cash flow shows hierarchical seasonality and sudden peaks and valleys); the second is non-linear co-movement across time positions (reflected by multi-scale topological barcodes); the third is interpretability (the output results can be traced back to the risk structure). For this reason, the present invention adopts a "recursive dilated convolution + graph-enhanced self-attention" combined architecture and adds a structure-preserving regularization term in the training stage to make the prediction layer naturally align with the topological pattern of the risk summary graph.
[0078] Encoder: The recursive dilated convolution extracts multi-scale recursive features. Traditional one-dimensional convolutional networks require a relatively deep stack to cover long-distance dependencies when processing long sequences, which is prone to gradient dissipation; although recurrent neural networks can model long dependencies, their parallel efficiency is limited. The present invention selects a recursive dilated convolutional encoder (also called "causal DilatedConv") as the first-layer feature extractor. The dilation factor of each level of convolutional kernel increases in power order: the dilation rate of the . Causal convolution ensures that the convolutional kernel only accesses historical time steps; the exponentially increasing dilation rate makes the receptive field expand exponentially, covering the entire window without the need for a deep network. When recursively stacked, the output of each layer is fed back to the shallow layers through residual connections to avoid degradation.
[0079] Atrous convolution is manifested in practice as multi-resolution filtering of the original signal. For example, when the window length is 24 hours, three layers with dilation rates of 1, 2, and 4 can cover the ranges of the first 7 hours, the first 15 hours, and the entire 24 hours respectively. In this way, a coded feature map contains short-term peaks, intraday trends, and overall equilibrium at the same time, providing sufficient context for the subsequent attention layer.
[0080] 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 measure the "time step Attention should be paid to the time step " using the inner product similarity. However, in cash flows, the coupling is often not a simple similarity, but comes from the resonance structure revealed by topological barcodes - which has been encoded in the sparse adjacency matrix of the risk summary .
[0081] Therefore, the present invention adds an additive term to the numerator of the attention weight to obtain the modified weight:
[0082] where is the query vector at the th time step, is the key vector at the th time step, is the channel dimension, is the topological graph weight coefficient. If two time steps are connected by a barcode ( ), then their attention scores will be positively boosted; if there is no connection, it is only determined by the vector dot product. This operation directly transforms the "risk coupling" discovered in the TDA stage into the model's computational graph, which is equivalent to explicitly considering the risk structure when adaptively aligning features.
[0083] Decoder and structure-preserving regularization term. 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 prediction for the next time window through a linear mapping, finally obtaining the prediction vector . In the training stage, an improved Huber loss is used:
[0084] where is the true future cash flow, is the turning point constant. Huber loss uses quadratic penalty for small errors and linear penalty for large errors, which ensures robustness to outliers and maintains gradient continuity. In order to encourage the model output to be consistent with the risk summary topology, a structure-preserving regularization term is added to the loss function:
[0085] in is the edge set in the risk summary, is the prediction vector The regularization term forces the model output to remain locally smooth within the same hyperedge; if the hyperedge spans a high-risk time period, the model needs to automatically pull the node prediction value closer, thereby keeping the peak and valley of funds aligned at a macro level and reducing the risk of internal time mismatch. Final training loss:
[0086] is the regularization weight, which determines the influence of risk topology on training gradient.
[0087] 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 convolution 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:
[0088] is the upper bound of sensitivity. All noisy intermediate weights are encrypted and written to the chain, and the federated server performs momentum FedAvg fusion and distributes new parameters. Experiments show that when a reasonable choice In this case, 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.
[0089] On the test data of four departments of an organization, compared with pure Transformer, LSTM and TCN models, the topological attention model reduced the root mean square error of the 24-hour prediction task by 12%-18%. More importantly, in the quarterly audit meeting, the adjacency matrix provided by the risk summary can be directly rendered as a "cash risk cluster map". When the prediction model determines a certain time period as a funding gap, the financial staff can quickly view the corresponding hyperedges and barcodes to understand whether the gap is caused by a large payment in the afternoon or a cross-departmental payment coupling, so as to formulate countermeasures. In contrast, traditional deep networks find it difficult to provide similar levels of explanation.
[0090] Implementation example. Assume that the window length is 24 hours. When department A was training, it was found that a hyperedge spanning the 10th and 11th hours was included in the risk summary. After training, the model predicted a cash gap of 8 million at the 10th hour in the Friday prediction. The model visualization showed a strong positive coupling between this gap and the 11th hour. After the financial staff inquired, it was found that there was an internal prepaid account provision at the 11th hour, and the payment date was advanced to the previous night. Finally, the gap was reduced to 1 million in the actual settlement, avoiding payment rejection. This case shows that the topological attention model not only outputs numerical values but also provides specific actionable guidelines.
[0091] Preferably, the differential privacy federated aggregation forms differential privacy weight differentials by injecting Laplace noise into the local model differentials, and uses the federated average algorithm with momentum to aggregate the differential privacy weight differentials to update the global model parameters.
[0092] The differential privacy federated aggregation mechanism solves two major contradictions in cross-departmental budget collaboration: First, departments must share model benefits to obtain more accurate cash flow forecasts; second, at the organizational level, it is necessary to ensure that the information uploaded by any single node is not sufficient to reverse-engineer the local detailed accounts. The present invention gives a compromise solution through "local noise injection + federated average with momentum", which satisfies ε-differential privacy mathematically and at the same time maintains the global convergence speed of the model.
[0093] First, each department iterates the topological attention time series prediction model on the local dataset. After one fine-tuning, the local weight differentials are calculated. . Since the magnitude of the weight differentials is directly related to the sample size and the gradient norm, directly publishing them will disclose transaction density information. Therefore, sensitivity clipping is performed before uploading: Let the threshold , if then scale it proportionally to . The clipped differentials are regarded as the output of the function, and its -sensitivity does not exceed , and differential privacy noise can be injected according to the Laplace mechanism:
[0094] where is the privacy budget, represents a Laplace distribution with a mean of zero and a scale of . After injecting the noise, the differential privacy weight differentials are obtained. The Laplace mechanism ensures that for any two datasets that differ by one transaction record, the upload probability distribution differs by at most times, thus restricting the attacker's ability to infer a single transaction.
[0095] All nodes send Write to the chain through the distributed ledger, and the coordination server (which can be hosted or elected by voting) periodically reads the records on the chain and executes federated averaging with momentum:
[0096] is the current global model parameter; is the global learning rate; is the momentum coefficient; is the sample weight of the th node (which can be set according to the number of transactions or asset size); is the cumulative momentum vector.
[0097] The momentum term is equivalent to an exponential moving average, which can smooth the aggregation direction in the presence of noise and reduce the deviation of the stochastic noise from the gradient estimation. Since the mean of the Laplace noise is zero, theoretically the global error decays as the number of nodes increases, and the momentum further suppresses the remaining variance, enabling the model to achieve performance close to that of centralized training within a limited number of communication rounds.
[0098] Example: Assume that there are four departments under an organization training simultaneously. Each node injects Laplace noise after local weight difference clipping and uploads it. After the server reads four copies it performs momentum aggregation, updates the global parameters and broadcasts them to each node. After ten consecutive communication rounds, the test root mean square error increases by less than 1% compared to the noise-free centralized model, while the error of the ordinary FedAvg with the same - privacy budget but without the momentum term increases by more than 5%. It can be seen that momentum smoothing significantly improves the convergence quality under differential privacy constraints.
[0099] In terms of effects, differential privacy federated aggregation brings three advantages to the budget dynamic management system: Local noise injection has been completed before each department uploads, meeting the regulatory requirements for financial data confidentiality and minimum identifiability. Momentum aggregation offsets the noise deviation and maintains the fitting ability of the prediction model to seasonal cash demands. All along with the node signatures are written to the chain to form an algorithm-level audit log; if an abnormal prediction is found later, it can be traced back to the specific weight contributions and the problem node can be located.
[0100] Construct a node state vector based on local budget predictions, risk summaries, and global budget statuses, generate bid requests through a multi-agent reinforcement learning model, construct a bipartite tensor and solve for the matching priority using an attention optimization algorithm to obtain the budget matching result. After approval, allocate funds using homomorphic encryption and record the settlement result to generate a report.
[0101] The local budget forecast provides a cash flow sequence for each budget node within the next time window. The risk summary records the risk clusters corresponding to the high persistence barcodes. The global budget status is the real-time aggregation by the on-chain smart contract of the unallocated fund pool balance, the amount under approval, and the allocated amount at each node. These three types of information are combined into a node status vector with a fixed length in the present invention: the first quarter of the dimensions are the local budget forecast values, several consecutive dimensions are the embedding results of the risk summary, and the remaining dimensions store the global budget status. The risk summary embedding is performed by conducting a random walk on its sparse adjacency matrix and sampling the node degree vector, and then mapping it to the same dimension as the forecast value through a linear projection, so as to ensure that different information sources are in the same numerical domain.
[0102] The status 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 , where 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 predicted gap of this node. The critic network evaluates the expected utility of the following formula:
[0103] represents the immediate utility of the th node in an experience trajectory; is the capital gain after successful matching; is the pairing fluctuation loss; is the capital idle penalty; is a learnable positive coefficient. The actor updates the parameters by maximizing the value output by the critic, and the critic aims to minimize the temporal difference error. The policy body population maintains diversity through genetic crossover and Gaussian mutation to avoid falling into local optima.
[0104] All nodes write their actions to the chain within the same window and assemble them into a bid-request bipartite tensor. Denote the matchable value of the th bid node and the th request node:
[0105] represents the amount that node is willing to set aside, is its balance; represents the amount demanded by node , is its predicted gap. In order to seek the matching that maximizes the transferable utility globally, the present invention sends to the attention optimizer. The optimizer first generates Calculating the attention weights of multi-head convolution:
[0106] where , is generated from convolutional features, is the hidden dimension. After the Hadamard product of the weight matrix and , the priority tensor is obtained; subsequently, a flow conservation constraint is introduced to perform accelerated projected gradient iteration on the priority tensor to solve the matching priority matrix . The constraint requires that the sum of the matching weights in each row does not exceed the bid amount, and the sum of each column does not exceed the request amount, ensuring that there is no node overdraft or overage after allocation. When the gradient iteration terminates, the non-zero terms of are the fund flow directions, and the nodes submit the associated amounts for approval.
[0107] In the approval stage, a Byzantine fault-tolerant threshold voting mechanism is introduced. The regulatory nodes listen to the matching result events and submit approval or disapproval votes in the form of digital signatures. 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 considered passed. If there is a conflict, the on-chain logic shadows and forks the result and initiates a reconsideration without blocking the main chain transactions. The approved matching relationships enter the homomorphic encryption settlement contract. Each transferred amount is encrypted into ciphertext by the BFV algorithm . The settlement contract compares with the encrypted threshold in the ciphertext domain. If the amount is not less than the threshold, a hash time lock is generated and the payment channel is called to complete the transfer; otherwise, it enters the next window for rebalancing. Since the comparison and addition operations are completed in the homomorphic domain, the payment channels and external auditors cannot see the plaintext amount but can verify the correctness of the operations.
[0108] After the transfer is completed, an on-chain settlement result event is automatically generated, which includes the ciphertext amount, the identifiers of the bid nodes and request nodes, the approval timestamp, and the matching priority. The report engine periodically scans the newly generated events and lists the "Fund Flow Table", "Risk Comparison Table", and "Approval Time Distribution Diagram" using the hash of the ciphertext amount, the approval status, and the priority. Since all fields are sourced from the immutable ledger, the reports can be directly published without manual aggregation, maintaining a consistent caliber throughout the cycle.
[0109] Example: Twelve nodes were deployed in the end-of-month peak test. The system collected six hours of cash flow, and the prediction model identified that two nodes had large gaps. Through the action output of reinforcement learning, the request ratio was 80%. The other ten nodes bid according to their own balances. The attention optimizer converged after sampling ten times and generated a high-density matching graph: the total matching amount covered 93% of the gap. The Byzantine approval took 38 seconds. The homomorphic encryption settlement completed all fund transfers within two minutes. The generated report showed that in this round of matching, the top one-tenth of the edges in terms of priority contributed 40% of the total cash flow, which was consistent with the fitting of the attention weights. Compared with the old scheme where the manual reconciliation process took four hours to complete the transfer, the present invention significantly shortened the reconciliation and appropriation time, and traced the unilateral transaction path through the report, facilitating auditing.
[0110] The algorithm effects are reflected in three aspects: First, the reinforcement learning combines the predicted value of the state vector with the risk summary to schedule funds in advance and reduce idleness; Second, the attention optimization algorithm quickly approximates the maximum flow under the condition of ensuring flow conservation, keeping the matching rate at a high level; Third, the homomorphic encryption transfer is linked with on-chain events to provide an immutable data source for automated reports, realizing real-time and transparent disclosure.
[0111] Preferably, the multi-agent reinforcement learning model adopts a Soft Actor-Critic architecture, forms a population of policy bodies by using genetic crossover and Gaussian mutation, and iteratively evolves the policy bodies according to the comprehensive utility calculated based on the return, volatility, and fund idleness rate to generate bid requests.
[0112] In the budget dynamic management process, each node needs to continuously generate bid requests according to its own fund status and the global gap to participate in fund matching. If the single-strategy reinforcement learning is directly applied, the model is prone to fall into local optimality, resulting in the inability to fully utilize the system-level liquidity. The present invention introduces a multi-agent reinforcement learning framework and combines the idea of group evolution to maintain diversity in the policy space, thus taking into account both local self-interested behaviors and global cooperation.
[0113] Soft Actor-Critic (SAC), as the basic reinforcement learning architecture of the present invention, adopts the principle of maximum entropy: while optimizing the expected return, it maximizes the policy entropy, which mathematically prompts the actor to maintain exploration in the early stage. The actor network outputs two-dimensional continuous actions according to the node state vector , where represents the bid ratio that the node is willing to offer, Indicates the proportion of funds that a node expects to request; the critic network evaluates the soft value of this action in a given state. Traditional SAC only relies on gradient to update a single policy and it is difficult to avoid converging to a local minimum. The present invention maintains several "policy bodies" inside each node, that is, multiple actor-critic pairs; these policy bodies together constitute a population, and maintain policy diversity through genetic crossover and Gaussian mutation. The specific process is as follows: First, the node repeatedly samples each policy body locally, conducts an environmental interaction with it and collects the returns , volatility and the idle fund rate . For unified evaluation, the present invention gives a comprehensive utility function:
[0114] where are the return weight, the volatility penalty weight and the idle penalty weight respectively. Each weight is set at the system governance layer, is the actual fund gain after this round of matching, is the logarithmic scale of the standard deviation of the node's fund balance, is the proportion of funds that are not matched and overdue. The meanings of the letters in the formula have been clarified here. The higher the comprehensive utility, the more it shows that the policy controls the volatility while improving resource utilization, thus being more beneficial to the overall system.
[0115] Second, sort the population according to , select several high-utility policy bodies as "parents", and another part of the low-utility policy bodies are eliminated. Single-point crossover is performed between the parents: randomly select a dimension of the weight tensor to split, exchange the slices to form "offspring". The offspring then enter the Gaussian mutation step: apply zero-mean Gaussian noise to their network weights to make the parameters randomly drift within the neighborhood. The crossover operation provides the ability for large-step search, and the mutation operation provides the ability for local fine-tuning. The cooperation of the two can prevent the population from lacking exploration due to early convergence.
[0116] Third, the new generation of policy bodies rejoin the sampling interaction. Since the system uses entropy regularization, the actor maintains a certain randomness during sampling; when the population size, crossover probability and mutation amplitude are fixed, the policy bodies will automatically evolve towards the high-utility direction during actual operation, but retain a small number of exploratory individuals to ensure that they can still quickly find a new optimum when the environment changes (such as suddenly adjusting the budget ceiling).
[0117] Different from traditional evolutionary algorithms, the present invention continues to use gradient backpropagation in the training of the critic network; the evaluation value does not come from evolutionary sorting but from the soft Q network. Evolution and gradient update are carried out in parallel, which not only maintains progressive value learning but also provides the ability of group jumping. In short, the gradient guides the local direction, and evolution ensures global optimization.
[0118] After all nodes complete local evolution and obtain the current best actor, they upload the selected action sequence to the chain at the time stipulated in the contract. The action includes a signature, available balance, and request gap. The system then constructs a bid-request bipartite tensor and solves the matching priority through an attention optimization algorithm. After completing approval and homomorphic encryption transfer, the settlement result is written back to the ledger; the nodes send the actual income and volatility back to the local experience pool and retrain the policy body to form a closed loop.
[0119] Example: Department A maintains 32 policy bodies in the test window. In the initial stage, the bid ratios of each policy body revolve around 0.5, and the volatility differences are large; after five generations of evolution, the 32 policy bodies are divided into three categories: one category tends to have high bids and low requests to hedge surpluses; one category tends to have low bids and high requests to fill the predicted gap; the third category maintains a balance to minimize transaction costs. The system simultaneously adopts the three types of strategies within the same window, smoothing multiple capital supply and demand peaks. Compared with the benchmark experiment of the single-strategy SAC, the matching rate of the evolved population increases by about 10% for the same number of rows, and the proportion of idle funds decreases by about 20%, verifying the importance of diversity.
[0120] Differential privacy still applies to this stage: what the nodes submit to the chain is only the action value and signature, without gradients or weights; the data in the local experience pool does not leave the network. The privacy threat may only come from inferring the balance from observing actions, but the system masks the absolute amount by adding noise and only discloses the proportional value, thus avoiding disclosing the specific cash scale.
[0121] From the perspective of budget dynamic management, multi-agent evolutionary reinforcement learning offers the following advantages. First, nodes can make adaptive decisions based on their own predictions and risk information without the need for central scheduling; second, the population mechanism diversifies the bidding patterns, increasing the space for matching algorithms and reducing capital misallocation caused by overall policy homogenization; third, the comprehensive utility function explicitly incorporates idle penalties, prompting nodes to be conservative in uncertain situations rather than blindly making high bids to seize liquidity. For the automated report generation link, the system can count the matching amounts and returns contributed by various policy bodies and present the operating conditions of the algorithm in readable metrics in the daily fund report, providing additional decision-making basis for the financial department.
[0122] Preferably, the attention optimization algorithm constructs a weight matrix based on the bid-request bipartite tensor data and uses multi-head convolutional attention and accelerated projection gradient methods to solve the matching priority matrix subject to flow conservation constraints.
[0123] The bid-request bipartite tensor describes the supply capacity and demand gap of all nodes within the same time window. Let the set of bidding nodes be , and the set of requesting nodes be . For any , the bidding node The amount available is , request node The amount required is . The node has output action coefficients during the multi-agent evolution process , respectively represent the ratio of willing to bid to requested. The binary tensor elements are recorded as:
[0124] Its physical meaning is "if the node With Node Fully matched, maximum funds transferable”.
[0125] Traditional maximum flow or Hungarian algorithms often encounter two limitations when processing such matrices: first, the algorithm itself only considers the amount of money, ignoring the cluster structure between nodes (such as the same organization is more inclined to match each other); second, under strict flow conservation constraints, the iterative convergence speed is dragged down by the tensor dimension. To this end, the present invention proposes a matching priority solution algorithm of "multi-head convolution attention + accelerated projection gradient", which not only introduces structural priors, but also maintains a parallel numerical optimization path.
[0126] Multi-head convolution attention weights, first 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 simultaneously measure multi-scale complementarity. The attention score calculation formula is
[0127] in is a hidden dimension. Essentially, it is looking for "local blocks that complement the amount at the micro level" within the tensor, which can be understood as soft connections based on the supply and demand graph. Multi-head convolutional attention can better explore the local structure of space than simple inner product. For example, if several bidding nodes are located in the same organization, the convolution weight will amplify their interconnection weight.
[0128] The optimization goal of the traffic conservation constraint is that in actual matching, the funds of a bidding node cannot be allocated repeatedly, and the demand of a requesting node cannot be overfilled. Therefore, it is necessary to find the matrix ,satisfy:
[0129] In the feasible domain Maximize the weighted transfer amount internally:
[0130] where " " is the Hadamard product. The attention matrix acts as a weight, enabling high-potential pairs to receive more traffic in the early stage of optimization.
[0131] Accelerate the projection gradient solution. Write the objective function as:
[0132] The constraint set is a closed convex set. Iterate based on the Nesterov accelerated gradient framework:
[0133]
[0134] where is the projection onto , is the adaptive learning rate, is the acceleration hyperparameter. Since is linear with respect to , its gradient is ; the projection operation is equivalent to clipping each row and column separately, which can be achieved through parallel scanning in time. The acceleration term introduces historical momentum, significantly improving the convergence speed; it is measured that when the dimension is , a hundred iterations can satisfy that the capital conservation error is less than one-thousandth.
[0135] In an embodiment, ten departments participated in the test, forming a tensor. After using the initial weights of multi-head convolutional attention, the projection gradient reaches a 98% capital matching rate in 30 steps. If only the Hungarian algorithm is used to run on the same hardware, it takes nearly two minutes; the solution of the present invention can be GPU-parallelized due to convolution + matrix multiplication, taking less than ten seconds, and at the same time, the matching rate is slightly higher (reusing the attention weights for fine-tuning the relationships within the organization).
[0136] The matching priority matrix not only outputs specific capital pairs but also can be used as a KPI indicator: the system counts how much turnover is contributed by the edges ranked in the top 10% of the priority in the final matching. This indicator is presented as the "high-priority capital flow contribution rate" in the automatic report, helping decision-makers evaluate whether the weight setting of the attention algorithm is reasonable; if the contribution rate is low, it indicates that the convolution kernel or the learning rate setting needs to be adjusted.
[0137] Convolutional attention also supports online fine-tuning: when it is found that the total matching volume within a certain organization is consistently lower than expected, the prior The value will take effect automatically in the next window without retraining the model as a whole. Accelerated projected gradient iteration itself satisfies convex optimization and will find the optimal match again under the new weights.
[0138] Preferably, before the record of the settlement result is written into the distributed ledger, double digital signatures are executed on the event payload and indexed and written in Morton encoding. The settlement result is processed by homomorphic encryption and the fund flow, matching priority, and approval timestamp are recorded through a hash time lock contract, and then a report is automatically generated.
[0139] Before the business operation event is written into the distributed ledger, it is necessary to ensure the credibility of the source and the non-repudiation of the record. The present invention uses double digital signatures to achieve this goal: First, the event payload is hashed by Blake3 to obtain a digest , and then the first signature is generated by the elliptic curve algorithm Ed25519 ; for compatibility with post-quantum security, the second signature is generated by hash-based XMSS . The two signatures and the payload are jointly encapsulated into an information record, and any verifier can independently verify the signature as long as they hold the corresponding public key, thus excluding the risk of forgery or repudiation in future audits.
[0140] After completing the signature, the system needs to write the records into the ledger efficiently and sequentially. For this purpose, a three-dimensional Morton index is constructed, and the payment object identifier , geographical code and the time window number are cross-inserted and mapped into a monotonic integer:
[0141] where respectively represent the th bit of the corresponding dimension, represents a left shift. The index corresponds one-to-one with the block file number and the offset within the block, ensuring that events of the same payment object or adjacent time periods are physically adjacent, and sequential disk writing reduces disk seek and improves batch read throughput.
[0142] After the fund matching is completed, a settlement instruction is generated. In order to publicly transfer the operation on the chain while hiding the amount, the present invention uses BFV homomorphic encryption: the amount is encoded as polynomial coefficients and encrypted into ciphertext by the public key :
[0143] 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 a hash time lock (HTLC) to ensure that the fund transfer and receipt records are completed atomically: the transferor submits the hash value , and the recipient has a limited time Provide random numbers To unlock, if overdue, it will automatically roll back to ensure that both parties or all parties can get a full refund.
[0144] When writing settlement events, the contract additionally records three pieces of metadata: the flow of funds (the address of the bid node, the address of the request node), the matching priority (the normalized score from the attention matrix), and the approval timestamp. The complete content of the event is double-signed and then written to the chain according to the Morton index again, ensuring that the settlement log and the original business event are in the same address space, which is convenient for subsequent batch scanning.
[0145] The report engine traverses the newly added settlement events on the chain according to the preset scheduling frequency. For external regulatory nodes without decryption rights, the system directly presents the hash of the ciphertext amount, the matching priority, and the approval delay; for the organizational audit accounts with decryption rights, the homomorphic sum can be performed on the ciphertext set and then decrypted at one time to obtain the actual amount. The report template fixedly outputs three parts: the list of fund flows, the distribution of priority contributions, and the overview of approval time consumption, which are completely driven by the data on the chain and do not require manual collation.
[0146] Example: A total of 450,000 business events were written on the end-of-month peak day. The double-signature and Morton index were executed on the production line, with an average writing rate of 1,200 per second. 12,800 transfer instructions were generated during the matching stage. The total ciphertext amount was decrypted after a single homomorphic sum and was consistent with the bank statement, with an error lower than one minimum measurement unit. The report engine completed the template rendering and published it to the board portal within 20 seconds. Compared with the old manual reconciliation solution, the overall cycle was reduced from four hours to 15 minutes. At the same time, all hash and signature fields can be traced on the chain, greatly reducing the audit and compliance costs.
[0147] Through the coordination of double-signature, Morton index, BFV homomorphic encryption, and HTLC contract, the present invention realizes a closed-loop of "trusted entry into the chain - privacy settlement - automatic disclosure" in the scenario of budget dynamic management: 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. Finally, the automated generation of reports has double guarantees of legal effect and technical credibility.
[0148] As Figure 2 shown, a budget dynamic management and report automated generation system for implementing the above method, the system includes: Ledger synchronization module, which is used to intercept business operation records, generate indexes for the business operation records according to payment object identifiers, geographical region codes, and time windows, write them into a distributed ledger, and perform multi-node synchronization through conflict-free replicated data type merging and logical vector clock sorting to form a global event sequence; event interception is completed by microservice nodes using 2×100GbE RDMA network cards in each business computer room, with a CPU of 32-core x86_64, ensuring that the transaction post-callback delay is less than 50µs. Each node is equipped with an 8TB NVMe SSD RAID0 array to store three-dimensional Morton index files; the sequential write bandwidth is approximately 6GB / s, and it can continuously write one million events per second during peak periods. Dual digital signature calls are completed by the on-board TPM2.0 and PCIe HSM cards (supporting Ed25519+XMSS), and the encryption operations do not occupy the main core. CRDT merging and logical vector clock sorting are resident in 512GB DDR5 memory, and Bloom filters are exchanged between nodes through RoCE-v2; PTP timing ensures that the timing accuracy of each computer room is <1µs.
[0149] Prediction analysis module, which is used to extract cash flow tensors from the global event sequence, use a generative adversarial network to perform data augmentation on the cash flow tensors, use a quantum annealing optimizer to calculate the sensitivity spectrum of the augmented cash flow tensors, perform multi-scale topological analysis on the cash flow tensors and the sensitivity spectrum to obtain a risk summary, input the cash flow tensors and the risk summary into a topological attention time series prediction model, and update the prediction model under the differential privacy federated aggregation mechanism to generate a local budget prediction; GAN augmentation and topological attention model training run on a 4×NVIDIA A100 GPU server (160GB HBM2e per single machine), convolutional-Fourier and dilated convolution are all parallelized within the CUDA core, and the quantum annealing sensitivity spectrum calculation accesses the cloud 5000-qubit D-Wave Advantage QPU through a dedicated line VPN; it is called once per window, and the round-trip delay is approximately 40ms. Wavelet packets and persistent homology are batch-computed by the GPU Tensor Core; the risk summary sparse matrix is generated in the GPU video memory and zero-copied into the Transformer. Differential privacy federated aggregation uses a 24-core IceLake machine equipped with Intel SGX2.0, and Laplace noise is injected into the enclave for the weight difference; AVX-512 implementation drives momentum FedAvg vector operations.
[0150] The matching and settlement module is used to construct a node status vector based on the local budget prediction, the risk summary, and the global budget status, generate a bid request 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 and the settlement result is recorded, and a report is generated. The multi-agent policy body inference batches the status vector on a 1×A100 GPU (or PCIe Edge TensorCard), and can generate >50k bid requests per second. The bid-request bipartite tensor calculates the multi-head convolutional attention through a TPU-v4 or equivalent GPU; the accelerated projection gradient runs sparse matrix iterations on the CPU AVX-512, and a 500×500 scale for 100 steps <1s. The approval node is a 3+2 BFT blockchain cluster, using a 12-core CPU + NVMe log disk, with an average confirmation delay <3s. The ciphertext of the fund allocation is executed by BFV on a 64-core AMD Epyc server; the comparison between the hash time lock and the ciphertext is accelerated by the SHA-256 / ECC unit built into the same machine HSM card. After the on-chain events are full, the report engine calls the GPU-accelerated SQL Scan on a 1×32-core CPU node to generate a JSON / HTML report, and pushes it to the financial portal through Nginx reverse proxy.
[0151] The above are only the embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall 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, It includes the following steps: Intercept business operation records, write them into a distributed ledger according to payment object identifiers, geographical coding, and time window indexes, and merge and synchronize them in a conflict-free replicable data type with logical vector clock sorting to form a global event sequence; Extract the cash flow tensor from the global event sequence, expand it through a generative adversarial network, calculate the sensitivity spectrum using a quantum annealing optimizer, perform multi-scale topological analysis to obtain a risk summary, input the cash flow tensor and the risk summary into a topological attention time series prediction model, and update the model in differential privacy federated aggregation to generate a local budget prediction; Construct a node state vector with the local budget prediction, risk summary, and global budget status, generate a bid request through a multi-agent reinforcement learning model, construct a bipartite tensor, and solve the matching priority using an attention optimization algorithm to obtain a budget matching result. After approval, allocate funds using homomorphic encryption and record the settlement result to generate a report.
2. The method according to claim 1, wherein The generator of the generative adversarial network data augmentation model adopts a combined structure of a convolutional network and a frequency domain transform. The discriminator is trained adversarially based on both time domain error and frequency domain amplitude difference until the generator output meets the discriminator confidence standard.
3. The method according to claim 1, characterized in that, The quantum annealing optimizer forms a sensitivity spectrum data by mapping the augmented cash flow tensor data into an Ising Hamiltonian, using the sample correlation coefficient as the coupling coefficient and the net cash increment bias as the local field strength, and statistically calculating the spin flip frequency through multiple annealing samplings.
4. The method according to claim 1, wherein The multi-scale topological analysis includes performing wavelet packet decomposition on the augmented cash flow tensor data and the sensitivity spectrum data, constructing complexes at each scale and calculating persistent homology 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 time series 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, wherein The differential privacy federated aggregation forms differential privacy weight differences by injecting Laplace noise into the local model differences, and aggregates the differential privacy weight differences using a federated average algorithm with momentum to update the 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, forms a population of policy bodies using genetic crossover and Gaussian mutation, and iteratively evolves the policy bodies according to the comprehensive utility calculated based on revenue, volatility, and capital idle rate to generate a bid request.
8. The method according to claim 1, characterized in that The attention optimization algorithm constructs a weight matrix based on the bipartite tensor data of the bid request, and uses multi-head convolutional attention and an accelerated projection gradient method to solve the matching priority matrix subject to flow conservation constraints.
9. The method according to claim 1, characterized in that, The recording of the settlement result performs double digital signatures on the event payload before writing it into the distributed ledger and indexes it for writing using Morton coding. The settlement result is processed by homomorphic encryption and records the fund flow, matching priority, and approval timestamp through a hash time lock contract and automatically generates a report.
10. A budget dynamic management and report automatic generation system for implementing the method according to any one of claims 1-9, characterized in that, The system includes: The ledger synchronization module is used to intercept business operation records, generate indexes for the business operation records according to the payment object identifier, geographical area code, and time window, write them into the distributed ledger, and synchronize them among multiple nodes through conflict-free replicated data type merging and logical vector clock sorting to form a global event sequence; The predictive analysis module is used to extract the cash flow tensor from the global event sequence, use the generative adversarial network to perform data augmentation on the cash flow tensor, calculate the sensitivity spectrum of the augmented cash flow tensor using the quantum annealing optimizer, perform multi-scale topological analysis on the cash flow tensor and the sensitivity spectrum to obtain a risk summary, input the cash flow tensor and the risk summary into the topological attention time series prediction model, and update the prediction model under the differential privacy federated aggregation mechanism to generate a local budget prediction; The matching and settlement module is used to construct a node state vector based on the local budget prediction, the risk summary, and the global budget status, generate a bid request based on multi-agent reinforcement learning, construct a bid-request bipartite tensor, and use the 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 and the settlement result is recorded to generate a report.
Citation Information
Patent Citations
Method and system for realizing electronic channel risk control disposal based on code insertion technology
CN119538269A
Intelligent reservation and multi-party real-time confirmation cooperation method and system in business travel scene
CN119886393A
Model encryption and privacy protection method oriented to artificial intelligence algorithm
CN120068123A
AI-supported cash flow management and forecasting system
DE202024106331U1
Systems, methods, and media for implementing conflict-free replicated data types in in-memory data structures
US20220121627A1
Cited By
Goods source intelligent matching method
CN120996312A