Blockchain-based smart contract generation method, system and electronic device

Through the smart contract generation method based on the blockchain, the neural network technology is used to automatically review the business license, which solves the time-consuming and labor-intensive problem of manual review in the existing technology and realizes the automation of the business license review.

CN112651753BActive Publication Date: 2024-09-24HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202011612684.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2024-09-24
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

The business license review process in the existing technology relies on manual review, which is time-consuming and labor-intensive, and lacks automated solutions.

Method used

A blockchain-based smart contract generation method is used to obtain the business license text, perform word segmentation and word embedding, and use neural networks to generate smart contracts to achieve automatic review.

Benefits of technology

It realizes the automation of business license review, reduces the time and energy of manual review, and improves review efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112651753B
    Figure CN112651753B
Patent Text Reader

Abstract

The present invention provides a method, system and electronic device for generating a smart contract based on blockchain, and relates to the field of blockchain technology. The method first obtains a business license text in a created blockchain network; wherein the business license text is a text corresponding to a business license document stored in the blockchain network; then the first vector of the business license text is determined according to the business license text; the first vector includes the word segmentation result and the word embedding result of the business license text; then the first vector is input into a preset neural network to obtain a second vector; the second vector is used to determine the data of a code block in the blockchain network according to the word segmentation result and the word embedding result; finally, the smart contract is determined according to the data of the code block in the second vector. When the applicant submits an application for a business license, the smart contract can automatically review whether the applicant meets the business license application based on the information on the blockchain, solving the problem of time-consuming and labor-intensive manual review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based smart contract generation method, system and electronic device. Background Art

[0002] In the application process of business license, a lot of information review is involved. Applicants need to submit various application documents to meet the complex review requirements. In addition, the review process in the existing technology adopts manual review, which is time-consuming and labor-intensive. However, smart contracts in the field of blockchain technology have the advantages of open and transparent rules, visible rules and data in the contract, and all transactions are publicly visible, without any false or hidden transactions. Combined with the advantages of blockchain such as information immutability and non-forgeability, it is very suitable to apply smart contracts to the review process of business licenses, but the existing technology lacks relevant implementation means. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a blockchain-based smart contract generation method, system and electronic device, which realizes an end-to-end smart contract automatic generation process. When an applicant submits an application for a business license, the reviewer collects the applicant's relevant application information from the blockchain. The smart contract can automatically review whether the applicant meets the business license application requirements based on the information on the blockchain, thereby realizing the automation of business license review and solving the problem of time-consuming and labor-intensive manual review in the prior art.

[0004] In a first aspect, an embodiment of the present invention provides a method for generating a smart contract based on blockchain, wherein the smart contract is used for reviewing a business license, and the method includes:

[0005] Obtain the business license text in the created blockchain network; wherein the business license text is the text corresponding to the business license document stored in the blockchain network;

[0006] Determine a first vector of the business license text according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text;

[0007] The first vector is input into a preset neural network to obtain a second vector; the second vector is used to determine the data of the code block in the blockchain network according to the word segmentation result and the word embedding result;

[0008] According to the data of the code block in the second vector, the smart contract is determined.

[0009] In some implementations, the step of determining the first vector of the business license text according to the business license text includes:

[0010] Perform word segmentation on the business license text according to the preset part-of-speech segmentation rules to determine the part-of-speech segmentation result of the business license text;

[0011] A word embedding operation is performed on the word segmentation result according to a preset word embedding rule, and the generated word embedding vector is determined as the first vector.

[0012] In some implementations, the step of performing a word segmentation operation on the business license text according to a preset part-of-speech segmentation rule and determining the part-of-speech segmentation result of the business license text includes:

[0013] Obtain the parts of speech included in the preset part-of-speech segmentation rules; the parts of speech include: subject, other, relationship, and relationship object;

[0014] The business license text is segmented according to the parts of speech to determine the segmentation results of the subject, others, relationship and relationship object of the business license text.

[0015] In some implementations, the step of performing a word embedding operation on the word segmentation result according to a preset word embedding rule and determining the generated word embedding vector as the first vector includes:

[0016] Get word segmentation results for subject, other, relation, and relation object;

[0017] Using the word embedding method, the word segmentation result corresponding to the relationship is converted into the first word embedding vector;

[0018] Using the word aggregation method, the word segmentation results corresponding to the subject and the relation object are converted into the second word embedding vector;

[0019] A first vector is determined according to the first word embedding vector and the second word embedding vector.

[0020] In some implementations, the word aggregation method is implemented by the following formula:

[0021]

[0022] Wherein, xk is the subject or the relation object; E xi-1 is the previous word vector of the subject or the relation object; E xi+1 is the word vector after the subject or the relation object; i is the weight; E xk is the aggregation result of the subject and the relationship object.

[0023] In some embodiments, the step of inputting the first vector into a preset neural network to obtain the second vector includes:

[0024] Input the vector data of the subject, others, relation and relation object in the first vector into the neural network;

[0025] The neural network calculates and outputs a three-dimensional vector (a1, a2, a3); a1 is used to determine the classification of the part of speech; a2 is used to match the code block; and a3 is used to determine the position of the relation object in the code block.

[0026] A second vector is determined based on the three-dimensional vector.

[0027] In some embodiments, the loss function of the neural network during training is:

[0028]

[0029] Among them, Loss is the output value of the loss function; K is the number of data sets; is the number of part-of-speech classifications; a1 is the first dimension of the output vector; is the i-th a1 belonging to the j-th class; a2 i is the real value of the second dimension of the i-th output vector; a3 i is the third-dimensional true value of the i-th output vector; a2 i ′ is the second dimension prediction value of the i-th output vector; a3 i ′ is the third-dimensional prediction value of the i-th output vector; w1, w2, w3 are weight values ​​respectively, and w1>w2>w3.

[0030] In a second aspect, an embodiment of the present invention provides a blockchain-based smart contract generation system, where the smart contract is used for reviewing a business license, and the system includes:

[0031] A data acquisition module, used to acquire the business license text in the created blockchain network; wherein the business license text is the text corresponding to the business license document stored in the blockchain network;

[0032] A first vector determination module, used to determine a first vector of the business license text according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text;

[0033] A second vector determination module, used to input the first vector into a preset neural network to obtain a second vector; the second vector is used to determine the data of the code block in the blockchain network according to the word segmentation result and the word embedding result;

[0034] The smart contract determination module is used to determine the smart contract according to the data of the code block in the second vector.

[0035] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a processor and a memory; a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the blockchain-based smart contract generation method mentioned in any possible implementation manner of the first aspect above are implemented.

[0036] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the blockchain-based smart contract generation method mentioned in any possible implementation manner of the first aspect above are implemented.

[0037] The embodiments of the present invention bring the following beneficial effects:

[0038] The present invention provides a method, system and electronic device for generating a smart contract based on blockchain. The smart contract is used for the review of a business license. The method first obtains a business license text in a created blockchain network; wherein the business license text is a text corresponding to a business license document stored in the blockchain network; then the first vector of the business license text is determined according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text; then the first vector is input into a preset neural network to obtain a second vector; the second vector is used to determine the data of a code block in the blockchain network according to the word segmentation result and the word embedding result; finally, the smart contract is determined according to the data of the code block in the second vector. The method realizes an end-to-end smart contract automatic generation process. When an applicant submits an application for a business license, the reviewer collects the applicant's relevant application information from the blockchain. The smart contract can automatically review whether the applicant meets the business license application based on the information on the blockchain, thereby realizing the automation of the business license review and solving the problem of time-consuming and labor-intensive manual review in the prior art.

[0039] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.

[0040] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically listed below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 A flowchart of a blockchain-based smart contract generation method provided in an embodiment of the present invention;

[0043] Figure 2 A flowchart of step S102 in a blockchain-based smart contract generation method provided in an embodiment of the present invention;

[0044] Figure 3 A flowchart of step S201 in a blockchain-based smart contract generation method provided in an embodiment of the present invention;

[0045] Figure 4 A flowchart of step S202 in a blockchain-based smart contract generation method provided in an embodiment of the present invention;

[0046] Figure 5 A flowchart of step S103 in a blockchain-based smart contract generation method provided in an embodiment of the present invention;

[0047] Figure 6 A schematic diagram of the structure of a blockchain-based smart contract generation system provided by an embodiment of the present invention;

[0048] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0049] icon:

[0050] 610-data acquisition module; 620-first vector determination module; 630-second vector determination module; 640-smart contract determination module; 101-processor; 102-memory; 103-bus; 104-communication interface. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] In the application process of business license, a lot of information review is involved. Applicants need to submit various application documents to meet the complex review requirements. In addition, the review process in the existing technology adopts manual review, which is time-consuming and labor-intensive. However, smart contracts in the field of blockchain technology have the advantages of open and transparent rules, visible rules and data in the contract, and all transactions are publicly visible, without any false or hidden transactions. Combined with the advantages of blockchain such as information immutability and non-forgeability, it is very suitable to apply smart contracts to the review process of business licenses, but the existing technology lacks relevant implementation means.

[0053] Based on this, the embodiment of the present invention provides a blockchain-based smart contract generation method, system and electronic device, which realizes an end-to-end smart contract automatic generation process through blockchain technology and neural network technology, combined with word segmentation and embedding strategies. When the applicant submits an application for a business license, the reviewer collects the applicant's relevant application information from the blockchain. The smart contract can automatically review whether the applicant meets the business license application based on the information on the blockchain, realizing the automation of business license review and solving the problem of time-consuming and labor-intensive manual review in the prior art.

[0054] To facilitate understanding of this embodiment, a blockchain-based smart contract generation method disclosed in an embodiment of the present invention is first introduced in detail.

[0055] See also Figure 1 A flowchart of a method for generating a smart contract based on blockchain is shown, the method comprising the following steps:

[0056] Step S101, obtaining the business license text in the created blockchain network; wherein the business license text is the text corresponding to the business license document stored in the blockchain network.

[0057] The blockchain network in this step is applied to the nodes of business license review, which includes various business license documents. Since the format of business license documents is fixed, the format of the corresponding text content is also roughly the same. After obtaining the business license text, it is necessary to perform similar formatting operations on the text content, such as sentence segmentation, word extraction, and related classification of the content of the business license text.

[0058] Step S102, determining a first vector of the business license text according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text.

[0059] For the business license text, the most important thing is to obtain the subject and the related objects related to the subject, so it is necessary to perform word segmentation on the business license text. Word segmentation can be performed according to subject, others, relationship, relationship object, etc., and then the classification results are subjected to word embedding operations.

[0060] The word embedding operation in this step is an operation related to the field of artificial intelligence. Word embedding can be regarded as giving each group an n-dimensional code, which can describe the part of speech in one dimension and the emotional color in another dimension. The process of replacing the symbol description with the feature description is similar to the use of deep networks in machine vision to extract the basic features of images, which is also convenient for comparison, generalization, and knowledge transfer. Word embedding can ultimately map the features of words to a lower dimension, making the relevant model have fewer parameters and faster training.

[0061] Step S103, input the first vector into a preset neural network to obtain a second vector; the second vector is used to determine the data of the code block in the blockchain network according to the word segmentation result and the word embedding result.

[0062] The acquisition of the first vector can be considered as the segmentation and vectorization of the business license text, and the acquisition of the second vector can be considered as the association between the part of speech of the business license text and the blockchain. Specifically, the code block in the blockchain network is a conditional judgment code block, which can be set in the relevant template library.

[0063] As the input data of the neural network, the essence of the first vector is the word embedding vector, and in the second vector output from the neural network, each dimension and part of speech determines the positional relationship between the phrase and the code block, and thus determines the subsequent generation of the smart contract.

[0064] Step S104: Determine the smart contract according to the data of the code block in the second vector.

[0065] The data related to the code block in the second vector determines the content and location of the code block. The data related to the code block is processed using the relevant code generator to generate a smart contract.

[0066] In essence, a smart contract is a program that realizes the automated processing of traditional contracts in the form of computer instructions. A smart contract is a piece of code that is triggered and executed when two parties trade on the blockchain. This piece of code is a smart contract. A smart contract is not just a program that can be executed automatically, it is itself a system participant that responds to received information, can receive and store value, and can also send information and value to the outside.

[0067] When an applicant submits an application for a business license, the reviewer collects the applicant's relevant application information from the blockchain, and the smart contract automatically reviews whether the applicant meets the business license application requirements based on the information on the blockchain.

[0068] It can be seen from the blockchain-based smart contract generation method provided in the above embodiment that the method realizes the end-to-end smart contract automatic generation process through blockchain technology and neural network technology, combined with word segmentation and embedding strategy. After the applicant submits an application for a business license, the reviewer collects the applicant's relevant application information from the blockchain. The smart contract can automatically review whether the applicant meets the business license application based on the information on the blockchain, realizing the automation of business license review and solving the problem of time-consuming and labor-intensive manual review in the prior art.

[0069] In some implementations, step S102 of determining the first vector of the business license text according to the business license text is as follows: Figure 2 As shown, including:

[0070] Step S201, performing word segmentation operation on the business license text according to a preset part-of-speech segmentation rule to determine the part-of-speech segmentation result of the business license text.

[0071] In the specific implementation process, the business license text is segmented according to subject, others, relationship and relationship object. The specific steps are as follows: Figure 3 As shown:

[0072] Step S31, obtaining the parts of speech included in the preset part-of-speech segmentation rule; wherein the parts of speech include: subject, other, relationship, and relationship object.

[0073] Step S32, performing word segmentation operations on the business license text according to the parts of speech, and determining the segmentation results of the subject, others, relationship, and relationship object of the business license text.

[0074] The subject is the object of the conditional judgment in the code block; the relationship is the relationship of equal, greater than, less than, etc.; the relationship object is the target value of the conditional judgment in the code block, which is the target behind the relationship. For example, "100,000 yuan" in "greater than 100,000 yuan" is the relationship object; others refer to words that do not play any role in the code block generation process.

[0075] Step S202: perform a word embedding operation on the word segmentation result according to a preset word embedding rule, and determine the generated word embedding vector as the first vector.

[0076] The process of obtaining word embedding vectors for business license text according to subject, others, relations and relations is as follows: Figure 4 As shown, including:

[0077] Step S41, obtaining word segmentation results of subject, other, relation and relation object.

[0078] The word segmentation results of the parts of speech of subject, other, relation and relation object have been completed by steps S31-S32 and will not be repeated here.

[0079] Step S42: using a word embedding method, convert the word segmentation result corresponding to the relationship into a first word embedding vector.

[0080] In this step, the word segmentation results corresponding to the relationship are directly obtained through the word embedding method.

[0081] Step S43, using a word aggregation method, converting the word segmentation results corresponding to the subject and the relationship object into a second word embedding vector.

[0082] In this step, the embedding vectors of the subject and the relational object are calculated, and the second word embedding vector is obtained by word aggregation. In the specific implementation process, the word aggregation method is implemented by the following formula:

[0083]

[0084] Wherein, xk is the subject or the relation object; E xi-1 is the previous word vector of the subject or the relation object; E xi+1 is the word vector after the subject or the relation object; i is the weight; E xk is the aggregation result of the subject and the relationship object.

[0085] Step S44, determining a first vector according to the first word embedding vector and the second word embedding vector.

[0086] After the first vector is obtained, the first vector is input into a preset neural network to obtain a second vector. In some embodiments, step S103 is as follows: Figure 5 As shown, including:

[0087] Step S501, inputting vector data of the subject, others, relation and relation object in the first vector into the neural network.

[0088] Step S502, the neural network calculates and outputs a three-dimensional vector (a1, a2, a3); wherein a1 is used to determine the classification of the part of speech; a2 is used to match the code block; and a3 is used to determine the position of the relationship object in the code block.

[0089] Specifically, taking the parts of speech as subject, others, relation, and relation object as an example, when a1=1, the word is the subject; when a1=2, the word is a relation; when a1=3, the word is a relation object; and when a1=4, the word is others.

[0090] Step S503: determine a second vector according to the three-dimensional vector.

[0091] The first feature of the output vector is used for part-of-speech classification. When a1=1, the word is the subject. As the object of conditional judgment in the code block, its position is obtained through the third dimension feature a3 of the output vector: the position is determined by the shortest Euclidean distance between a3 output by the neural network and the position number.

[0092] When a1=2, the word is a relationship, and the (conditional judgment) code block in the template library is matched through the corresponding relationship. The corresponding relationship is obtained through the second dimension feature a2 of the output vector: the code block number is determined by using the shortest Euclidean distance between a2 output by the neural network and the code block number.

[0093] When a1=3, the word is a relational object, and serves as the target value of the conditional judgment in the code block. Its position is obtained through the third-dimensional feature a3 of the output vector: the position is determined by the shortest Euclidean distance between a3 output by the neural network and the position number.

[0094] When a1=4, the word is other, which means that the word is irrelevant in the current code generation process and no code generation related operations are performed.

[0095] If other types of words have corresponding code generation operations, they can be expanded by adding categories of a1 features, such as a1=5, a1=6, etc., and corresponding operations are performed after part-of-speech classification.

[0096] In some embodiments, the loss function of the neural network during training is:

[0097]

[0098] Among them, Loss is the output value of the loss function; K is the number of data sets; is the number of part-of-speech classifications; a1 is the first dimension of the output vector; is the i-th a1 belonging to the j-th class; a2 i is the real value of the second dimension of the i-th output vector; a3 i is the third-dimensional true value of the i-th output vector; a2 i ′ is the second dimension prediction value of the i-th output vector; a3 i ′ is the third-dimensional prediction value of the i-th output vector; w1, w2, w3 are weight values ​​respectively, and w1>w2>w3.

[0099] When an applicant applies for a business license, he or she no longer needs to provide relevant application materials. When the reviewer receives the application, he or she collects the applicant's relevant application information from the blockchain node. The smart contract automatically reviews whether the applicant meets the business license application requirements based on the information on the blockchain. In the specific implementation process, manual verification can be performed after obtaining the audit results on the blockchain to further improve the audit accuracy.

[0100] It can be seen from the blockchain-based smart contract generation method provided in the above embodiment that the method realizes the end-to-end smart contract automatic generation process through blockchain technology and neural network technology, combined with word segmentation and embedding strategy. After the applicant submits an application for a business license, the reviewer collects the applicant's relevant application information from the blockchain. The smart contract can automatically review whether the applicant meets the business license application based on the information on the blockchain, realizing the automation of business license review and solving the problem of time-consuming and labor-intensive manual review in the prior art.

[0101] Corresponding to the above method embodiment, the embodiment of the present invention also provides a blockchain-based smart contract generation system, which is used for the review of business licenses. The structural diagram of the system is shown in FIG. Figure 6 As shown, including:

[0102] The data acquisition module 610 is used to acquire the business license text in the created blockchain network; wherein the business license text is the text corresponding to the business license document stored in the blockchain network;

[0103] A first vector determination module 620, configured to determine a first vector of the business license text according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text;

[0104] A second vector determination module 630 is used to input the first vector into a preset neural network to obtain a second vector; the second vector is used to determine the data of the code block in the blockchain network according to the word segmentation result and the word embedding result;

[0105] The smart contract determination module 640 is used to determine the smart contract according to the data of the code block in the second vector.

[0106] The blockchain-based smart contract generation system provided in the embodiment of the present invention has the same technical features as the blockchain-based smart contract generation method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects. For the sake of brief description, for matters not mentioned in the embodiment part, reference can be made to the corresponding content in the above method embodiment.

[0107] This embodiment also provides an electronic device, which is a structural diagram of the electronic device as shown in Figure 7 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to realize the above-mentioned blockchain-based smart contract generation.

[0108] Figure 7The electronic device shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .

[0109] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0110] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.

[0111] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method of the above embodiment in combination with its hardware.

[0112] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method of the above embodiment are executed.

[0113] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0116] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0117] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for generating a smart contract based on blockchain, characterized in that: The smart contract is used for reviewing the business license, and the method includes: Obtaining a business license text in the created blockchain network; wherein the business license text is a text corresponding to the business license document stored in the blockchain network; Determine a first vector of the business license text according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text; Inputting the first vector into a preset neural network to obtain a second vector; the second vector is used to determine the data of the code block in the blockchain network according to the word segmentation result and the word embedding result; Determining the smart contract according to the data of the code block in the second vector; The step of determining a first vector of the business license text according to the business license text comprises: Performing a word segmentation operation on the business license text according to a preset part-of-speech segmentation rule to determine a part-of-speech segmentation result of the business license text; Performing a word embedding operation on the word segmentation result according to a preset word embedding rule, and determining the generated word embedding vector as the first vector; The step of performing a word segmentation operation on the business license text according to a preset part-of-speech segmentation rule to determine the part-of-speech segmentation result of the business license text includes: Obtaining the parts of speech included in the preset part-of-speech segmentation rule; wherein the parts of speech include: subject, other, relationship, and relationship object; Perform word segmentation operations on the business license text according to the parts of speech, and determine segmentation results of the subject, the others, the relationship, and the relationship object of the business license text; The step of performing a word embedding operation on the word segmentation result according to a preset word embedding rule, and determining the generated word embedding vector as the first vector includes: Obtain the word segmentation results where the parts of speech are the subject, the others, the relationship, and the relationship object; Using a word embedding method, converting the word segmentation result corresponding to the relationship into a first word embedding vector; Using a word aggregation method, converting the word segmentation results corresponding to the subject and the relationship object into a second word embedding vector; Determine the first vector according to the first word embedding vector and the second word embedding vector; The word aggregation method is implemented by the following formula: Wherein, xk is the subject or the relation object; E xi-1 is the previous word vector of the subject or the relation object; E xi+1 is the word vector after the subject or the relation object; i is the weight; E xk is the aggregation result of the subject and the relation object; The step of inputting the first vector into a preset neural network to obtain a second vector comprises: Inputting vector data of the subject, the other, the relationship and the relationship object in the first vector into the neural network; The neural network calculates and outputs a three-dimensional vector (a1, a2, a3); wherein a1 is used to determine the classification of the part of speech; a2 is used to match the code block; and a3 is used to determine the position of the relational object in the code block; Determine the second vector according to the three-dimensional vector; The loss function of the neural network during training is: Wherein, Loss is the output value of the loss function; K is the number of data sets; M is the number of categories of the part of speech; a1 is the first dimension of the output vector; is the i-th a1 belonging to the j-th class; a2 i is the real value of the second dimension of the i-th output vector; a3 i is the third-dimensional true value of the i-th output vector; a2 i ′ is the second dimension prediction value of the i-th output vector; a3 i ′ is the third-dimensional prediction value of the i-th output vector; w1, w2, w3 are weight values ​​respectively, and w1>w2>w3.

2. A blockchain-based smart contract generation system, characterized in that: The smart contract is used for the review of the business license, and the system includes: A data acquisition module, used to acquire the business license text in the created blockchain network; wherein the business license text is the text corresponding to the business license document stored in the blockchain network; A first vector determination module, used to determine a first vector of the business license text according to the business license text; the first vector includes a word segmentation result and a word embedding result of the business license text; A second vector determination module, used to input the first vector into a preset neural network to obtain a second vector; the second vector is used to determine the data of the code block in the blockchain network according to the word segmentation result and the word embedding result; a smart contract determination module, configured to determine the smart contract according to the data of the code block in the second vector; In the process of determining the first vector of the business license text according to the business license text, the first vector determination module is further used to: perform a word segmentation operation on the business license text according to a preset part-of-speech segmentation rule to determine the part-of-speech segmentation result of the business license text; perform a word embedding operation on the word segmentation result according to a preset word embedding rule, and determine the generated word embedding vector as the first vector; In the process of performing word segmentation operation on the business license text according to the preset part-of-speech segmentation rule to determine the part-of-speech segmentation result of the business license text, the first vector determination module is also used to: obtain the part-of-speech included in the preset part-of-speech segmentation rule; wherein the part-of-speech includes: subject, others, relationship and relationship object; perform word segmentation operation on the business license text according to the part-of-speech respectively, and determine the segmentation results of the subject, others, relationship and relationship object of the business license text; In the process of performing a word embedding operation on the word segmentation result according to a preset word embedding rule and determining the generated word embedding vector as the first vector, the first vector determination module is further used to: obtain the word segmentation result whose part of speech is the subject, the other, the relationship and the relationship object; convert the word segmentation result corresponding to the relationship into a first word embedding vector by using a word embedding method; convert the word segmentation results corresponding to the subject and the relationship object into a second word embedding vector by using a word aggregation method; determine the first vector according to the first word embedding vector and the second word embedding vector; The word aggregation method used in the first vector determination module is implemented by the following formula: Wherein, xk is the subject or the relation object; E xi-1 is the previous word vector of the subject or the relation object; E xi+1 is the word vector after the subject or the relation object; i is the weight; E xk is the aggregation result of the subject and the relation object; In the process of inputting the first vector into a preset neural network to obtain the second vector, the second vector determination module is further used to: input vector data of the subject, the other, the relationship and the relationship object in the first vector into the neural network; the neural network calculates and outputs a three-dimensional vector (a1, a2, a3); wherein a1 is used to determine the classification of the part of speech; a2 is used to match the code block; a3 is used to determine the position of the relationship object in the code block; and the second vector is determined according to the three-dimensional vector; The loss function of the neural network in the second vector determination module during training is: Wherein, Loss is the output value of the loss function; K is the number of data sets; M is the number of categories of the part of speech; a1 is the first dimension of the output vector; is the i-th a1 belonging to the j-th class; a2 i is the real value of the second dimension of the i-th output vector; a3 i is the third-dimensional true value of the i-th output vector; a2 i ′ is the second dimension prediction value of the i-th output vector; a3 i ′ is the third-dimensional prediction value of the i-th output vector; w1, w2, w3 are weight values ​​respectively, and w1>w2>w3.

3. An electronic device, characterized in that: include: processor and storage device; The storage device stores a computer program, which, when executed by the processor, implements the steps of the blockchain-based smart contract generation method as claimed in claim 1.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of the blockchain-based smart contract generation method described in claim 1 are implemented.

Citation Information

Patent Citations

  • Method for automatically classifying intelligent contracts on basis of feed-forward neural networks

    CN106778882A

  • Text similarity measure method combining word clustering and word combination semantic features

    CN108399163A

  • A secure Java smart contract interpretation execution engine and method

    CN109710384A

  • Three-embedded convolutional neural network model and text multi-classification method thereof

    CN110046250A

  • Service processing method based on block chain and related device

    CN110245186A