A method and system for regulatory traceability and settlement of distributed green electricity transactions

By training an anomaly detection model locally on distributed trading nodes and encrypting the uploaded parameters, combined with a zero-knowledge proof verification circuit, the problem of balancing regulatory penetration and data privacy protection in distributed green electricity trading supervision is solved, realizing the sharing of anomaly detection capabilities and data privacy protection.

CN122312295APending Publication Date: 2026-06-30CHANGCHUN INST OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGCHUN INST OF TECH
Filing Date
2026-06-03
Publication Date
2026-06-30

Smart Images

  • Figure CN122312295A_ABST
    Figure CN122312295A_ABST
Patent Text Reader

Abstract

This invention relates to the field of distributed green electricity transaction supervision, traceability, and settlement technology, and discloses a method and system for distributed green electricity transaction supervision, traceability, and settlement. Each transaction node independently trains a long short-term memory network anomaly detection model using local historical transaction data, and encrypts and uploads the network weight parameters and gradients to a central aggregation server. The central aggregation server updates the global model using a federated averaging algorithm and distributes it. When the anomaly score output by the global model reaches a warning threshold, the regulatory node issues a proof request. A specific transaction node locally generates an arithmetic circuit witness value containing anomaly input data, local reasoning process, and regulatory rules, and generates a proof string through an interactive zero-knowledge proof protocol. The verification circuit embedded in the regulatory node verifies the validity of the proof string without obtaining the original data and outputs regulatory instructions. This invention achieves shared anomaly detection capabilities and penetrating verification of regulatory logic, improving data security in the regulatory process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed green energy transaction supervision, traceability and settlement technology, and discloses a method and system for distributed green energy transaction supervision, traceability and settlement. Background Technology

[0002] In the field of distributed green electricity trading supervision, current conventional solutions mostly adopt a data-centric aggregation model or only compare and verify transaction hash values ​​on the blockchain. In the closest existing technical implementation, the regulatory platform requires each distributed trading node to upload detailed data such as local historical transaction electricity prices, transaction volume, and transaction frequency in plaintext to a central database. The regulatory platform centrally deploys anomaly detection models based on long short-term memory networks in the central database, using the plaintext data uploaded by all nodes for unified training and global analysis to identify abnormal transaction patterns. Another existing implementation completely abandons the acquisition of underlying data, only extracting state features at the transaction stage to generate hash values ​​and recording them in a distributed ledger. The regulatory end confirms the connectivity of the transaction link by comparing the consistency of adjacent hash values.

[0003] The aforementioned existing technical solutions suffer from a core technical problem: the inability to reconcile regulatory transparency with data privacy protection. When using a plaintext data aggregation model, commercial privacy data such as electricity pricing strategies and electricity consumption habits of trading nodes are directly exposed to the central database, leading to data leakage risks and resistance from nodes, hindering regulatory implementation. Conversely, when using a hash value comparison model, the regulatory end can only obtain surface-level connectivity information of state transitions, unable to delve into the business logic layer to jointly verify the reasoning process of the node's local model with preset regulatory rules, thus failing to identify potential hoarding of green electricity or abnormal collusion. Overall, existing technologies lack a technical mechanism for achieving localized training of anomaly detection models and remote verification of regulatory logic without obtaining original transaction details. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for the supervision, traceability and settlement of distributed green electricity transactions, which can solve the problems in the background art.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for regulatory traceability and settlement of distributed green electricity transactions, comprising: On each distributed transaction node, an abnormal behavior detection model based on a long short-term memory network is independently trained using local historical transaction data. The network weight parameters and gradients of the trained local abnormal behavior detection model are encrypted and uploaded to the central aggregation server. The central aggregation server uses a federated averaging algorithm to update the parameters of the global abnormal behavior detection model and distributes the updated global model weights to each distributed transaction node. The regulatory node has an embedded zero-knowledge proof verification circuit. When the abnormal score of a specific distributed transaction node output by the global abnormal behavior detection model reaches the warning threshold, the regulatory node sends a proof request to the specific distributed transaction node. The specific distributed transaction node locally generates an arithmetic circuit Witness value containing input data from abnormal transaction periods, local model inference process, and preset regulatory rules, generates a proof string through an interactive zero-knowledge proof protocol, and sends it to the regulatory node; The zero-knowledge proof verification circuit of the regulatory node verifies the validity of the proof string without obtaining the original transaction details data. If the verification passes, it outputs a regulatory instruction containing the qualitative result of the abnormal behavior.

[0006] Preferably, the step of independently training an abnormal behavior detection model based on a long short-term memory network using local historical transaction data includes: Each distributed trading node obtains the historical trading electricity price sequence, historical trading electricity volume sequence, and trading frequency sequence within its local preset time window; The historical transaction electricity price sequence, the historical transaction electricity volume sequence, and the transaction frequency sequence are normalized and time-aligned to construct a multi-dimensional time series input matrix; The multidimensional time series input matrix is ​​input into the long short-term memory network, and the cell state and hidden layer state are calculated through the forget gate, input gate and output gate of the long short-term memory network. The hidden layer state is input to the fully connected layer, and the normal transaction probability distribution of the distributed transaction node within the preset time window is output. With the goal of minimizing the cross-entropy loss function between the normal transaction probability distribution and the preset normal label, the network weight parameters and gradients of the long short-term memory network and the fully connected layer are updated through the backpropagation algorithm.

[0007] Preferably, the step of encrypting the network weight parameters and gradients of the trained local abnormal behavior detection model and uploading them to the central aggregation server includes: Each distributed transaction node obtains a public key pre-shared with the central aggregation server, and uses the public key to perform homomorphic encryption on the network weight parameters and the gradient to generate a first ciphertext vector and a second ciphertext vector; The first ciphertext vector and the second ciphertext vector are uploaded to the central aggregation server; The central aggregation server receives the first ciphertext vector and the second ciphertext vector uploaded by all distributed transaction nodes, and directly performs a weighted summation operation on the first ciphertext vector and the second ciphertext vector in the ciphertext state according to the number of nodes to obtain the global ciphertext weight vector and the global ciphertext gradient vector. The central aggregation server uses the locally stored private key to decrypt the global ciphertext weight vector and the global ciphertext gradient vector to obtain the plaintext global weight parameters and the plaintext global gradient, and then uses the federated averaging algorithm to update the parameters of the global abnormal behavior detection model.

[0008] Preferably, when the anomaly score of a specific distributed transaction node output by the global anomaly behavior detection model reaches the warning threshold, the regulatory node issues a proof request to the specific distributed transaction node, including: The specific distributed transaction node inputs the current real-time transaction data into the updated global abnormal behavior detection model and outputs the real-time probability of normal transactions. Calculate the difference between constant 1 and the real-time normal transaction probability, and use the difference as the anomaly score of the specific distributed transaction node; The regulatory node maintains a dynamic early warning threshold queue, which is periodically updated based on the average historical anomaly score of the specific distributed trading node in the past preset historical period and a preset volatility coefficient. When the anomaly score is greater than the current dynamic early warning threshold in the dynamic early warning threshold queue, the regulatory node generates a proof request containing the timestamp corresponding to the anomaly score and the node identifier, and sends the proof request to the specific distributed transaction node.

[0009] Preferably, the specific distributed transaction node locally generates an arithmetic circuit Witness value that includes input data from abnormal transaction periods, the local model inference process, and preset regulatory rules, including: Extract the abnormal transaction period input data corresponding to the timestamp of the abnormal score, and combine the abnormal transaction period input data, the weight matrix and bias vector involved in the reasoning in the local abnormal behavior detection model, and the electricity price deviation threshold and transaction frequency upper limit in the preset regulatory rules in a preset order to generate an initial state vector. The matrix multiplication operation in the inference process of the local abnormal behavior detection model is decomposed into a combination of multiple addition gates and multiplication gates; The comparison operations in the preset regulatory rules are transformed into equality verification constraints. Using the initial state vector as input, the arithmetic circuit is constructed through the addition gate, the multiplication gate, and the equality verification constraint, and the set of output values ​​of all gates in the arithmetic circuit is used as the Witness value of the arithmetic circuit.

[0010] Preferably, the step of generating a proof string through an interactive zero-knowledge proof protocol and sending it to the supervisory node includes: The specific distributed transaction node generates a first-order polynomial commitment based on the Witness value of the arithmetic circuit. The specific distributed transaction node receives the random challenge number issued by the regulatory node, and substitutes the random challenge number into the first-order polynomial commitment to calculate the polynomial evaluation result; The polynomial evaluation result, the certificate issuance information of the first-order polynomial commitment, and the common input parameters of the arithmetic circuit are concatenated, and a hash operation is performed on the concatenated result to generate the proof string. The specific distributed transaction node sends the proof string to the regulatory node.

[0011] Preferably, the step of normalizing and aligning the historical transaction electricity price sequence, the historical transaction electricity volume sequence, and the transaction frequency sequence to construct a multi-dimensional time series input matrix includes: Obtain the set of adjacent nodes of the distributed transaction node in the distribution network topology; Extract the transaction electricity sequence of each neighboring node in the neighboring node set within the preset time window; Perform maximum and minimum value normalization on the transaction electricity sequence of the adjacent nodes to obtain the normalized feature vector of the adjacent nodes; The normalized neighbor node feature vectors are concatenated with the normalized historical transaction electricity price sequence, the historical transaction electricity sequence, and the transaction frequency sequence in the time dimension to generate the multidimensional time series input matrix containing spatial topological features.

[0012] Preferably, the step of performing homomorphic encryption on the network weight parameters and the gradient using the public key to generate a first ciphertext vector and a second ciphertext vector includes: Obtain the parameter matrix of the network weight parameters and the gradient; Calculate the sorted queue of the absolute values ​​of each element in the parameter matrix, and remove the elements in the sorted queue whose absolute values ​​are lower than a preset pruning threshold to obtain a sparse parameter matrix. Extract the values ​​of the non-zero elements in the sparsified parameter matrix and the indexes of the non-zero elements in the parameter matrix; Using the public key, homomorphic encryption is performed on the numerical value of the non-zero element and the position index respectively. The encrypted numerical ciphertext and the index ciphertext are combined and encoded to generate the first ciphertext vector and the second ciphertext vector.

[0013] Preferably, the step of decomposing the matrix multiplication operation in the inference process of the local abnormal behavior detection model into a combination of multiple addition gates and multiplication gates includes: Identify the Sigmoid and Tanh nonlinear activation functions used in the state update of the hidden layer of the Long Short-Term Memory network during the inference process. A discrete lookup table of the Sigmoid nonlinear activation function and the Tanh nonlinear activation function within a preset domain is pre-constructed; When the matrix multiplication operation is decomposed into a combination of the addition gate and the multiplication gate, the calculation process of the Sigmoid nonlinear activation function and the Tanh nonlinear activation function is replaced by a table lookup operation on the discrete lookup table. The table lookup operation is transformed into multiple equality verification gates that equal the constraints, and the equality verification gates are connected to the combination circuit formed by the addition gate and the multiplication gate.

[0014] A distributed green electricity trading regulatory traceability and settlement system includes: The distributed transaction node local training component is used to independently train an abnormal behavior detection model based on a long short-term memory network on each distributed transaction node using local historical transaction data. The network weight parameters and gradients of the trained local abnormal behavior detection model are encrypted and uploaded to the central aggregation server. The central aggregation component is used to update the parameters of the global anomaly detection model using a federated averaging algorithm, and distribute the updated global model weights to each distributed transaction node. The regulatory triggering component, which embeds a zero-knowledge proof verification circuit, is used to send a proof request to the specific distributed transaction node when the abnormal score of the specific distributed transaction node output by the global abnormal behavior detection model reaches the warning threshold. The proof generation component is deployed on the specific distributed transaction node and is used to locally generate an arithmetic circuit Witness value containing input data during abnormal transaction periods, local model inference process and preset regulatory rules. It generates a proof string through an interactive zero-knowledge proof protocol and sends it to the regulatory verification component. The regulatory verification component is used to verify the validity of the proof string without obtaining the original transaction details data. If the verification is successful, a regulatory instruction containing the qualitative result of the abnormal behavior is output.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention achieves shared anomaly detection capabilities rather than shared raw transaction details by independently training anomaly detection models locally on each transaction node and encrypting the network weight parameters and gradients before uploading them to a central aggregation server for federated averaging algorithm updates. Simultaneously, by generating an arithmetic circuit witness value containing input data from the abnormal transaction period, the local model inference process, and preset regulatory rules locally on specific transaction nodes, and generating a proof string based on an interactive zero-knowledge proof protocol and sending it to the regulatory node for validity verification, the regulatory node can complete logical penetration and compliance verification of the anomaly scoring trigger node without obtaining the raw transaction details, eliminating the limitations imposed on regulatory logic by underlying data silos.

[0016] 2. This invention avoids the risk of model parameter leakage during transmission by introducing a homomorphic encryption mechanism to perform a weighted summation operation on the uploaded network weight parameters and gradients in a ciphertext state; by constructing a dynamic early warning threshold queue and periodically updating it based on the historical average anomaly score and a preset volatility coefficient, the judgment criteria for anomaly scores are adapted to the actual transaction volatility state of different nodes; by sparsifying the model parameter matrix and extracting the values ​​and position indices of non-zero elements for homomorphic encryption, the amount of data in the ciphertext calculation and transmission process is reduced; by pre-constructing a discrete lookup table of nonlinear activation functions and transforming the lookup operation into an equality verification gate connected to an arithmetic circuit, the number of constraints in the zero-knowledge proof circuit is reduced, and the computational overhead of the proof generation and verification process is reduced. Attached Figure Description

[0017] Figure 1 This is a main flowchart of a distributed green electricity trading regulatory traceability and settlement method; Figure 2 Flowchart for training a local abnormal behavior detection model; Figure 3 Flowchart for updating parameters in homomorphic encryption and federated aggregation; Figure 4 Flowchart for dynamic early warning threshold triggering and proof request issuance; Figure 5 Flowchart for generating witness values ​​for arithmetic circuits; Figure 6 This is a flowchart to demonstrate the string generation and verification process. Detailed Implementation

[0018] This specific implementation relates to the field of distributed green electricity trading supervision technology. The disclosed distributed green electricity trading supervision traceability and settlement method and system can be applied to regional power market green electricity trading scenarios that include trading entities such as distributed photovoltaics, user-side energy storage, and virtual power plants. The following describes the technical content of this solution in complete and detailed manner with reference to embodiments.

[0019] Please refer to the attached document. Figure 1 In one embodiment, the distributed green electricity trading supervision, traceability, and settlement process relies on multiple distributed trading nodes, a central aggregation server, and regulatory nodes. The distributed trading nodes are local edge computing nodes corresponding to the green electricity trading entities, possessing capabilities for local data storage, model training, encrypted computation, and circuit generation. The central aggregation server is a trusted computing node deployed in the power trading center, possessing capabilities for encrypted computation and model parameter aggregation. The regulatory node is a trusted execution environment node deployed in the power regulatory agency, embedding zero-knowledge proof verification circuits, and possessing capabilities for proof verification and regulatory instruction output.

[0020] Specifically, each distributed trading node stores local historical transaction data corresponding to its own trading behavior within a pre-defined trusted storage area. This local historical transaction data includes historical transaction electricity price sequences, historical transaction electricity volume sequences, and transaction frequency sequences within a pre-defined time window. Each distributed trading node independently trains an anomaly detection model based on a Long Short-Term Memory (LSTM) network within a local trusted execution environment using this local historical transaction data. During training, the distributed trading node preprocesses the local historical transaction data to construct a feature sequence conforming to the LTM network input format. This feature sequence is then input into the LTM network for forward propagation calculation to obtain the normal transaction probability distribution output by the model. Based on this normal transaction probability distribution and pre-defined labels, the loss value is calculated, and the model's network weight parameters and gradients are updated using a backpropagation algorithm.

[0021] After completing a preset number of rounds of local training, each distributed trading node encrypts the network weight parameters and gradients of the trained local anomaly detection model. During encryption, each distributed trading node obtains an encryption key pre-negotiated with the central aggregation server and performs encryption operations on the network weight parameters and gradients based on this key, generating a first ciphertext vector for the corresponding network weight parameters and a second ciphertext vector for the corresponding gradients. Each distributed trading node then uploads the generated first and second ciphertext vectors to the central aggregation server through a pre-defined encrypted communication channel.

[0022] The central aggregation server receives the first and second ciphertext vectors uploaded by all online distributed trading nodes and updates the parameters of the global anomaly detection model using a federated averaging algorithm. Specifically, the central aggregation server performs aggregation operations on all received first and second ciphertext vectors to obtain globally aggregated ciphertext parameters. It then decrypts these parameters to obtain the plaintext global weight parameters and global gradient. Based on these global weight parameters and global gradient, the network parameters of the global anomaly detection model are replaced and updated, completing the iterative optimization of the global model. The central aggregation server then distributes the updated global model weights to each distributed trading node via an encrypted communication channel. Each distributed trading node receives the global model weights and replaces the network parameters of its local anomaly detection model, completing the synchronous update of its local model.

[0023] The zero-knowledge proof verification circuit embedded in the regulatory node is compiled and deployed based on preset regulatory rules and arithmetic circuit constraints. Each distributed trading node inputs the real-time trading data it collects into the updated global abnormal behavior detection model, outputting the normal trading probability of the corresponding real-time trading data, and calculating the abnormal score at the corresponding time based on the normal trading probability. The regulatory node obtains the abnormal scores output by each distributed trading node in real time, maintains a preset warning threshold, and when the abnormal score of a specific distributed trading node output by the global abnormal behavior detection model reaches the warning threshold, the regulatory node generates a corresponding proof request and sends the proof request to that specific distributed trading node. The proof request includes the timestamp corresponding to the abnormal score, the node identifier, and preset random seed information.

[0024] Upon receiving a proof request, a specific distributed transaction node generates an arithmetic circuit Witness value within its local trusted execution environment. This value includes input data from the abnormal transaction period, the local model inference process, and preset regulatory rules. Specifically, based on the timestamp in the proof request, the node extracts the input data for the corresponding abnormal transaction period, obtains the weight and bias parameters involved in the inference process of that period within its local abnormal behavior detection model, and acquires the constraint threshold parameters from the preset regulatory rules. These parameters are then combined according to a preset permutation rule to form the input vector of the arithmetic circuit. The node decomposes the numerical operations in the local model inference process into basic addition and multiplication gates, transforms the threshold constraints from the preset regulatory rules into equality verification constraints, constructs a complete arithmetic circuit based on the input vector, addition gates, multiplication gates, and equality verification constraints, executes the entire arithmetic circuit operation, and uses the set of output values ​​from all gates during the operation as the Witness value of the arithmetic circuit.

[0025] A specific distributed transaction node generates a proof string based on the generated Witness value using an interactive zero-knowledge proof protocol and sends it to the supervisory node. Specifically, the specific distributed transaction node generates a corresponding first-order polynomial commitment based on the structure of the arithmetic circuit and the Witness value, and sends the initial information of the first-order polynomial commitment to the supervisory node. The supervisory node generates a random challenge number based on preset cryptographic security rules and distributes the random challenge number to the specific distributed transaction node. After receiving the random challenge number, the specific distributed transaction node substitutes the random challenge number into the polynomial corresponding to the first-order polynomial commitment, calculates the polynomial evaluation result, concatenates the polynomial evaluation result, the issuance information of the first-order polynomial commitment, and the common input parameters of the arithmetic circuit, performs a cryptographic hash operation on the concatenated byte stream, and generates a fixed-length proof string. The specific distributed transaction node sends the generated proof string to the supervisory node through an encrypted communication channel.

[0026] The zero-knowledge proof verification circuit of the regulatory node verifies the validity of the received proof string without obtaining the original transaction details data of a specific distributed trading node. Specifically, the regulatory node splits and hashes the proof string based on the initial information of the arithmetic circuit's common input parameters, the random challenge number, and the first-order polynomial commitment, stored locally. If the verification passes, the constraint verification operation of the zero-knowledge proof verification circuit is executed to confirm that the Witness value corresponding to the proof string satisfies all the constraints of the arithmetic circuit. If the verification passes, the regulatory node outputs a regulatory instruction containing the qualitative result of the abnormal behavior. The regulatory instruction can be sent to the corresponding specific distributed trading node and the power trading center for subsequent operations such as transaction interception, anomaly tracing, and settlement calibration.

[0027] In this embodiment, the basic network structure parameters of the global abnormal behavior detection model are shown in the table below.

[0028] Table 1. Basic Network Structure Parameters of the Global Abnormal Behavior Detection Model

[0029] In Table 1, the input dimension of the input layer corresponds to three basic features: historical transaction electricity price sequence, historical transaction electricity volume sequence, and transaction frequency sequence; the output dimension of the LSTM layer is 64, which corresponds to the feature dimension of the hidden layer state and is used to capture the temporal correlation of transaction behavior at different time scales; two fully connected layers are used to reduce the dimensionality and map the temporal features, and finally output the normal transaction probability value in the range of 0 to 1.

[0030] This embodiment fully implements the entire process of abnormal behavior detection, model federation, zero-knowledge proof regulatory verification, and settlement control in a distributed green electricity trading scenario. Through the mechanism of local model training and encrypted parameter uploading, it achieves global sharing of anomaly detection capabilities and avoids centralized aggregation of original transaction details data. Through the zero-knowledge proof protocol, it enables regulatory nodes to verify the compliance of abnormal transaction behavior without obtaining the original transaction data, thus taking into account both the data privacy protection of the trading entities and the need for penetrating supervision by regulatory agencies.

[0031] refer to Figure 2 In a preferred embodiment, the process of local training of anomaly detection models based on long short-term memory networks by distributed transaction nodes has been refined to cover the entire process.

[0032] Specifically, each distributed trading node first acquires the historical transaction electricity price sequence, historical transaction electricity volume sequence, and transaction frequency sequence within a local preset time window. The length of the preset time window can be configured according to the trading cycle. In this embodiment, the preset time window is 30 calendar days, the sampling interval of the transaction data is 1 hour, and the sample length of a single sequence is 720. The distributed trading nodes normalize and time-align the acquired historical transaction electricity price sequence, historical transaction electricity volume sequence, and transaction frequency sequence to construct a multi-dimensional time series input matrix.

[0033] The normalization process uses the maximum-minimum normalization method, performing normalization operations on all elements of a single feature sequence. The corresponding formula is:

[0034] Where x is a single element in the original feature sequence. This is the minimum value of the feature sequence within a preset time window. The maximum value of the feature sequence within a preset time window. These are the normalized eigenvalues, and the normalized eigenvalues ​​take values ​​in the range [0,1].

[0035] The time alignment operation aligns the timestamps of different feature sequences based on a preset sampling interval, removes outlier samples with mismatched timestamps, and completes the feature values ​​corresponding to missing timestamps using a linear interpolation method for feature values ​​at adjacent time steps. After normalization and time alignment, the distributed transaction nodes concatenate the three types of feature sequences along the feature dimension to generate an initial multidimensional time series input matrix.

[0036] Furthermore, the distributed trading node obtains its own set of neighboring nodes in the distribution network topology. The determination of the neighboring node set is based on the physical topology of the distribution network, selecting other distributed trading nodes that have a direct electrical connection with the distributed trading node to form the neighboring node set. The distributed trading node extracts the transaction electricity sequences of each neighboring node within the same preset time window, and performs the same maximum-minimum-value normalization processing as the local feature sequence on all neighboring node transaction electricity sequences to obtain a normalized neighboring node feature vector. The distributed trading node concatenates the normalized neighboring node feature vector with the normalized local historical transaction electricity price sequence, historical transaction electricity sequence, and transaction frequency sequence in the time dimension to generate a multi-dimensional time series input matrix containing spatial topological features.

[0037] In this embodiment, the feature dimensions and physical meanings of the multidimensional time series input matrix are shown in the table below.

[0038] Table 2. Comparison of Feature Dimensions and Physical Meanings of Multidimensional Time Series Input Matrix

[0039] In Table 2, M is the number of nodes in the set of adjacent nodes, which is determined by the physical topology of the distribution network; the total feature dimension of the multidimensional time series input matrix is ​​M+3, the row dimension of the matrix is ​​the number of time steps within the preset time window, and the column dimension is the total feature dimension, which can be directly input into the Long Short-Term Memory network for training.

[0040] Specifically, distributed transaction nodes input the constructed multidimensional time series input matrix into the Long Short-Term Memory (LSTM) network, and calculate the cell state and hidden layer state through the LTM network's forget gate, input gate, and output gate. The gating operation process of the LTM network is as follows: First, calculate the output of the forget gate at time t. The corresponding formula is: in, The output of the forget gate at time t. It is the Sigmoid activation function. Here is the weight matrix for the forget gate. The hidden layer state at time t-1 Let be the input feature vector at time t, corresponding to the row vector at time t in the multidimensional time series input matrix. Let be the bias vector of the forget gate. This refers to matrix multiplication.

[0041] Then, the output of the input gate and the candidate cell state at time t are calculated, and the corresponding calculation formula is: in, The input gate outputs at time t. Here is the weight matrix of the input gate. The bias vector for the input gate; Let t represent the candidate cell state at time t. The hyperbolic tangent activation function is used. This is the weight matrix for the candidate cell states. is the bias vector for the candidate cell state.

[0042] Based on the outputs of the forget gate and the input gate, the cell state at time t is updated. The corresponding calculation formula is: in, Let t represent the cell state at time t. The cell state at time t-1. The Hadamard product is an operation that multiplies corresponding elements of two matrices with the same dimension.

[0043] The formula for calculating the output of the output gate and the hidden layer state at time t is as follows:

[0044] in, The output of the output gate at time t. This is the weight matrix of the output gate. This is the bias vector for the output gate. Let t be the hidden layer state at time t.

[0045] The distributed transaction node inputs the hidden state of the final time step output by the Long Short-Term Memory Network into the fully connected layer. The fully connected layer performs nonlinear mapping and dimensionality reduction on the hidden state and outputs the normal transaction probability distribution of the distributed transaction node within a preset time window. The individual probability value in the normal transaction probability distribution ranges from [0,1]. The closer the value is to 1, the higher the probability that the transaction behavior at the corresponding time step conforms to the normal transaction pattern.

[0046] Distributed transaction nodes aim to minimize the cross-entropy loss function between the normal transaction probability distribution and the preset normal label. They update the network weight parameters and gradients of the Long Short-Term Memory network and the fully connected layer using the backpropagation algorithm. The formula for the cross-entropy loss function is: in, Here, N represents the cross-entropy loss value, and N is the number of samples within the preset time window. The preset normal label is for the nth sample. The label value for a normal transaction sample is 1, and the label value for an abnormal transaction sample is 0. This represents the normal transaction probability output by the model for the nth sample. Based on the calculated loss value, the distributed transaction nodes use the backpropagation algorithm to calculate the gradients of all weight parameters and bias parameters in the network, and then use the gradient descent algorithm to iteratively update the parameters until the loss value converges below a preset threshold, thus completing the training of the local model.

[0047] This embodiment details the complete training process of the Long Short-Term Memory Network (LSTM) abnormal behavior detection model, clarifying the full implementation methods of feature preprocessing, multi-dimensional time series input matrix construction, gating operation, loss calculation, and parameter update. By introducing the spatial features of adjacent nodes in the distribution network topology, the model can capture the spatial correlation characteristics of transaction behavior within the region. Through clear formulaic operation descriptions, it ensures that those skilled in the art can completely reproduce the training process of the model, meeting the legal requirements for full disclosure of patents.

[0048] refer to Figure 3 In a preferred embodiment, the distributed transaction nodes encrypt and upload the network weight parameters and gradients of the local model, and the parameter aggregation process of the central aggregation server is implemented in detail throughout the entire process.

[0049] Specifically, after completing local model training, each distributed transaction node obtains a public key pre-shared with the central aggregation server. This public key and the private key stored locally on the central aggregation server form a homomorphic encryption key pair. The homomorphic encryption algorithm uses a public-key encryption algorithm that supports addition homomorphism, enabling addition and constant multiplication operations in ciphertext state, and the decrypted result is consistent with the result in plaintext state. Using the obtained public key, the distributed transaction nodes perform homomorphic encryption on the trained network weight parameters and gradients, generating a first ciphertext vector for the corresponding network weight parameters and a second ciphertext vector for the corresponding gradients.

[0050] Furthermore, before performing homomorphic encryption, the distributed transaction node first performs sparsification on the parameter matrix of the network weight parameters and gradients. Specifically, the distributed transaction node obtains the parameter matrix corresponding to the network weight parameters and gradients, calculates a sorted queue of the absolute values ​​of each element in the parameter matrix, and arranges the sorted queue in descending order of absolute value. Elements in the sorted queue with absolute values ​​lower than a preset pruning threshold are removed to obtain the sparsified parameter matrix. The preset pruning threshold can be configured according to the model accuracy requirements. In this embodiment, the preset pruning threshold is set to 0.1 times the mean of the absolute values ​​of the parameter matrix elements. The distributed transaction node extracts the values ​​of non-zero elements in the sparsified parameter matrix and the position indices of the non-zero elements in the original parameter matrix. The position indices include the row number and column number of the element. Using a pre-shared public key, the distributed transaction node performs homomorphic encryption on the values ​​of the non-zero elements and their position indices respectively. The encrypted ciphertext of the values ​​and the ciphertext of the indices are combined and encoded according to a preset encoding format to generate a first ciphertext vector and a second ciphertext vector.

[0051] In this embodiment, the encryption encoding format of the sparse parameter matrix is ​​shown in the table below.

[0052] Table 3 Comparison of Encryption Encoding Formats for Sparse Parameter Matrices

[0053] In Table 3, N represents the number of non-zero elements in the sparsification parameter matrix; the byte lengths of the index ciphertext segment and the numerical ciphertext segment change dynamically with the number of non-zero elements; the segment identifier is used to distinguish between the first ciphertext vector and the second ciphertext vector, with the first ciphertext vector corresponding to the weight parameter and the segment identifier being 0x0001, and the second ciphertext vector corresponding to the gradient parameter and the segment identifier being 0x0002; the check segment is used by the central aggregation server to perform integrity verification on the received ciphertext vectors to prevent data tampering during transmission.

[0054] Specifically, distributed transaction nodes upload the generated first and second ciphertext vectors to the central aggregation server via a pre-defined encrypted communication channel. The central aggregation server receives the first and second ciphertext vectors uploaded by all distributed transaction nodes. First, it performs an integrity check on the ciphertext vectors based on the hash value of the checksum segment, discarding those that fail the check. For the ciphertext vectors that pass the check, it parses them, extracting the corresponding index ciphertext and value ciphertext. The central aggregation server then directly performs a weighted summation operation on all first and second ciphertext vectors in the ciphertext state, based on the number of nodes, to obtain the global ciphertext weight vector and the global ciphertext gradient vector. The formula for the weighted summation operation in the ciphertext state is: in, For homomorphic encryption functions based on pre-shared public keys, Let K be the ciphertext vector of the global weight parameters, and K be the total number of distributed transaction nodes participating in the aggregation. This is the encrypted vector of the local weight parameters uploaded by the k-th distributed transaction node. The encrypted aggregation operation of the gradient parameters uses the same operation method as the weight parameters to obtain the global encrypted gradient vector.

[0055] The central aggregation server uses a locally stored private key paired with the pre-shared public key to decrypt the global encrypted weight vector and the global encrypted gradient vector, obtaining the plaintext global weight parameters and the plaintext global gradient. The central aggregation server employs a federated averaging algorithm to update the parameters of the global anomaly detection model; the corresponding parameter update formula is: in, Here are the updated global model weight parameters, and K is the total number of distributed transaction nodes participating in the aggregation. The local model weight parameters are uploaded by the k-th distributed transaction node. Based on the decrypted plaintext global gradient, the central aggregation server synchronously updates the bias parameters of the global model, completing one iterative optimization of the global anomaly detection model. The central aggregation server then distributes the updated global model weights and bias parameters to each distributed transaction node via an encrypted communication channel. Upon receiving the data, each distributed transaction node replaces the corresponding parameters in its local anomaly detection model, completing the synchronization between the local and global models.

[0056] This embodiment refines the entire implementation process of homomorphic encryption, ciphertext aggregation, and federated averaging update of model parameters. By using parameter sparsity and pruning, the number of parameters that need to be encrypted and transmitted is reduced, thereby lowering the overhead of ciphertext computation and data transmission. The addition homomorphic encryption algorithm is used to achieve parameter aggregation in the ciphertext state, avoiding the risk of model parameter leakage during transmission and aggregation. This ensures that the local training data of each distributed transaction node will not be leaked through model parameters, thus strengthening the data privacy protection capabilities of the transaction entity.

[0057] refer to Figures 4 to 6 In a preferred embodiment, the entire process of triggering early warnings for anomaly scoring, generating Witness values ​​for arithmetic circuits, and generating and verifying zero-knowledge proof strings is implemented in detail.

[0058] Specifically, a specific distributed trading node inputs the current real-time trading data into the updated global abnormal behavior detection model. After undergoing the same normalization process as during training, the real-time trading data is input into the model for forward propagation, outputting the real-time normal trading probability corresponding to the real-time trading data. The specific distributed trading node calculates the difference between the constant 1 and the real-time normal trading probability, and uses this difference as the abnormality score for the specific distributed trading node at that moment. The corresponding calculation formula is as follows: in, The anomaly score at time t, The real-time normal transaction probability output by the model at time t is given. The abnormality score ranges from [0,1], and the closer the value is to 1, the higher the probability of abnormal transaction behavior at the corresponding time.

[0059] The regulatory node maintains a dynamic early warning threshold queue, which is periodically updated based on the average historical anomaly scores of specific distributed trading nodes over a preset historical period and a preset volatility coefficient. In this embodiment, the preset historical period is 7 calendar days, the update cycle is 24 hours, and the preset volatility coefficient is a configurable constant. The formula for updating the dynamic early warning threshold is: in, The dynamic warning threshold updated at time t. The average historical anomaly score over a preset historical period T, where k is a preset fluctuation coefficient. The standard deviation of historical anomaly scores within a preset historical period T is used. The regulatory node maintains an independent dynamic warning threshold queue for each distributed trading node. The queue length matches the preset historical period. After each update, the new threshold is added to the tail of the queue, and expired thresholds at the head of the queue are removed.

[0060] When the anomaly score of a specific distributed trading node exceeds the current dynamic early warning threshold in the dynamic early warning threshold queue, the regulatory node generates a proof request containing the timestamp corresponding to the anomaly score and the node identifier, and sends the proof request to that specific distributed trading node. The proof request also contains a preset random seed, which is used for the generation of random numbers in the subsequent zero-knowledge proof protocol.

[0061] Upon receiving the proof request, a specific distributed trading node generates an arithmetic circuit Witness value within its local trusted execution environment. Specifically, the node extracts input data for the abnormal trading period corresponding to the timestamp of the abnormal score. The length of the abnormal trading period is consistent with the time window length of the model input, and the input data consists of normalized multi-dimensional time-series features. The node obtains the weight matrix and bias vector from its local abnormal behavior detection model that participate in the inference process for that abnormal trading period. It also obtains the electricity price deviation threshold and transaction frequency upper limit from preset regulatory rules. The node combines the aforementioned abnormal trading period input data, weight matrix, bias vector, electricity price deviation threshold, and transaction frequency upper limit in a preset order to generate an initial state vector, which is the arithmetic circuit's private input vector.

[0062] A specific distributed transaction node decomposes the matrix multiplication operation in the inference process of the local abnormal behavior detection model into a combination of multiple addition and multiplication gates. Each matrix multiplication operation can be decomposed into a basic operation of summing corresponding element-wise multiplications, corresponding to the cascading of multiplication and addition gates. Further, the specific distributed transaction node identifies the Sigmoid and Tanh nonlinear activation functions used in the Long Short-Term Memory network hidden layer state updates during the inference process, and pre-constructs discrete lookup tables for the Sigmoid and Tanh nonlinear activation functions within preset domains. In this embodiment, the preset domain of the Sigmoid function is [-8, 8], and the preset domain of the Tanh function is [-4, 4]. Equal-interval discrete sampling is performed within these domains to generate the discrete lookup table.

[0063] In this embodiment, the discrete lookup table parameters for the Sigmoid and Tanh activation functions are configured as shown in the table below.

[0064] Table 4. Discrete Lookup Table Parameter Configuration Table for Sigmoid and Tanh Activation Functions

[0065] In Table 4, the sampling step size is the ratio of the domain interval length to the number of discrete sampling points, ensuring that the sampling points are evenly distributed within the domain; the numerical precision is the number of decimal places retained in the output value of the lookup table, which can be adjusted according to the balance requirements between the number of circuit constraints and the calculation precision; the discrete lookup table is stored in the local trusted storage area of ​​the distributed transaction node and can be directly called during the circuit construction process.

[0066] Specifically, when a specific distributed trading node decomposes matrix multiplication into a combination of addition and multiplication gates, it replaces the calculation process of the Sigmoid and Tanh nonlinear activation functions with a lookup operation on a discrete lookup table. The lookup operation involves matching the corresponding sampling interval based on the input value and obtaining the pre-stored output value for that interval. This specific distributed trading node transforms the lookup operation into multiple equality verification gates equal to the constraints. These equality verification gates are then connected to a combinational circuit composed of addition and multiplication gates, completing the circuit transformation for nonlinear operations. This avoids the problem of an explosion in the number of constraints caused by directly implementing nonlinear functions in arithmetic circuits.

[0067] Specific distributed trading nodes transform comparison operations in pre-defined regulatory rules into equality verification constraints. For example, comparing the transaction price with a price deviation threshold is transformed into an equality constraint where the result of subtracting the price deviation threshold from the transaction price equals 0. Similarly, comparing the transaction frequency with a transaction frequency cap is transformed into an equality constraint where the result of subtracting the transaction frequency cap from the transaction frequency cap equals 0. Each distributed trading node uses an initial state vector as input and constructs a complete arithmetic circuit through addition gates, multiplication gates, and equality verification constraints. It then executes the entire arithmetic circuit operation and uses the set of output values ​​from all gates in the arithmetic circuit as the arithmetic circuit's Witness value.

[0068] Specific distributed transaction nodes generate proof strings using an interactive zero-knowledge proof protocol and send them to the supervisory node. Specifically, each node generates a first-order polynomial commitment based on the Witness value of an arithmetic circuit. This commitment is constructed using elliptic curve cryptography, transforming the constraints of the arithmetic circuit into a first-order polynomial. The corresponding commitment value is generated based on the polynomial's coefficients, and the commitment value is a point on the elliptic curve. The node then sends the initial information of the generated first-order polynomial commitment to the supervisory node. This initial information includes the commitment value and the common input parameters of the arithmetic circuit.

[0069] After receiving the initial information of the first-order polynomial commitment, the regulatory node generates a random challenge number using a cryptographically secure random number generator and distributes the random challenge number to specific distributed transaction nodes. The specific distributed transaction nodes receive the random challenge number from the regulatory node, substitute it into the first-order polynomial corresponding to the first-order polynomial commitment, and calculate the polynomial evaluation result. The specific distributed transaction nodes concatenate the polynomial evaluation result, the issuance information of the first-order polynomial commitment, and the common input parameters of the arithmetic circuit, and perform a cryptographically secure hash operation on the concatenated result to generate a fixed-length proof string. The corresponding calculation formula is as follows: in, For the generated proof string, SHA-256 is a cryptographically secure hash function. This is a byte concatenation operation. This is the result of evaluating the polynomial at the random challenge number c. The issuance information is for a first-order polynomial commitment. These are the common input parameters for the arithmetic circuit. Specific distributed transaction nodes send the generated proof string to the supervisory node via an encrypted communication channel.

[0070] The zero-knowledge proof verification circuit of the regulatory node verifies the validity of the proof string without obtaining the original transaction details. Specifically, the regulatory node decomposes the proof string, obtains the corresponding polynomial evaluation result, issuance information, and common input parameters, performs a hash check, and confirms that the hash operation result matches the proof string. After the check passes, the regulatory node performs a zero-knowledge proof verification operation; the corresponding verification formula is:

[0071] in, Let g be the commitment value of a first-order polynomial commitment, h be the generators of the elliptic curve cyclic group, and c be the number of random challenges issued by the supervisory node. This is the result of evaluating the polynomial at the challenge number c. This is a bilinear mapping operation on an elliptic curve. If the results of the operations on both sides of the equation are equal, the verification passes, confirming that the Witness value corresponding to the proof string satisfies all the constraints of the arithmetic circuit. That is, the input data, model inference process, and regulatory rule constraints of the abnormal transaction period of the specific distributed transaction node all meet the preset requirements. If the verification passes, the regulatory node outputs a regulatory instruction containing the qualitative result of the abnormal behavior. The regulatory instruction can be used for operations such as tracing the source of abnormal transactions, settling and calibrating illegal transactions, and controlling the transaction permissions of abnormal nodes.

[0072] This embodiment details the entire process of calculating anomaly scores, updating dynamic warning thresholds, constructing arithmetic circuits, generating Witness values, and generating and verifying zero-knowledge proof strings. It adapts to the fluctuating transaction behavior characteristics of different distributed transaction nodes through a dynamic warning threshold queue, reducing the probability of false warnings. By transforming the nonlinear activation function into a discrete lookup table and equality verification gate, it reduces the number of constraints in the zero-knowledge proof circuit, lowering the computational overhead of the proof generation and verification process. Through an interactive zero-knowledge proof protocol, it enables regulatory nodes to verify the compliance of abnormal transaction behavior throughout the entire process without obtaining the original transaction details data, achieving a balance between penetrating supervision and data privacy protection.

[0073] In one embodiment, the distributed green electricity trading regulatory traceability and settlement system includes a distributed trading node local training component, a central aggregation component, a regulatory triggering component, a proof generation component, and a regulatory verification component.

[0074] The distributed trading node local training component is deployed in the local trusted execution environment of each distributed trading node. It is used to independently train an anomaly detection model based on a Long Short-Term Memory (LSTM) network using local historical trading data on each distributed trading node. The network weight parameters and gradients of the trained local anomaly detection model are encrypted and uploaded to the central aggregation server. The specific implementation of the distributed trading node local training component is consistent with the local training and encrypted upload process in the aforementioned method embodiments.

[0075] The central aggregation component is deployed in the trusted computing environment of the central aggregation server. It is used to update the parameters of the global anomaly detection model using a federated averaging algorithm and distribute the updated global model weights to each distributed transaction node. The specific implementation of the central aggregation component is consistent with the encrypted aggregation and model update process in the aforementioned method embodiments.

[0076] The regulatory triggering component is deployed in the trusted execution environment of the regulatory node and embeds a zero-knowledge proof verification circuit. It is used to send a proof request to a specific distributed transaction node when the anomaly score of that node, output by the global anomaly behavior detection model, reaches a warning threshold. The specific implementation of the regulatory triggering component is consistent with the anomaly score monitoring and proof request issuance process in the aforementioned method embodiments.

[0077] The proof generation component is deployed in the local trusted execution environment of a specific distributed transaction node. It is used to locally generate an arithmetic circuit Witness value containing input data from abnormal transaction periods, the local model inference process, and preset regulatory rules. A proof string is generated through an interactive zero-knowledge proof protocol and sent to the regulatory verification component. The specific implementation of the proof generation component is consistent with the Witness value generation and proof string generation process in the aforementioned method embodiments.

[0078] The regulatory verification component is deployed in the trusted execution environment of the regulatory node. It verifies the validity of the proof string without obtaining the original transaction details. If the verification passes, it outputs a regulatory instruction containing a qualitative result of the abnormal behavior. The specific implementation of the regulatory verification component is consistent with the proof verification and regulatory instruction output process in the aforementioned method embodiments.

Claims

1. A method for regulatory traceability and settlement of distributed green electricity transactions, characterized in that, include: On each distributed transaction node, an abnormal behavior detection model based on a long short-term memory network is independently trained using local historical transaction data. The network weight parameters and gradients of the trained local abnormal behavior detection model are encrypted and uploaded to the central aggregation server. The central aggregation server uses a federated averaging algorithm to update the parameters of the global abnormal behavior detection model and distributes the updated global model weights to each distributed transaction node. The regulatory node has an embedded zero-knowledge proof verification circuit. When the abnormal score of a specific distributed transaction node output by the global abnormal behavior detection model reaches the warning threshold, the regulatory node sends a proof request to the specific distributed transaction node. The specific distributed transaction node locally generates an arithmetic circuit Witness value containing input data from abnormal transaction periods, local model inference process, and preset regulatory rules, generates a proof string through an interactive zero-knowledge proof protocol, and sends it to the regulatory node; The zero-knowledge proof verification circuit of the regulatory node verifies the validity of the proof string without obtaining the original transaction details data. If the verification passes, it outputs a regulatory instruction containing the qualitative result of the abnormal behavior.

2. The method for regulatory traceability and settlement of distributed green electricity transactions according to claim 1, characterized in that, The method of independently training an abnormal behavior detection model based on a long short-term memory network using local historical transaction data includes: Each distributed trading node obtains the historical trading electricity price sequence, historical trading electricity volume sequence, and trading frequency sequence within its local preset time window; The historical transaction electricity price sequence, the historical transaction electricity volume sequence, and the transaction frequency sequence are normalized and time-aligned to construct a multi-dimensional time series input matrix; The multidimensional time series input matrix is ​​input into the long short-term memory network, and the cell state and hidden layer state are calculated through the forget gate, input gate and output gate of the long short-term memory network. The hidden layer state is input to the fully connected layer, and the normal transaction probability distribution of the distributed transaction node within the preset time window is output. With the goal of minimizing the cross-entropy loss function between the normal transaction probability distribution and the preset normal label, the network weight parameters and gradients of the long short-term memory network and the fully connected layer are updated through the backpropagation algorithm.

3. The method for regulatory traceability and settlement of distributed green electricity transactions according to claim 1, characterized in that, The step of encrypting the network weight parameters and gradients of the trained local abnormal behavior detection model and uploading them to the central aggregation server includes: Each distributed transaction node obtains a public key pre-shared with the central aggregation server, and uses the public key to perform homomorphic encryption on the network weight parameters and the gradient to generate a first ciphertext vector and a second ciphertext vector; The first ciphertext vector and the second ciphertext vector are uploaded to the central aggregation server; The central aggregation server receives the first ciphertext vector and the second ciphertext vector uploaded by all distributed transaction nodes, and directly performs a weighted summation operation on the first ciphertext vector and the second ciphertext vector in the ciphertext state according to the number of nodes to obtain the global ciphertext weight vector and the global ciphertext gradient vector. The central aggregation server uses the locally stored private key to decrypt the global ciphertext weight vector and the global ciphertext gradient vector to obtain the plaintext global weight parameters and the plaintext global gradient, and then uses the federated averaging algorithm to update the parameters of the global abnormal behavior detection model.

4. The method for regulatory traceability and settlement of distributed green electricity transactions according to claim 1, characterized in that, When the anomaly score of a specific distributed transaction node output by the global anomaly behavior detection model reaches the warning threshold, the regulatory node sends a proof request to the specific distributed transaction node, including: The specific distributed transaction node inputs the current real-time transaction data into the updated global abnormal behavior detection model and outputs the real-time probability of normal transactions. Calculate the difference between constant 1 and the real-time normal transaction probability, and use the difference as the anomaly score of the specific distributed transaction node; The regulatory node maintains a dynamic early warning threshold queue, which is periodically updated based on the average historical anomaly score of the specific distributed trading node in the past preset historical period and a preset volatility coefficient. When the anomaly score is greater than the current dynamic early warning threshold in the dynamic early warning threshold queue, the regulatory node generates a proof request containing the timestamp corresponding to the anomaly score and the node identifier, and sends the proof request to the specific distributed transaction node.

5. The method for regulatory traceability and settlement of distributed green electricity transactions according to claim 1, characterized in that, The specific distributed trading node locally generates an arithmetic circuit Witness value that includes input data from abnormal trading periods, the local model inference process, and preset regulatory rules, including: Extract the abnormal transaction period input data corresponding to the timestamp of the abnormal score, and combine the abnormal transaction period input data, the weight matrix and bias vector involved in the reasoning in the local abnormal behavior detection model, and the electricity price deviation threshold and transaction frequency upper limit in the preset regulatory rules in a preset order to generate an initial state vector. The matrix multiplication operation in the inference process of the local abnormal behavior detection model is decomposed into a combination of multiple addition gates and multiplication gates; The comparison operations in the preset regulatory rules are transformed into equality verification constraints. Using the initial state vector as input, the arithmetic circuit is constructed through the addition gate, the multiplication gate, and the equality verification constraint, and the set of output values ​​of all gates in the arithmetic circuit is used as the Witness value of the arithmetic circuit.

6. The method for regulatory traceability and settlement of distributed green electricity transactions according to claim 1, characterized in that, The step of generating a proof string through an interactive zero-knowledge proof protocol and sending it to the supervisory node includes: The specific distributed transaction node generates a first-order polynomial commitment based on the Witness value of the arithmetic circuit. The specific distributed transaction node receives the random challenge number issued by the regulatory node, and substitutes the random challenge number into the first-order polynomial commitment to calculate the polynomial evaluation result; The polynomial evaluation result, the certificate issuance information of the first-order polynomial commitment, and the common input parameters of the arithmetic circuit are concatenated, and a hash operation is performed on the concatenated result to generate the proof string. The specific distributed transaction node sends the proof string to the regulatory node.

7. A method for regulatory traceability and settlement of distributed green electricity transactions according to claim 2, characterized in that, The process of normalizing and aligning the historical electricity price sequence, the historical electricity volume sequence, and the transaction frequency sequence to construct a multi-dimensional time series input matrix includes: Obtain the set of adjacent nodes of the distributed transaction node in the distribution network topology; Extract the transaction electricity sequence of each neighboring node in the neighboring node set within the preset time window; Perform maximum and minimum value normalization on the transaction electricity sequence of the adjacent nodes to obtain the normalized feature vector of the adjacent nodes; The normalized neighbor node feature vectors are concatenated with the normalized historical transaction electricity price sequence, the historical transaction electricity sequence, and the transaction frequency sequence in the time dimension to generate the multidimensional time series input matrix containing spatial topological features.

8. A method for regulatory traceability and settlement of distributed green electricity transactions according to claim 3, characterized in that, The step of using the public key to perform homomorphic encryption on the network weight parameters and the gradient to generate a first ciphertext vector and a second ciphertext vector includes: Obtain the parameter matrix of the network weight parameters and the gradient; Calculate the sorted queue of the absolute values ​​of each element in the parameter matrix, and remove the elements in the sorted queue whose absolute values ​​are lower than a preset pruning threshold to obtain a sparse parameter matrix. Extract the values ​​of the non-zero elements in the sparsified parameter matrix and the indexes of the non-zero elements in the parameter matrix; Using the public key, homomorphic encryption is performed on the numerical value of the non-zero element and the position index respectively. The encrypted numerical ciphertext and the index ciphertext are combined and encoded to generate the first ciphertext vector and the second ciphertext vector.

9. A method for regulatory traceability and settlement of distributed green electricity transactions according to claim 5, characterized in that, The matrix multiplication operation in the inference process of the local abnormal behavior detection model is decomposed into a combination of multiple addition gates and multiplication gates, including: Identify the Sigmoid and Tanh nonlinear activation functions used in the state update of the hidden layer of the Long Short-Term Memory network during the inference process. A discrete lookup table of the Sigmoid nonlinear activation function and the Tanh nonlinear activation function within a preset domain is pre-constructed; When the matrix multiplication operation is decomposed into a combination of the addition gate and the multiplication gate, the calculation process of the Sigmoid nonlinear activation function and the Tanh nonlinear activation function is replaced by a table lookup operation on the discrete lookup table. The table lookup operation is transformed into multiple equality verification gates that equal the constraints, and the equality verification gates are connected to the combination circuit formed by the addition gate and the multiplication gate.

10. A distributed green electricity trading supervision, traceability, and settlement system, characterized in that, include: The distributed transaction node local training component is used to independently train an abnormal behavior detection model based on a long short-term memory network on each distributed transaction node using local historical transaction data. The network weight parameters and gradients of the trained local abnormal behavior detection model are encrypted and uploaded to the central aggregation server. The central aggregation component is used to update the parameters of the global anomaly detection model using a federated averaging algorithm, and distribute the updated global model weights to each distributed transaction node. The regulatory triggering component, which embeds a zero-knowledge proof verification circuit, is used to send a proof request to the specific distributed transaction node when the abnormal score of the specific distributed transaction node output by the global abnormal behavior detection model reaches the warning threshold. The proof generation component is deployed on the specific distributed transaction node and is used to locally generate an arithmetic circuit Witness value containing input data during abnormal transaction periods, local model inference process and preset regulatory rules. It generates a proof string through an interactive zero-knowledge proof protocol and sends it to the regulatory verification component. The regulatory verification component is used to verify the validity of the proof string without obtaining the original transaction details data. If the verification is successful, a regulatory instruction containing the qualitative result of the abnormal behavior is output.