CN118409747A - Intelligent contract generation method, device, equipment, storage medium and program product - Google Patents
Intelligent contract generation method, device, equipment, storage medium and program product Download PDFInfo
- Publication number
- CN118409747A CN118409747A CN202410859638.4A CN202410859638A CN118409747A CN 118409747 A CN118409747 A CN 118409747A CN 202410859638 A CN202410859638 A CN 202410859638A CN 118409747 A CN118409747 A CN 118409747A
- Authority
- CN
- China
- Prior art keywords
- contract
- function components
- connection
- contract function
- components
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 230000004044 response Effects 0.000 claims abstract description 56
- 230000006870 function Effects 0.000 claims description 253
- 238000004590 computer program Methods 0.000 claims description 36
- 238000010586 diagram Methods 0.000 claims description 18
- 230000036961 partial effect Effects 0.000 claims description 2
- 239000000306 component Substances 0.000 description 282
- 238000011161 development Methods 0.000 description 15
- 238000005516 engineering process Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000002829 reductive effect Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 239000008358 core component Substances 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application relates to an intelligent contract generation method, an intelligent contract generation device, intelligent contract generation equipment, an intelligent contract generation storage medium and an intelligent contract generation program product, and relates to the technical field of blockchain. The method comprises the following steps: the contract generation interface comprises a working area and a component library area, wherein the component library area comprises a plurality of contract functional components, the plurality of contract functional components are moved to the working area for display in response to dragging operation aiming at the plurality of contract functional components, logic relations among the plurality of contract functional components are obtained in response to connection operation aiming at the plurality of contract functional components displayed in the working area, and then the functional codes of the plurality of contract functional components are spliced according to the logic relations to generate an intelligent contract.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to an intelligent contract generating method, apparatus, device, storage medium, and program product.
Background
With the rapid development of information technology, the blockchain technology is used as a decentralized, non-tamperable, safe and reliable distributed account book technology, and gradually changes our life style and economic pattern. In many applications of blockchain technology, smart contracts (Smart Contract) have received extensive attention and research as one of its core components.
At present, intelligent contracts need to be manually developed by developers with professional programming knowledge, so that the intelligent contracts have certain limitations in development and have high development thresholds.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an intelligent contract generation method, apparatus, device, storage medium, and program product capable of automatically generating an intelligent contract.
In a first aspect, the present application provides a method for generating an intelligent contract. The method comprises the following steps:
displaying a contract generation interface, wherein the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
Responsive to a drag operation for a plurality of contract function components, moving the plurality of contract function components into the workspace for display;
Obtaining a logical relationship between the plurality of contract function components in response to a connection operation for the plurality of contract function components displayed within the workspace;
and splicing the function codes of the contract function components according to the logic relation to generate intelligent contracts.
In one embodiment, before the splicing the function codes of the plurality of contract function components according to the logical relationship to generate the smart contract, the method further includes:
In response to an editing operation for a target contract feature, displaying an editing area of the target contract feature on the contract generation interface, the editing area including: a property editing control;
Responding to the input operation of the attribute editing control, and displaying attribute parameters corresponding to the input operation in the editing area;
and inputting the attribute parameters into template codes corresponding to the target contract functional components to obtain the functional codes of the target contract functional components.
In one embodiment, before the splicing the function codes of the plurality of contract function components according to the logical relationship to generate the smart contract, the method further includes:
In response to a connection operation for the plurality of contract function components displayed within the workspace, displaying a connection graph for the plurality of contract function components corresponding to the connection operation;
If a first contract function component which is not connected with other contract function components exists in the connection diagram of the contract function components, displaying first connection error prompt information; the first connection error prompt message is used for prompting a user that a contract function component which is not connected with other contract function components exists.
In one embodiment, after the obtaining the logical relationship between the plurality of contract function components in response to the connection operation for the plurality of contract function components displayed in the workspace, the method further comprises:
If the connection between some contract function components in the contract function components has logic conflict, displaying a second connection error prompt message; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
In one embodiment, after the attribute parameter corresponding to the input operation is displayed in the editing area in response to the input operation for the attribute editing control, the method further includes:
if the attribute parameters corresponding to the input operation have errors, displaying parameter error prompt information; the parameter error prompt information is used for reminding a user that the input attribute parameter has errors.
In one embodiment, the contract generation interface further includes an intelligent contract generation control, and the splicing the function codes of the plurality of contract function components according to the logic relationship to generate an intelligent contract includes:
Responding to clicking operation of the intelligent contract generation control, splicing the function codes of the contract function components according to the logic relation to generate an intelligent contract, and displaying the generation progress prompt information of the intelligent contract;
The generating progress prompt message includes: an estimated remaining wait period for the smart contract is generated and/or a progress percentage value for the smart contract is generated.
In a second aspect, the application further provides an intelligent contract generating device. The device comprises:
The system comprises a first display module, a second display module and a second display module, wherein the first display module is used for displaying a contract generation interface, the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
A moving module for moving the plurality of contract function components to the in-workspace for display in response to a drag operation for the plurality of contract function components;
An acquisition module for acquiring a logical relationship between the plurality of contract function components in response to a connection operation for the plurality of contract function components displayed in the workspace;
and the generation module is used for splicing the function codes of the contract function components according to the logic relation so as to generate the intelligent contract.
In one embodiment, the apparatus further comprises:
A second display module, configured to display, on the contract generation interface, an editing area of the target contract function component in response to an editing operation for the target contract function component, where the editing area includes: a property editing control;
the third display module is used for responding to the input operation of the attribute editing control and displaying attribute parameters corresponding to the input operation in the editing area;
And the input module is used for inputting the attribute parameters into template codes corresponding to the target contract functional components so as to obtain the functional codes of the target contract functional components.
In one embodiment, the apparatus further comprises:
a fourth display module for displaying a connection graph of the plurality of contract function components corresponding to a connection operation in response to the connection operation for the plurality of contract function components displayed in the workspace;
A fifth display module, configured to display a first connection error prompt message if a first contract function component that is not connected to another contract function component exists in the connection graphs of the plurality of contract function components; the first connection error prompt message is used for prompting a user that a contract function component which is not connected with other contract function components exists.
In one embodiment, the apparatus further comprises:
A sixth display module, configured to display a second connection error prompt message if there is a logic conflict in connection between some of the plurality of contract function components; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
In one embodiment, the apparatus further comprises:
the seventh display module is used for displaying parameter error prompt information if the attribute parameter corresponding to the input operation has errors; the parameter error prompt information is used for reminding a user that the input attribute parameter has errors.
In one embodiment, the generating module is specifically configured to, in response to a clicking operation for the intelligent contract generating control, splice function codes of the plurality of contract function components according to the logical relationship to generate an intelligent contract, and display generation progress prompt information of the intelligent contract;
The generating progress prompt message includes: an estimated remaining wait period for the smart contract is generated and/or a progress percentage value for the smart contract is generated.
In a third aspect, the application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the computer program is executed by the processor.
In a fourth aspect, the application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of any of the methods described above.
In a fifth aspect, the application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the methods described above.
The intelligent contract generation method, the device, the equipment, the storage medium and the program product are characterized in that a contract generation interface is displayed, the contract generation interface comprises a working area and a component library area, the component library area comprises a plurality of contract function components, the plurality of contract function components are moved into the working area to be displayed in response to dragging operation for the plurality of contract function components, the logic relation among the plurality of contract function components is acquired in response to connection operation for the plurality of contract function components displayed in the working area, and then the function codes of the plurality of contract function components are spliced according to the logic relation to generate the intelligent contract. According to the embodiment of the application, the logical relations between the contract functional components and the contract functional components are obtained through the contract generation interface, and then the intelligent contract is directly generated according to the logical relations between the contract functional components and the contract functional components, so that the intelligent contract can be automatically generated, the operation of intelligent contract development is simplified, the threshold of intelligent contract development is reduced, and the accuracy and efficiency of intelligent contract development are improved.
Drawings
FIG. 1 is an internal block diagram of a computer device according to an embodiment of the present application;
FIG. 2 is a flow chart of an intelligent contract generation method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a contract generation interface provided by an embodiment of the application;
Fig. 4 is a flowchart of a method for obtaining a function code according to an embodiment of the present application;
FIG. 5 is a flowchart of a first connection error indication message display method according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of an intelligent contract generation method based on an image interface according to an embodiment of the present application;
fig. 7 is a block diagram of an intelligent contract generating apparatus according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
With the rapid development of information technology, the blockchain technology is used as a decentralized, non-tamperable, safe and reliable distributed account book technology, and gradually changes our life style and economic pattern. In many applications of blockchain technology, smart contracts (Smart Contract) have received extensive attention and research as one of its core components.
At present, intelligent contracts need to be manually developed by developers with professional programming knowledge, so that the intelligent contracts have certain limitations in development and have high development thresholds.
The intelligent contract generation method provided by the embodiment of the application can be applied to an application environment shown in figure 1. Fig. 1 is an internal structure diagram of a computer device, which may be a server, according to an embodiment of the present application, and the internal structure diagram may be as shown in fig. 1. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a smart contract generation method.
It will be appreciated by those skilled in the art that the architecture shown in fig. 1 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements may be implemented, as a particular computer device may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
In one embodiment, as shown in fig. 2, fig. 2 is a flow chart of a smart contract generating method according to an embodiment of the present application, where the method may be applied to the computer device in fig. 1, and the method includes the following steps:
S201, displaying a contract generation interface.
The contract generation interface comprises a working area and a component library area, wherein the component library area comprises a plurality of contract function components.
Referring to fig. 3, fig. 3 is a schematic diagram of a contract generation interface according to an embodiment of the present application. As shown in FIG. 3, the contract generation interface may include a workspace, a component library area, an edit area, a top menu bar, and a bottom status bar. Wherein the work area is a main area for a user to operate, and the user can select a plurality of contract function components from the component library area and display the contract function components in the work area. The user may also connect the input connection point and the output connection point of each contract function component at the work site, respectively. The component library area is used to display a number of contract function components, which may be contract function components that are commonly used in intelligent contract development. The editing area is used for editing attribute parameters of the selected target contract function component. The top menu bar includes functionality controls for file management, view, generation, etc. The user can finish operations such as opening or storing files, switching views, generating intelligent contracts and the like through the functional controls. The bottom status bar may be used to display the status of the current smart contract, such as displaying error cues or generating progress cues.
In the embodiment of the application, the contract generation interface can be displayed by responding to clicking operation of the intelligent contract generation software icon.
Optionally, the contract function component may include at least one of a basic logic component, a data processing component, and a transaction related component. The basic logic component can be at least one of a condition judgment component and a circulation control component; the data processing component may be, for example, at least one of a data storage component, a data retrieval component; the transaction related component may be, for example, at least one of a resource transfer component, a contract invocation component.
S202, responding to drag operation for the contract function components, and moving the contract function components to the working area for display.
In the embodiment of the application, a user can select the contract function components required by intelligent contract generation in the component library area and drag the selected contract function components to the working area for display. In response to a drag operation for the contract feature, the user-selected contract feature is displayed within the workspace.
S203, in response to connection operation of the contract function components displayed in the working area, logic relations among the contract function components are acquired.
In one embodiment, the contract feature includes an input connection point and an output connection point. A user may connect a plurality of contract function components by connecting input connection points and output connection points of the contract function components with connection points of other contract function components. In response to a connection operation for a plurality of contract function components displayed within a workspace, a logical relationship between the plurality of contract function components is obtained.
Alternatively, the input connection point of the contract function component may be used to receive data or instructions output by a previous contract function component via the input connection point. Similarly, an output connection point of a contract function component may be used to output data or instructions to a next contract function component via the output connection point.
S204, splicing the function codes of the contract function components according to the logic relationship to generate the intelligent contract.
In one possible implementation, a contract feature corresponds to a set of template code. The user can set the attribute parameters of the selected contract function components through the edit section. In response to the property parameter editing operation, the property parameters input by the user may be converted into corresponding data structures, and the data structures written into template code to obtain the function code of the selected contract function component.
For example, the user may select the target programming language based on actual needs. In response to the programming language selection operation, the attribute parameters input by the user may be converted into a data structure of the target programming language, and the data structure may be written into a template code of the target programming language to obtain a function code of a contract function component of the target programming language.
In the embodiment of the application, the functional codes of a plurality of contract functional components can be spliced according to the connection relation between the connection points of the contract functional components, namely the logic relation between the contract functional components, so as to obtain the complete intelligent contract code.
Optionally, after the intelligent contract code is generated, the user can manually edit and adjust the intelligent contract code according to the requirement, so as to improve the flexibility of intelligent contract generation.
In the embodiment of the application, a contract generation interface is displayed, the contract generation interface comprises a working area and a component library area, the component library area comprises a plurality of contract functional components, the plurality of contract functional components are moved to the working area for display in response to the dragging operation of the plurality of contract functional components, the logic relation among the plurality of contract functional components is acquired in response to the connection operation of the plurality of contract functional components displayed in the working area, and then the functional codes of the plurality of contract functional components are spliced according to the logic relation to generate the intelligent contract. According to the embodiment of the application, the logical relations between the contract functional components and the contract functional components are obtained through the contract generation interface, and then the intelligent contract is directly generated according to the logical relations between the contract functional components and the contract functional components, so that the intelligent contract can be automatically generated, the operation of intelligent contract development is simplified, the threshold of intelligent contract development is reduced, and the accuracy and efficiency of intelligent contract development are improved.
Referring to fig. 4, fig. 4 is a flowchart of a method for obtaining a function code according to an embodiment of the present application. On the basis of the above embodiment, before the step S204, the method further includes the following steps:
s401, in response to the editing operation for the target contract function component, displaying an editing area of the target contract function component on the contract generation interface.
Wherein, the editing area comprises: a property editing control.
In one embodiment, the user may select a target contract component in the workspace, and edit the target contract component by double-clicking or single-clicking on the target contract function component. In response to a double-click or single-click operation for the target contract feature, an edit section of the target contract feature is displayed on the contract generation interface.
S402, responding to the input operation for the attribute editing control, and displaying attribute parameters corresponding to the input operation in the editing area.
Optionally, the property editing control may include an input control, and/or a selection control.
When the property editing control comprises an input control, a user can input property parameters corresponding to the target contract function control through the input control. And responding to the input operation for the input control, and displaying attribute parameters corresponding to the input operation in the editing area.
When the property editing control comprises a selection control, a user can select the property parameters corresponding to the target contract function control through an option list of the selection control. And responding to the selection operation for the selection control, and displaying attribute parameters corresponding to the input operation in the editing area.
Illustratively, the target contract function component may be a resource transfer component, and the attribute parameters include a resource transfer value and a recipient address. Or the target contract function component may be a loop control component, then the attribute parameters include a loop condition and a loop period.
S403, inputting the attribute parameters into template codes corresponding to the target contract function components to obtain the function codes of the target contract function components.
Alternatively, the attribute parameters may be converted into corresponding data structures and the data structures written into template code to obtain the function code of the target contract function component.
In the embodiment of the application, the editing area of the target contract functional component is displayed on the contract generation interface in response to the editing operation aiming at the target contract functional component, the attribute parameters corresponding to the input operation are displayed in the editing area in response to the input operation aiming at the attribute editing control, and the attribute parameters are input into the template codes corresponding to the target contract functional component so as to obtain the functional codes of the target contract functional component, thereby improving the flexibility of intelligent contract generation, enabling the intelligent contract to better adapt to different requirements, separating the template codes from the attribute parameters, facilitating the modification of the template codes and the attribute parameters, and simultaneously reducing the risk of errors in the intelligent contract generation process.
Referring to fig. 5, fig. 5 is a flowchart illustrating a first connection error notification message display method according to an embodiment of the present application. On the basis of the above embodiment, before the step S204, the method further includes the following steps:
s501, in response to a connection operation for a plurality of contract function components displayed in a work area, a connection graph of a plurality of contract function components corresponding to the connection operation is displayed.
In one embodiment, a user may connect a plurality of contract function components within a workspace through an input connection point and an output connection point. In response to a connection operation for connection points of a plurality of contract function components within a work area, a connection graph of the plurality of contract function components corresponding to the connection operation is displayed in the work area, that is, connection lines between connection points of the contract function components are displayed in the work area in addition to the plurality of contract function components.
S502, if a first contract function component which is not connected with other contract function components exists in the connection diagram of the contract function components, displaying first connection error prompt information.
The first connection error prompt message is used for prompting a user to have a contract function component which is not connected with other contract function components.
Optionally, the connection relation of the connection points of the contract function components in the working area can be monitored in real time, if a first contract function component which is not connected with the connection points of other contract function components exists in the input connection points and the output connection points in the contract function components, first connection error prompt information is generated, and the first connection error prompt information is displayed in a bottom status bar, so that the contract function components which are not connected with the other contract function components exist in the current connection diagram of the user through the first connection error prompt information.
In the embodiment of the application, in response to the connection operation of the plurality of contract function components displayed in the working area, the connection graphs of the plurality of contract function components corresponding to the connection operation are displayed, and if the first contract function component which is not connected with other contract function components exists in the connection graphs of the plurality of contract function components, the first connection error prompt information is displayed so as to indicate that the contract function component which is not connected with other contract function components exists in the current connection graphs of the user through the first connection error prompt information, thereby prompting the user to modify the connection relation among the plurality of contract function components, reducing the risk of error occurrence of the connection graphs of the plurality of contract function components and further improving the accuracy of intelligent contracts generated according to the connection graphs.
On the basis of the above embodiment, after the step S203, the method further includes the following steps:
And if the logic conflict exists among the connections among part of the contract function components, displaying a second connection error prompt message.
The second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
Illustratively, if a cyclic dependency is formed between two or more contract functional components, i.e., contract functional component A invokes contract functional component B, which in turn invokes contract functional component A, resulting in the cyclic dependency, then it is determined that a logical conflict exists for connections between some of the plurality of contract functional components.
Or if the output connection point of the contract function component A is connected with the input connection point of the contract function component B, but the data type of the output of the contract function component A is not matched with the data type of the input of the contract function component B, determining that logic conflict exists among the connections among part of the contract function components.
If the logic conflict exists among the connections among part of the contract function components in the contract function components, generating second connection error prompt information, and displaying the second connection error prompt information in a bottom status bar so as to indicate that the logic conflict exists among the connections among part of the contract function components in the current connection diagram of the user through the second connection error prompt information.
In the embodiment of the application, if logic conflict exists in the connection between partial contract function components in the plurality of contract function components, the second connection error prompt information is displayed, so that a user can be prompted to modify the connection relation between the plurality of contract function components, the risk of error occurrence of the connection diagram of the plurality of contract function components is reduced, and the accuracy of intelligent contracts generated according to the connection diagram is further improved.
On the basis of the above embodiment, after the step S402, the method further includes the following steps:
and if the attribute parameters corresponding to the input operation have errors, displaying parameter error prompt information.
The parameter error prompt information is used for reminding a user that the input attribute parameters have errors.
For example, if the attribute parameter corresponding to the input operation has been defined in other contract function components, that is, a repeatedly defined variable appears, it is determined that an error exists in the attribute parameter corresponding to the input operation.
Or assuming that the target contract function component is a condition judgment component, the attribute parameter corresponding to the input operation may be a judgment condition. If the multiple judging conditions of the condition judging component comprise mutually contradictory conditions, determining that the attribute parameters corresponding to the input operation have errors.
Or if the data type of the attribute parameter corresponding to the input operation is different from the data type of the attribute parameter required by the target contract function component, determining that the attribute parameter corresponding to the input operation has an error.
Optionally, if the attribute parameter corresponding to the input operation has an error, generating parameter error prompt information, and displaying the parameter error prompt information in a bottom status bar, so as to indicate that the attribute parameter input by the user has an error through the parameter error prompt information.
In the embodiment of the application, if the attribute parameters corresponding to the input operation have errors, the parameter error prompt information is displayed, so that a user can be prompted to timely modify the input attribute parameters according to the display parameter error prompt information, the risk of errors in the intelligent contract development process is reduced, and the intelligent contract development efficiency and the intelligent contract quality are improved.
On the basis of the above embodiment, the step S204 may be further implemented by the following steps:
And in response to clicking operation of the intelligent contract generation control, splicing the function codes of the contract function components according to the logic relationship to generate the intelligent contract, and displaying the generation progress prompt information of the intelligent contract.
Wherein, generating progress prompt message includes: an estimated remaining wait period of the smart contract is generated and/or a progress percentage value of the smart contract is generated.
An intelligent contract generation control may be included in a top menu bar of the contract generation interface, and functional codes of a plurality of contract functional components may be spliced according to a logical relationship in response to a click operation for the intelligent contract generation control to generate an intelligent contract. And in the process of generating the intelligent contract, the generation progress prompt information of the intelligent contract is displayed in real time in the bottom status bar.
In the embodiment of the application, the clicking operation of the control is generated aiming at the intelligent contract, the functional codes of the contract functional components are spliced according to the logic relationship to generate the intelligent contract, and the generation progress prompt information of the intelligent contract is displayed, so that the generation progress of the intelligent contract can be intuitively reflected, the credibility of an intelligent contract generation platform and the use experience of a user are improved, and when errors occur in the intelligent contract generation process, the generation progress prompt information of the intelligent contract can help the user to quickly locate the positions where the errors occur, thereby improving the speed of error checking.
Referring to fig. 6, fig. 6 is a flowchart of an intelligent contract generating method based on an image interface according to an embodiment of the present application. The method comprises the following steps:
S601, displaying a contract generation interface.
S602, responding to drag operation for the contract function components, and moving the contract function components to the working area for display.
S603, in response to connection operation of the contract function components displayed in the working area, logic relations among the contract function components are acquired.
S604, responding to the input operation for the attribute editing control, and displaying attribute parameters corresponding to the input operation in the editing area.
S605, inputting the attribute parameters into template codes corresponding to the target contract function components to obtain the function codes of the target contract function components.
S606, in response to clicking operation of the intelligent contract generation control, the function codes of the contract function components are spliced according to the logic relationship to generate the intelligent contract.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides an intelligent contract generation device for realizing the intelligent contract generation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of one or more smart contract generating devices provided below may refer to the limitation of the smart contract generating method described above, and will not be repeated here.
In one embodiment, as shown in fig. 7, fig. 7 is a block diagram of an intelligent contract generating apparatus according to an embodiment of the present application, where the apparatus 700 includes:
The first display module 701 is configured to display a contract generation interface, where the contract generation interface includes a working area, and a component library area, and the component library area includes a plurality of contract function components.
A movement module 702 for moving the plurality of contract function components to the in-workspace display in response to a drag operation for the plurality of contract function components.
An obtaining module 703, configured to obtain a logical relationship between the plurality of contract function components in response to a connection operation for the plurality of contract function components displayed in the workspace.
And the generating module 704 is configured to splice the function codes of the plurality of contract function components according to the logic relationship to generate the intelligent contract.
In one embodiment, the apparatus 700 further comprises:
And a second display module for displaying an edit section of the target contract function component on the contract generation interface in response to an edit operation for the target contract function component, the edit section including: a property editing control;
The third display module is used for responding to the input operation for the attribute editing control and displaying attribute parameters corresponding to the input operation in the editing area;
And the input module is used for inputting the attribute parameters into the template codes corresponding to the target contract functional components so as to obtain the functional codes of the target contract functional components.
In one embodiment, the apparatus 700 further comprises:
A fourth display module for displaying a connection graph of a plurality of contract function components corresponding to a connection operation in response to the connection operation for the plurality of contract function components displayed in the work area;
A fifth display module, configured to display a first connection error prompt message if a first contract function component that is not connected to another contract function component exists in the connection graphs of the plurality of contract function components; the first connection error prompt message is used for prompting the user that the contract function components which are not connected with other contract function components exist.
In one embodiment, the apparatus 700 further comprises:
A sixth display module, configured to display a second connection error prompt message if there is a logic conflict in connection between some of the contract function components; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
In one embodiment, the apparatus 700 further comprises:
the seventh display module is used for displaying parameter error prompt information if the attribute parameters corresponding to the input operation have errors; the parameter error prompt information is used for reminding the user that the input attribute parameters have errors.
In one embodiment, the generating module is specifically configured to, in response to a clicking operation for an intelligent contract generating control, splice function codes of a plurality of contract function components according to a logical relationship to generate an intelligent contract, and display generation progress prompt information of the intelligent contract;
Wherein, generating progress prompt message includes: an estimated remaining wait period of the smart contract is generated and/or a progress percentage value of the smart contract is generated.
The respective modules in the above-described smart contract generation apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
displaying a contract generation interface, wherein the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
Responsive to a drag operation for the plurality of contract function components, moving the plurality of contract function components to a display within the workspace;
Obtaining a logical relationship between a plurality of contract function components in response to a connection operation for the plurality of contract function components displayed within the workspace;
and splicing the function codes of the contract function components according to the logic relationship to generate the intelligent contract.
In one embodiment, the processor when executing the computer program further performs the steps of:
In response to an editing operation for the target contract feature, displaying an editing area of the target contract feature on the contract generation interface, the editing area including: a property editing control;
Responding to the input operation aiming at the attribute editing control, and displaying attribute parameters corresponding to the input operation in an editing area;
and inputting the attribute parameters into template codes corresponding to the target contract functional components to obtain the functional codes of the target contract functional components.
In one embodiment, the processor when executing the computer program further performs the steps of:
in response to a connection operation for a plurality of contract function components displayed within the workspace, displaying a connection graph for the plurality of contract function components corresponding to the connection operation;
If a first contract function component which is not connected with other contract function components exists in the connection diagram of the contract function components, displaying first connection error prompt information; the first connection error prompt message is used for prompting the user that the contract function components which are not connected with other contract function components exist.
In one embodiment, the processor when executing the computer program further performs the steps of:
if logic conflict exists in the connection between part of the contract function components, displaying second connection error prompt information; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
In one embodiment, the processor when executing the computer program further performs the steps of:
If the attribute parameters corresponding to the input operation have errors, displaying parameter error prompt information; the parameter error prompt information is used for reminding the user that the input attribute parameters have errors.
In one embodiment, the processor when executing the computer program further performs the steps of:
in response to clicking operation of the intelligent contract generation control, splicing functional codes of a plurality of contract functional components according to a logic relationship to generate an intelligent contract, and displaying generation progress prompt information of the intelligent contract;
Wherein, generating progress prompt message includes: an estimated remaining wait period of the smart contract is generated and/or a progress percentage value of the smart contract is generated.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
displaying a contract generation interface, wherein the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
Responsive to a drag operation for the plurality of contract function components, moving the plurality of contract function components to a display within the workspace;
Obtaining a logical relationship between a plurality of contract function components in response to a connection operation for the plurality of contract function components displayed within the workspace;
and splicing the function codes of the contract function components according to the logic relationship to generate the intelligent contract.
In one embodiment, the computer program when executed by the processor further performs the steps of:
In response to an editing operation for the target contract feature, displaying an editing area of the target contract feature on the contract generation interface, the editing area including: a property editing control;
Responding to the input operation aiming at the attribute editing control, and displaying attribute parameters corresponding to the input operation in an editing area;
and inputting the attribute parameters into template codes corresponding to the target contract functional components to obtain the functional codes of the target contract functional components.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in response to a connection operation for a plurality of contract function components displayed within the workspace, displaying a connection graph for the plurality of contract function components corresponding to the connection operation;
If a first contract function component which is not connected with other contract function components exists in the connection diagram of the contract function components, displaying first connection error prompt information; the first connection error prompt message is used for prompting the user that the contract function components which are not connected with other contract function components exist.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if logic conflict exists in the connection between part of the contract function components, displaying second connection error prompt information; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
In one embodiment, the computer program when executed by the processor further performs the steps of:
If the attribute parameters corresponding to the input operation have errors, displaying parameter error prompt information; the parameter error prompt information is used for reminding the user that the input attribute parameters have errors.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in response to clicking operation of the intelligent contract generation control, splicing functional codes of a plurality of contract functional components according to a logic relationship to generate an intelligent contract, and displaying generation progress prompt information of the intelligent contract;
Wherein, generating progress prompt message includes: an estimated remaining wait period of the smart contract is generated and/or a progress percentage value of the smart contract is generated.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
displaying a contract generation interface, wherein the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
Responsive to a drag operation for the plurality of contract function components, moving the plurality of contract function components to a display within the workspace;
Obtaining a logical relationship between a plurality of contract function components in response to a connection operation for the plurality of contract function components displayed within the workspace;
and splicing the function codes of the contract function components according to the logic relationship to generate the intelligent contract.
In one embodiment, the computer program when executed by the processor further performs the steps of:
In response to an editing operation for the target contract feature, displaying an editing area of the target contract feature on the contract generation interface, the editing area including: a property editing control;
Responding to the input operation aiming at the attribute editing control, and displaying attribute parameters corresponding to the input operation in an editing area;
and inputting the attribute parameters into template codes corresponding to the target contract functional components to obtain the functional codes of the target contract functional components.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in response to a connection operation for a plurality of contract function components displayed within the workspace, displaying a connection graph for the plurality of contract function components corresponding to the connection operation;
If a first contract function component which is not connected with other contract function components exists in the connection diagram of the contract function components, displaying first connection error prompt information; the first connection error prompt message is used for prompting the user that the contract function components which are not connected with other contract function components exist.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if logic conflict exists in the connection between part of the contract function components, displaying second connection error prompt information; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
In one embodiment, the computer program when executed by the processor further performs the steps of:
If the attribute parameters corresponding to the input operation have errors, displaying parameter error prompt information; the parameter error prompt information is used for reminding the user that the input attribute parameters have errors.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in response to clicking operation of the intelligent contract generation control, splicing functional codes of a plurality of contract functional components according to a logic relationship to generate an intelligent contract, and displaying generation progress prompt information of the intelligent contract;
Wherein, generating progress prompt message includes: an estimated remaining wait period of the smart contract is generated and/or a progress percentage value of the smart contract is generated.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.
Claims (10)
1. A method of intelligent contract generation, the method comprising:
Displaying a contract generation interface, wherein the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
responsive to a drag operation for a plurality of contract function components, moving the plurality of contract function components into the workspace for display;
obtaining a logical relationship between the plurality of contract function components in response to a connection operation for the plurality of contract function components displayed within the workspace;
and splicing the function codes of the contract function components according to the logic relation to generate intelligent contracts.
2. The method of claim 1, wherein before concatenating the function codes of the plurality of contract function components to generate a smart contract according to the logical relationship, the method further comprises:
In response to an editing operation for a target contract feature, displaying an editing area of the target contract feature on the contract generation interface, the editing area including: a property editing control;
responding to input operation for the attribute editing control, and displaying attribute parameters corresponding to the input operation in the editing area;
and inputting the attribute parameters into template codes corresponding to the target contract functional components to obtain the functional codes of the target contract functional components.
3. The method of claim 2, wherein before concatenating the function codes of the plurality of contract function components to generate a smart contract according to the logical relationship, the method further comprises:
In response to a connection operation for the plurality of contract function components displayed within the workspace, displaying a connection graph of the plurality of contract function components corresponding to the connection operation;
if a first contract function component which is not connected with other contract function components exists in the connection diagram of the contract function components, displaying first connection error prompt information; the first connection error prompt message is used for prompting a user to have a contract function component which is not connected with other contract function components.
4. The method of claim 2, wherein after the obtaining the logical relationship between the plurality of contract function components in response to the connection operation for the plurality of contract function components displayed within the workspace, the method further comprises:
If logic conflict exists in connection between partial contract function components in the contract function components, displaying second connection error prompt information; the second connection error prompt message is used for prompting the user that the connection between some contract function components has logic conflict.
5. The method of claim 2, wherein, in response to an input operation for the property editing control, after displaying a property parameter corresponding to the input operation in the editing area, the method further comprises:
If the attribute parameters corresponding to the input operation have errors, displaying parameter error prompt information; the parameter error prompt information is used for reminding a user that the input attribute parameters have errors.
6. The method of any of claims 1-5, further comprising an intelligent contract generation control in the contract generation interface, the splicing functional code of the plurality of contract functional components according to the logical relationship to generate an intelligent contract comprising:
responding to clicking operation of the intelligent contract generation control, splicing the function codes of the contract function components according to the logic relation to generate intelligent contracts, and displaying the generation progress prompt information of the intelligent contracts;
Wherein, the generating progress prompt message includes: generating an estimated remaining wait period of the smart contract and/or generating a progress percentage value of the smart contract.
7. An intelligent contract generation apparatus, the apparatus comprising:
The system comprises a first display module, a second display module and a second display module, wherein the first display module is used for displaying a contract generation interface, the contract generation interface comprises a working area and a component library area, and the component library area comprises a plurality of contract function components;
A moving module for moving the plurality of contract function components to the in-workspace display in response to a drag operation for the plurality of contract function components;
an obtaining module, configured to obtain a logical relationship between the plurality of contract function components in response to a connection operation for the plurality of contract function components displayed in the workspace;
And the generation module is used for splicing the function codes of the contract function components according to the logic relation so as to generate intelligent contracts.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410859638.4A CN118409747A (en) | 2024-06-28 | 2024-06-28 | Intelligent contract generation method, device, equipment, storage medium and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410859638.4A CN118409747A (en) | 2024-06-28 | 2024-06-28 | Intelligent contract generation method, device, equipment, storage medium and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118409747A true CN118409747A (en) | 2024-07-30 |
Family
ID=91996253
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410859638.4A Pending CN118409747A (en) | 2024-06-28 | 2024-06-28 | Intelligent contract generation method, device, equipment, storage medium and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118409747A (en) |
-
2024
- 2024-06-28 CN CN202410859638.4A patent/CN118409747A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112036736B (en) | Workflow creation method and device | |
JP5295464B1 (en) | System construction support tool and system | |
RU2488159C2 (en) | Ranging of visualisation types based on data set suitability for visualisation | |
EP2338116A2 (en) | Document-based workflows | |
JP2009501970A (en) | Building a finite state machine model | |
US20090178026A1 (en) | Self-describing re-usable software components | |
CN113094125B (en) | Business process processing method, device, server and storage medium | |
CN106600226B (en) | Method and device for optimizing process management system | |
KR20100081351A (en) | Logical structure design surface | |
KR20150110063A (en) | Apparatus and method of integrating mapreduce for big data processing | |
CN113918437B (en) | User behavior data analysis method, device, computer equipment and storage medium | |
CN117252559B (en) | Business process processing method, device, computer equipment and storage medium | |
CN114238085A (en) | Interface testing method and device, computer equipment and storage medium | |
US7567257B2 (en) | Partition-based undo of partitioned object graph | |
JP2023531931A (en) | Semiconductor device modeling method and apparatus | |
CN118409747A (en) | Intelligent contract generation method, device, equipment, storage medium and program product | |
CN112446625A (en) | Process line generation system, method, platform and storage medium | |
CN116167882A (en) | Conditional expression dynamic configuration method, accounting condition calculation method and accounting condition calculation device | |
CN113407163B (en) | Module association assignment method, device, computer equipment and readable storage medium | |
CN113821219B (en) | Method and system for realizing application program containerization | |
CN115269390A (en) | Automatic testing method and device for graphical interface and storage medium | |
CN117610505B (en) | Data processing method and device based on standard model | |
KR20210121574A (en) | Data set management device and method for displaying relationship between machine learning model and data set using the same | |
JP7287486B2 (en) | Attachment and restoration of sticky notes to visualized data | |
CN118152137A (en) | Resource allocation method, device, computer equipment, storage medium and product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |