CN113094429B - Data processing method, data query method, computer device and storage medium - Google Patents

Data processing method, data query method, computer device and storage medium Download PDF

Info

Publication number
CN113094429B
CN113094429B CN202110296507.6A CN202110296507A CN113094429B CN 113094429 B CN113094429 B CN 113094429B CN 202110296507 A CN202110296507 A CN 202110296507A CN 113094429 B CN113094429 B CN 113094429B
Authority
CN
China
Prior art keywords
data
proto
contract
format file
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110296507.6A
Other languages
Chinese (zh)
Other versions
CN113094429A (en
Inventor
袁兴强
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202110296507.6A priority Critical patent/CN113094429B/en
Publication of CN113094429A publication Critical patent/CN113094429A/en
Application granted granted Critical
Publication of CN113094429B publication Critical patent/CN113094429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators

Abstract

The invention provides a data processing method, a data query method, computer equipment and a storage medium, wherein the data processing method comprises the following steps: acquiring a first proto format file corresponding to a first contract; defining a plurality of first data types according to a first proto format file; compiling each first data type according to a first protoc tool corresponding to a first programming language of a first contract to generate a plurality of second data types; and generating first transactions according to the second data types and sending the first transactions to the block chain network so that the block chain nodes execute the first transactions through the first contracts, calling a data serialization method configured in the first contracts to carry out serialization processing on the execution results of the first transactions, and generating and storing first data. The invention realizes the technical effects of not wasting storage space in the blockchain system for executing the intelligent contract through the wasm virtual machine and supporting high-concurrency user inquiry.

Description

Data processing method, data query method, computer device and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a data processing method, a data query method, a computer device, and a storage medium.
Background
Web Assembly, called wasm for short, is a brand new format which is portable, small in size, fast in loading and compatible with Web. Since wasm supports multi-language compilation, dynamic contracts for blockchains have been increasingly used to execute virtual machines, so that developers can write contracts in multiple languages and then compile into wasm bytecodes and issue onto blockchains, users can invoke contracts through open interfaces, and contracts are executed by the wasm virtual machines.
In the existing technical solution for executing intelligent contracts of a block chain through a wasm virtual machine, since the wasm supports multi-language compilation, intelligent contracts developed through different programming languages are deployed on the block chain, for example, an a contract is developed through a C language, a B contract is developed through Java, a C contract is developed through Python, a D contract is developed through Rust, and the like. When each contract executes a transaction, if transaction execution results are directly stored in the blockchain database in formats of different programming languages, a user can face the problem of data analysis when inquiring data. Thus, in existing blockchain systems, contracts require that transaction execution results be converted to a user-readable format, such as json type, and stored in a blockchain database. When the user queries the data, the data in the readable format can be directly queried.
The problem with the above scheme is that data in the user-readable format such as json is several times larger than data in the native format before conversion, and several times of storage space is required, thereby resulting in a great waste of storage space of the blockchain system.
In view of the above problems, those skilled in the art can directly store the transaction execution result of the native type into the blockchain database (instead of converting the transaction execution result into the user-readable format) when the contract executes the transaction, and load the corresponding contract when the user queries the contract to convert the data of the native type into the user-readable format. However, although this solution can solve the above problem of wasting storage space, it also causes a new problem: the contracts need to be loaded to resolve data at each user query, and the existing blockchain system has difficulty in supporting high-concurrency loading contracts, so that the high-concurrency user query cannot be supported.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies of the prior art, it is desirable to provide a data processing method, a data query method, a computer device, and a storage medium that do not waste the storage space of a blockchain system, nor affect the system to support high-concurrency user queries.
In a first aspect, the present invention provides a data processing method, where a block chain is configured with a plurality of intelligent contracts issued in the form of wasm bytecodes and executed by a wasm virtual machine, each intelligent contract is configured with a proto format file in one-to-one correspondence, and a data type, a data serialization method, and a data deserialization method defined according to the corresponding proto format file are configured in each intelligent contract, where the data processing method includes:
acquiring a first proto format file corresponding to a first contract;
defining a plurality of first data types according to a first proto format file;
compiling each first data type according to a first protoc tool corresponding to a first programming language of a first contract to generate a plurality of second data types;
and generating first transactions according to the second data types and sending the first transactions to the block chain network so that the block chain nodes execute the first transactions through the first contracts, calling a data serialization method configured in the first contracts to carry out serialization processing on the execution results of the first transactions, and generating and storing first data.
The first data are used for the first user side to analyze through a plurality of third data types and a data deserialization method defined by the first proto format file after being acquired so as to obtain second data, the second data are converted into third data in a user readable format, and the third data are displayed; and each third data type is generated by compiling each first data type by the first user terminal according to a second protoc tool corresponding to the second programming language.
In a second aspect, the present invention provides a data processing method applicable to a blockchain node, where a blockchain is configured with a plurality of intelligent contracts issued in the form of wasm bytecodes and executed by a wasm virtual machine, each intelligent contract is configured with a proto format file corresponding to each other, and a data type, a data serialization method, and a data deserialization method defined according to the corresponding proto format file are configured in each intelligent contract, where the data processing method includes:
executing the first transaction through the first contract, calling a data serialization method configured in the first contract to carry out serialization processing on an execution result of the first transaction, generating and storing first data.
The first transaction is generated according to each second data type after a first proto format file corresponding to a first contract is obtained by first equipment, a plurality of first data types are defined according to the first proto format file, and each first data type is compiled according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types;
the first data is used for the first user terminal to analyze through a plurality of third data types and a data deserialization method defined by the first proto format file after being acquired so as to obtain second data, convert the second data into third data in a user readable format and display the third data; and each third data type is generated by compiling each first data type by the first user terminal according to a second protoc tool corresponding to the second programming language.
In a third aspect, the present invention provides a data query method applicable to a user side, where a block chain is configured with a plurality of intelligent contracts issued in the form of wasm byte codes and executed by a wasm virtual machine, each intelligent contract is configured with a proto format file in one-to-one correspondence, and a data type, a data serialization method, and a data deserialization method defined according to the corresponding proto format file are configured in each intelligent contract, where the data query method includes:
acquiring first data stored on a block chain; the first data is generated by executing a first transaction through a first contract by the block chain nodes and calling a data serialization method configured in the first contract to perform serialization processing on an execution result of the first transaction; in the first transaction, first equipment acquires a first proto format file corresponding to a first contract, a plurality of first data types are defined according to the first proto format file, and after the first data types are compiled according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types, the first data types are generated according to the second data types;
acquiring a first proto format file;
defining each first data type and data deserialization method according to the first proto format file;
compiling each first data type according to a second protoc tool corresponding to a second programming language to generate a plurality of third data types;
analyzing the first data through each third data type and a data deserialization method defined by the first proto format file to obtain second data;
converting the second data into third data in a user-readable format;
and displaying the third data.
In a fourth aspect, the invention also provides a computer device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a method provided according to embodiments of the invention.
In a fifth aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the methods provided according to the embodiments of the present invention.
The data processing method, the data query method, the computer device and the storage medium provided by the embodiments of the invention configure the data type, the data serialization method and the data deserialization method in the intelligent contract, and configure the proto format file corresponding to the intelligent contract and used for defining the data type, the data serialization method and the data deserialization method, so that the contract can call the data serialization method configured in the contract to convert the transaction execution result into serialized data with small volume and store the serialized data in the block chain database when executing the transaction, thereby avoiding the waste of storage space; meanwhile, when a user inquires data, a user side analyzes the serialized data stored in the block chain database according to a data deserialization method defined by a proto format file under a chain, so that the problem that high-concurrency user inquiry is not supported due to data analysis on the chain is avoided, and the technical effects of not wasting storage space and supporting high-concurrency user inquiry are realized in a block chain system executing an intelligent contract through a wasm virtual machine;
the data processing method, the data query method, the computer device and the storage medium provided by some embodiments of the present invention further satisfy the business requirement of protecting the data privacy on the chain by storing the proto format file on the centralized server that needs identity authentication.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a data processing method according to an embodiment of the present invention.
Fig. 2 is a flowchart of another data processing method according to an embodiment of the present invention.
Fig. 3 is a flowchart of a data query method according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present invention.
As shown in fig. 1, in this embodiment, the present invention provides a data processing method, where a block chain is configured with a plurality of intelligent contracts issued in the form of wasm byte codes and executed by a wasm virtual machine, each intelligent contract is configured with a proto format file corresponding to each other, and a data type, a data serialization method, and a data deserialization method defined according to the corresponding proto format file are configured in each intelligent contract, where the data processing method includes:
s11: acquiring a first proto format file corresponding to a first contract;
s13: defining a plurality of first data types according to a first proto format file;
s15: compiling each first data type according to a first protoc tool corresponding to a first programming language of a first contract to generate a plurality of second data types;
s17: and generating first transactions according to the second data types and sending the first transactions to the block chain network so that the block chain nodes execute the first transactions through the first contracts, calling a data serialization method configured in the first contracts to carry out serialization processing on the execution results of the first transactions, and generating and storing first data.
The first data are used for the first user side to analyze through a plurality of third data types and a data deserialization method defined by the first proto format file after being acquired so as to obtain second data, the second data are converted into third data in a user readable format, and the third data are displayed; and each third data type is generated by compiling each first data type by the first user terminal according to a second protoc tool corresponding to the second programming language.
It should be noted that the method shown in fig. 1 is applicable to both the blockchain node generating and sending transaction and the user side generating and sending transaction.
As will be appreciated by those skilled in the art, protobuf is a method of programming language independent, platform independent, extensible serialization of structured data. For example, if developer X defines a type of data type1 using protobuf, the user can compile to generate type1_ c according to type1 by using a protoc tool (protoc) corresponding to c language, or compile to generate type1_ go according to type1 by using a protoc tool (protoc-gen-go) corresponding to go language, and can also directly convert type1_ c to type1_ go or directly convert type1_ go to type1_ c, and so on. For a specific principle, reference may be made to technical documents of protobuf, which are not described in detail in this application.
The data processing method is exemplarily described below by taking the example that a blockchain system is developed through Go language (that is, both a node side and a user side are developed through Go language), a contract a is developed through C language, a proto format file corresponding to the contract a is stored on a blockchain, a contract B is developed through Java, a proto format file corresponding to the contract B is stored on a centralized server, a blockchain node a generates and sends a transaction tx1 executed through the contract a, a user side of a user B generates and sends a transaction tx2 executed through the contract B, a user side of a user C queries an execution result of tx1, and a user side of a user d queries an execution result of tx 2.
When the block chain link point A is to generate a transaction executed by the A contract:
in step S11, the node a obtains a contract corresponding proto format file from the blockchain database: contict _ a.proto;
in step S13, the node a defines several data types according to the context _ a.proto, for example, a first data type req _ login is defined;
in step S15, the node a compiles the first data type req _ logic according to a protoc tool (protoc) corresponding to the programming language C of the contract a to generate a second data type req _ logic _ C;
in step S17, node a generates transaction tx1 according to the second data type req _ logic _ c, and sends tx1 to the blockchain network.
The block chain node receives, broadcasts and packages the data, executes tx1 through an A contract, calls a data serialization method configured in the A contract to carry out serialization processing on an execution result of tx1, generates first data1, and stores the data1 in a block chain database.
When the user C needs to query the execution result of tx1, the user end of the user C obtains the data1 through a blockchain browser or other commonly used blockchain query methods in the field;
meanwhile, the user side of the user C also acquires a proto format file (Contract _ A.proto) corresponding to a Contract (A Contract) for executing tx 1;
after the context _ a.proto is obtained, the user side of the user c first defines the first data type req _ login according to the context _ a.proto, and also defines a data deserialization method according to the context _ a.proto;
secondly, compiling the first data type req _ login according to a second protoc tool (protoc-gen-Go) corresponding to the programming language (Go) of the user side to generate a third data type req _ login _ Go;
thirdly, analyzing the data1 according to the third data type req _ login _ go and the data deserialization method to obtain second data2 of a go language type;
finally, the second data2 is converted into third data3 in a user-readable format (e.g., json, etc.), and data3 is exposed.
The process of generating and sending a transaction tx2 executed by the contract B and the execution result of the user query tx2 by the user B is substantially the same as the process of generating and sending a transaction tx1 executed by the contract a and the execution result of the user query tx1 by the user c by the block chain node a, and the difference is that:
in step S11, the user end of the user B needs to request the centralized server to download the proto format file (containment _ b.proto) corresponding to the Contract B;
and the centralized server responds to the downloading request of the user end of the user B and performs identity authentication on the user B:
if the authentication fails, the download request fails, and the user side of the user B cannot acquire the Contract _ B.proto;
and if the authentication is successful, the downloading request is successful, and the centralized server returns the content _ B.proto to the user end of the user B.
The user side of the user d also needs to be subjected to identity authentication when requesting to download the content _ b.proto from the centralized server, if the identity authentication fails, the user side of the user d cannot acquire the content _ b.proto, the user side of the user d cannot analyze the execution result of tx2 into a user readable format, and the user d cannot acquire the execution result of tx 2.
In the above embodiment, the proto format file corresponding to the contract a is stored in the block chain, and the proto format file corresponding to the contract B is stored in the centralized server for performing identity authentication on the user requesting to download the proto format file, which is an example, the data processing method shown in fig. 1 is exemplarily described; in other embodiments, all the proto-format files corresponding to the intelligent contracts may be stored on the blockchain according to actual needs, or all the proto-format files corresponding to the intelligent contracts may be stored on a centralized server for performing identity authentication on a user requesting to download the proto-format files, so that the same technical effect may be achieved.
In the embodiment, the data type, the data serialization method and the data deserialization method are configured in the intelligent contract, and the proto format file corresponding to the intelligent contract and used for defining the data type, the data serialization method and the data deserialization method is configured at the same time, so that the contract can call the data serialization method configured in the contract to convert a transaction execution result into serialized data with small volume and store the serialized data into the block chain database when executing transaction, and the waste of storage space is avoided; meanwhile, when a user inquires data, a user side analyzes the serialized data stored in the block chain database according to a data deserialization method defined by a proto format file under a chain, so that the problem that high-concurrency user inquiry is not supported due to data analysis on the chain is avoided, and the technical effects of not wasting storage space and supporting high-concurrency user inquiry are realized in a block chain system executing an intelligent contract through a wasm virtual machine;
and further, the proto format file is stored in a centralized server needing identity authentication, so that the service requirement of protecting the data privacy on the chain is further met.
Fig. 2 is a flowchart of another data processing method according to an embodiment of the present invention. The method illustrated in fig. 2 may be performed in conjunction with the method illustrated in fig. 1.
As shown in fig. 2, in this embodiment, the present invention further provides a data processing method suitable for a blockchain node, where a plurality of intelligent contracts issued in the form of wasm byte codes and executed by a wasm virtual machine are configured on a blockchain, each intelligent contract is configured with a proto format file corresponding to each other, and a data type, a data serialization method, and a data deserialization method defined according to the corresponding proto format file are configured in each intelligent contract, where the data processing method includes:
s21: executing the first transaction through the first contract, calling a data serialization method configured in the first contract to carry out serialization processing on an execution result of the first transaction, generating and storing first data.
The first transaction is generated according to each second data type after a first proto format file corresponding to a first contract is obtained by first equipment, a plurality of first data types are defined according to the first proto format file, and each first data type is compiled according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types;
the first data is used for the first user terminal to analyze through a plurality of third data types and a data deserialization method defined by the first proto format file after being acquired so as to obtain second data, convert the second data into third data in a user readable format and display the third data; and each third data type is generated by compiling each first data type by the first user terminal according to a second protoc tool corresponding to the second programming language.
In a preferred embodiment, the proto format files corresponding to the intelligent contracts are stored on the block chain.
In another preferred embodiment, the proto format files corresponding to the intelligent contracts are stored on the centralized server; the centralized server is configured to authenticate the identity of a user requesting to acquire the proto-format file, and to provide the requested proto-format file when the identity authentication is successful.
The data processing principle of the method shown in fig. 2 can refer to the method shown in fig. 1, and is not described herein again.
Fig. 3 is a flowchart of a data query method according to an embodiment of the present invention. The method illustrated in fig. 3 may be performed in conjunction with the methods illustrated in fig. 1-2.
As shown in fig. 3, in this embodiment, the present invention further provides a data query method applicable to a user side, where a block chain is configured with a plurality of intelligent contracts issued in the form of wasm byte codes and executed by a wasm virtual machine, each intelligent contract is configured with a proto format file corresponding to each other, and a data type, a data serialization method, and a data deserialization method defined according to the corresponding proto format file are configured in each intelligent contract, where the data query method includes:
s31: acquiring first data stored on a block chain; the first data is generated by executing a first transaction through a first contract by the block chain nodes and calling a data serialization method configured in the first contract to perform serialization processing on an execution result of the first transaction; in the first transaction, first equipment acquires a first proto format file corresponding to a first contract, a plurality of first data types are defined according to the first proto format file, and after the first data types are compiled according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types, the first data types are generated according to the second data types;
s32: acquiring a first proto format file;
s33: defining each first data type and data deserialization method according to the first proto format file;
s34: compiling each first data type according to a second protoc tool corresponding to a second programming language to generate a plurality of third data types;
s35: analyzing the first data through each third data type and a data deserialization method defined by the first proto format file to obtain second data;
s36: converting the second data into third data in a user-readable format;
s37: and displaying the third data.
In a preferred embodiment, the proto format files corresponding to the intelligent contracts are stored on the block chain.
In another preferred embodiment, the proto format files corresponding to the intelligent contracts are stored on the centralized server; the centralized server is configured to authenticate the identity of a user requesting to acquire the proto-format file, and to provide the requested proto-format file when the identity authentication is successful.
The data processing principle of the method shown in fig. 3 can also refer to the method shown in fig. 1, and is not described herein again.
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 4, as another aspect, the present application also provides a device 400 including one or more Central Processing Units (CPUs) 401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the device 400 are also stored. The CPU401, ROM402, and RAM403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present application.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each unit may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (11)

1. A data processing method is characterized in that a block chain is provided with a plurality of intelligent contracts issued in the form of wasm byte codes and executed through a wasm virtual machine, each intelligent contract is respectively provided with a proto format file in one-to-one correspondence, data types, data serialization methods and data deserialization methods defined according to the corresponding proto format files are configured in the intelligent contracts, and the data processing method comprises the following steps:
acquiring a first proto format file corresponding to a first contract;
defining a plurality of first data types according to the first proto format file;
compiling each first data type according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types;
generating a first transaction according to each second data type and sending the first transaction to a block chain network, so that block chain nodes execute the first transaction through the first contract, calling a data serialization method configured in the first contract to carry out serialization processing on an execution result of the first transaction, generating first data and storing the first data;
the first data are used for the first user side to analyze through a plurality of third data types and according to a data deserialization method defined by the first proto format file after being acquired so as to obtain second data, the second data are converted into third data in a user readable format, and the third data are displayed; and each third data type is generated by compiling each first data type by the first user terminal according to a second protoc tool corresponding to a second programming language of the first user terminal.
2. The method of claim 1, wherein respective proto-format files corresponding to respective ones of the intelligent contracts are stored on the blockchain.
3. The method of claim 1, wherein respective proto-format files corresponding to respective smart contracts are stored on a centralized server;
the centralized server is configured to perform identity authentication on a user requesting to acquire a proto-format file, and provide the requested proto-format file when the identity authentication is successful.
4. A data processing method is characterized in that a block chain is provided with a plurality of intelligent contracts issued in the form of wasm byte codes and executed through a wasm virtual machine, each intelligent contract is respectively provided with a proto format file in one-to-one correspondence, data types, data serialization methods and data deserialization methods defined according to the corresponding proto format files are configured in the intelligent contracts, the data processing method is suitable for block chain nodes, and the data processing method comprises the following steps:
executing a first transaction through a first contract, calling a data serialization method configured in the first contract to carry out serialization processing on an execution result of the first transaction, generating first data and storing the first data;
the first transaction is generated according to each second data type after a first proto format file corresponding to the first contract is obtained by first equipment, a plurality of first data types are defined according to the first proto format file, and each first data type is compiled according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types;
the first data is used for the first user terminal to analyze through a plurality of third data types and according to a data deserialization method defined by the first proto format file to obtain second data, convert the second data into third data in a user readable format, and display the third data; and each third data type is generated by compiling each first data type by the first user end according to a second protoc tool corresponding to a second programming language of the first user end.
5. The method of claim 4, wherein respective proto-format files corresponding to respective smart contracts are stored on the blockchain.
6. The method of claim 4, wherein the proto-format files corresponding to the smart contracts are stored on a centralized server;
the centralized server is configured to perform identity authentication on a user requesting to acquire a proto-format file, and provide the requested proto-format file when the identity authentication is successful.
7. A data query method is characterized in that a block chain is provided with a plurality of intelligent contracts issued in the form of wasm byte codes and executed through a wasm virtual machine, each intelligent contract is respectively provided with a proto format file in one-to-one correspondence, data types, data serialization methods and data deserialization methods defined according to the corresponding proto format files are configured in the intelligent contracts, the data query method is suitable for a user side, and the data query method comprises the following steps:
acquiring first data stored on a block chain; the first data is generated by block chain nodes executing a first transaction through a first contract and invoking a data serialization method configured in the first contract to perform serialization processing on an execution result of the first transaction; in the first transaction, first equipment acquires a first proto format file corresponding to a first contract, a plurality of first data types are defined according to the first proto format file, and after each first data type is compiled according to a first protoc tool corresponding to a first programming language of the first contract to generate a plurality of second data types, each first data type is generated according to each second data type;
acquiring the first proto format file;
defining each first data type and data deserialization method according to the first proto format file;
compiling each first data type according to a second protoc tool corresponding to a second programming language of the current user side to generate a plurality of third data types;
analyzing the first data through each third data type and a data deserialization method defined by the first proto format file to obtain second data;
converting the second data into third data in a user-readable format;
and displaying the third data.
8. The method of claim 7, wherein respective proto-format files corresponding to respective smart contracts are stored on the blockchain.
9. The method of claim 7, wherein the proto-format files corresponding to the smart contracts are stored on a centralized server;
the centralized server is configured to perform identity authentication on a user requesting to acquire a proto-format file, and provide the requested proto-format file when the identity authentication is successful.
10. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-9.
11. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-9.
CN202110296507.6A 2021-03-19 2021-03-19 Data processing method, data query method, computer device and storage medium Active CN113094429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110296507.6A CN113094429B (en) 2021-03-19 2021-03-19 Data processing method, data query method, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110296507.6A CN113094429B (en) 2021-03-19 2021-03-19 Data processing method, data query method, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN113094429A CN113094429A (en) 2021-07-09
CN113094429B true CN113094429B (en) 2022-05-24

Family

ID=76668457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110296507.6A Active CN113094429B (en) 2021-03-19 2021-03-19 Data processing method, data query method, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN113094429B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268620A (en) * 2021-12-13 2022-04-01 深圳供电局有限公司 Data compression transmission method for intelligent equipment of Internet of things

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609679A (en) * 2019-09-17 2019-12-24 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer readable storage medium and computer equipment
CN111124551A (en) * 2019-11-22 2020-05-08 矩阵元技术(深圳)有限公司 Data serialization and deserialization method and device and computer equipment
CN111369237A (en) * 2020-02-28 2020-07-03 腾讯科技(深圳)有限公司 Data processing method and device and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11038771B2 (en) * 2019-04-26 2021-06-15 Salesforce.Com, Inc. Systems, methods, and apparatuses for implementing a metadata driven rules engine on blockchain using distributed ledger technology (DLT)

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609679A (en) * 2019-09-17 2019-12-24 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer readable storage medium and computer equipment
CN111124551A (en) * 2019-11-22 2020-05-08 矩阵元技术(深圳)有限公司 Data serialization and deserialization method and device and computer equipment
CN111369237A (en) * 2020-02-28 2020-07-03 腾讯科技(深圳)有限公司 Data processing method and device and computer storage medium

Also Published As

Publication number Publication date
CN113094429A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN105872083A (en) Method and system supporting server access by different types of clients as well as server
US20040003388A1 (en) Preparation of a software configuration using an XML type programming language
US20060200748A1 (en) System and method for applying workflow of generic services' to component based applications for devices
US11550599B2 (en) Method and apparatus for running applet
CN110865889B (en) Method and device for transmitting event between components
CN111625585B (en) Access method, device, host and storage medium of hardware acceleration database
CN113094429B (en) Data processing method, data query method, computer device and storage medium
Pedratscher et al. M2FaaS: Transparent and fault tolerant FaaSification of Node. js monolith code blocks
CN111125064A (en) Method and device for generating database mode definition statement
US9690577B1 (en) Legacy applications as web services
CN110888794A (en) Interface test method and device
CN110764769B (en) Method and device for processing user request
CN110928545B (en) Component distribution method, development method and device of single-page application and storage medium
WO2019043462A1 (en) Systems and methods for creating automated interface transmission between heterogeneous systems in an enterprise ecosystem
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN109240673B (en) Method and system for dynamically loading and updating view based on react-native
CN114301970B (en) Service calling method, device, electronic equipment and storage medium
CN110308999B (en) Method for dynamically sharing dependency package between applications, storage medium and mobile terminal
CN110825622A (en) Software testing method, device, equipment and computer readable medium
CN115061678A (en) Code compiling method and client based on browser proxy service
US8943476B2 (en) System and method to in-line script dependencies
CN113835842A (en) Service design method and system for simultaneously supporting monomer architecture and micro-service architecture
US20090222471A1 (en) Database exploration for building wireless component applications
US20230385075A1 (en) Networked Universal Code Package Provider
CN111026388B (en) Method for adapting to order receiving application and payment middleware

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant