Deep learning-based smart contract risk assessment and accounts receivable financing method

By using an improved RetNet network to perform joint temporal modeling of the semantic structure, behavior execution, and performance financing layer of smart contracts, the shortcomings of existing technologies in smart contract risk assessment and financing decision-making are addressed. This enables multi-dimensional characterization of complex contract risks and refined linkage of financing control, thereby improving the accuracy of risk identification and the security of decision-making.

CN122134466APending Publication Date: 2026-06-02SHANGHAI DIANMING TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI DIANMING TECHNOLOGY CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing methods for smart contract risk assessment and financing decision-making struggle to characterize the implicit logical relationships within the contract's semantic structure. They are unable to effectively model nested function calls, interactions between state variables, and complex control flow paths. Furthermore, they lack joint analysis of call frequency fluctuations, abnormal transaction patterns, and long-term performance trends, resulting in insufficient adaptability and stability of financing risk assessment results for complex business scenarios.

Method used

We employ an improved RetNet network for deep learning, using semantic RetNet encoding branches, behavioral RetNet encoding branches, a financing guidance module, and a feature fusion module to jointly perform temporal modeling of the semantic structure, behavioral execution, and performance financing layer of smart contracts. By utilizing a multi-scale parallel Retention structure and a risk perception adaptive decay mechanism, we can achieve multi-dimensional characterization of contract risk and precise control of financing decisions.

Benefits of technology

It significantly improves the accuracy of smart contract risk identification and the security of financing decisions, reduces reliance on manual risk control, supports on-chain automated execution, and achieves multi-dimensional characterization of complex contract risks and refined linkage of financing control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122134466A_ABST
    Figure CN122134466A_ABST
Patent Text Reader

Abstract

This invention discloses a method for smart contract risk assessment and accounts receivable financing based on deep learning, comprising the following steps: Step 1: collecting smart contract-related data; Step 2: preprocessing the smart contract-related data; Step 3: embedding and mapping the standard contract-related data to obtain a smart contract feature vector sequence; Step 4: generating a comprehensive contract risk feature vector sequence from the smart contract feature vector sequence using an improved RetNet network; Step 5: assessing the contract risk using the comprehensive contract risk feature vector sequence and outputting the contract risk assessment result; Step 6: performing financing control inference based on the contract risk assessment result to generate a financing control decision result; Step 7: writing the financing control decision result into the target smart contract and generating a financing control instruction. This invention improves the accuracy of smart contract risk assessment and the reliability of financing decisions through an improved RetNet network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology data analysis technology, and in particular to a method for smart contract risk assessment and accounts receivable financing based on deep learning. Background Technology

[0002] With the widespread application of blockchain technology in supply chain finance, digital asset management, and inter-enterprise settlement scenarios, accounts receivable financing based on smart contracts is gradually becoming an important tool for financial institutions and core enterprises to conduct credit transmission and capital flow. Existing smart contract risk assessment and financing decision-making methods mainly rely on rule auditing, human expert experience, or static feature statistical analysis, and generally suffer from the following problems: Traditional risk identification methods based on rule matching or static code features struggle to characterize the implicit logical relationships within the semantic structure of contracts. They fail to effectively model nested function calls, interactions of state variables, and complex control flow paths, resulting in insufficient ability to identify potentially high-risk contract operations. Existing methods often treat contract code risk separately from on-chain call behavior, lacking a joint analysis mechanism for call frequency fluctuations, abnormal transaction patterns, and long-term performance trends, making it difficult to reflect the dynamic risk evolution process in real-world operating environments. Furthermore, in accounts receivable financing scenarios, there is a significant coupling relationship between financial characteristics such as accounts receivable amount, aging structure, and historical repayment behavior and contract operational risk. However, existing technologies typically fail to construct a unified risk fusion modeling framework, leading to insufficient adaptability and stability of financing risk assessment results for complex business scenarios.

[0003] Therefore, how to provide a method for risk assessment and accounts receivable financing based on deep learning for smart contracts is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] One objective of this invention is to propose a method for smart contract risk assessment and accounts receivable financing based on deep learning. This invention fully utilizes deep temporal modeling and multi-scale risk perception technologies, and through an improved RetNet network, achieves deep modeling and joint assessment of smart contract operational risks, and performs financing risk fusion analysis and financing control decision reasoning. It has the advantages of high risk identification accuracy, strong dynamic adaptability, and high reliability of financing decisions.

[0005] The method for smart contract risk assessment and accounts receivable financing based on deep learning according to embodiments of the present invention includes the following steps: Step 1: Collect smart contract association data of the target smart contract; Step 2: Perform data preprocessing on the smart contract-related data to obtain standard contract-related data; Step 3: Embed, map, and encode the standard contract-related data to obtain the smart contract feature vector sequence; Step 4: Input the smart contract feature vector sequence into the improved RetNet network, perform joint risk feature modeling and guided fusion, and generate a comprehensive risk feature vector sequence for the contract; the improved RetNet network includes a semantic RetNet encoding branch, a behavioral RetNet encoding branch, a financing guidance module, and a feature fusion module; the semantic RetNet encoding branch adopts an improved RetNet Block stacking structure; Step 5: Use the risk assessment mapping module to perform contract risk assessment on the comprehensive risk feature vector sequence of the contract, and output the contract risk assessment results; Step Six: Based on the contract risk assessment results, perform financing control reasoning to generate financing control decision results; Step 7: Write the financing control decision results into the target smart contract and generate financing control instructions.

[0006] Optionally, the smart contract associated data includes smart contract source code text, on-chain transaction call records, accounts receivable information, and historical performance and repayment records.

[0007] Optionally, step two specifically includes: The data preprocessing includes character standardization, timestamp alignment, and numerical normalization. The character standardization specifically involves converting the smart contract source code text into UTF-8 encoding format to obtain standard contract code text. The timestamp alignment specifically involves aligning the timestamp fields in on-chain transaction call records, accounts receivable information, and historical repayment records according to a set time step to obtain aligned on-chain transaction call records, aligned accounts receivable information, and aligned historical repayment records. The numerical normalization process specifically involves mapping the numerical fields in the aligned on-chain transaction call records, aligned accounts receivable information, and aligned historical performance repayment records to the [0, 1] interval using the minimum-maximum normalization method, thereby obtaining standard on-chain transaction call records, standard on-chain accounts receivable information, and standard historical performance repayment records. The standard contract associated data consists of the standard contract code text, standard on-chain transaction call records, standard on-chain accounts receivable information, and standard historical performance and repayment records.

[0008] Optionally, step three specifically includes: The standard contract code text is initially segmented according to the set lexical rules to obtain a sequence of contract lexical units; The type of each contract lexical unit is determined and the type is labeled to obtain a contract semantic token sequence. The types include keyword tokens, function identifier tokens, variable identifier tokens, operator tokens, and call symbol tokens. The contract semantic token sequence is input into the embedding mapping layer, which performs an embedding mapping operation on each contract semantic token through a set embedding matrix to generate a semantic embedding vector sequence. Standard on-chain transaction call records are numerically and vectorized to obtain call behavior feature vectors, and then arranged into a call behavior feature vector sequence according to the time step order. The numerical encoding specifically involves converting non-numerical fields into numerical fields according to a set field mapping rule; the vector encoding specifically involves performing an embedding mapping operation on the standard on-chain transaction call record that has been numerically encoded through an embedding mapping layer to obtain a call behavior feature vector. Standard accounts receivable information and standard historical repayment records are numerically and vectorized, and features are concatenated to obtain financing feature vectors. The financing feature vectors are then arranged into a financing feature vector sequence according to the time step order. The semantic embedding vector sequence, the call behavior feature vector sequence, and the financing feature vector sequence are combined to form the smart contract feature vector sequence.

[0009] Optionally, step four specifically includes: The semantic RetNet coding branch and the behavioral RetNet coding branch are two parallel coding branches; The semantic RetNet encoding branch adopts a stacked structure of several layers of improved RetNet Blocks to model the contract semantic risk of the semantic embedding vector sequence and generate a semantic risk feature vector sequence. The behavioral RetNet encoding branch adopts a stacked structure of several layers of standard RetNet Blocks to perform time-series modeling of the contract call behavior feature vector sequence and generate a behavioral risk feature vector sequence. The financing guidance module adopts a two-layer MLP structure to extract risk guidance features from the financing feature vector sequence and generate a financing guidance vector sequence. The first layer MLP structure includes a linear mapping and a ReLU activation function, and the second layer MLP structure includes a linear mapping and a tanh activation function. The semantic risk feature vector sequence, behavioral risk feature vector sequence, and financing guidance vector sequence are aligned and fused through the feature fusion module to generate a comprehensive contract risk feature vector sequence, specifically: The semantic risk feature vector sequence is averaged and pooled to obtain the average semantic risk feature vector. The average semantic risk feature vector is then copied and expanded to maintain consistency with the time step dimension of the behavioral risk feature vector sequence and the financing guidance vector sequence, thus obtaining the average semantic risk feature vector sequence. The average semantic risk feature vector sequence, behavioral risk feature vector sequence, and financing guidance vector sequence are concatenated at each time step, and a comprehensive contract risk feature vector sequence is generated through linear mapping.

[0010] Optionally, the semantic RetNet encoding branch employs a stacked structure of several layers of improved RetNet Blocks to model contract semantic risk on the semantic embedding vector sequence, generating a semantic risk feature vector sequence, specifically including: Each layer of the improved RetNet Block includes a multi-scale parallel Retention module and a risk-aware adaptive decay module; Use the sequence dimension of the semantic embedding vector sequence as the time step dimension; The multi-scale parallel Retention module performs multi-scale risk feature modeling, feature concatenation, and linear fusion on the semantic embedding vector at the current time step to generate a multi-scale fused feature vector. In the risk perception adaptive decay module, the multi-scale fusion feature vector of the current time step is generated into a risk decay vector through linear mapping and Sigmoid activation; The risk attenuation vector is multiplied element-wise with the multi-scale fusion feature vector to obtain the attenuation modulation feature vector. The multi-scale fusion feature vector of the current time step is then residually connected and normalized with the attenuation modulation feature vector to obtain the semantic risk feature vector. The semantic risk feature vectors of all time steps are arranged into a semantic risk feature vector sequence according to the time step.

[0011] Optionally, the multi-scale parallel Retention module performs multi-scale risk feature modeling, feature concatenation, and linear fusion on the semantic embedding vector at the current time step to generate a multi-scale fused feature vector, specifically including: The multi-scale parallel Retention module includes a short-term risk modeling channel, a medium-term behavior modeling channel, and a long-term performance modeling channel. Set short-term time decay factor, medium-term time decay factor and long-term time decay factor; In the short-term risk modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the short-term time decay factor to obtain the short-term Retention feature vector of the current time step. The weighted cumulative calculation of Retention is specifically as follows: Generate a query vector from the semantic embedding vector of the current time step through a linear mapping, and generate key vectors and value vectors from the semantic embedding vectors of all historical time steps through linear mapping respectively. The attention weight scalar is obtained by performing a dot product operation between the query vector of the current time step and the key vector of each historical time step. Multiply the attention weight scalar with the value vector of the corresponding historical time step to obtain the weighted value vector of the corresponding historical time step, and accumulate the weighted value vectors of all historical time steps. Then multiply it with the short-term time decay factor to obtain the short-term Retention feature vector of the current time step. The short-term Retention feature vectors are used to generate gating weight scalars through linear mapping and Sigmoid activation. Based on the residual gated weight scalar, the semantic embedding vector of the current time step is gated and fused with the short-term Retention feature vector to obtain the short-term risk feature vector of the current time step. In the mid-term behavior modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the mid-term time decay factor to obtain the mid-term Retention feature vector of the current time step. The mid-term Retention feature vector is convolved in one dimension to obtain the mid-term behavioral feature vector. In the long-term performance modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the long-term time decay factor to obtain the long-term Retention feature vector of the current time step. Set a smoothing coefficient, and perform a weighted fusion of the long-term Retention feature vector at the current time step and the long-term trend smoothing vector at the previous time step to obtain the long-term trend smoothing vector at the current time step; where the long-term trend smoothing vector at the first time step is equal to the long-term Retention feature vector. The short-term risk feature vector, medium-term behavior feature vector, and long-term trend smoothing vector of the current time step are concatenated and a multi-scale fusion feature vector of the current time step is generated through linear transformation.

[0012] Optionally, step five specifically includes: The risk assessment mapping module includes a feature mapping unit, a risk score prediction unit, an anomaly probability prediction unit, and a risk level discrimination unit; In the feature mapping unit, the sequence of contract comprehensive risk feature vectors is averaged and pooled along the time step dimension to obtain the global risk feature vector; the global risk feature vector is then transformed linearly to obtain the risk-mapped feature vector. In the risk scoring prediction unit, the risk mapping feature vector is transformed by linear transformation and projected in one dimension to obtain the contract risk score. In the anomaly probability prediction unit, the risk mapping feature vector is projected into one dimension through linear transformation and then normalized by Sigmoid to obtain the performance anomaly probability. In the risk level discrimination unit, the risk mapping feature vector is transformed linearly to obtain the risk level logical vector; the risk level logical vector is normalized by Softmax to obtain the risk level probability vector; the vector index corresponding to the maximum value in the risk level probability vector is selected as the contract risk level label. The contract risk assessment result consists of contract risk score, probability of performance anomaly, and contract risk level label.

[0013] Optionally, step six specifically includes: The financing control decision results include financing control indicators, available financing amount range, and financing execution parameter vector; The contract risk score, the probability of performance anomaly, and the risk level label are vectorized and encoded, and then concatenated along the feature dimension to obtain the contract risk assessment vector. The financing feature vector sequence is averaged and pooled along the time step dimension to obtain the average financing feature vector. The contract risk assessment vector and the average financing feature vector are concatenated, and the feature is mapped through linear transformation to obtain the comprehensive financing risk score vector. The financing risk comprehensive score vector is projected into one dimension through linear transformation and then normalized by Sigmoid to obtain the financing access score. Set a financing access threshold. If the financing access score is greater than or equal to the financing access threshold, generate a financing control flag 1; otherwise, generate a financing control flag 0. The financing risk comprehensive score vector is linearly transformed and projected into one dimension, and then nonlinearly activated by the Softplus function to generate the financing ratio coefficient. Set the book value of accounts receivable and the minimum financing ratio coefficient. The product of the financing ratio coefficient and the book value of accounts receivable is the maximum financing amount; the product of the maximum financing amount and the minimum financing ratio coefficient is the minimum financing amount. A range of available financing amounts is generated based on the minimum and maximum available financing amounts; The financing risk comprehensive score vector is transformed into a four-dimensional parameter mapping to obtain the financing execution parameter vector, which includes financing interest rate adjustment parameters, financing term control parameters, loan disbursement trigger threshold parameters, and risk control recovery trigger parameters.

[0014] Optionally, the financing control instructions include status flags, amount ranges, parameter configurations, and trigger logic expressions for controlling the smart contract to execute the financing process; the financing control instructions are deployed to the callable function interface of the target smart contract to drive the on-chain execution and status update of the financing process.

[0015] The beneficial effects of this invention are: This invention utilizes an improved RetNet network to jointly model the risk characteristics of smart contracts at the semantic structure, behavioral execution, and performance financing layers, achieving a multi-dimensional characterization of complex contract risks. By setting up parallel semantic and behavioral RetNet encoding branches and introducing a financing guidance module and a feature fusion module, contract semantic risks, abnormal call behavior, and financing performance risks can be aligned and fused within the same feature space, significantly improving the ability to model cross-modal risk correlations. The multi-scale parallel Retention structure and risk perception adaptive decay mechanism adopted enable the model to simultaneously perceive short-term high-risk operational fluctuations, medium-term abnormal call behavior, and long-term performance trend changes, effectively enhancing the ability to identify hidden risks and temporally evolving risks. In the risk assessment stage, risk scoring, performance anomaly probability, and risk level discrimination can be completed through linear mapping and activation functions, reducing inference complexity and improving computational stability. In the financing control stage, the risk assessment results and financing features are jointly inferred to generate the available financing amount range and financing execution parameters, achieving refined linkage control of financing access, amount control, and risk recovery. This invention has significant technical effects in improving the accuracy of smart contract risk identification, enhancing the security of financing decisions, reducing reliance on manual risk control, and supporting automated on-chain execution. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the deep learning-based smart contract risk assessment and accounts receivable financing method proposed in this invention; Figure 2 This is a flowchart of the improved RetNet network structure in the deep learning-based smart contract risk assessment and accounts receivable financing method proposed in this invention; Figure 3 This is a flowchart of the improved RetNet Block structure in the deep learning-based smart contract risk assessment and accounts receivable financing method proposed in this invention. Detailed Implementation

[0017] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0018] refer to Figures 1-3 The method for smart contract risk assessment and accounts receivable financing based on deep learning includes the following steps: Step 1: Collect smart contract association data of the target smart contract; Step 2: Perform data preprocessing on the smart contract-related data to obtain standard contract-related data; Step 3: Embed, map, and encode the standard contract-related data to obtain the smart contract feature vector sequence; Step 4: Input the smart contract feature vector sequence into the improved RetNet network, perform joint risk feature modeling and guided fusion, and generate a comprehensive risk feature vector sequence for the contract; the improved RetNet network includes a semantic RetNet encoding branch, a behavioral RetNet encoding branch, a financing guidance module, and a feature fusion module; the semantic RetNet encoding branch adopts an improved RetNet Block stacking structure; Step 5: Use the risk assessment mapping module to perform contract risk assessment on the comprehensive risk feature vector sequence of the contract, and output the contract risk assessment results; Step Six: Based on the contract risk assessment results, perform financing control reasoning to generate financing control decision results; Step 7: Write the financing control decision results into the target smart contract and generate financing control instructions.

[0019] In this embodiment, the smart contract associated data includes smart contract source code text, on-chain transaction call records, accounts receivable information, and historical performance and repayment records; The on-chain transaction call record includes the call timestamp, calling account address, function signature, transaction value, and execution status; the accounts receivable information includes the amount, aging days, payer identifier, and account creation timestamp; the historical repayment record includes the payer's repayment time, repayment amount, overdue days, and repayment status flag.

[0020] In this embodiment, step two specifically includes: The data preprocessing includes character standardization, timestamp alignment, and numerical normalization. The character standardization specifically involves converting the smart contract source code text into UTF-8 encoding format, removing non-printable characters and differences in multilingual symbols, and obtaining standard contract code text. The timestamp alignment specifically involves aligning the timestamp fields in on-chain transaction call records, accounts receivable information, and historical repayment records according to a set time step to obtain aligned on-chain transaction call records, aligned accounts receivable information, and aligned historical repayment records. The numerical normalization process specifically involves mapping the numerical fields in the aligned on-chain transaction call records, aligned accounts receivable information, and aligned historical repayment records to the [0, 1] interval using a minimum-maximum normalization method to obtain standard on-chain transaction call records, standard on-chain accounts receivable information, and standard historical repayment records. The numerical fields include: call timestamp, transaction value, account amount, account aging days, account creation timestamp, repayment time, repayment amount, and overdue days. The standard contract associated data consists of the standard contract code text, standard on-chain transaction call records, standard on-chain accounts receivable information, and standard historical performance and repayment records.

[0021] In this embodiment, step three specifically includes: The standard contract code text is initially segmented according to the set lexical rules to obtain a sequence of contract lexical units; The type of each contract lexical unit is determined and the type is labeled to obtain a contract semantic token sequence. The types include keyword tokens, function identifier tokens, variable identifier tokens, operator tokens, and call symbol tokens. In this invention, type labeling of each contract lexical unit explicitly distinguishes code components with different semantic functions, facilitating differentiated modeling of their semantic importance during the modeling of the improved RetNet network. Keywords typically determine statement structure and control flow, function identifiers reflect call logic and contract interfaces, variable identifiers carry state information, operators embody numerical and logical operations, and call symbols associate execution paths and external dependencies. Precise type labeling of these contract lexical units allows the construction of a contract semantic token sequence with prior structural information, enhancing the improved RetNet network's ability to identify and express risk-sensitive code fragments.

[0022] The contract semantic token sequence is input into the embedding mapping layer, which performs an embedding mapping operation on each contract semantic token through a set embedding matrix to generate a semantic embedding vector sequence. Standard on-chain transaction call records are numerically and vectorized to obtain call behavior feature vectors, and then arranged into a call behavior feature vector sequence according to the time step order. The numerical encoding specifically involves converting non-numerical fields into numerical fields according to a set field mapping rule; the vector encoding specifically involves performing an embedding mapping operation on the standard on-chain transaction call record that has been numerically encoded through an embedding mapping layer to obtain a call behavior feature vector; the non-numerical fields include the call account address, function signature, and execution status; the embedding mapping layer maps each numerical field to a semantic vector of a set dimension based on a set embedding matrix, and merges the semantic vectors of multiple fields through vector concatenation to output a structured call behavior feature vector; Standard accounts receivable information and standard historical repayment records are numerically and vectorized, and features are concatenated to obtain financing feature vectors. The financing feature vectors are then arranged into a financing feature vector sequence according to the time step order. The semantic embedding vector sequence, the call behavior feature vector sequence, and the financing feature vector sequence are combined to form the smart contract feature vector sequence.

[0023] In this embodiment, step four specifically includes: The semantic RetNet coding branch and the behavioral RetNet coding branch are two parallel coding branches; The semantic RetNet encoding branch adopts a stacked structure of several layers of improved RetNet Blocks to model the contract semantic risk of the semantic embedding vector sequence and generate a semantic risk feature vector sequence. The behavioral RetNet encoding branch adopts a stacked structure of several layers of standard RetNet Blocks to perform time-series modeling on the contract call behavior feature vector sequence, generating a behavioral risk feature vector sequence, specifically: Set the time decay factor; Generate a behavior query vector from the contract call behavior feature vector of the current time step through linear mapping, and generate behavior key vectors and behavior value vectors from the contract call behavior feature vectors of all historical time steps through linear mapping respectively. Perform a dot product operation between the behavior query vector of the current time step and the behavior key vector of each historical time step to obtain the behavior attention weight scalar. Multiply the behavior attention weight scalar with the behavior value vector of the corresponding historical time step to obtain the behavior weight vector of the corresponding historical time step; Accumulate the weighted vector of behaviors from all historical time steps, and then multiply it by the time decay factor to obtain the behavior risk feature vector of the current time step; The behavioral risk feature vectors are arranged into a behavioral risk feature vector sequence according to time steps; The financing guidance module adopts a two-layer MLP structure to extract risk guidance features from the financing feature vector sequence and generate a financing guidance vector sequence. The first layer MLP structure includes a linear mapping and a ReLU activation function, and the second layer MLP structure includes a linear mapping and a tanh activation function. The semantic risk feature vector sequence, behavioral risk feature vector sequence, and financing guidance vector sequence are aligned and fused through the feature fusion module to generate a comprehensive contract risk feature vector sequence, specifically: The semantic risk feature vector sequence is averaged and pooled to obtain the average semantic risk feature vector. The average semantic risk feature vector is then copied and expanded to maintain consistency with the time step dimension of the behavioral risk feature vector sequence and the financing guidance vector sequence, thus obtaining the average semantic risk feature vector sequence. The average semantic risk feature vector sequence, behavioral risk feature vector sequence, and financing guidance vector sequence are concatenated at each time step, and a comprehensive contract risk feature vector sequence is generated through linear mapping.

[0024] In this embodiment, the semantic RetNet encoding branch adopts a stacked structure of several layers of improved RetNet Blocks to model contract semantic risk on the semantic embedding vector sequence and generate a semantic risk feature vector sequence, specifically including: Each layer of the improved RetNet Block includes a multi-scale parallel Retention module and a risk-aware adaptive decay module; Use the sequence dimension of the semantic embedding vector sequence as the time step dimension; The multi-scale parallel Retention module performs multi-scale risk feature modeling, feature concatenation, and linear fusion on the semantic embedding vector at the current time step to generate a multi-scale fused feature vector. In the risk perception adaptive decay module, the multi-scale fusion feature vector of the current time step is generated into a risk decay vector through linear mapping and Sigmoid activation; The risk attenuation vector is multiplied element-wise with the multi-scale fusion feature vector to obtain the attenuation modulation feature vector. The multi-scale fusion feature vector of the current time step is then residually connected and normalized with the attenuation modulation feature vector to obtain the semantic risk feature vector. The semantic risk feature vectors of all time steps are arranged into a semantic risk feature vector sequence according to the time step.

[0025] In this embodiment, the multi-scale parallel Retention module performs multi-scale risk feature modeling, feature concatenation, and linear fusion on the semantic embedding vector at the current time step to generate a multi-scale fused feature vector, specifically including: The multi-scale parallel Retention module includes a short-term risk modeling channel, a medium-term behavior modeling channel, and a long-term performance modeling channel. Set short-term time decay factor, medium-term time decay factor and long-term time decay factor; among them, the short-term time decay factor, medium-term time decay factor and long-term time decay factor all belong to the (0,1) interval, and the values ​​gradually increase. In the short-term risk modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the short-term time decay factor to obtain the short-term Retention feature vector of the current time step. The weighted cumulative calculation of Retention is specifically as follows: Generate a query vector from the semantic embedding vector of the current time step through a linear mapping, and generate key vectors and value vectors from the semantic embedding vectors of all historical time steps through linear mapping respectively. The attention weight scalar is obtained by performing a dot product operation between the query vector of the current time step and the key vector of each historical time step. Multiply the attention weight scalar with the value vector of the corresponding historical time step to obtain the weighted value vector of the corresponding historical time step, and accumulate the weighted value vectors of all historical time steps. Then multiply it with the short-term time decay factor to obtain the short-term Retention feature vector of the current time step. The short-term Retention feature vectors are used to generate gating weight scalars through linear mapping and Sigmoid activation. Based on the residual gated weight scalar, the semantic embedding vector of the current time step is gated and fused with the short-term Retention feature vector to obtain the short-term risk feature vector of the current time step. In the mid-term behavior modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the mid-term time decay factor to obtain the mid-term Retention feature vector of the current time step. The mid-term Retention feature vector is convolved in one dimension to obtain the mid-term behavioral feature vector. In the long-term performance modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the long-term time decay factor to obtain the long-term Retention feature vector of the current time step. Set a smoothing coefficient, and perform a weighted fusion of the long-term Retention feature vector at the current time step and the long-term trend smoothing vector at the previous time step to obtain the long-term trend smoothing vector at the current time step; where the long-term trend smoothing vector at the first time step is equal to the long-term Retention feature vector. The short-term risk feature vector, medium-term behavior feature vector, and long-term trend smoothing vector of the current time step are concatenated and a multi-scale fusion feature vector of the current time step is generated through linear transformation.

[0026] In this invention, the improved RetNet network maintains the same overall structure as the original RetNet network. Both adopt a time decay mechanism to perform temporal modeling of the input sequence and achieve the ability to model long-distance dependencies of historical information through a preservative weighted accumulation method. In the basic network unit, linear mapping is used to obtain query, key, and value vectors, and weighted accumulation is performed on the features of historical time steps to construct the output features of the current time step, thus retaining the structural advantages of RetNet in terms of low computational complexity and excellent modeling of deep dependencies.

[0027] The improved RetNet network, while maintaining the basic RetNet modeling framework, constructs parallel semantic RetNet encoding branches and behavioral RetNet encoding branches to address the temporal multi-scale and financial semantic requirements of smart contract risk modeling. It utilizes a financing guidance module and a feature fusion module to achieve semantic-guided fusion of financing risk. Specifically, the behavioral RetNet encoding branch retains the original RetNet structure, while the semantic RetNet encoding branch introduces a multi-scale parallel Retention structure, a risk-aware adaptive decay mechanism, and a residual-gated fusion mechanism. The multi-scale parallel Retention structure models features at the same time step in parallel through short-term risk modeling, medium-term behavioral modeling, and long-term performance modeling channels, introducing different time decay factors to capture behavioral and performance risk features across different time spans. The risk-aware adaptive decay module introduces a sigmoid-activated risk decay factor adjustment mechanism to modulate the multi-scale fused features element-wise, and fuses the current input and retained features through residual gating, improving the semantic representation accuracy and adjustment capability of the improved RetNet network.

[0028] Through the aforementioned structural improvements, the improved RetNet network not only inherits the advantages of the original RetNet network in long sequence modeling, but also significantly enhances its ability to perceive and model risk patterns at different temporal levels. It is suitable for complex financial risk scenarios such as potentially high-risk operations in contract semantics and short-term abnormal fluctuations and long-term performance trend changes in contract call behavior. At the same time, the introduced risk perception adaptive decay and residual gating mechanism enable the improved RetNet network to have stronger stability and discrimination ability when facing complex cross semantics and high-dimensional risk factors, thereby improving the overall accuracy of smart contract risk identification.

[0029] In this embodiment, step five specifically includes: The risk assessment mapping module includes a feature mapping unit, a risk score prediction unit, an anomaly probability prediction unit, and a risk level discrimination unit; In the feature mapping unit, the sequence of contract comprehensive risk feature vectors is averaged and pooled along the time step dimension to obtain the global risk feature vector; the global risk feature vector is then transformed linearly to obtain the risk-mapped feature vector. In the risk scoring prediction unit, the risk mapping feature vector is projected in one dimension through a linear transformation to obtain the contract risk score. Specifically, the risk score weight vector and the risk score bias value are set, and the risk mapping feature vector is linearly transformed. In the anomaly probability prediction unit, the risk mapping feature vector is projected into one dimension through a linear transformation and then normalized by Sigmoid to obtain the performance anomaly probability. Specifically, the performance probability weight vector and the performance probability bias value are set, the risk mapping feature vector is linearly transformed to obtain the performance prediction value, and the performance prediction value is normalized by the Sigmoid function to obtain the performance anomaly probability. In the risk level discrimination unit, the risk mapping feature vector is mapped to the risk level through a linear transformation to obtain the risk level logical vector. Specifically, the risk level weight matrix and the risk level bias vector are set, and the risk mapping feature vector is linearly transformed. The risk level logical vector is then subjected to Softmax normalization to obtain the risk level probability vector. The vector index corresponding to the maximum value in the risk level probability vector is selected as the contract risk level label. The contract risk assessment result consists of contract risk score, probability of performance anomaly, and contract risk level label.

[0030] In this embodiment, step six specifically includes: The financing control decision results include financing control indicators, available financing amount range, and financing execution parameter vector; The contract risk score, the probability of performance anomaly, and the risk level label are vectorized and encoded, and then concatenated along the feature dimension to obtain the contract risk assessment vector. The financing feature vector sequence is averaged and pooled along the time step dimension to obtain the average financing feature vector. The contract risk assessment vector and the average financing feature vector are concatenated, and the feature is mapped through linear transformation to obtain the comprehensive financing risk score vector. The financing risk comprehensive score vector is projected into one dimension through linear transformation and then normalized by Sigmoid to obtain the financing access score. Set a financing access threshold. If the financing access score is greater than or equal to the financing access threshold, a financing control flag 1 is generated; otherwise, a financing control flag 0 is generated. A financing control flag of 1 indicates that financing is allowed, and a financing control flag of 0 indicates that financing is prohibited. The financing risk comprehensive score vector is linearly transformed and projected into one dimension, and then nonlinearly activated by the Softplus function to generate the financing ratio coefficient. Set the book value of accounts receivable and the minimum financing ratio coefficient. The product of the financing ratio coefficient and the book value of accounts receivable is the maximum financing amount; the product of the maximum financing amount and the minimum financing ratio coefficient is the minimum financing amount. A range of available financing amounts is generated based on the minimum and maximum available financing amounts; The financing risk comprehensive score vector is transformed into a four-dimensional parameter mapping to obtain the financing execution parameter vector, which includes financing interest rate adjustment parameters, financing term control parameters, loan disbursement trigger threshold parameters, and risk control recovery trigger parameters.

[0031] In this invention, a deep modeling of the contract semantic risk feature vector sequence and the behavioral risk feature vector sequence is completed through an improved RetNet network. Feature alignment and fusion are then achieved by combining the financing guidance vector sequence, resulting in a fully expressive contract comprehensive risk feature vector sequence. Therefore, in the contract risk assessment and financing control inference process, only linear transformation, pooling processing, and activation function operations need to be performed on the risk assessment vector and the financing risk comprehensive score vector to efficiently generate contract risk score, performance anomaly probability, risk level label, financing access control mark, available financing amount range, and financing execution parameter vector. There is no need to introduce a complex modeling structure, which significantly improves the overall inference efficiency and model deployment adaptability.

[0032] In this embodiment, the financing control instruction includes a status flag, amount range, parameter configuration, and trigger logic expression for controlling the smart contract to execute the financing process; the financing control instruction is deployed to the callable function interface of the target smart contract to drive the on-chain execution and status update of the financing process.

[0033] In this invention, the financing control flag is used as the assignment field of the financing status variable in the smart contract to indicate whether the current smart contract allows the financing process to begin. Write the minimum and maximum available financing amounts within the financing range into the smart contract parameter storage structure as boundary conditions for financing amount calculation and verification. Write the four parameters in the financing execution parameter vector into the corresponding parameter slots of the smart contract in sequence: the financing interest rate adjustment parameter is written into the interest rate setting field, the financing term control parameter is written into the financing term field, the loan disbursement trigger threshold parameter is written into the loan disbursement condition field, and the risk control recovery trigger parameter is written into the performance control field.

[0034] Example 1: To verify the feasibility of this invention in practice, the method of this invention was applied to a supply chain finance service platform. This platform provides blockchain-based accounts receivable confirmation and financing services to manufacturing, logistics, and raw material trading companies. The platform uses smart contracts to complete processes such as accounts receivable transfer, financing application, loan disbursement triggering, and repayment settlement. More than 10,000 smart contracts have been deployed, with an average daily on-chain transaction volume exceeding 200,000.

[0035] In this business scenario, financial institutions primarily rely on the execution results of smart contracts to provide financing and loans to SMEs. However, the following problems have gradually emerged in actual operation: some contracts, despite lacking obvious semantic vulnerabilities, frequently exhibit abnormal calls during actual operation; some accounts receivable contracts have historical performance records of delays or installment defaults, which traditional rule models cannot identify in advance; and existing risk assessment methods typically separate contract code risk, transaction behavior risk, and financing attribute risk, lacking a unified deep modeling mechanism. This leads to delayed financing access judgments, large deviations in credit limit calculations, and ultimately, an increase in bad debt rates and a decrease in capital utilization.

[0036] During implementation, the platform first collects associated data of the target smart contract, including the contract source code text, on-chain transaction call records, accounts receivable amount and aging information, and the corresponding enterprise's historical performance and repayment records. This data undergoes character standardization, timestamp alignment, and numerical normalization to form a standard contract associated dataset. Subsequently, lexical segmentation and type labeling are performed on the standard contract code, transforming it into a semantic token sequence, and a semantic embedding vector sequence is generated through an embedding mapping layer. Simultaneously, on-chain transaction records are numerically encoded and vectorized to construct a call behavior feature vector sequence. Accounts receivable amount, aging structure, and historical repayment status are jointly encoded to generate a financing feature vector sequence. These three types of feature vector sequences are uniformly input into an improved RetNet network for joint risk modeling, outputting a comprehensive contract risk feature vector sequence.

[0037] Based on the comprehensive risk feature vector sequence of the contract, the platform generates contract risk score, performance anomaly probability and contract risk level label through the risk assessment mapping module. It further combines financing features to perform financing control reasoning, output financing access control flag, financing amount range and financing execution parameter vector, and write financing control instructions into the target smart contract to realize on-chain automatic triggering and control of the financing process.

[0038] To further verify the practical effect of the method of this invention in a real business environment, 1154 smart contracts that have completed their lifecycles were selected as experimental samples, including 483 normally fulfilling contracts, 376 contracts with delayed performance, and 295 high-risk contracts that have defaulted, to construct a comparative experimental dataset. Three comparison schemes were used: Scheme A: a static rule detection method based on human experience, including dangerous function matching, call count threshold judgment, and code complexity index screening; Scheme B: a risk modeling method based on the standard RetNet network, directly modeling the contract semantics and behavioral sequences, but excluding multi-scale parallel Retention structures, risk-aware adaptive decay modules, and financing guidance mechanisms; Scheme C: a linear weighted evaluation method based on behavioral clustering and accounts receivable rating. The comparison results are shown in Table 1.

[0039] Table 1. Performance Comparison of Different Schemes in Smart Contract Financing Risk Identification

[0040] As shown in Table 1, the method of this invention outperforms the comparative scheme in several comparative indicators. Regarding the accuracy of contract risk identification, the method of this invention reaches 92.7%, an improvement of 14.3 percentage points compared to comparative scheme A, significantly enhancing the ability to identify high-risk smart contracts. In terms of the AUC index for performance anomaly prediction, the method of this invention reaches 0.893, significantly higher than the comparative scheme, indicating that the method of this invention has stronger discriminative performance in capturing potential default trends. Regarding the bad debt rate of financing, the method of this invention effectively controls it to 1.84%, the lowest among all schemes, significantly reducing the credit risk of financial institutions. In terms of average approval time, the method of this invention maintains a time of 2.41 seconds, balancing real-time requirements with deep modeling needs, reducing processing time by nearly half compared to comparative scheme B.

[0041] Furthermore, in terms of the actual loan approval rate, this invention achieves 81.6%, significantly higher than the 65.1% of the comparative scheme A, indicating that the method of this invention improves financing coverage under controllable risk. Regarding the average deviation rate of available financing amount, the method of this invention is only 6.2%, reflecting that the method of this invention predicts financing amount more accurately and reliably, which helps improve the matching efficiency of credit allocation. This invention not only improves the accuracy of risk identification and the reliability of prediction, but also has significant advantages in efficiency and resource allocation capabilities, verifying the feasibility and superiority of the proposed method in real-world business scenarios.

[0042] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for smart contract risk assessment and accounts receivable financing based on deep learning, characterized in that, Includes the following steps: Step 1: Collect smart contract association data of the target smart contract; Step 2: Perform data preprocessing on the smart contract-related data to obtain standard contract-related data; Step 3: Embed, map, and encode the standard contract-related data to obtain the smart contract feature vector sequence; Step 4: Input the smart contract feature vector sequence into the improved RetNet network, perform joint risk feature modeling and guided fusion, and generate a comprehensive risk feature vector sequence for the contract; the improved RetNet network includes a semantic RetNet encoding branch, a behavioral RetNet encoding branch, a financing guidance module, and a feature fusion module; the semantic RetNet encoding branch adopts an improved RetNet Block stacking structure; Step 5: Use the risk assessment mapping module to perform contract risk assessment on the comprehensive risk feature vector sequence of the contract, and output the contract risk assessment results; Step Six: Based on the contract risk assessment results, perform financing control reasoning to generate financing control decision results; Step 7: Write the financing control decision results into the target smart contract and generate financing control instructions.

2. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 1, characterized in that, The smart contract-related data includes the smart contract source code text, on-chain transaction call records, accounts receivable information, and historical performance and repayment records.

3. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 1, characterized in that, Step two specifically includes: The data preprocessing includes character standardization, timestamp alignment, and numerical normalization. The character standardization specifically involves converting the smart contract source code text into UTF-8 encoding format to obtain standard contract code text. The timestamp alignment specifically involves aligning the timestamp fields in on-chain transaction call records, accounts receivable information, and historical repayment records according to a set time step to obtain aligned on-chain transaction call records, aligned accounts receivable information, and aligned historical repayment records. The numerical normalization process specifically involves mapping the numerical fields in the aligned on-chain transaction call records, aligned accounts receivable information, and aligned historical performance repayment records to the [0, 1] interval using the minimum-maximum normalization method, thereby obtaining standard on-chain transaction call records, standard on-chain accounts receivable information, and standard historical performance repayment records. The standard contract associated data consists of the standard contract code text, standard on-chain transaction call records, standard on-chain accounts receivable information, and standard historical performance and repayment records.

4. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 1, characterized in that, Step three specifically includes: The standard contract code text is initially segmented according to the set lexical rules to obtain a sequence of contract lexical units; The type of each contract lexical unit is determined and the type is labeled to obtain a contract semantic token sequence. The types include keyword tokens, function identifier tokens, variable identifier tokens, operator tokens, and call symbol tokens. The contract semantic token sequence is input into the embedding mapping layer, which performs an embedding mapping operation on each contract semantic token through a set embedding matrix to generate a semantic embedding vector sequence. Standard on-chain transaction call records are numerically and vectorized to obtain call behavior feature vectors, and then arranged into a call behavior feature vector sequence according to the time step order. The numerical encoding specifically involves converting non-numerical fields into numerical fields according to a set field mapping rule; the vector encoding specifically involves performing an embedding mapping operation on the standard on-chain transaction call record that has been numerically encoded through an embedding mapping layer to obtain a call behavior feature vector. Standard accounts receivable information and standard historical repayment records are numerically and vectorized, and features are concatenated to obtain financing feature vectors. The financing feature vectors are then arranged into a financing feature vector sequence according to the time step order. The semantic embedding vector sequence, the call behavior feature vector sequence, and the financing feature vector sequence are combined to form the smart contract feature vector sequence.

5. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 1, characterized in that, Step four specifically includes: The semantic RetNet coding branch and the behavioral RetNet coding branch are two parallel coding branches; The semantic RetNet encoding branch adopts a stacked structure of several layers of improved RetNet Blocks to model the contract semantic risk of the semantic embedding vector sequence and generate a semantic risk feature vector sequence. The behavioral RetNet encoding branch adopts a stacked structure of several layers of standard RetNet Blocks to perform time-series modeling of the contract call behavior feature vector sequence and generate a behavioral risk feature vector sequence. The financing guidance module adopts a two-layer MLP structure to extract risk guidance features from the financing feature vector sequence and generate a financing guidance vector sequence. The first layer MLP structure includes a linear mapping and a ReLU activation function, and the second layer MLP structure includes a linear mapping and a tanh activation function. The semantic risk feature vector sequence, behavioral risk feature vector sequence, and financing guidance vector sequence are aligned and fused through the feature fusion module to generate a comprehensive contract risk feature vector sequence, specifically: The semantic risk feature vector sequence is averaged and pooled to obtain the average semantic risk feature vector. The average semantic risk feature vector is then copied and expanded to maintain consistency with the time step dimension of the behavioral risk feature vector sequence and the financing guidance vector sequence, thus obtaining the average semantic risk feature vector sequence. The average semantic risk feature vector sequence, behavioral risk feature vector sequence, and financing guidance vector sequence are concatenated at each time step, and a comprehensive contract risk feature vector sequence is generated through linear mapping.

6. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 5, characterized in that, The semantic RetNet encoding branch employs a stacked structure of several layers of improved RetNet Blocks to model contract semantic risk on the semantic embedding vector sequence, generating a semantic risk feature vector sequence, specifically including: Each layer of the improved RetNet Block includes a multi-scale parallel Retention module and a risk-aware adaptive decay module; Use the sequence dimension of the semantic embedding vector sequence as the time step dimension; The multi-scale parallel Retention module performs multi-scale risk feature modeling, feature concatenation, and linear fusion on the semantic embedding vector at the current time step to generate a multi-scale fused feature vector. In the risk perception adaptive decay module, the multi-scale fusion feature vector of the current time step is generated into a risk decay vector through linear mapping and Sigmoid activation; The risk attenuation vector is multiplied element-wise with the multi-scale fusion feature vector to obtain the attenuation modulation feature vector. The multi-scale fusion feature vector of the current time step is then residually connected and normalized with the attenuation modulation feature vector to obtain the semantic risk feature vector. The semantic risk feature vectors of all time steps are arranged into a semantic risk feature vector sequence according to the time step.

7. The method for risk assessment and accounts receivable financing of smart contracts based on deep learning according to claim 6, characterized in that, The multi-scale parallel Retention module performs multi-scale risk feature modeling, feature concatenation, and linear fusion on the semantic embedding vector at the current time step to generate a multi-scale fused feature vector, specifically including: The multi-scale parallel Retention module includes a short-term risk modeling channel, a medium-term behavior modeling channel, and a long-term performance modeling channel. Set short-term time decay factor, medium-term time decay factor and long-term time decay factor; In the short-term risk modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the short-term time decay factor to obtain the short-term Retention feature vector of the current time step. The weighted cumulative calculation of Retention is specifically as follows: Generate a query vector from the semantic embedding vector of the current time step through a linear mapping, and generate key vectors and value vectors from the semantic embedding vectors of all historical time steps through linear mapping respectively. The attention weight scalar is obtained by performing a dot product operation between the query vector of the current time step and the key vector of each historical time step. Multiply the attention weight scalar with the value vector of the corresponding historical time step to obtain the weighted value vector of the corresponding historical time step, and accumulate the weighted value vectors of all historical time steps. Then multiply it with the short-term time decay factor to obtain the short-term Retention feature vector of the current time step. The short-term Retention feature vectors are used to generate gating weight scalars through linear mapping and Sigmoid activation. Based on the residual gated weight scalar, the semantic embedding vector of the current time step is gated and fused with the short-term Retention feature vector to obtain the short-term risk feature vector of the current time step. In the mid-term behavior modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the mid-term time decay factor to obtain the mid-term Retention feature vector of the current time step. The mid-term Retention feature vector is convolved in one dimension to obtain the mid-term behavioral feature vector. In the long-term performance modeling channel, the semantic embedding vector of the current time step is weighted and accumulated based on the long-term time decay factor to obtain the long-term Retention feature vector of the current time step. Set a smoothing coefficient, and perform a weighted fusion of the long-term Retention feature vector at the current time step and the long-term trend smoothing vector at the previous time step to obtain the long-term trend smoothing vector at the current time step; where the long-term trend smoothing vector at the first time step is equal to the long-term Retention feature vector. The short-term risk feature vector, medium-term behavior feature vector, and long-term trend smoothing vector of the current time step are concatenated and a multi-scale fusion feature vector of the current time step is generated through linear transformation.

8. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 1, characterized in that, Step five specifically includes: The risk assessment mapping module includes a feature mapping unit, a risk score prediction unit, an anomaly probability prediction unit, and a risk level discrimination unit; In the feature mapping unit, the sequence of contract comprehensive risk feature vectors is averaged and pooled along the time step dimension to obtain the global risk feature vector; the global risk feature vector is then transformed linearly to obtain the risk-mapped feature vector. In the risk scoring prediction unit, the risk mapping feature vector is transformed by linear transformation and projected in one dimension to obtain the contract risk score. In the anomaly probability prediction unit, the risk mapping feature vector is projected into one dimension through linear transformation and then normalized by Sigmoid to obtain the performance anomaly probability. In the risk level discrimination unit, the risk mapping feature vector is transformed linearly to obtain the risk level logical vector; the risk level logical vector is normalized by Softmax to obtain the risk level probability vector; the vector index corresponding to the maximum value in the risk level probability vector is selected as the contract risk level label. The contract risk assessment result consists of contract risk score, probability of performance anomaly, and contract risk level label.

9. The method for smart contract risk assessment and accounts receivable financing based on deep learning according to claim 1, characterized in that, Step six specifically includes: The financing control decision results include financing control indicators, available financing amount range, and financing execution parameter vector; The contract risk score, the probability of performance anomaly, and the risk level label are vectorized and encoded, and then concatenated along the feature dimension to obtain the contract risk assessment vector. The financing feature vector sequence is averaged and pooled along the time step dimension to obtain the average financing feature vector. The contract risk assessment vector and the average financing feature vector are concatenated, and the feature is mapped through linear transformation to obtain the comprehensive financing risk score vector. The financing risk comprehensive score vector is projected into one dimension through linear transformation and then normalized by Sigmoid to obtain the financing access score. Set a financing access threshold. If the financing access score is greater than or equal to the financing access threshold, generate a financing control flag 1; otherwise, generate a financing control flag 0. The financing risk comprehensive score vector is linearly transformed and projected into one dimension, and then nonlinearly activated by the Softplus function to generate the financing ratio coefficient. Set the book value of accounts receivable and the minimum financing ratio coefficient. The product of the financing ratio coefficient and the book value of accounts receivable is the maximum financing amount; the product of the maximum financing amount and the minimum financing ratio coefficient is the minimum financing amount. A range of available financing amounts is generated based on the minimum and maximum available financing amounts; The financing risk comprehensive score vector is transformed into a four-dimensional parameter mapping to obtain the financing execution parameter vector, which includes financing interest rate adjustment parameters, financing term control parameters, loan disbursement trigger threshold parameters, and risk control recovery trigger parameters.

10. The method for risk assessment and accounts receivable financing of smart contracts based on deep learning according to claim 1, characterized in that, The financing control instructions include status flags, amount ranges, parameter configurations, and trigger logic expressions for controlling the smart contract to execute the financing process; the financing control instructions are deployed to the callable function interface of the target smart contract to drive the on-chain execution and status update of the financing process.