Blockchain data processing method and apparatus, storage medium, and electronic device
By acquiring the user-configured on-chain processing information, generating and deploying smart contracts, the complexity and high development difficulty of blockchain technology are solved, and automated data on-chain processing is achieved, reducing development difficulty.
Patent Information
- Application Number
- CN202111501527.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2041-12-09
AI Technical Summary
Blockchain technology is complex and difficult to develop, especially in smart contract development, where there are significant differences, increasing the learning difficulty and cost for developers.
A blockchain data processing method is provided, which generates a target object processing program and a calling interface by obtaining the user-configured on-chain processing configuration information, combines them into a smart contract and deploys it on the blockchain network, automatically executes on-chain processing operations, and reduces the user's dependence on the underlying blockchain technology.
It simplifies the blockchain development process, reduces the development difficulty for users, and enables automated processing of data on-chain.
Smart Images

Figure CN114201503B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of blockchain technology, and more specifically, to a blockchain data processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] Blockchain is a technology that enables the collective maintenance of a reliable database in a decentralized and trustless manner. With the development of blockchain technology, its business applications have become increasingly widespread.
[0003] However, the principles of blockchain technology are quite complex, posing a significant challenge for beginners. For example, the development model and programming language of blockchain smart contracts differ considerably from traditional business system development, which greatly increases the learning difficulty and development costs for developers. Summary of the Invention
[0004] The purpose of this disclosure is to provide a blockchain data processing method, apparatus, storage medium, and electronic device to solve the aforementioned related technical problems.
[0005] To achieve the above objectives, according to a first aspect of the present disclosure, a blockchain data processing method is provided, comprising:
[0006] Obtain the on-chain processing configuration information configured by the user for the target object. The on-chain processing configuration information includes the attribute information of the target object, the execution rule information of the target object, and the on-chain rule information of the target object.
[0007] Generate the target object processing program and calling interface based on the on-chain processing configuration information;
[0008] The target object processing program and the calling interface are combined to generate the target smart contract;
[0009] The target smart contract is deployed on a blockchain network, and the target smart contract is used to perform on-chain processing operations for the target object.
[0010] Optionally, the execution rule information includes legal verification rule information, computation rule information, and security rule information, and the step of generating the target object processing program and calling interface according to the on-chain processing configuration information includes:
[0011] Generate a valid verification program fragment based on the valid verification rule information;
[0012] Generate a computation program fragment based on the aforementioned computation rule information;
[0013] Generate a secure computing program fragment based on the security rule information;
[0014] The legitimate verification program fragment, the computation program fragment, and the secure computation program fragment are combined to obtain the target object processing program.
[0015] Optionally, the method further includes:
[0016] For each generated program fragment, the combination order identifier of the program fragment is determined according to a preset combination rule;
[0017] The step of combining the legal verification program fragment, the computation program fragment, and the secure computation program fragment to obtain the target object processing program includes:
[0018] The legitimate verification program segment, the computation program segment, and the secure computation program segment are combined according to the combination order identifier to obtain the target object processing program.
[0019] Optionally, the combination order of the computation program segment, the legal verification program segment, and the secure computation program segment is as follows: legal verification program segment, computation program segment, and secure computation program segment.
[0020] Optionally, the validity verification procedure fragment includes a field attribute verification procedure fragment and / or a field validity verification procedure fragment;
[0021] The computation program fragment includes a target program fragment written by the user when configuring the on-chain processing configuration information, which is used to perform a preset operation; the computation rule information includes the target program fragment.
[0022] The secure computation program fragment includes: an encryption computation program fragment and / or a decryption computation program fragment.
[0023] Optionally, the step of generating the target object handler and the calling interface based on the on-chain processing configuration information includes:
[0024] Obtain the target object name and the corresponding blockchain network information based on the target object's attribute information;
[0025] Obtain the target on-chain operation type corresponding to the target object based on the on-chain rule information of the target object;
[0026] Based on the target object name and the target on-chain operation type, generate the operation function name;
[0027] The calling interface is obtained by combining the blockchain network information corresponding to the target object and the name of the operation function.
[0028] According to a second aspect of the present disclosure, a blockchain data processing apparatus is provided, comprising:
[0029] The first acquisition module is used to acquire the on-chain processing configuration information configured by the user for the target object. The on-chain processing configuration information includes the attribute information of the target object, the execution rule information of the target object, and the on-chain rule information of the target object.
[0030] The first generation module is used to generate a target object processing program and a calling interface based on the on-chain processing configuration information.
[0031] The second generation module is used to combine the target object processing program and the calling interface to generate the target smart contract.
[0032] The contract deployment module is used to deploy the target smart contract on the blockchain network, and the target smart contract is used to perform the on-chain processing operation of the target object.
[0033] Optionally, the execution rule information includes legal verification rule information, computation rule information, and security rule information, and the first generation module includes:
[0034] The first generation submodule is used to generate a legal verification program fragment based on the legal verification rule information;
[0035] The second generation submodule is used to generate a computation program fragment based on the computation rule information;
[0036] The third generation submodule is used to generate a secure computing program fragment based on the security rule information;
[0037] The combination submodule is used to combine the legal verification program fragment, the calculation program fragment, and the secure calculation program fragment to obtain the target object processing program.
[0038] Optionally, the device further includes:
[0039] The identifier determination module is used to determine the combination order identifier of each generated program fragment according to a preset combination rule.
[0040] The combined submodule includes:
[0041] The combination subunit is used to combine the legal verification program segment, the operation program segment, and the secure calculation program segment according to the combination order identifier to obtain the target object processing program.
[0042] Optionally, the combination order of the computation program segment, the legal verification program segment, and the secure computation program segment is as follows: legal verification program segment, computation program segment, and secure computation program segment.
[0043] Optionally, the validity verification procedure fragment includes a field attribute verification procedure fragment and / or a field validity verification procedure fragment;
[0044] The computation program fragment includes a target program fragment written by the user when configuring the on-chain processing configuration information, which is used to perform a preset operation; the computation rule information includes the target program fragment.
[0045] The secure computation program fragment includes: an encryption computation program fragment and / or a decryption computation program fragment.
[0046] Optionally, the first generation module includes:
[0047] The first acquisition submodule is used to acquire the name of the target object and the blockchain network information corresponding to the target object based on the attribute information of the target object;
[0048] The second acquisition submodule acquires the target on-chain operation type corresponding to the target object based on the on-chain rule information of the target object;
[0049] The fourth generation submodule is used to generate an operation function name based on the target object name and the target on-chain operation type;
[0050] The interface combination submodule is used to combine the blockchain network information corresponding to the target object and the operation function name to obtain the calling interface.
[0051] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0052] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:
[0053] A memory on which computer programs are stored;
[0054] A processor for executing the computer program in the memory to implement the steps of the method described in any of the first aspects above.
[0055] Taking the application of the method to a server as an example, in the above technical solution, the user can configure on-chain processing configuration information for the target object to be added to the blockchain, such as the target object's attribute information, execution rule information, and on-chain rule information. The server can then obtain the on-chain processing configuration information and generate a target object processing program and a calling interface based on it. Next, the server can combine the target object processing program and the calling interface to generate a target smart contract and deploy it in the blockchain network. The target smart contract is used to execute the on-chain processing operation of the target object. In other words, the above technical solution can automatically generate and deploy a smart contract for executing on-chain processing operations based on the user-configured on-chain processing configuration information, meaning the user does not need to concern themselves with the underlying blockchain technology logic during this process. Therefore, the above technical solution can assist users in achieving data on-chain, helping to reduce the difficulty of blockchain development for users.
[0056] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0057] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:
[0058] Figure 1 This is a flowchart illustrating an exemplary embodiment of a blockchain data processing method.
[0059] Figure 2 This is a flowchart illustrating a combination of program fragments as shown in an exemplary embodiment of this disclosure.
[0060] Figure 3 This is a flowchart illustrating a smart contract generation process as shown in an exemplary implementation example of this disclosure.
[0061] Figure 4 This is a flowchart illustrating the generation process of an interface call, as shown in an exemplary embodiment of this disclosure.
[0062] Figure 5 This is a block diagram of a blockchain data processing apparatus shown in an exemplary embodiment of this disclosure.
[0063] Figure 6 This is a block diagram of an electronic device shown in an exemplary embodiment of this disclosure. Detailed Implementation
[0064] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0065] Figure 1 This is a flowchart of a blockchain data processing method shown in this disclosure, with reference to... Figure 1 The method includes:
[0066] In step 11, the on-chain processing configuration information configured by the user for the target object is obtained.
[0067] Taking the application of the described method to a server as an example, in some implementation scenarios, the server may provide a configuration page. The configuration page may include multiple items to be configured, such as attribute information configuration items, execution rule configuration items, on-chain rule configuration items, etc.
[0068] Users can configure each configuration item based on the target object's metadata to obtain the target object's on-chain processing configuration information. The on-chain processing configuration information may include the target object's attribute information, the target object's execution rule information, and the target object's on-chain rule information.
[0069] The attribute information of the target object may include the definition of the target object's attributes, such as the target object's name, attribute name (e.g., .txt, .mp3, etc.), field type (e.g., string, int, etc.), description, etc. In some implementation scenarios, the attribute information of the target object may also include, for example, the name of the blockchain network to which the target object belongs, the access address of the blockchain network, the channel to which the target object belongs, etc.
[0070] The execution rule information for the target object may include the logical processing rules for the target object. For example, in some implementation scenarios, the execution rule information includes legality verification rule information, operation rule information, and security rule information. The legality verification rule information may include verification rules for the target object's field attributes, such as validating the field attribute type (e.g., String, int), and verifying whether a field is allowed to be empty. The operation rule information may include the logical operation rules that the target object needs to perform, such as determining whether the temperature is within the 0-100℃ range, and performing operations on fields (e.g., addition, subtraction, multiplication, division). The security rule information may include the security operations that the target object needs to perform, such as encryption and decryption.
[0071] The on-chain rules information of the target object may include the definition of the on-chain behavior of the target object, such as data on-chain operations such as adding, deleting, modifying, and querying data.
[0072] In addition, in some implementation scenarios, the on-chain processing configuration information can also be presented in the form of XML (Extensible Markup Language), JSON (JavaScript Object Notation) arrays, etc.
[0073] Taking XML as an example, in some implementations, it can be achieved through... <entity / > Define the target object name, through <property / > Define the target object property name, through <field / > Define the attribute values of the target object.
[0074] In addition, it can also be done through <logic / > Define the valid validation rules for the target object, through <security / > Define security rules for the target object, through <algorithm / > Define the logical operation rules that the target object needs to perform. This can also be done through... <behavior / > Describe the on-chain rules of the target object, and through <action / > Describe the on-chain rule type of the target object, such as <insert / > , <delete / > , <update / > , <select>< / select> "etc." refers to operations such as adding, deleting, modifying, and querying.
[0075] As an example, the XML file for generating on-chain processing configuration information in some implementation scenarios is shown below:
[0076]
[0077] The above on-chain processing configuration information describes the target object `user`, whose `passwd` field is of type string and cannot be empty. Furthermore, the `passwd` field needs to be encrypted before being uploaded to the blockchain, with the interface for this encryption being `insertUser`.
[0078] In step 12, a target object processing program and a calling interface are generated based on the on-chain processing configuration information.
[0079] For example, when the execution rule information includes legal verification rule information, computation rule information, and security rule information, the step of generating the target object processing program and calling interface based on the on-chain processing configuration information includes:
[0080] Generate a valid verification program fragment based on the valid verification rule information; generate a computation program fragment based on the computation rule information; generate a secure computation program fragment based on the security rule information.
[0081] Thus, after obtaining the valid verification program fragment, the computation program fragment, and the secure computation program fragment, they can be combined to obtain the target object processing program. As an example, in some implementations, the program fragments can be combined sequentially according to the generation order of the valid verification program fragment, the computation program fragment, and the secure computation program fragment to obtain the target object processing program.
[0082] It is worth noting that in some implementation scenarios, the target object processing program obtained by combining the legal verification program fragment, the computation program fragment, and the secure computation program fragment may also have problems. For example, the applicant found that if the target object processing program is obtained by combining the computation program fragment, the secure computation program fragment, and the legal verification program fragment in that order, the target object processing program may first perform computation on the target object, encrypt the computation result, and then perform legal verification. It should be noted that if the legal verification fails, the on-chain process of the target object will be terminated. Therefore, in this case, the completed computation and encryption process is an invalid computation process, resulting in a waste of resources. In addition, in some implementation scenarios, the computation program fragment may also involve the state transformation of the target object. For example, the input of the computation program fragment can be the target object, and the output of the computation program fragment can be the blockchain storage object. In this case, since the target object has undergone state transformation, the legal verification program fragment may have no input (no target object), that is, in this case, the legal verification process for the target object cannot be performed.
[0083] To this end, the applicant extracted the execution process of the smart contract and set the combination order of the legal verification program fragment, the computation program fragment, and the secure computation program fragment. For example, in one possible implementation, the method further includes:
[0084] For each generated program fragment, the combination order identifier of the program fragment is determined according to the preset combination rules.
[0085] Figure 2 This disclosure presents a flowchart of a combination of program fragments. In specific implementation, the server can parse the on-chain processing configuration information to obtain execution rule information. For the legal verification rule information, computation rule information, and security rule information included in the execution rule information, the server can perform ORM (Object Relational Mapping) respectively to obtain the legal verification program fragment, computation program fragment, and secure computation program fragment.
[0086] Next, combination sequence identifiers can be generated for the legal verification program fragment, the computation program fragment, and the secure computation program fragment, respectively.
[0087] For example, in some implementation scenarios, the combination order of the computation program segment, the legal verification program segment, and the secure computation program segment is as follows: legal verification program segment, computation program segment, and secure computation program segment.
[0088] Specifically, the legal validation program fragment can be generated using dynamic proxies based on legal validation rule information. In some embodiments, the legal validation program fragment may include a field attribute validation program fragment to implement field attribute legal validation functionality. In some embodiments, the legal validation program fragment may include a field validity validation program fragment to implement field validity validation (e.g., whether it is empty). Of course, in some embodiments, the legal validation program fragment may also simultaneously include a field attribute validation program fragment, a field validity validation program fragment, and other program fragments generated based on legal validation rule information; this disclosure does not impose any limitations on this. Continuing with the example of the above combination order, after generating the legal validation program fragment, the combination order of the legal validation program fragments can also be determined to be 1.
[0089] It is worth noting that in some implementation scenarios, multiple valid verification procedure fragments may exist. In this case, a combined identifier can be generated for the multiple valid verification procedure fragments. For example, in some implementations, valid verification procedure fragments A and B of the same type may exist. In this case, a combined order identifier for valid verification procedure fragments A and B can be generated based on the generation time of the valid verification procedure fragments. For example, if valid verification procedure fragment A was generated before valid verification procedure fragment B, the combined order of valid verification procedure fragment A can be set to 1.1, and the combined order of valid verification procedure fragment B can be set to 1.2.
[0090] Furthermore, in some implementations, different types of validator segments may exist. In this case, the combination order of the validator segments can be set according to the priority of the content to be verified (e.g., it can be preset, or determined according to the importance of the content to be verified). For example, there may be a validator segment C for verifying the object name "name" and a validator segment D for verifying the object number "ID". Since there may be multiple object numbers "ID" under an object name (e.g., representing an organization), and the same object number "ID" may exist under different object names (e.g., member 1 of organization 1, member 1 of organization 2), in this case, the combination order of the validator segment C for verifying the object name can be set to 1.1, and the combination order of the validator segment D for verifying the object number "ID" can be set to 1.2.
[0091] Reference Figure 2 Regarding the aforementioned computational program fragment, this fragment can be obtained based on computational rule information mapping, and is used to provide algorithmic logic operation functions, such as determining whether the temperature is within the 0-100 range, performing a +1 operation on a field, etc. Here, the computational program fragment can include some atomic computational program fragments, such as +, -, >, <, ==, etc., which can be generated by parsing the computational logic symbols in the computational rule information. It is worth noting that when configuring the on-chain processing configuration information, the user can also write a target program fragment for performing preset operations (e.g., custom algorithm operations), meaning the computational rule information includes the target program fragment. In this case, the computational program fragment can also include the target program fragment. Following the example of the above combination order, after generating the computational program fragment, the combination order of the computational program fragment can be determined to be 2.
[0092] The secure computation program fragment can be obtained based on security rule information mapping and is used to provide security protection functions. In some embodiments, the secure computation program fragment includes: an encryption computation program fragment and / or a decryption computation program fragment. The encryption computation program fragment is used to implement functions such as encrypting fields and digitally signing fields. The decryption computation program fragment is used to implement field decryption functions. In specific implementations, the secure computation program fragment can be generated by parsing the security processing logic in the security rule information. For example, if the security processing logic includes an encryption method (such as symmetric encryption, asymmetric encryption, etc.), the corresponding encryption algorithm can be called to generate the encryption computation program fragment. Following the example of the above combination order, after generating the secure computation program fragment, the combination order of the secure computation program fragment can be determined to be 3.
[0093] Thus, given the determined combination order identifiers of each program segment, the step of combining the legal verification program segment, the computation program segment, and the secure computation program segment to obtain the target object processing program includes:
[0094] The legitimate verification program segment, the computation program segment, and the secure computation program segment are combined according to the combination order identifier to obtain the target object processing program.
[0095] Using the above example, the program segments can be combined according to the size of the combination order identifier (such as 1.1, 1.2, 1.3, ..., 2.1, 2.2, ..., 3.1, 3.2, ...) to obtain the target object processing program.
[0096] The above technical solution prioritizes assembling the legal verification program fragment, followed by the computation program fragment, and finally the secure computation program fragment. This allows the target object processing program to first verify the legitimacy of the on-chain data through the legal verification program. Since the legal verification program does not change the object state (i.e., the output of the legal verification program remains the original object), it is compatible with subsequent program processing after legal verification. For example, after the legal verification program fragment, a new object state can be calculated using the computation program, and then the data of the new object can be encrypted / decrypted using the secure computation program. In other words, the above combination order ensures effective data flow between the various program fragments, thereby enabling the smart contract's functions to execute effectively.
[0097] In addition, refer to Figure 3 The diagram illustrates a smart contract generation process. In some implementation scenarios, it may be necessary to map and transform the target object to obtain a blockchain object. For example, the blockchain ledger can store data as a JSON array, with a data structure consisting of two parts: a header and a body. The header records information such as the object name and on-chain time. The body stores the object's attribute information. Therefore, when mapping the target object, the on-chain processing configuration information can be parsed to obtain the target object's attribute information, such as entity class name, field name, and field type. Then, a JSON algorithm can be used to convert the target object's attribute information into a JSON array and load it into the body structure. Furthermore, object metadata such as the object name can be loaded into the header structure, thus completing the mapping from the target object to the blockchain ledger object.
[0098] Still refer to Figure 1 In step 12, a call interface can also be generated based on the on-chain processing configuration information. Figure 4This disclosure presents a flowchart of a call interface generation process, wherein the call interface generation steps include:
[0099] S41, obtain the target object name and the blockchain network information corresponding to the target object based on the target object's attribute information. Here, the blockchain network information may include, for example, the blockchain network domain name, channel name, smart contract name (e.g., user-preset), etc.
[0100] S42, obtain the target on-chain operation type corresponding to the target object based on the on-chain rule information of the target object. The on-chain operation type may include insert / update / select / delete, etc., and the target on-chain operation type can be any of these on-chain operation types.
[0101] S43. Based on the target object name and the target on-chain operation type, generate an operation function name. As an example, the naming rule for the operation function name can follow the blockchain storage naming rule, that is, it can be represented as "operation type + object name".
[0102] S44, combine the blockchain network information corresponding to the target object and the operation function name to obtain the calling interface.
[0103] Continuing with the above example, the calling interface can be represented as "blockchain network domain name / channel name / contract name / operation function name". The symbol " / " is used to distinguish the different parts of the calling interface. For example, when inputting the calling interface, the blockchain storage service can parse the " / " symbol to obtain the input blockchain network domain name, channel name, contract name, and operation function name. In this way, the blockchain storage service can access the corresponding blockchain network through the blockchain network domain name, route the request to the corresponding smart contract service through the channel name and contract name, and access the corresponding service interface provided by the smart contract through the operation function name.
[0104] Still refer to Figure 1 After obtaining the target object handler and the calling interface, in step 13, the target object handler and the calling interface are combined to generate the target smart contract.
[0105] In step 14, the target smart contract is deployed on the blockchain network, and the target smart contract is used to perform the on-chain processing operation of the target object.
[0106] Here, the server can, for example, determine the blockchain network corresponding to the target object based on the on-chain processing configuration information, and deploy the target smart contract in the blockchain network by interacting with it. Thus, when a user invokes the target smart contract in the blockchain network, the target smart contract can execute the on-chain processing operation of the target object.
[0107] In the above technical solution, users can configure on-chain processing configuration information for the target object to be added to the blockchain, such as the target object's attribute information, execution rule information, and on-chain rule information. The server can then obtain this on-chain processing configuration information and generate a target object processing program and a calling interface based on it. Next, the server can combine the target object processing program and the calling interface to generate a target smart contract and deploy it in the blockchain network. This target smart contract is used to execute the on-chain processing operation of the target object. In other words, the above technical solution can automatically generate and deploy smart contracts for executing on-chain processing operations based on the user-configured on-chain processing configuration information, meaning users do not need to concern themselves with the underlying blockchain technology logic during this process. Therefore, the above technical solution can assist users in achieving data on-chain, helping to reduce the difficulty of blockchain development for users.
[0108] Based on the same inventive concept, this disclosure also provides a blockchain data processing device. Figure 5 This is a block diagram of a blockchain data processing device shown in this disclosure, with reference to... Figure 5 The device 500 includes:
[0109] The first acquisition module 501 is used to acquire the on-chain processing configuration information configured by the user for the target object. The on-chain processing configuration information includes the attribute information of the target object, the execution rule information of the target object, and the on-chain rule information of the target object.
[0110] The first generation module 502 is used to generate a target object processing program and a calling interface based on the on-chain processing configuration information.
[0111] The second generation module 503 is used to combine the target object processing program and the calling interface to generate a target smart contract.
[0112] The contract deployment module 504 is used to deploy the target smart contract on the blockchain network, and the target smart contract is used to perform the on-chain processing operation of the target object.
[0113] Taking the application of the method to a server as an example, in the above technical solution, the user can configure on-chain processing configuration information for the target object to be added to the blockchain, such as the target object's attribute information, execution rule information, and on-chain rule information. The server can then obtain the on-chain processing configuration information and generate a target object processing program and a calling interface based on it. Next, the server can combine the target object processing program and the calling interface to generate a target smart contract and deploy it in the blockchain network. The target smart contract is used to execute the on-chain processing operation of the target object. In other words, the above technical solution can automatically generate and deploy a smart contract for executing on-chain processing operations based on the user-configured on-chain processing configuration information, meaning the user does not need to concern themselves with the underlying blockchain technology logic during this process. Therefore, the above technical solution can assist users in achieving data on-chain, helping to reduce the difficulty of blockchain development for users.
[0114] Optionally, the execution rule information includes legal verification rule information, computation rule information, and security rule information, and the first generation module includes:
[0115] The first generation submodule is used to generate a legal verification program fragment based on the legal verification rule information;
[0116] The second generation submodule is used to generate a computation program fragment based on the computation rule information;
[0117] The third generation submodule is used to generate a secure computing program fragment based on the security rule information;
[0118] The combination submodule is used to combine the legal verification program fragment, the calculation program fragment, and the secure calculation program fragment to obtain the target object processing program.
[0119] Optionally, the device further includes:
[0120] The identifier determination module is used to determine the combination order identifier of each generated program fragment according to a preset combination rule.
[0121] The combined submodule includes:
[0122] The combination subunit is used to combine the legal verification program segment, the operation program segment, and the secure calculation program segment according to the combination order identifier to obtain the target object processing program.
[0123] Optionally, the combination order of the computation program segment, the legal verification program segment, and the secure computation program segment is as follows: legal verification program segment, computation program segment, and secure computation program segment.
[0124] Optionally, the validity verification procedure fragment includes a field attribute verification procedure fragment and / or a field validity verification procedure fragment;
[0125] The computation program fragment includes a target program fragment written by the user when configuring the on-chain processing configuration information, which is used to perform a preset operation; the computation rule information includes the target program fragment.
[0126] The secure computation program fragment includes: an encryption computation program fragment and / or a decryption computation program fragment.
[0127] Optionally, the first generation module includes:
[0128] The first acquisition submodule is used to acquire the name of the target object and the blockchain network information corresponding to the target object based on the attribute information of the target object;
[0129] The second acquisition submodule acquires the target on-chain operation type corresponding to the target object based on the on-chain rule information of the target object;
[0130] The fourth generation submodule is used to generate an operation function name based on the target object name and the target on-chain operation type;
[0131] The interface combination submodule is used to combine the blockchain network information corresponding to the target object and the operation function name to obtain the calling interface.
[0132] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0133] This disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the blockchain data processing method provided in this disclosure.
[0134] This disclosure also provides an electronic device, including:
[0135] A memory on which computer programs are stored;
[0136] A processor is configured to execute the computer program in the memory to implement the steps of the blockchain data processing method provided in this disclosure.
[0137] Figure 6 This is a block diagram illustrating an electronic device 600 according to an exemplary embodiment. For example... Figure 6As shown, the electronic device 600 may include a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input / output (I / O) interface 604, and a communication component 605.
[0138] The processor 601 controls the overall operation of the electronic device 600 to complete all or part of the steps in the blockchain data processing method described above. The memory 602 stores various types of data to support the operation of the electronic device 600. This data may include, for example, instructions for any application or method operating on the electronic device 600, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 602 or transmitted via communication component 605. The audio component also includes at least one speaker for outputting audio signals. I / O interface 604 provides an interface between processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 605 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0139] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the blockchain data processing method described above.
[0140] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the blockchain data processing method described above. For example, the computer-readable storage medium may be the memory 602 including the program instructions described above, which may be executed by the processor 601 of the electronic device 600 to complete the blockchain data processing method described above.
[0141] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a programmable device, the computer program having a code portion for performing the blockchain data processing method described above when executed by the programmable device.
[0142] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0143] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0144] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A blockchain data processing method, characterized in that, include: Obtain the on-chain processing configuration information configured by the user for the target object. The on-chain processing configuration information includes the target object's attribute information, the target object's execution rule information, and the target object's on-chain rule information. The execution rule information includes legal verification rule information, computation rule information, and security rule information. Generate the target object processing program and calling interface based on the on-chain processing configuration information; The target object processing program and the calling interface are combined to generate the target smart contract; The target smart contract is deployed on a blockchain network, and the target smart contract is used to perform on-chain processing operations for the target object.
2. The method according to claim 1, characterized in that, The step of generating the target object processing program and calling interface based on the on-chain processing configuration information includes: Generate a valid verification program fragment based on the valid verification rule information; Generate a computation program fragment based on the aforementioned computation rule information; Generate a secure computing program fragment based on the security rule information; The legitimate verification program fragment, the computation program fragment, and the secure computation program fragment are combined to obtain the target object processing program.
3. The method according to claim 2, characterized in that, The method further includes: For each generated program fragment, the combination order identifier of the program fragment is determined according to a preset combination rule; The step of combining the legal verification program fragment, the computation program fragment, and the secure computation program fragment to obtain the target object processing program includes: The legitimate verification program segment, the computation program segment, and the secure computation program segment are combined according to the combination order identifier to obtain the target object processing program.
4. The method according to claim 3, characterized in that, The order of the combination of the computation program segment, the legal verification program segment, and the secure computation program segment is as follows: legal verification program segment, computation program segment, and secure computation program segment.
5. The method according to any one of claims 2 to 4, characterized in that, The valid verification procedure fragment includes a field attribute verification procedure fragment and / or a field validity verification procedure fragment; The computation program fragment includes a target program fragment written by the user when configuring the on-chain processing configuration information, which is used to perform a preset operation; the computation rule information includes the target program fragment. The secure computation program fragment includes: an encryption computation program fragment and / or a decryption computation program fragment.
6. The method according to claim 1, characterized in that, The step of generating the target object processing program and calling interface based on the on-chain processing configuration information includes: Obtain the target object name and the corresponding blockchain network information based on the target object's attribute information; Obtain the target on-chain operation type corresponding to the target object based on the on-chain rule information of the target object; Based on the target object name and the target on-chain operation type, generate the operation function name; The calling interface is obtained by combining the blockchain network information corresponding to the target object and the name of the operation function.
7. A blockchain data processing device, characterized in that, include: The first acquisition module is used to acquire the on-chain processing configuration information configured by the user for the target object. The on-chain processing configuration information includes the target object's attribute information, the target object's execution rule information, and the target object's on-chain rule information. The execution rule information includes legal verification rule information, computation rule information, and security rule information. The first generation module is used to generate a target object processing program and a calling interface based on the on-chain processing configuration information. The second generation module is used to combine the target object processing program and the calling interface to generate the target smart contract. The contract deployment module is used to deploy the target smart contract on the blockchain network, and the target smart contract is used to perform the on-chain processing operation of the target object.
8. The apparatus according to claim 7, characterized in that, The execution rule information includes legal verification rule information, computation rule information, and security rule information. The first generation module includes: The first generation submodule is used to generate a legal verification program fragment based on the legal verification rule information; The second generation submodule is used to generate a computation program fragment based on the computation rule information; The third generation submodule is used to generate a secure computing program fragment based on the security rule information; The combination submodule is used to combine the legal verification program fragment, the calculation program fragment, and the secure calculation program fragment to obtain the target object processing program.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-6.
10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Block chain chaining method and device, electronic equipment and storage medium
CN110880146A
Calculation processing method and device based on block chain, equipment and medium
CN111143890A