Method, system, device and storage medium for filling in files based on block chain

文档序号:8261 发布日期:2021-09-17 浏览:25次 中文

1. A method for filling in a file based on a blockchain, the method comprising:

generating a template file through an intelligent contract deployed on a block chain according to a preset data element and a preset visual style;

storing the template file in a node account book of the block chain through storage logic in the intelligent contract;

acquiring key value pair data, and verifying the key value pair data and a preset data element of the template file through a verification logic in the intelligent contract;

writing the key value pair data into a form value corresponding to the template file through the intelligent contract according to a preset data element of the template file, and generating a format file;

encrypting the layout file through encryption logic in the intelligent contract to generate a layout encryption file of the layout file;

and storing the format encryption file in a node account book of the block chain through storage logic in the intelligent contract.

2. The method of claim 1, wherein obtaining key-value pair data, and wherein verifying the key-value pair data against a predetermined data element of the template file by a verification logic in the smart contract comprises:

acquiring key value pair data, calling an intelligent contract deployed on the block chain according to constraint conditions of the preset data elements set in a key name retrieval template file to perform preset verification on the key value pair data, and performing preset setting on the key value pair data based on the constraint conditions, wherein the preset verification comprises verifying data content and verifying data length, and the preset setting comprises setting data arrangement, setting data fonts and setting data word sizes.

3. The method of claim 1, wherein encrypting the layout file via encryption logic in the smart contract, generating a layout encrypted file for the layout file comprises:

and carrying out Base64 encoding on the format file through an encryption logic in the intelligent contract, and carrying out symmetric or asymmetric encryption on the format file subjected to the Base64 encoding to generate a format encrypted file.

4. The method of claim 1, wherein storing, by storage logic in the smart contract, the layout encryption file in a node ledger of the blockchain comprises:

and performing data segmentation on the format encrypted file through storage logic in the intelligent contract to generate a corresponding data subset, and storing the data subset in a node book of the block chain.

5. The method of claim 1, wherein after encrypting the layout file via encryption logic in the smart contract to generate a layout encrypted file for the layout file, the method further comprises:

and performing hash operation on the format encrypted file to generate a corresponding hash value, storing the hash value in a node account book of the block chain through storage logic in the intelligent contract, and storing the format encrypted file in a centralized storage system or a distributed file storage system.

6. The method of claim 1, wherein after generating the template file by the smart contract deployed on the blockchain according to the preset data elements and the preset visualization style, the method further comprises:

and processing the template file according to a preset algorithm to generate a corresponding digital abstract, storing the digital abstract in a node account book of the block chain through a storage logic in the intelligent contract, and storing the template file in a centralized storage system or a distributed file storage system.

7. The method of claim 1, wherein prior to storing the template file in a node ledger of the blockchain by storage logic in the intelligent contract, the method further comprises:

base64 encoding the template file by smart contracts on the blockchain.

8. A system for filling in files based on a block chain is characterized by comprising an intelligent contract module and a node book module;

the intelligent contract module generates a template file according to a preset data element and a preset visual style;

the intelligent contract module stores the template file in the node book module through storage logic;

the intelligent contract module acquires key-value pair data and verifies the key-value pair data and preset data elements of the template file through verification logic;

the intelligent contract module writes the key value pair data into a form value corresponding to the template file according to preset data elements of the template file and generates a format file;

the intelligent contract module encrypts the format file through encryption logic to generate a format encrypted file of the format file;

and the intelligent contract module stores the format encryption file in the node ledger module through storage logic.

9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the method of filling in a file based on a blockchain of any one of claims 1 to 7.

10. A storage medium having stored thereon a computer program, wherein the computer program is arranged to execute the method of filling in a file based on a blockchain of any one of claims 1 to 7 when the computer program is run.

Background

When a traditional user issues an invoice and signs a contract online, a paper material is usually printed or printed in advance, and then relevant information is filled in the paper material. With the development of digital economy and the popularization of electronization, data electronic documents such as electronic invoices, electronic contracts, electronic insurance policies, electronic medical records and the like are commonly used at present to replace paper media. Wherein, like the electronic invoice, the data elements and the visual styles for describing the electronic invoice are usually made into a template file of the electronic invoice; like electronic contracts, format terms are planned in advance to achieve the purpose of repeated use. The user needs to submit information to the third-party centralized service platform according to the template file or the format clause instead of directly combining with the template file, and related operations not only increase the operation burden of the user, but also have the risks that the information is tampered and the privacy is leaked.

At present, an effective solution is not provided aiming at the problems of unsafe data and complicated operation existing in the filling of format files in the related technology.

Disclosure of Invention

The embodiment of the application provides a method, a system, a device and a storage medium for filling in files based on a block chain, so as to at least solve the problems of unsafe data and complicated operation existing in filling in format files in the related technology.

In a first aspect, an embodiment of the present application provides a method for filling in a file based on a blockchain, where the method includes:

generating a template file through an intelligent contract deployed on a block chain according to a preset data element and a preset visual style;

storing the template file in a node account book of the block chain through storage logic in the intelligent contract;

acquiring key value pair data, and verifying the key value pair data and a preset data element of the template file through a verification logic in the intelligent contract;

writing the key value pair data into a form value corresponding to the template file through the intelligent contract according to a preset data element of the template file, and generating a format file;

encrypting the layout file through encryption logic in the intelligent contract to generate a layout encryption file of the layout file;

and storing the format encryption file in a node account book of the block chain through storage logic in the intelligent contract.

In some embodiments, obtaining key-value pair data, and verifying, by a verification logic in the intelligent contract, the key-value pair data and a preset data element of the template file includes:

acquiring key value pair data, calling an intelligent contract deployed on the block chain according to constraint conditions of the preset data elements set in a key name retrieval template file to perform preset verification on the key value pair data, and performing preset setting on the key value pair data based on the constraint conditions, wherein the preset verification comprises verifying data content and verifying data length, and the preset setting comprises setting data arrangement, setting data fonts and setting data word sizes.

In some embodiments, encrypting the layout file by encryption logic in the smart contract, generating a layout encrypted file for the layout file comprises:

and carrying out Base64 encoding on the format file through an encryption logic in the intelligent contract, and carrying out symmetric or asymmetric encryption on the format file subjected to the Base64 encoding to generate a format encrypted file.

In some embodiments, storing, by the storage logic in the smart contract, the layout encryption file in a node ledger of the blockchain comprises:

and performing data segmentation on the format encrypted file through storage logic in the intelligent contract to generate a corresponding data subset, and storing the data subset in a node book of the block chain.

In some embodiments, after encrypting the layout file by encryption logic in the smart contract to generate a layout encrypted file of the layout file, the method further comprises:

and performing hash operation on the format encrypted file to generate a corresponding hash value, storing the hash value in a node account book of the block chain through storage logic in the intelligent contract, and storing the format encrypted file in a centralized storage system or a distributed file storage system.

In some embodiments, after generating the template file by the smart contract deployed on the blockchain according to the preset data elements and the preset visualization style, the method further includes:

and processing the template file according to a preset algorithm to generate a corresponding digital abstract, storing the digital abstract in a node account book of the block chain through a storage logic in the intelligent contract, and storing the template file in a centralized storage system or a distributed file storage system.

In some embodiments, before storing, by the storage logic in the intelligent contract, the template file in a node ledger of the blockchain, the method further comprises:

base64 encoding the template file by smart contracts on the blockchain.

In a second aspect, an embodiment of the present application provides a system for filling in a file based on a blockchain, where the system includes an intelligent contract module and a node ledger module;

the intelligent contract module generates a template file according to a preset data element and a preset visual style;

the intelligent contract module stores the template file in the node book module through storage logic;

the intelligent contract module acquires key-value pair data and verifies the key-value pair data and preset data elements of the template file through verification logic;

the intelligent contract module writes the key value pair data into a form value corresponding to the template file according to preset data elements of the template file and generates a format file;

the intelligent contract module encrypts the format file through encryption logic to generate a format encrypted file of the format file;

and the intelligent contract module stores the format encryption file in the node ledger module through storage logic.

In a third aspect, an embodiment of the present application provides an electronic apparatus, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method according to the first aspect when executing the computer program.

In a fourth aspect, the present application provides a storage medium having a computer program stored therein, where the computer program is executed by a processor to implement the method for filling in a file based on a blockchain as described in the first aspect.

Compared with the related technology, the method, the system, the device and the storage medium for filling in files based on the block chain provided by the embodiment of the application generate the template file through the intelligent contract deployed on the block chain according to the preset data elements and the preset visual style, store the template file in the node account book of the block chain through the storage logic in the intelligent contract, acquire the key value pair data, verify the key value pair data and the preset data elements of the template file through the verification logic in the intelligent contract, write the key value pair data into the form value corresponding to the template file through the intelligent contract according to the preset data elements of the template file, generate the format file, encrypt the format file through the encryption logic in the intelligent contract, generate the format encrypted file of the format file, store the format encrypted file in the node account book of the block chain through the storage logic in the intelligent contract, the method solves the problems of unsafe data and complicated operation existing in filling of the format file in the related technology, realizes the purpose of directly filling the interactive form on the template file through the block chain without repeated operation through multiple systems, reduces the operation complexity of a user, reduces intermediate circulation links, directly and/or indirectly stores the filled format file through the block chain, and further guarantees the information safety and privacy based on the non-tampering and traceable mechanism of the block chain.

Drawings

The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:

FIG. 1 is a schematic diagram of a method of creating an intelligent contract;

FIG. 2 is a schematic diagram of a method for invoking an intelligent contract;

FIG. 3 is a schematic diagram of a method of creating an intelligent contract and invoking the intelligent contract;

FIG. 4 is a flow chart of steps of an electronic invoice generation and fill-in method according to the related art;

FIG. 5 is a flow chart of steps of an electronic contract generation and filling method according to the related art;

FIG. 6 is a flowchart illustrating brief steps of a method for filling in a document based on a blockchain according to an embodiment of the present disclosure;

FIG. 7 is a flowchart illustrating steps of a method for filling in a document based on a blockchain according to an embodiment of the present disclosure;

FIG. 8 is a block diagram of a block chain based filing system according to an embodiment of the present application;

fig. 9 is an internal structural diagram of an electronic device according to an embodiment of the present application.

Description of the drawings: 81. an intelligent contract module; 82. and a node account book module.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.

It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.

Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.

Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.

Blockchains are generally divided into three types: public chain (Public Blockchain), private chain (PrivateBlockchain) and alliance chain (Consortium Blockchain). Furthermore, there may be a combination of the above types, such as private chain + federation chain, federation chain + public chain, and so on.

Among them, the most decentralized is the public chain. The public chain is represented by bitcoin and ether house, and participants (also called nodes in the block chain) joining the public chain can read data records on the chain, participate in transactions, compete for accounting rights of new blocks, and the like. Moreover, each node can freely join or leave the network and perform related operations.

Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain may be a weakly centralized system with strict restrictions on nodes and a small number of nodes. This type of blockchain is more suitable for use within a particular establishment.

A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; the nodes are authorized to join the network and form a benefit-related alliance, and block chain operation is maintained together.

Based on the basic characteristics of a blockchain, a blockchain is usually composed of several blocks. The time stamps corresponding to the creation time of the block are recorded in the blocks respectively, and all the blocks form a time-ordered data chain according to the time stamps recorded in the blocks strictly.

The real data generated by the physical world can be constructed into a standard transaction (transaction) format supported by a block chain, then is issued to the block chain, the node equipment in the block chain performs consensus processing on the received transaction, and after the consensus is achieved, the node equipment serving as an accounting node in the block chain packs the transaction into a block and performs persistent evidence storage in the block chain.

The consensus algorithm supported in the blockchain may include:

the first kind of consensus algorithm, namely the consensus algorithm that the node device needs to contend for the accounting right of each round of accounting period; consensus algorithms such as Proof of Work (POW), Proof of equity (POS), Proof of commission rights (DPOS), etc.;

the second kind of consensus algorithm, namely the consensus algorithm which elects accounting nodes in advance for each accounting period (without competing for accounting right); for example, a consensus algorithm such as a Practical Byzantine Fault Tolerance (PBFT) is used.

In a blockchain network employing a first type of consensus algorithm, node devices competing for billing rights can execute a transaction upon receipt. One of the node devices competing for the accounting right may win in the process of competing for the accounting right in the current round, and become an accounting node. The accounting node may package the received transaction with other transactions to generate a latest block and send the generated latest block or a block header of the latest block to other node devices for consensus.

In the block chain network adopting the second type of consensus algorithm, the node equipment with the accounting right is agreed before accounting in the current round. Thus, the node device, after receiving the transaction, may send the transaction to the accounting node if it is not the accounting node of its own round. For the accounting node of the current round, the transaction may be performed during or before packaging the transaction with other transactions to generate the latest block. After generating the latest block, the accounting node may send the latest block or a block header of the latest block to other node devices for consensus.

As described above, regardless of which consensus algorithm is used by the blockchain, the accounting node of the current round may pack the received transaction to generate the latest block, and send the generated latest block or the block header of the latest block to other node devices for consensus verification. If no problem is verified after other node equipment receives the latest block or the block header of the latest block, the latest block can be added to the tail of the original block chain, so that the accounting process of the block chain is completed. The transaction contained in the block may also be performed by other nodes in verifying the new block or block header sent by the accounting node.

In the field of blockchain, an important concept is Account (Account); taking an ether house as an example, the ether house generally divides an account into an external account and a contract account; the external account is an account directly controlled by the user and is also called as a user account; and the contract account is created by the user through an external account, the account containing the contract code (i.e. the smart contract). Of course, for some blockchain items derived from the ethernet-based architecture (such as ant blockchains), the account types supported by the blockchain may be further expanded, and are not particularly limited in this specification.

For accounts in a blockchain, the account status of the account is usually maintained through a structure. When a transaction in a block is executed, the status of the account associated with the transaction in the block chain is also typically changed.

Taking etherhouses as an example, the structure of an account usually includes fields such as Balance, Nonce, Code and Storage. Wherein:

a Balance field for maintaining the current account Balance of the account;

a Nonce field for maintaining a number of transactions for the account; the counter is used for guaranteeing that each transaction can be processed only once, and replay attack is effectively avoided;

a Code field for maintaining a contract Code for the account; in practical applications, only the hash value of the contract Code is typically maintained in the Code field; thus, the Code field is also commonly referred to as the Codhash field.

A Storage field for maintaining the Storage contents of the account (default field value is null); for a contract account, a separate storage space is usually allocated to store the storage content of the contract account; this separate storage space is often referred to as the account storage of the contract account. The storage content of the contract account is generally constructed into a data structure of an MPT (MerklePatriceitie) tree and stored in the independent storage space; in which, the Storage content based on the contract account is constructed into an MPT tree, which is also commonly referred to as a Storage tree. Whereas the Storage field typically maintains only the root node of the Storage tree; thus, the Storage field is also commonly referred to as the Storage root field.

Wherein, for the external account, the field values of the Code field and the Storage field shown above are both null values.

In addition, in practical applications, whether public, private, or alliance, it is possible to provide the functionality of a Smart contract (Smart contract). An intelligent contract on a blockchain is a contract on a blockchain that can be executed triggered by a transaction. An intelligent contract may be defined in the form of code.

Taking an Etherhouse as an example, a user is supported to create and call some complex logic in the Etherhouse network. The ethernet workshop is used as a programmable block chain, and the core of the ethernet workshop is an ethernet workshop virtual machine (EVM), and each ethernet workshop node can run the EVM. The EVM is a well-behaved virtual machine through which various complex logic can be implemented. The user issuing and invoking smart contracts in the etherhouse is running on the EVM. In fact, the EVM directly runs virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"), so the intelligent contract deployed on the blockchain may be bytecode.

Fig. 1 is a schematic diagram of a method for creating a smart contract, as shown in fig. 1, after Bob sends a Transaction (Transaction) containing information for creating a smart contract to an ethernet network, each node can execute the Transaction in an EVM. In fig. 1, the From field of the transaction is used To record the address of the account initiating the creation of the intelligent contract, the contract code stored in the field value of the Data field of the transaction may be bytecode, and the field value of the To field of the transaction is a null account. After the nodes reach the agreement through the consensus mechanism, the intelligent contract is successfully created, and the follow-up user can call the intelligent contract.

After the intelligent contract is established, a contract account corresponding to the intelligent contract appears on the block chain, and the block chain has a specific address; for example, "0 x68e12cf284 …" in each node in fig. 1 represents the address of the contract account created; the contract Code (Code) and account store (Storage) will be maintained in the account store for that contract account. The behavior of the intelligent contract is controlled by the contract code, while the account storage of the intelligent contract preserves the state of the contract. In other words, the intelligent contract causes a virtual account to be generated on the blockchain that contains the contract code and account storage.

As mentioned above, the Data field containing the transaction that created the intelligent contract may hold the byte code of the intelligent contract. A bytecode consists of a series of bytes, each of which can identify an operation. Based on the multiple considerations of development efficiency, readability and the like, a developer can select a high-level language to write intelligent contract codes instead of directly writing byte codes. For example, the high-level language may employ a language such as Solidity, Serpent, LLL, and the like. For intelligent contract code written in a high-level language, the intelligent contract code can be compiled by a compiler to generate byte codes which can be deployed on a blockchain.

Taking the Solidity language as an example, the contract code written by it is very similar to a Class (Class) in the object-oriented programming language, and various members including state variables, functions, function modifiers, events, etc. can be declared in one contract. A state variable is a value permanently stored in an account Storage (Storage) field of an intelligent contract to save the state of the contract.

Fig. 2 is a schematic diagram of a method for invoking an intelligent contract, as shown in fig. 2, and still taking an ethernet shop as an example, after Bob sends a transaction including information of invoking the intelligent contract to the ethernet shop network, each node may execute the transaction in the EVM. In fig. 2, the From field of the transaction is used To record the address of the account initiating the intelligent contract invocation, the To field is used To record the address of the intelligent contract invocation, and the Data field of the transaction is used To record the method and parameters of the intelligent contract invocation. After invoking the smart contract, the account status of the contract account may change. Subsequently, a client may view the account status of the contract account through the accessed block link point (e.g., node 1 in fig. 2).

The intelligent contract can be independently executed at each node in the blockchain network in a specified mode, and all execution records and data are stored on the blockchain, so that after the transaction is executed, transaction certificates which cannot be tampered and lost are stored on the blockchain.

FIG. 3 is a schematic diagram of a method for creating an intelligent contract and invoking the intelligent contract, as shown in FIG. 3. An intelligent contract is created in an Ethernet workshop and needs to be subjected to the processes of compiling the intelligent contract, changing the intelligent contract into byte codes, deploying the intelligent contract to a block chain and the like. The intelligent contract is called in the Ethernet workshop, a transaction pointing to the intelligent contract address is initiated, the EVM of each node can respectively execute the transaction, and the intelligent contract code is distributed and operated in the virtual machine of each node in the Ethernet workshop network.

In the related art, an electronic invoice usually makes data elements and visual styles describing the electronic invoice into a template file of the electronic invoice; the electronic contract can be used repeatedly by formulating format terms in advance. Such an operation flow is commonly called as sample preparation, and in the subsequent use process, information is only required to be filled in a format file provided by the sample preparation.

Taking an electronic invoice as an example, fig. 4 is a flowchart of steps of an electronic invoice generation and filling method according to the related art, as shown in fig. 4, the method includes the following steps:

s402, manufacturing and forming an electronic bill template file according to the data elements and the visual style of the electronic bill;

s404, the billing platform presents the template file according to the style of the template file by using technologies such as HTML and the like according to the template file, and collects information to be filled in through forms and the like;

s406, combining the filled information and the template file to form a new format file, which is usually a file in a PDF format;

and S408, signing by using the digital certificate by a tax bureau, a billing unit and the like to generate a new version file of the electronic invoice.

Taking an electronic contract as an example, fig. 5 is a flowchart of steps of an electronic contract generating and filling method according to the related art, as shown in fig. 5, the method includes the steps of:

s502, one party plans format terms in advance, and then typesets through editing software such as Microsoft Word or WPS and the like to generate a reusable template file;

s504, the template file is converted into a format file in a PDF format, and then the format file is uploaded to a third party signing platform. Or directly uploading the edited template file, and performing format conversion through a third-party signing platform;

and S506, opening the uploaded file on the third-party signing platform, dragging the form on the interface, placing the form at the position of the content to be filled in, and re-manufacturing the template file. Storing the corresponding information into a centralized database of the third party signing platform;

s508, the user calls the template file information stored in the centralized database at the third party signing platform, fills the related information in the corresponding form and submits the information to the third party signing platform;

and S510, the third-party signing platform generates a new layout file according to the information submitted by the user for subsequent signing operation.

Through steps S402 to S408 and steps S502 to S510 in the related art, after a user formulates a related template file according to a business requirement of the user, in an actual filling process, the user does not directly use the template file of the user to perform content filling, but performs a secondary operation of a third-party centralized service platform, the user inputs information into the third-party centralized service platform, and the third-party centralized service platform combines the input information with the template file to generate a format file required by the user.

Therefore, after independent third-party software such as Microsoft Word or WPS is used for editing the template, information to be filled in is written in by using other third-party product services, the inconsistency of a multi-party system causes that a user needs to perform complicated operation in the process, and information security and privacy protection strategies of all parties are invisible.

Therefore, a method for directly filling in the layout file is needed by the user to solve the intermediate tedious operations and potential information security and privacy risks.

An embodiment of the present application provides a method for filling in a file based on a block chain, and fig. 6 is a flowchart illustrating a brief step of the method for filling in a file based on a block chain according to an embodiment of the present application, and as shown in fig. 6, the method includes the following steps:

s602, manufacturing a corresponding template file according to the data elements and the visual styles described by the requirement information;

s604, filling an interactive form field in the template file to generate a layout file;

and S606, the format file is stored in a node account book of the block chain after being coded.

The operation processes related to the embodiment of the application are all realized through a block chain intelligent contract and do not relate to any centralized system, so that the consistency and the safety of user operation and privacy protection of the user operation are solved.

An embodiment of the present application provides a method for filling in a file based on a block chain, and fig. 7 is a flowchart illustrating steps of the method for filling in a file based on a block chain according to an embodiment of the present application, as shown in fig. 7, the method includes the following steps:

s702, generating a template file through an intelligent contract deployed on a block chain according to a preset data element and a preset visual style;

s704, storing the template file in a node account book of the block chain through storage logic in the intelligent contract;

s706, acquiring key value pair data, and verifying the key value pair data and preset data elements of the template file through verification logic in the intelligent contract;

s708, writing key value pair data into a form value corresponding to the template file through an intelligent contract according to preset data elements of the template file, and generating a layout file;

s710, encrypting the layout file through encryption logic in the intelligent contract to generate a layout encrypted file of the layout file;

and S712, storing the format encryption file in the node account book of the block chain through the storage logic in the intelligent contract.

It should be noted that the preset data elements are described using an interactive form field. So-called interactive forms, also known as acroforms, are a set of domains that interactively gather information from users. The template file may contain any number of fields that appear on any combination of pages, all of which constitute a single, integral interactive form that covers the entire document. Any unexplained use of form is understood to refer to interactive forms.

The interactive form supports the following field types:

the button field represents an interactive control which can be operated on a screen by a user by using a mouse and comprises common buttons, check boxes and radio buttons;

a text field is a box or area into which a user can enter text using a keyboard;

the option field contains several text items, of which at most one can be selected as a field value. The option fields include a scroll drop-down list box and a combo box;

the signature field represents the digital signature and optional data that authenticates the signer's name and document content.

The preset visualization style includes the length and width, resolution, and the position, size, even border, color, etc. of the page where the text, image, interactive form, etc. are located in the template file.

The template file may be generated in other ways besides by the intelligent contract deployed on the blockchain, which is not described herein again in this embodiment

Through the steps S702 to S712 in the embodiment of the application, the problems of unsafe data and complicated operation existing in the filling of the format file are solved, the interactive form can be directly filled in the template file through the block chain without repeated operation through multiple systems, the operation complexity of a user is reduced, the middle circulation link is reduced, the filled format file is directly and/or indirectly stored through the block chain, and the information safety and privacy are further ensured based on the non-tampering and traceable mechanism of the block chain.

In some embodiments, S706, acquiring the key-value pair data, and verifying the key-value pair data and the preset data element of the template file through a verification logic in the intelligent contract includes:

acquiring key value pair data, calling an intelligent contract deployed on a block chain according to constraint conditions of preset data elements set in a key name retrieval template file to perform preset verification on the key value pair data, and performing preset setting on the key value pair data based on the constraint conditions, wherein the preset verification comprises verifying data content and verifying data length, and the preset setting comprises setting data arrangement, setting data fonts and setting data word sizes.

In some embodiments, step S710, encrypting the layout file through encryption logic in the smart contract, and generating a layout encrypted file of the layout file includes:

the method comprises the steps of carrying out Base64 encoding on a format file through an encryption logic in an intelligent contract, and carrying out symmetrical or asymmetrical encryption on the format file subjected to the Base64 encoding to generate a format encryption file.

In some embodiments, step S712, storing the format encrypted file in the node ledger of the blockchain by the storage logic in the intelligent contract includes:

and carrying out data segmentation on the format encrypted file through storage logic in the intelligent contract to generate a corresponding data subset, and storing the data subset in a node ledger of the block chain.

In some embodiments, in step S710, after encrypting the layout file by the encryption logic in the smart contract to generate a layout encrypted file of the layout file, the method further includes:

and performing hash operation on the format encrypted file to generate a corresponding hash value, storing the hash value in a node account book of the block chain through storage logic in the intelligent contract, and storing the format encrypted file in a centralized storage system or a distributed file storage system.

In some embodiments, in step S702, after generating the template file by the smart contract deployed on the blockchain according to the preset data elements and the preset visualization style, the method further includes:

processing the template file according to a preset algorithm to generate a corresponding digital abstract, storing the digital abstract in a node book of a block chain through a storage logic in an intelligent contract, and storing the template file in a centralized storage system or a distributed file storage system.

In some embodiments, before storing the template file in the node ledger of the blockchain through the storage logic in the intelligent contract at step S704, the method further includes:

the template file is Base64 encoded by smart contracts on the blockchain.

It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.

The embodiment of the present application provides a system for filling in a file based on a blockchain, fig. 8 is a structural block diagram of the system for filling in a file based on a blockchain according to the embodiment of the present application, and as shown in fig. 8, the system includes an intelligent contract module 81 and a node ledger module 82;

the intelligent contract module 81 generates a template file according to the preset data elements and the preset visual style;

the intelligent contract module 81 stores the template file in the node book module 82 through storage logic;

the intelligent contract module 81 acquires key value pair data and verifies the key value pair data and preset data elements of the template file through verification logic;

the intelligent contract module 81 writes the key value pair data into the corresponding form value of the template file according to the preset data elements of the template file and generates a format file;

the intelligent contract module 81 encrypts the format file through encryption logic to generate a format encrypted file of the format file;

the intelligent contract module 81 stores the format encrypted file in the node ledger module 82 through storage logic.

According to the embodiment of the application, the intelligent contract module 81 generates a template file according to preset data elements and preset visual patterns, stores the template file in the node book module 82 of the block chain through storage logic, acquires key value pair data, verifies the key value pair data and the preset data elements of the template file through verification logic, writes the key value pair data into corresponding form values of the template file according to the preset data elements of the template file, generates a format file, encrypts the format file through encryption logic, generates a format encrypted file of the format file, stores the format encrypted file in the node book module 82 of the block chain through the storage logic, solves the problems of unsafe data and complicated operation existing in filling of the format file, realizes filling of interactive forms on the template file directly through the block chain without repeated operation through multiple systems, the operation complexity of a user is reduced, the intermediate circulation link is reduced, the filled layout file is directly and/or indirectly stored through the block chain, and the information safety and privacy are further guaranteed based on the non-tampering and traceable mechanism of the block chain.

The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.

The present embodiment also provides an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.

The electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.

It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments, and details of this embodiment are not described herein again.

In addition, in combination with the method for filling in a file based on a blockchain in the foregoing embodiments, the embodiments of the present application may provide a storage medium to implement. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any of the above-described embodiments of a method for filling in a file based on a blockchain.

In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device 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 comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. 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 method of filling in a file based on a blockchain. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.

In an embodiment, fig. 9 is a schematic internal structure diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 9, there is provided an electronic device, which may be a server, and its internal structure diagram may be as shown in fig. 9. The electronic device comprises a processor, a network interface, an internal memory and a non-volatile memory connected by an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used for providing calculation and control capability, the network interface is used for communicating with an external terminal through network connection, the internal memory is used for providing an environment for an operating system and the running of a computer program, the computer program is executed by the processor to realize a method for filling in files based on the block chain, and the database is used for storing data.

Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration relevant to the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or combine certain components, or have a different arrangement of components.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种项目工程生成方法、装置、计算机设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!