Smart contract processing method and device

By filtering and evaluating the changes of smart contracts, we guide the changes of smart contracts, solving the problems of incomplete content and difficulty of change in smart contracts, and improving the matching degree and enthusiasm for change between smart contracts and participants.

CN119762221APending Publication Date: 2025-04-04CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411560340.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The content in the smart contract is incomplete, which leads to low enthusiasm among participants, and it is difficult for existing technology to effectively change the smart contract, resulting in low content matching and insufficient enthusiasm among participants to participate.

Method used

By obtaining changes to smart contracts deployed by the license chain, performing content feature filtering, evaluating the effectiveness of the changed content, and changing the smart contracts based on the evaluation indicators, improving the matching degree between the changed smart contract and the license chain nodes.

Benefits of technology

It improves the matching degree between smart contracts and participants, improves the flexibility and security of smart contracts to change, and enhances the enthusiasm of participants to change smart contracts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762221A_ABST
    Figure CN119762221A_ABST
Patent Text Reader

Abstract

An embodiment of this specification provides a method and device for processing a smart contract, the method comprising: obtaining a change request for a smart contract deployed on a permission chain; performing feature filtering on the content features of the change content of the smart contract carried in the change request; performing content evaluation on the change content based on the feature filtering result to obtain an evaluation index, and performing change processing on the smart contract according to the evaluation index to obtain a changed smart contract. The use of the embodiment of this application can improve the matching degree between the smart contract and the participants.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data processing technology, and in particular to a smart contract processing method and device. Background Art

[0002] With the continuous development of Internet technology and the continuous advancement of social information, in order to simplify complex transaction processes, more and more participants have begun to use smart contracts to implement transactions on the blockchain; in the process of executing smart contracts, if the content of the smart contract is not perfect, the enthusiasm of the participants to participate in the execution of the smart contract may not be high, so it is often necessary to change the content of the smart contract.

[0003] At present, although some rights to change smart contracts have been opened, there are relatively few actual operations to change smart contracts, which may lead to unreasonable content in smart contracts, low matching between smart contracts and participants, and thus reduce the enthusiasm of participants in smart contracts to participate. Summary of the invention

[0004] The purpose of one embodiment of this specification is to provide a smart contract processing method and device to improve the matching degree between smart contracts and participants.

[0005] To solve the above technical problems, one embodiment of this specification is implemented as follows: In a first aspect, an embodiment of this specification provides a smart contract processing method, the method comprising: Obtain change requests for smart contracts deployed on permissioned chains; Performing feature filtering processing on content features of the change content of the smart contract carried in the change request; Based on the feature filtering result, content evaluation processing is performed on the changed content to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract.

[0006] The smart contract processing method provided in this embodiment obtains a change request for a smart contract deployed on a permission chain, performs feature filtering on the content features of the change content of the smart contract carried in the change request to obtain a feature filtering result, and on this basis, performs content evaluation processing with the help of the feature filtering result to obtain an evaluation index, and performs change processing on the smart contract according to the evaluation index to obtain a changed smart contract. In this way, by performing feature filtering on the content features of the change content of the smart contract, the effectiveness of the content features is achieved, thereby improving the accuracy of subsequent evaluation indicators, guiding the changes to the smart contract through the evaluation indicators, improving the flexibility of the change of the smart contract, and improving the matching degree of the participants corresponding to the changed smart contract and the permission chain node, meeting the actual needs of the permission chain node, thereby improving the enthusiasm of the participants to participate in the change of the smart contract.

[0007] In a second aspect, another embodiment of this specification provides a smart contract processing device, the device comprising: The request acquisition module is used to obtain change requests for smart contracts deployed on the permissioned chain; A feature filtering module, used to perform feature filtering processing on content features of the change content of the smart contract carried by the change request; The content evaluation module is used to perform content evaluation processing on the changed content based on the feature filtering result to obtain an evaluation index, and to perform change processing on the smart contract according to the evaluation index to obtain a changed smart contract.

[0008] In the third aspect, another embodiment of the present specification provides a smart contract processing device, which includes: a memory, a processor, and computer-executable instructions stored on the memory and executable on the processor, and when the computer-executable instructions are executed by the processor, the steps of the smart contract processing method described in the first aspect above are implemented.

[0009] In a fourth aspect, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the smart contract processing method as described in the first aspect above are implemented.

[0010] In a fifth aspect, another embodiment of the present specification provides a computer program product, wherein the computer program product includes a smart contract processing program, and the smart contract processing program is executed by a processor to implement the steps of the smart contract processing method as described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. Figure 1 A processing flow chart of a smart contract processing method provided for one embodiment of this specification; Figure 2 A schematic diagram of a content evaluation model provided for one embodiment of this specification; Figure 3 A processing flow chart of a smart contract processing method applied to a permission chain scenario provided by one embodiment of this specification; Figure 4 A schematic diagram of a smart contract processing device provided for one embodiment of this specification; Figure 5 A schematic diagram of the structure of a smart contract processing device provided for one embodiment of this specification. DETAILED DESCRIPTION

[0012] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0013] An embodiment of a smart contract processing method provided in this specification is as follows: The smart contract processing method provided in this embodiment can be executed by a computer device, which can be a terminal or a server. The terminal can include a mobile phone, a laptop computer, an intelligent interactive device, etc., and the server can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.

[0014] Reference Figure 1 The smart contract processing method provided in this embodiment specifically includes the following steps S102 to S106.

[0015] Step S102, obtaining a change request for the smart contract deployed on the permission chain.

[0016] The permission chain described in this embodiment includes a private chain and / or a consortium chain in the blockchain; the change request refers to a change request for changing the content of the smart contract or a modification request for modifying the content; optionally, the change request carries the change content of the smart contract; the change request can be a change request submitted by one or more permission chain nodes, that is, one or more permission chain nodes can submit their own change requests.

[0017] In specific implementation, a change request for a smart contract deployed in the permission chain sent by at least one permission chain node may be obtained, and the change request carries the change content of the smart contract of at least one permission chain node. This embodiment may be applied to the owner node of the permission chain, and the owner node may be the node of the owner of the smart contract in the permission chain; the permission chain node may be a participant node, that is, a participant node that participates in changing the smart contract.

[0018] During the specific execution process, in order to improve the effectiveness of changes to smart contracts and avoid frequent changes to smart contracts, optionally, the number of permission chain nodes accounts for a greater than a preset ratio of the number of execution nodes of the smart contract, or the number of permission chain nodes is greater than a preset threshold; the execution nodes of a smart contract refer to all nodes involved in the execution of the smart contract.

[0019] Specifically, the participant corresponding to at least one license chain node may perform detection processing on the smart contract in at least one detection dimension before going online to participate in the execution of the smart contract. If the proportion of detection failure results in the detection results is greater than a preset proportion, at least one license chain node may submit a change request for the smart contract to the node of the owner; specifically, at least one license chain node may send the detection result to the target license chain node. When the target license chain node detects that the proportion of detection failure results in the detection results is greater than a preset proportion, it may return a request to submit an instruction to the license chain node corresponding to the detection failure result. The license chain node may submit a change request for the smart contract to the node of the owner, which may be at least one license chain node; the change request may carry the change content of the smart contract; the detection failure result here may include that the smart contract does not meet the needs of the participant in at least one detection dimension.

[0020] Among them, at least one detection dimension may include a risk detection dimension of the smart contract, a detection dimension of profit distribution in the smart contract, a detection dimension of the task content of the smart contract and / or a detection dimension of the task type of the smart contract.

[0021] In addition to the above-mentioned change request carrying the change content of the smart contract, the change request may also carry the device address of the permission chain node submitting the change request and / or the node identifier of the permission chain node; for example, [ID-IP||Q] is used to represent the information carried in the change request, ID (Identification)-IP represents the device address and node identifier, and Q represents the change content of the smart contract; the device address can be the IP (Internet Protocol) address of the device.

[0022] The changed content of the smart contract may also be the changed content of at least one change dimension, such as the change dimension including the risk change dimension of the smart contract, the change dimension of the profit distribution in the smart contract, the change dimension of the task content of the smart contract and / or the change dimension of the task type of the smart contract.

[0023] Step S104: Perform feature filtering on the content features of the change content of the smart contract carried in the change request.

[0024] After obtaining the change request for the smart contract deployed on the permission chain, in this step, in order to improve the effectiveness and simplicity of the content features, the content features of the change content of the smart contract carried by the change request are filtered.

[0025] In actual applications, smart contracts belong to the block system or the owner of the smart contract, so changing smart contracts is very rigorous, and only participants with a high security factor and credibility can join the change process, that is, they have the authority to modify the content of the smart contract; in order to improve the security of smart contract changes and ensure the credibility of the participants who make smart contract changes, a non-interactive method can be used to enable the owner of the smart contract to verify the security of the participants in a smaller number of interactions; in an optional implementation provided by this embodiment, after the above-mentioned change request for the smart contract deployed on the permission chain is executed, the following operations are also performed: Authentication of the permission chain node that submitted the change request; If the identity verification is successful, execute step S104; In the above process of identity authentication of the permission chain node that submitted the change request, the following operations are performed: Encrypt the blank placeholder message to obtain an encrypted message, and send the encrypted message to the permission chain node; The decryption result of the encrypted message returned by the permission chain node is subjected to trusted verification processing according to the preset verification questions.

[0026] If the trusted verification passes, it can be determined that the identity authentication is successful.

[0027] Among them, the blank placeholder message refers to a temporary message or symbol that replaces the actual content. The permission chain node can be one or more (at least one). The permission chain node refers to the node on the permission chain; the permission chain node can be a participant node, that is, a participant node that participates in changing the smart contract. The preset verification question can be a pre-set verification question. The preset verification question of each participant can be the same or different. For example, the preset verification question ZQ includes:

[0028] In the process of performing trusted verification processing on the decryption result of the encrypted message returned by the license chain node according to the preset verification problem, if it is detected that the decryption result or the encrypted message and the decryption result meet the constraints in the preset verification problem, it is determined that the verification is passed; if not detected, it is determined that the verification is not passed.

[0029] It should be noted that the blank placeholder message here can be a blank placeholder message of the permission chain node, that is, different permission chain nodes can have different blank placeholder messages. Specifically, the encrypted message can be sent to the permission chain node according to the device address carried in the change request and / or the node identifier of the permission chain node.

[0030] On this basis, in an optional implementation manner provided by this embodiment, in the process of encrypting the blank placeholder message to obtain an encrypted message, the following operations are performed: Generating a random number based on the first multiplication group to obtain a random number, and constructing a first encrypted sub-message according to the random number and a generator of the second multiplication group; A second encrypted sub-message is constructed based on the blank placeholder message, the random number, the generator and the preset prime number, and an encrypted message is constructed according to the first encrypted sub-message and the second encrypted sub-message.

[0031] The random number may be a random number corresponding to a permission chain node, that is, different permission chain nodes may have different random numbers.

[0032] Specifically, in the process of constructing the first encrypted sub-message according to the random number and the generator of the second multiplication group, the generator of the second multiplication group can be exponentiated according to the random number to obtain the first encrypted sub-message; in the process of constructing the second encrypted sub-message based on the blank placeholder message, the random number, the generator and the preset prime number, the first sub-message block can be calculated according to the blank placeholder message and the generator, and the second sub-message block can be calculated according to the random number, the third random number and the preset prime number, and the second encrypted sub-message is calculated according to the first sub-message block and the second sub-message block. Specifically, the generator can be exponentiated according to the blank placeholder message to obtain the first sub-message block, and the third random number and the preset prime number can be input into the pairing algorithm for pairing processing, and the pairing processing result can be exponentiated according to the random number to obtain the second sub-message block; the third random number here can be a random positive integer.

[0033] In addition, in the process of encrypting a blank placeholder message to obtain an encrypted message, random number generation can also be performed based on the first multiplication group to obtain a random number, generate a third random number, and input the blank placeholder message, random number, third random number, generator of the second multiplication group, and preset prime number into the encryption algorithm for encryption processing to obtain an encrypted message; or, the random number and generator can also be input into the first encryption algorithm for a first encryption processing to obtain a first encrypted sub-message, and the blank placeholder message, random number, third random number, generator, and preset prime number can be input into the second encryption algorithm for a second encryption processing to obtain a second encrypted sub-message, and an encrypted message can be constructed based on the first encrypted sub-message and the second encrypted sub-message.

[0034] For example, encryption algorithms include:

[0035] Where c = ; d = ;h=( )); Alternatively, the first encryption algorithm may include c= , the second encryption algorithm includes d= ; represents an encrypted message; i represents the i-th permission chain node; m represents a blank placeholder message, which can specifically represent the blank placeholder message of the i-th permission chain node; r represents the random number of the i-th permission chain node, r Subgroup of order q , express The multiplicative group of the elements whose multiplication is reversible is the first multiplicative group; g represents the generator of the second multiplicative group, which can be a large prime number. The multiplication group G of q represents a preset prime number; k represents a third random number; and e represents a pairing algorithm or a pairing function.

[0036] After the encrypted message is obtained by encrypting the blank placeholder message and the encrypted message is sent to the permission chain node for execution, in order to further verify the credibility of the permission chain node, the permission to change the permission chain node is verified with a small number of interactions; in an optional implementation manner provided by this embodiment, the following operations are further performed: Determine a first condition according to a first verification value returned by the permission chain node and a preset prime number, and determine a second condition according to a second verification value returned by the permission chain node and a generator of a second multiplication group; If the first condition and the second condition match, a trusted verification processing operation is performed on the decryption result of the encrypted message returned by the permission chain node according to the preset verification question.

[0037] Optionally, the first verification value is calculated based on a first random number selected from a first multiplication group, a generator and a preset prime number; optionally, the second verification value is calculated based on the first random number, a second random number of a preset length and a preset prime number.

[0038] Optionally, the first verification value is obtained after inputting the first random number, the generator and the second value selected from the first multiplication group into the first numerical calculation algorithm for numerical calculation; the second verification value is obtained after inputting the first random number, the second random number of a preset length and the preset prime number into the second numerical calculation algorithm for numerical calculation.

[0039] For example, the first numerical calculation algorithm includes: a= , =

[0040] Wherein, a represents the first verification value; represents the first random number; p represents the second value; Represents a preset prime number; The second numerical calculation algorithm includes: z=( +ew)mod q Wherein, z represents the second verification value; represents the first random number; e represents the second random number; w represents the preset parameter; q represents the preset prime number; The preset length of the second random number may be t bits. ( <q)。

[0041] Specifically, in the process of determining the first condition according to the first verification value returned by the license chain node and the preset prime number, the product can be calculated according to the first verification value and the first value obtained by calculating based on the preset prime number and the third random number, and the remainder can be calculated according to the product and the second value obtained by calculating based on the preset prime number and the third random number, and the remainder can be used as the first condition; in the process of determining the second condition according to the second verification value returned by the license chain node and the generator of the second multiplication group, the generator can be exponentiated according to the second verification value, and the result of the exponentiation can be used as the second condition; the matching of the first condition and the second condition may include: the first condition is equal to the second condition. Optionally, the first value can be obtained after the third random number and the preset prime number are input into the pairing algorithm for pairing processing.

[0042] For example, the first condition includes:

[0043] in, The result represents the first condition; represents the first verification value; represents the first value; represents the second value; The second condition includes:

[0044] in, The result of represents the second condition; z represents the second verification value.

[0045] In this embodiment, in the process of performing feature filtering processing on the content features of the changed content of the smart contract carried by the change request, feature extraction can be performed on the changed content of the smart contract carried by the change request to obtain the content features of the changed content, and feature filtering processing can be performed on the content features of the changed content to obtain feature filtering results; the process of performing feature filtering processing on the content features of the changed content of the smart contract carried by the change request in this embodiment can be performed by the feature extraction layer and feature filtering layer included in the content evaluation model, specifically, the feature extraction layer can perform feature extraction on the changed content, and the feature extraction layer can be a convolutional network; the feature filtering layer can perform feature filtering processing on the content features of the changed content.

[0046] Specifically, in the process of extracting features of the changed content of the smart contract carried in the change request and obtaining content features of the changed content, a convolution operation may be performed on the changed content of the smart contract to obtain content features of the changed content; For example, a convolutional network consists of: M=[ ]

[0047] Where B represents B filters of the same size; The feature map representing the output of the i-th filter; +

[0048] Among them, x represents the changed content; L represents the length of the changed content; V represents the dimension of the embedding vector; V-dimensional vector representing the i-th word; Represents the convolution kernel of the filter; represents the word window; K represents the length of the sliding window of the change content; a convolution operation Use word window at each position Generate a column feature map ; Represents the characteristics of each word in the changed content; is the V-dimensional vector of the word under the previous sliding window, is the preset bias, Variable dynamic bias, is the multiplication unit, () is a non-linear activation function.

[0049] In the process of performing feature filtering on the content features of the changed content, the content features of the changed content can be vectorized to obtain an output vector as a feature filtering result; specifically, feature transformation can be performed on the content features based on a convolution kernel to obtain transformation features, and compression processing can be performed based on the transformation features, specifically linear compression processing can be performed to obtain the feature filtering result.

[0050] In addition, the content features of the changed content may also be input into a feature filtering algorithm for feature filtering processing to obtain a feature filtering result; for example, the feature filtering algorithm includes:

[0051] in, The feature map representing the output of the i-th filter, i.e., the content features of the changed content; The convolution kernel representing the filter (the convolution kernel of the filter shared by different windows); represents the feature filtering result; d represents the convolution size; is a variable dynamic bias; g() is a linear compression function; If there are C filters in the feature filtering layer, the feature filtering result is:

[0052] Among them, the dimension of P is .

[0053] Step S106, based on the feature filtering result, content evaluation processing is performed on the changed content to obtain evaluation indicators, and the smart contract is changed according to the evaluation indicators to obtain a changed smart contract.

[0054] The above-mentioned feature filtering process is performed on the content features of the change content of the smart contract carried by the change request. In this step, the change content is evaluated based on the feature filtering result to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract.

[0055] The evaluation index described in this embodiment refers to an evaluation index for evaluating the changed content of the smart contract, such as the tolerance of the party to which the smart contract belongs to the changed content.

[0056] In specific implementation, in order to mine the connection between the part and the whole in the feature filtering result, the evaluation index can be accurately calculated through the connection between the part and the whole; in an optional implementation provided by this embodiment, in the process of performing content evaluation processing on the changed content based on the feature filtering result to obtain the evaluation index, the following operations are performed: Calculate the coupling coefficient according to the feature filtering result to obtain the coupling coefficient, and transform the feature filtering result to obtain the transformation feature; The transformation features are weighted based on the coupling coefficients to obtain weighted features, and evaluation indicators of the changed content are calculated based on the weighted features.

[0057] On this basis, in an optional implementation manner provided by this embodiment, in the process of calculating the coupling coefficient according to the feature filtering result to obtain the coupling coefficient, the following operations are performed: Predicting the feature filtering results according to the shared weight matrix of each submodule to obtain each first prediction vector, and predicting the feature filtering results according to the non-shared weight matrix of each submodule to obtain each second prediction vector; A coupling coefficient is calculated based on each of the first prediction vectors and each of the second prediction vectors to obtain each coupling coefficient.

[0058] In addition, the feature filtering results may be respectively input into the first prediction algorithm and the second prediction algorithm for prediction processing to obtain first prediction vectors and second prediction vectors.

[0059] For example, the first prediction algorithm includes:

[0060] in, represents each first prediction vector; Represents the shared weight matrix of the jth submodule; Represents the feature filtering result; represents bias; The second prediction algorithm includes:

[0061] in, represents each second prediction vector; Represents the non-shared weight matrix of the j-th submodule.

[0062] Further, in an optional implementation manner provided in this embodiment, any coupling coefficient among the coupling coefficients is calculated in the following manner: Calculating a first sum of coupling coefficients of each submodule to the parent module, and calculating a second sum of coupling coefficients of any submodule to each submodule; Calculating an external weight according to a coupling coefficient of any submodule to the parent module and the first sum, and calculating an internal weight according to a coupling coefficient of any submodule to the parent module and the second sum; Any coupling coefficient is calculated based on the external weight, the internal weight, and a merged vector of the first prediction vector and the corresponding second prediction vector of any submodule.

[0063] Among them, the coupling coefficient can be the connection coefficient between the submodule and the parent module, which represents the importance of the submodule to the parent module; the coupling coefficient of any submodule to each submodule can be the connection coefficient of any submodule to each submodule, that is, the importance.

[0064] In addition, the coupling coefficient of each submodule to the parent module and the coupling coefficient of any submodule to the parent module can be input into the external weight algorithm for external weight calculation to obtain external weight; the coupling coefficient of any submodule to each submodule and the coupling coefficient of any submodule to the parent module can be input into the internal weight algorithm for internal weight calculation to obtain internal weight; the internal weight, external weight and merged vector are input into the coupling coefficient calculation algorithm for coupling coefficient calculation to obtain any coupling coefficient.

[0065] For example, external weight algorithms include:

[0066] in, represents external weight; Represents the coupling coefficient of each submodule to the parent module; Represents the coupling coefficient of any submodule to the parent module; The internal weighting algorithm includes:

[0067] in, represents the internal weight; Represents the coupling coefficient of any submodule to each submodule; The coupling coefficient calculation algorithm includes:

[0068] in, represents any coupling coefficient; represents the coupling coefficient of the previous iteration; represents the merge vector; , Represents the conversion coupling coefficient; the conversion coupling coefficient can be calculated based on the initial coupling coefficient; ;

[0069] in, represents the preset coefficient; represents the initial coupling coefficient; Represents the first prediction vector of any submodule; Represents the second prediction vector of any submodule.

[0070] It should be noted that, in the process of calculating any coupling coefficient, the above-mentioned calculation method can be iteratively executed once or multiple times until the number of iterations reaches a threshold or each coupling coefficient meets the preset requirements to obtain each coupling coefficient; the above-mentioned sub-module can be a sub-convolution or a sub-capsule, and the parent module can be a parent convolution or a parent capsule.

[0071] Specifically, in the process of transforming the feature filtering results to obtain the transformed features, in order to further determine the relationship between the subconvolution and the parent convolution, the effect of mining the relationship between the part and the whole can be achieved; the feature filtering results can be transformed according to a preset shared weight matrix to obtain the transformed features or the feature filtering results can be input into the transformation algorithm for feature transformation to obtain the transformed features; For example, transformation algorithms include: = +

[0072] in, Represents the transformation feature; The i-th matrix representing the preset shared weight matrix; Represents the i-th feature map in the feature filtering result; Represents bias.

[0073] In the process of performing weighted calculation on the transformation feature based on the coupling coefficient to obtain the weighted feature, the coupling coefficient and the transformation feature can be input into a weighted algorithm to perform weighted calculation to obtain the weighted feature.

[0074] In an optional implementation manner provided by this embodiment, in the process of calculating the evaluation index of the change content based on the weighted features, the following operations are performed: Performing compression processing on the weighted matrix to obtain a compressed matrix; Performing a positive evaluation on the changed content based on the compression matrix to obtain a positive evaluation result, and performing a reverse evaluation on the changed content to obtain a reverse evaluation result; The forward evaluation result and the reverse evaluation result are spliced ​​to obtain the splicing result, and self-attention calculation is performed based on the splicing result to obtain the attention weight as an evaluation indicator of the changed content.

[0075] Specifically, the weighted matrix may be input into a compression algorithm (non-linear compression algorithm) for compression processing to obtain a compressed matrix.

[0076] For example, compression algorithms include:

[0077] in, represents the weighting matrix; = , represents the weighting matrix, represents the coupling coefficient; represents the compression matrix; is the nonlinear compression function g().

[0078] Specifically, in the process of performing a forward evaluation on the changed content based on the compression matrix to obtain a positive evaluation result, and performing a reverse evaluation on the changed content to obtain a reverse evaluation result, a forward attention calculation can be performed based on the compression matrix to obtain the positive attention weight of the changed content, and a reverse attention calculation can be performed based on the compression matrix to obtain the reverse attention weight of the changed content; in the process of performing a forward attention calculation based on the compression matrix to obtain the positive attention weight of the changed content, and performing a reverse attention calculation based on the compression matrix to obtain the reverse attention weight of the changed content, the compression matrix and the previous forward hidden state can be input into the forward evaluation algorithm for forward evaluation processing to obtain the forward hidden state as the forward attention weight, and the compression matrix and the previous reverse hidden state can be input into the reverse evaluation algorithm for reverse evaluation processing to obtain the reverse hidden state as the reverse attention weight.

[0079] For example, the forward evaluation algorithm includes:

[0080] The reverse evaluation algorithm includes:

[0081] in, Represents the positive hidden state, which is also the positive attention weight; represents the previous forward hidden state; , , and These are algorithm parameters; represents the compression matrix; Represents the reverse hidden state, which is the reverse attention weight; represents the previous reverse hidden state; f() is the activation function; in this way, the comprehensiveness and effectiveness of the attention weight are improved through forward and reverse attention calculations.

[0082] In addition, the splicing result can also be input into the self-attention algorithm for self-attention calculation to obtain the attention weight.

[0083] For example, self-attention algorithms include: ( )

[0084]

[0085] v [ ] in, is the intermediate state variable; , , are algorithm parameters; Represents the splicing result; () is the activation function; Represents the attention weight.

[0086] During the specific execution process, in order to improve the safety of changing the smart contract, in an optional implementation provided by this embodiment, in the process of changing the smart contract according to the evaluation index and obtaining the changed smart contract, the following operations are performed: If the evaluation index exceeds the preset index threshold, the smart contract is changed according to the change content to obtain a changed smart contract.

[0087] It should be noted that when the evaluation index exceeds the preset index threshold, the change content of the smart contract can also be sent to the permission chain node, and the permission chain node here may include all permission chain nodes that submit change requests.

[0088] After the smart contract is changed according to the changed content and the changed smart contract is executed, the changed smart contract can also be broadcast on the chain; or the changed smart contract can be broadcast on the chain and the smart contract can be updated based on the changed smart contract.

[0089] On this basis, the parties involved in changing the smart contract can determine whether to execute the changed smart contract based on the changed smart content.

[0090] It should be supplemented that each optional implementation method or each feasible execution method in steps S102 to S106 provided in this embodiment can be executed independently as needed, or can be combined and referenced with each other. At the same time, each specific execution step in each optional implementation method or each feasible execution method can also be executed independently, and this embodiment does not make specific limitations.

[0091] It should also be added that the evaluation index obtained by performing content evaluation processing on the changed content based on the feature filtering result can be obtained by performing content evaluation processing based on the coupling coefficient calculation layer, feature compression layer and attention calculation layer included in the content evaluation model; Figure 2 As shown, the content evaluation model includes a feature extraction layer, a feature filtering layer, a coupling coefficient calculation layer, a feature compression layer and an attention calculation layer.

[0092] In summary, the smart contract processing method provided in this embodiment first obtains a change request for a smart contract deployed on a permission chain, and performs identity authentication on the permission chain node that submits the change request; secondly, if the identity authentication is passed, a coupling coefficient is calculated according to the feature filtering result to obtain a coupling coefficient, feature extraction is performed on the change content of the smart contract carried by the change request to obtain content features, feature filtering is performed on the content features to obtain feature filtering results, coupling coefficient calculation is performed according to the feature filtering results to obtain coupling coefficients, the feature filtering results are transformed to obtain transformation features, weighted calculation is performed on the transformation features based on the coupling coefficient to obtain a weighted matrix, and the weighted matrix is ​​compressed to obtain a compressed matrix, and a positive evaluation is performed on the change content based on the compressed matrix to obtain a positive evaluation result, And reversely evaluate the changed content to obtain a reverse evaluation result, splice the forward evaluation result and the reverse evaluation result to obtain a splicing result, and perform self-attention calculation based on the splicing result to obtain an attention weight; if the attention weight is greater than the weight threshold, change the smart contract according to the changed content to obtain a changed smart contract, and broadcast the changed smart contract on the chain, so that the content features of the changed content of the smart contract are filtered to achieve the effectiveness of the content features, thereby improving the accuracy of subsequent evaluation indicators, guiding the changes of smart contracts through evaluation indicators, improving the flexibility of smart contract changes, and improving the matching degree between the changed smart contract and the permission chain node, meeting the actual needs of the permission chain node, and thereby improving the enthusiasm of the permission chain node to participate in the change of the smart contract.

[0093] The following combination Figure 3, taking the application of the smart contract processing method provided by this embodiment in the permission chain scenario as an example, the smart contract processing method provided by this embodiment is further explained. Figure 3 ,The smart contract processing method applied to the permission chain scenario specifically includes the following steps.

[0094] Step S302, obtaining a change request for the smart contract deployed on the permission chain.

[0095] Step S304: encrypt the blank placeholder message to obtain an encrypted message, and send the encrypted message to the permission chain node that submitted the change request.

[0096] Step S306: Perform trustworthy verification processing on the decryption result of the encrypted message returned by the permission chain node according to the preset verification question.

[0097] Step S308: If the verification is successful, feature filtering is performed on the content features of the change content of the smart contract carried in the change request.

[0098] Step S310, calculating the coupling coefficient according to the feature filtering result to obtain the coupling coefficient, and performing transformation processing on the feature filtering result to obtain the transformation feature.

[0099] Step S312: performing weighted calculation on the transformation features based on the coupling coefficients to obtain a weighted matrix, and performing compression processing on the weighted matrix to obtain a compressed matrix.

[0100] Step S314, performing forward attention calculation based on the compression matrix to obtain the forward attention weight, and performing reverse attention calculation based on the compression matrix to obtain the reverse attention weight.

[0101] Step S316, concatenate the forward attention weight and the reverse attention weight to obtain the concatenated weight, and perform self-attention calculation based on the concatenated weight to obtain the attention weight of the changed content. If the attention weight is greater than the weight threshold, the smart contract is changed according to the changed content to obtain a changed smart contract.

[0102] It should be noted that any one of steps S302 to S316 or any combination of multiple steps can be replaced by the corresponding technical means provided in the above steps S102 to S106 according to the needs of implementation and deployment, and will not be described one by one here.

[0103] Figure 4 A schematic diagram of a smart contract processing device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device comprises: A request acquisition module 402, used to acquire a change request for a smart contract deployed on a permissioned chain; A feature filtering module 404 is used to perform feature filtering processing on content features of the change content of the smart contract carried in the change request; The content evaluation module 406 is used to perform content evaluation processing on the changed content based on the feature filtering result to obtain an evaluation index, and perform change processing on the smart contract according to the evaluation index to obtain a changed smart contract.

[0104] The smart contract processing device provided in this embodiment first obtains a change request for a smart contract deployed on a permission chain by running a request acquisition module 402, then performs feature filtering on content features of the change content of the smart contract carried in the change request by running a feature filtering module 404, and finally runs a content evaluation module 406 to perform content evaluation on the change content based on the feature filtering result to obtain an evaluation index, and performs change processing on the smart contract according to the evaluation index to obtain a changed smart contract, so as to improve the matching degree between the smart contract and the participants.

[0105] The smart contract processing device provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.

[0106] Furthermore, an embodiment of this specification also provides a smart contract processing device, Figure 5 A schematic diagram of a smart contract processing device provided in an embodiment of this specification is shown in FIG. Figure 5 As shown, the device includes: a memory 501, a processor 502, a bus 503 and a communication interface 504. The memory 501, the processor 502 and the communication interface 504 communicate through the bus 503, and the communication interface 504 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.

[0107] Figure 5 In the embodiment, the memory 501 stores computer executable instructions that can be run on the processor 502. When the computer executable instructions are executed by the processor 502, the following process is implemented: Obtain change requests for smart contracts deployed on permissioned chains; Performing feature filtering processing on content features of the change content of the smart contract carried in the change request; Based on the feature filtering result, content evaluation processing is performed on the changed content to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract.

[0108] The smart contract processing device provided in this embodiment obtains a change request for a smart contract deployed on a permission chain through the cooperation of a memory 501, a processor 502, a bus 503 and a communication interface 504, and then performs feature filtering on the content features of the change content of the smart contract carried in the change request to obtain a feature filtering result. On this basis, content evaluation is performed with the help of the feature filtering result to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract, so as to improve the matching degree between the smart contract and the participants.

[0109] The smart contract processing device provided in an embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.

[0110] Furthermore, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented: Obtain change requests for smart contracts deployed on permissioned chains; Performing feature filtering processing on content features of the change content of the smart contract carried in the change request; Based on the feature filtering result, content evaluation processing is performed on the changed content to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract.

[0111] The computer-readable storage medium provided in this embodiment obtains a change request for a smart contract deployed on a permission chain, performs feature filtering on the content features of the change content of the smart contract carried in the change request, and obtains a feature filtering result. On this basis, content evaluation is performed with the help of the feature filtering result to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract, so as to improve the matching degree between the smart contract and the participants.

[0112] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0113] A computer-readable storage medium provided in an embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.

[0114] Furthermore, another embodiment of the present specification also provides a computer program product, which implements the following process when executed by a processor: Obtain change requests for smart contracts deployed on permissioned chains; Performing feature filtering processing on content features of the change content of the smart contract carried in the change request; Based on the feature filtering result, content evaluation processing is performed on the changed content to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract.

[0115] The computer program product provided in this embodiment, after obtaining a change request for a smart contract deployed on a permission chain, performs feature filtering on the content features of the change content of the smart contract carried in the change request to obtain a feature filtering result. On this basis, content evaluation is performed with the help of the feature filtering result to obtain evaluation indicators, and the smart contract is changed according to the evaluation indicators to obtain a changed smart contract, so as to improve the matching degree between the smart contract and the participants.

[0116] A computer program product provided in an embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.

[0117] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0118] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0121] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0122] Memory may include non-permanent storage in a computer-readable storage medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable storage medium.

[0123] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0124] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0126] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A smart contract processing method, characterized in that: The method comprises: Obtain change requests for smart contracts deployed on permissioned chains; Performing feature filtering processing on content features of the change content of the smart contract carried in the change request; Based on the feature filtering result, content evaluation processing is performed on the changed content to obtain an evaluation index, and the smart contract is changed according to the evaluation index to obtain a changed smart contract.

2. The smart contract processing method according to claim 1, characterized in that: After the step of obtaining a change request for a smart contract deployed on a permission chain is executed, and before the step of filtering the content features of the change content of the smart contract carried in the change request is executed, the method further includes: Performing identity authentication on the permission chain node that submitted the change request; If the identity authentication is passed, the step of filtering the content features of the change content of the smart contract carried in the change request is performed; The performing identity authentication processing on the permission chain node that submitted the change request includes: Encrypting the blank placeholder message to obtain an encrypted message, and sending the encrypted message to the permission chain node; The decryption result of the encrypted message returned by the permission chain node is subjected to a trustworthy verification process according to a preset verification question.

3. The smart contract processing method according to claim 2, characterized in that: The step of encrypting the blank placeholder message to obtain an encrypted message includes: Generating a random number based on the first multiplication group to obtain a random number, and constructing a first encrypted sub-message according to the random number and a generator of the second multiplication group; A second encrypted sub-message is constructed based on the blank placeholder message, the random number, the generator and the preset prime number, and the encrypted message is constructed according to the first encrypted sub-message and the second encrypted sub-message.

4. The smart contract processing method according to claim 2, characterized in that: After the sub-step of encrypting the blank placeholder message to obtain an encrypted message and sending the encrypted message to the permission chain node is executed, and before the sub-step of performing a trustworthy verification process on the decryption result of the encrypted message returned by the permission chain node according to a preset verification question is executed, the method further includes: Determine a first condition according to a first verification value returned by the permission chain node and a preset prime number, and determine a second condition according to a second verification value returned by the permission chain node and a generator of a second multiplication group; If the first condition and the second condition match, the sub-step of performing trustworthy verification processing on the decryption result of the encrypted message returned by the permission chain node according to the preset verification question is executed.

5. The smart contract processing method according to claim 4, characterized in that: The first verification value is calculated based on a first random number selected from a first multiplication group, the generator, and the preset prime number; The second verification value is calculated based on the first random number, a second random number of a preset length, and the preset prime number.

6. The smart contract processing method according to claim 1, characterized in that: The step of performing content evaluation on the changed content based on the feature filtering result to obtain an evaluation index includes: Calculating the coupling coefficient according to the feature filtering result to obtain the coupling coefficient, and transforming the feature filtering result to obtain the transformation feature; The transformation feature is weightedly calculated based on the coupling coefficient to obtain a weighted feature, and an evaluation index of the change content is calculated based on the weighted feature.

7. The smart contract processing method according to claim 6, characterized in that: The calculating the evaluation index of the changed content based on the weighted feature includes: Performing compression processing on the weighted matrix to obtain a compressed matrix; Based on the compression matrix, the changed content is positively evaluated to obtain a positive evaluation result, and the changed content is reversely evaluated to obtain a reverse evaluation result; The forward evaluation result and the reverse evaluation result are spliced ​​to obtain a spliced ​​result, and a self-attention calculation is performed based on the spliced ​​result to obtain an attention weight as the evaluation index.

8. The smart contract processing method according to claim 6, characterized in that: The step of calculating the coupling coefficient according to the feature filtering result to obtain the coupling coefficient includes: Predicting the feature filtering results according to the shared weight matrix of each submodule to obtain each first prediction vector, and predicting the feature filtering results according to the non-shared weight matrix of each submodule to obtain each second prediction vector; A coupling coefficient is calculated based on each of the first prediction vectors and each of the second prediction vectors to obtain each coupling coefficient.

9. The smart contract processing method according to claim 8, characterized in that: Any coupling coefficient among the coupling coefficients is calculated in the following way: Calculating a first sum of coupling coefficients of each submodule to a parent module, and calculating a second sum of coupling coefficients of any submodule to each submodule; Calculating an external weight according to a coupling coefficient of any submodule to the parent module and the first sum, and calculating an internal weight according to a coupling coefficient of any submodule to the parent module and the second sum; Any coupling coefficient is calculated based on the external weight, the internal weight, and a merged vector of the first prediction vector and the corresponding second prediction vector of any submodule.

10. The smart contract processing method according to claim 1, characterized in that: The step of changing the smart contract according to the evaluation index to obtain a changed smart contract includes: If the evaluation index exceeds the preset index threshold, the smart contract is changed according to the change content to obtain the changed smart contract; After the step of changing the smart contract according to the changed content and obtaining the changed smart contract is executed, the step further includes: The changed smart contract is broadcasted on the chain.

11. A smart contract processing device, characterized in that: The device comprises: The request acquisition module is used to obtain change requests for smart contracts deployed on the permissioned chain; A feature filtering module, used to perform feature filtering processing on content features of the change content of the smart contract carried by the change request; The content evaluation module is used to perform content evaluation processing on the changed content based on the feature filtering result to obtain an evaluation index, and to perform change processing on the smart contract according to the evaluation index to obtain a changed smart contract.

12. A smart contract processing device, characterized in that: The device includes a memory and a processor, wherein the memory stores computer executable instructions, and when the computer executable instructions are executed on the processor, the steps of the method described in any one of claims 1 to 10 can be implemented.

13. A computer-readable storage medium having computer-executable instructions stored therein, characterized in that: When the computer executable instructions are executed by a processor, the steps of the method described in any one of claims 1 to 10 can be implemented.

14. A computer program product, characterized in that The computer program product includes a smart contract processing program, and when the smart contract processing program is executed by a processor, the steps of the method described in any one of claims 1 to 10 can be implemented.