CN111369237B - Data processing method and device and computer storage medium - Google Patents

Data processing method and device and computer storage medium Download PDF

Info

Publication number
CN111369237B
CN111369237B CN202010129447.4A CN202010129447A CN111369237B CN 111369237 B CN111369237 B CN 111369237B CN 202010129447 A CN202010129447 A CN 202010129447A CN 111369237 B CN111369237 B CN 111369237B
Authority
CN
China
Prior art keywords
format
data
transaction data
target
node
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
CN202010129447.4A
Other languages
Chinese (zh)
Other versions
CN111369237A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010129447.4A priority Critical patent/CN111369237B/en
Publication of CN111369237A publication Critical patent/CN111369237A/en
Application granted granted Critical
Publication of CN111369237B publication Critical patent/CN111369237B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention provides a data processing method, a data processing device and a computer storage medium, wherein the method is applied to a user terminal, and a decentralization application runs on the user terminal, and the method comprises the following steps: acquiring transaction data submitted by the decentralizing application, wherein the data format of the transaction data is a first format; converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format; and sending the transaction data in the target format to a node of a blockchain network, so that the node converts the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by an intelligent contract of the node. By adopting the method and the device, the data volume transmitted in the cross-language communication process between the decentralised application and the intelligent contract can be reduced, and the accuracy of data conversion can be improved.

Description

Data processing method and device and computer storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method, apparatus, and computer storage medium.
Background
With the development of blockchain technology, development and application of decentralization application are attracting attention. Typically, the decentralised application may run on a user's personal device. Generally, the programming language of the decentralised application and the programming language of the intelligent contracts of the nodes of the blockchain network are two different languages. Communication in different code languages requires a conversion of data, i.e. a communication format is agreed upon if communication between the de-centralized application and the smart contract is to be performed. The current communication format is generally json format. However, json formatted data is text formatted data, which results in a relatively large amount of data being transferred across the process of language communication between the de-centralized application and the smart contract. In addition, the json-based method is easy to cause analysis errors in the conversion process, and the data analyzed by the same text can be different, for example, some special characters can be filtered in the conversion process, so that the accuracy of data conversion is reduced.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a device, electronic equipment and a computer storage medium, which can reduce the data volume transmitted in a cross-language communication process between an application with decentralization and an intelligent contract and can also improve the accuracy of data conversion.
In a first aspect, an embodiment of the present invention provides a data processing method, applied to a user terminal, where an application for decentralizing is running on the user terminal, the method includes:
acquiring transaction data submitted by the decentralizing application, wherein the data format of the transaction data is a first format;
converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format;
and sending the transaction data in the target format to a node of a blockchain network, so that the node converts the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by an intelligent contract of the node.
In a second aspect, an embodiment of the present invention further provides a data processing method, applied to a node of a blockchain network, where the method includes:
receiving transaction data in a target format sent by a user terminal, wherein the transaction data in the target format is obtained by converting a data format of transaction data submitted by a decentralizing application by the user terminal, and the target format comprises a binary format;
Converting the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by the intelligent contract of the node;
and calling the intelligent contract to process the transaction data in the second format.
In a third aspect, an embodiment of the present invention provides a data processing apparatus, which is applied to a user terminal, where a decentralizing application is running on the user terminal, and the apparatus includes:
the acquisition module is used for acquiring transaction data submitted by the decentralization application, wherein the data format of the transaction data is a first format;
the conversion module is used for converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format;
the communication module is used for sending the transaction data in the target format to the nodes of the blockchain network, so that the nodes convert the data format of the transaction data in the target format to obtain transaction data in a second format, and the second format is a data format supported by the intelligent contracts of the nodes.
In a fourth aspect, an embodiment of the present invention further provides a data processing apparatus, applied to a node of a blockchain network, the apparatus including:
The communication module is used for receiving transaction data in a target format sent by the user terminal, wherein the transaction data in the target format is obtained by converting a data format of the transaction data submitted by the decentralizing application by the user terminal, and the target format comprises a binary format;
the conversion module is used for converting the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by the intelligent contract of the node;
and the processing module is used for calling the intelligent contract to process the transaction data in the second format.
In a fifth aspect, an embodiment of the present invention provides a user terminal, including: a processor, an output device, and a memory; the memory is used for storing program instructions; the processor invokes the program instructions for implementing the aforementioned data processing method.
In a sixth aspect, an embodiment of the present invention provides a node of a blockchain network, including: a processor, an input device, and a memory; the memory is used for storing program instructions; the processor invokes the program instructions for implementing the aforementioned data processing method.
In a seventh aspect, an embodiment of the present invention provides a computer storage medium having stored therein program instructions for implementing the foregoing data processing method when executed.
In summary, the user terminal may obtain the transaction data in the first format submitted by the decentralizing application, and convert the data format of the transaction data to obtain the transaction data in the target format, where the target format includes a binary format; the user terminal sends the transaction data in the target format to the nodes of the blockchain network, so that the nodes convert the data format of the transaction data in the target format to obtain the transaction data in the second format.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1A is a schematic diagram of a data processing system according to an embodiment of the present invention;
FIG. 1B is a schematic diagram of a blockchain provided by an embodiment of the present invention;
FIG. 1C is a block generation process according to an embodiment of the present invention;
FIG. 1D is a schematic diagram of a game item purchase page provided by an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a data processing method according to an embodiment of the present invention;
FIG. 3 is a flowchart of another data processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another data processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a user terminal according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a block chain node according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
Referring to the data processing system shown in FIG. 1A, the data processing system may include a blockchain network 100, and a user terminal 102. Wherein:
The blockchain network 100 refers to a network for data sharing from node to node. The blockchain network may include a plurality of nodes 101, and the plurality of nodes 101 may refer to individual clients in the blockchain network. Each node 101 may receive input information while operating normally and maintain shared data within the blockchain network based on the received input information. In order to ensure information intercommunication in the blockchain network, information connection can exist between every two nodes in the blockchain network, and information transmission can be carried out between the nodes through the information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all nodes in the blockchain network are consistent.
The user terminal 102 may access the blockchain network and communicate with nodes in the blockchain network, such as sending transaction data in a target format to nodes in the blockchain network. Wherein the user terminal 102 has a decentralised application (Decentralized Application, DApp) running thereon. The decentralised application may also be referred to as a distributed application. For example, the decentralizing application may be a game application, and embodiments of the present invention are not limited. The user terminals 102 include, but are not limited to, smart terminals such as smartphones, tablets, desktops, and the like.
It should be noted that the number of nodes shown in fig. 1A is merely illustrative, and any number of nodes may be deployed according to actual needs.
For each node in the blockchain network, the node identification corresponding to the node identification is provided, and each node in the blockchain network can store the node identifications of other nodes in the blockchain network so as to broadcast the generated blocks to other nodes in the blockchain network according to the node identifications of the other nodes. Each node can maintain a node identification list shown in the following table, and the node names and the node identifications are correspondingly stored in the node identification list. The node identifier may be an IP (Internet Protocol, protocol of interconnection between networks) address, and any other information that can be used to identify the node, and the IP address is only illustrated in table 1.
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the blockchain network stores one and the same blockchain. The blockchain is composed of a plurality of blocks, referring to fig. 1B, the blockchain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the father block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
When each block in the blockchain is generated, referring to fig. 1C, when the node where the blockchain is located receives input information, checking the input information, after the checking is completed, storing the input information into a memory pool, and updating a hash tree used for recording the input information; then, updating the update time stamp to the time of receiving the input information, trying different random numbers, and calculating the characteristic value for a plurality of times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein SHA256 is a eigenvalue algorithm used to calculate eigenvalues; version (version number) is version information of the related block protocol in the block chain; the prev_hash is the block header characteristic value of the parent block of the current block; the merkle_root is a characteristic value of input information; ntime is the update time of the update timestamp; the nbits is the current difficulty, is a fixed value in a period of time, and is determined again after exceeding a fixed period of time; x is a random number; TARGET is a eigenvalue threshold that can be determined from nbits.
Thus, when the random number meeting the formula is calculated, the information can be correspondingly stored to generate the block head and the block main body, and the current block is obtained. And then, the node where the blockchain is located sends the newly generated blocks to other nodes in the blockchain network where the newly generated blocks are located according to the node identifications of other nodes in the blockchain network, the other nodes verify the newly generated blocks, and the newly generated blocks are added into the blockchain stored in the newly generated blocks after the verification is completed.
The intelligent contract is a code implementation for executing when a certain condition is met, a developer can define contract logic through a programming language, issue the contract logic to a blockchain (intelligent contract registration), call a key or trigger execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide functions of upgrading and logging off the intelligent contract.
Based on the data processing system shown in fig. 1A, an embodiment of the present invention provides a data processing scheme. In this data processing scheme, the user terminal 102 may obtain transaction data submitted by the de-centralized application, the transaction data having a data format that is the first format. The first format may be a data format supported by a programming language used by the de-centralized application. The user terminal 102 converts the data format of the transaction data to obtain transaction data in a target format, the target format comprising a binary format. For example, the target format may be a protobuf format. Wherein, the protobuf format can be abbreviated as pb format. The ProtoBuf may be written as ProtoBuf, the corresponding english full name may be Protocol Buffer, and the corresponding shorthand may be PB. That is, PB format may refer to PB format. The user terminal 102 sends transaction data in the target format to the node 101 of the blockchain network. When receiving the data in the target format sent by the user terminal 102, the node 101 may convert the data format of the transaction data in the target format to obtain transaction data in a second format, where the second format is a data format supported by the smart contract of the node 101, that is, the second format is a data format supported by a programming language used by the smart contract. Node 101 may invoke the smart contract to process the transaction data in the second format. The process realizes the process of cross-language communication between the decentralised application and the intelligent contract through the conversion of the target format, reduces the data quantity transmitted in the cross-language communication process, and can improve the accuracy of data conversion compared with a json-based method in the prior art because the target format comprises a binary format.
The data processing scheme provided by the embodiment of the invention is described below by taking a scene that a user purchases game props as an example.
In one application scenario, user a installs DApp1 on a smart phone, DApp1 is a game application that uses the programming language JAVA and node 101's smart contract uses the programming language c++. User A may enter the game prop purchase page of DApp1 as shown in FIG. 1D, and may select a game prop included in the game prop purchase page, and click a purchase button corresponding to the game prop. After the user clicks the purchase button, the smart phone may detect a purchase request submitted by DApp1 for the game prop, where the data format of the purchase request is in the first format, that is, the first format is a JAVA-supported data format. The smart phone may convert the data format of the purchase request to obtain a purchase request in PB format, and send the purchase request in PB format to the node 101. After receiving the PB format purchase request, the node 101 may convert the data format of the PB format purchase request to obtain a purchase request in a second format, where the second format is a data format supported by the smart contract of the node 101, that is, the second format is a data format supported by c++. Node 101 may invoke a smart contract to execute game item purchase logic in accordance with the purchase request.
It should be noted that, the embodiments of the present invention may be applied to other application scenarios besides the application scenarios described above, and the embodiments of the present invention are not limited to this.
It should be further noted that, in addition to being executed by the ue, the data processing scheme according to the embodiments of the present invention may also be executed by a service device capable of communicating with the blockchain network, for example, the service device may be a centralized service device. The service device may have the decentralized application running thereon.
Based on the above description, the embodiment of the invention provides a data processing method, which can be applied to a user terminal, and the user terminal runs a decentralizing application. Referring to fig. 2, the method specifically may include the following steps:
s201, acquiring transaction data submitted by the decentralization application, wherein the data format of the transaction data is a first format.
The transaction data may refer to any one or more of the data to be sent to the nodes of the blockchain network. The transaction data may be generated by the de-centralized application, may be obtained by user input, or the like, and embodiments of the present invention are not limited.
In one embodiment, the data to be sent to the blockchain network node may specifically refer to data that needs to be stored or processed by a node of the blockchain network. Wherein the data includes, but is not limited to, request, instruction, service data, etc., and the embodiments of the present invention are not limited.
In one embodiment, the user terminal may obtain transaction data submitted by the de-centralized application upon detecting the transaction data submitted by the de-centralized application.
S202, converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format.
In step S201-step S202, the user terminal may obtain transaction data submitted by the decentralized application, and convert the data format of the transaction data to obtain transaction data in a target format. Because the target format comprises a binary format, compared with the json format adopted in the prior art, the embodiment of the invention adopts the target format mode, so that the data volume transmitted in the cross-language communication process of the decentralizing application and the intelligent contract can be reduced.
In one embodiment, the process of converting the data format of the transaction data by the user terminal to obtain the transaction data in the target format may be that the user terminal converts the data format of the transaction data according to a preset first format conversion rule to obtain the transaction data in the target format.
In one embodiment, the first format conversion rule may include a rule set according to a serialization tool library. When the first format conversion rule includes a rule set according to the serialization tool library, the user terminal converts the data format of the transaction data according to the preset first format conversion rule, and the process of obtaining the transaction data in the target format may be as follows: the user terminal calls a serialization tool library of the decentralization application to conduct serialization processing on the transaction data to obtain serialization data corresponding to the transaction data, and the serialization data is used as the transaction data in a target format obtained after data format conversion of the transaction data. Wherein the serialization tool library of the de-centralization application may include conversion rules between data in the first format and data in the target format. Specifically, the user terminal may invoke a conversion rule between the data in the first format and the data in the target format included in the serialization tool library of the decentralization application, and perform serialization processing on the transaction data to obtain serialized data corresponding to the transaction data. In one embodiment, when the target format is a PB format, the serialization tool library may be a PB library. That is, when the target format is pb format, the serialization tool library may be a protbufb library, i.e., pb library.
S203, transmitting the transaction data in the target format to a node of a blockchain network, so that the node converts the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by an intelligent contract of the node.
The user terminal may send transaction data in the target format to a node of the blockchain network. The node may receive the transaction data in the target format and convert the data format of the transaction data in the target format to obtain the transaction data in the second format.
In one embodiment, it is contemplated that a user terminal may run multiple decentralised applications that may correspond to different blockchain networks. To accurately transmit data, the user terminal may determine a blockchain network to which the de-centralized application corresponds and then transmit transaction data in the target format to nodes of the blockchain network.
In one embodiment, the user terminal may include a profile corresponding to the de-centralized application. The user terminal may determine a blockchain network corresponding to the decentralised application according to the blockchain network information included in the configuration file of the decentralised application, and then send the transaction data in the target format to a node of the blockchain network.
In one embodiment, the user terminal may perform the following operations in addition to converting the data format of the transaction data submitted by the distributed application through steps S201-S203: the user terminal receives target data in a target format sent by a node, wherein the target data in the target format is obtained by converting the data format of the target data in a second format by the node; and the user terminal converts the data format of the target data in the target format to obtain the target data in the first format. Wherein the target data refers to any one or more data to be sent to the user terminal. For example, the target data may be a query result obtained by the node in response to a data query request sent by the user terminal.
In one embodiment, the user terminal may send a data query request to the node, and receive a query result in a target format sent by the node in response to the data query request, where the query result in the target format is obtained by converting a data format of the query result in the second format by the node; the user terminal converts the data format of the query result in the target format to obtain the query result in the first format, wherein the first format is the data format supported by the decentralizing application. This process will be further described in connection with the operations performed by the nodes.
In one embodiment, the user terminal may send a data query request to the node, and the node may obtain a query result in response to the data query request, the query result being in the second format. In one embodiment, a node may obtain query results from a blockchain in response to the data query request. The node can convert the data format of the query result to obtain the query result in the target format. That is, the query result in the target format is obtained by converting the data format of the query result in the second format by the node. The node may send the query result in the target format to the user terminal. The user terminal may receive a query result in a target format sent by the node in response to the data query request, and convert a data format of the query result in the target format to obtain a query result in a first format.
In one embodiment, the process of converting the data format of the target data in the target format by the user terminal to obtain the target data in the first format may call the serialization tool library of the deserialization application for the user terminal to perform deserialization processing on the target data in the target format to obtain the deserialized data corresponding to the target data in the target format; the user terminal takes the reverse-sequence data corresponding to the target data in the target format as the target data in the first format obtained after the data format conversion of the target data in the target format.
It can be seen that in the embodiment shown in fig. 2, the user terminal may obtain the transaction data in the first format submitted by the decentralized application, and convert the data format of the transaction data to obtain the transaction data in the target format, where the target format includes a binary format; the user terminal sends the transaction data in the target format to the nodes of the blockchain network, so that the nodes convert the data format of the transaction data in the target format to obtain the transaction data in the second format.
In one embodiment, the embodiment of the invention also provides another data processing method which can be applied to nodes of a blockchain network. Referring to fig. 3, the method specifically may include the following steps:
s301, receiving transaction data in a target format sent by a user terminal, wherein the transaction data in the target format is obtained by converting a data format of the transaction data submitted by a decentralizing application by the user terminal, and the target format comprises a binary format.
The user terminal may send transaction data in a target format to a node of the blockchain network, and the node may receive the transaction data in the target format sent by the user terminal.
In one embodiment, the user terminal may obtain transaction data submitted by the decentralized application, where the transaction data has a data format that is a first format, and then convert the data format of the transaction data to obtain transaction data in a target format, where the target format includes a binary format, so that the transaction data in the target format is sent to a node of the blockchain network, and the node may receive the data in the target format sent by the user terminal.
S302, converting the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is the data format supported by the intelligent contract of the node.
S303, calling the intelligent contract to process the transaction data in the second format.
In step S302-step S303, the node converts the data format of the transaction data in the target format, and the process of obtaining the transaction data in the second format may be that the user terminal converts the data format of the transaction data in the target format according to a preset second format conversion rule to obtain the transaction data in the second format, and then invokes the intelligent contract to process the transaction data in the second format.
In one embodiment, the second format conversion rule may include a rule set according to a serialization tool library. When the second format conversion rule includes a rule set according to the serialization tool library, the user terminal converts the data format of the transaction data in the target format according to the preset second format conversion rule, and the process of obtaining the transaction data in the second format may be as follows: the node calls a serialization tool library of the node to perform deserialization processing on the transaction data in the target format to obtain deserialized data, and the deserialized data is used as the transaction data in the second format obtained after the data format of the transaction data in the target format is converted. Wherein the serialization tool library of the node may include conversion rules between the data in the second format and the data in the target format. Specifically, the user terminal may invoke a conversion rule between the second format data and the target format data included in the serialization tool library of the node, and perform deserialization processing on the target format transaction data to obtain deserialized data. In one embodiment, when the target format is a PB format, the serialization tool library may be a PB library. That is, when the target format is pb format, the serialization tool library may be a protbufb library, i.e., pb library.
In one embodiment, in addition to converting the data format of the transaction data in the target format through step S301-step S303, the node may perform the following operations: the node acquires target data in a second format, converts the data format of the target data to obtain target data in the target format, and sends the target data in the target format to the user terminal. The target data may refer to any one or more data to be transmitted to the user terminal. For example, the target data may be a query result obtained by the node in response to the data query request.
In one embodiment, a node may receive a data query request sent by a user terminal; the node responds to the data query request to acquire a query result in a second format from the blockchain; the node converts the data format of the query result to obtain a query result in a target format; the node sends the query result in the target format to the user terminal, so that the user terminal converts the data format of the query result in the target format to obtain the query result in the first format, and the first format is the data format supported by the decentralizing application. This process will be further described in connection with the operations performed by the user terminal.
In one embodiment, the user terminal may send a data query request to the node, and the node may obtain a query result in response to the data query request, the query result being in the second format. For example, a node may obtain query results from a blockchain in response to the data query request. The node can convert the data format of the query result to obtain the query result in the target format. That is, the query result in the target format is obtained by converting the data format of the query result in the second format by the node. The node may send the query result in the target format to the user terminal. The user terminal may receive a query result in a target format sent by the node in response to the data query request, and convert a data format of the query result in the target format to obtain a query result in a first format.
In one embodiment, the process of converting the data format of the target data by the node to obtain the target data in the target format may call the serialization tool library of the node for serializing the target data by the node to obtain the serialized data corresponding to the target data; the node uses the serialized data corresponding to the target data as target data in a target format obtained after the data format of the target data is converted.
In the embodiment shown in fig. 3, the node may receive the transaction data in the target format sent by the user terminal, and convert the data format of the transaction data in the target format to obtain the transaction data in the second format, so as to invoke the intelligent contract to process the transaction data in the second format, which implements a cross-language communication process between the decentralized application and the intelligent contract, reduces the data amount transmitted in the communication process, and improves the accuracy of data conversion.
Based on the description of the method embodiment, in one embodiment, the embodiment of the present invention further provides a schematic structural diagram of a data processing apparatus as shown in fig. 4. The data processing device may be applied to the aforementioned user terminal on which the de-centralised application is running. As shown in fig. 4, the data processing apparatus in the embodiment of the present invention may include:
the obtaining module 401 is configured to obtain transaction data submitted by the decentralized application, where a data format of the transaction data is a first format.
The conversion module 402 is configured to convert a data format of the transaction data to obtain transaction data in a target format, where the target format includes a binary format.
The communication module 403 is configured to send the transaction data in the target format to a node of a blockchain network, so that the node converts a data format of the transaction data in the target format to obtain transaction data in a second format, where the second format is a data format supported by an intelligent contract of the node.
In an alternative embodiment, the conversion module 402 converts the data format of the transaction data to obtain the transaction data in the target format, specifically, invokes the serialization tool library of the decentralization application to perform serialization processing on the transaction data to obtain the serialization data corresponding to the transaction data; and taking the serialized data as the transaction data in the target format obtained after the data format of the transaction data is converted.
In an alternative embodiment, the serialization tool library comprises a protobuf library.
In an optional implementation manner, the communication module 403 is further configured to send a data query request to the node, and receive a query result in a target format sent by the node in response to the data query request, where the query result in the target format is obtained by converting, by the node, a data format of the query result in the second format.
In an alternative embodiment, the conversion module 402 is further configured to convert a data format of the query result in the target format to obtain a query result in a first format, where the first format is a data format supported by the decentralized application.
It can be seen that in the embodiment shown in fig. 4, the data processing apparatus may acquire the transaction data in the first format submitted by the decentralized application, and convert the data format of the transaction data to obtain the transaction data in the target format, where the target format includes a binary format; the data processing device sends the transaction data in the target format to the nodes of the blockchain network, so that the nodes convert the data format of the transaction data in the target format to obtain the transaction data in the second format, the process realizes a cross-language communication process between the decentralizing application and the intelligent contract, the data volume transmitted in the communication process is reduced, and the accuracy of data conversion is improved.
In one embodiment, the embodiment of the present invention further provides a schematic structural diagram of a data processing apparatus as shown in fig. 5. The data processing apparatus may be applied to the aforementioned nodes of a blockchain network. As shown in fig. 5, the data processing apparatus in the embodiment of the present invention may include:
The communication module 501 is configured to receive transaction data in a target format sent by a user terminal, where the transaction data in the target format is obtained by converting a data format of transaction data submitted by a decentralizing application by the user terminal, and the target format includes a binary format.
The conversion module 502 is configured to convert a data format of the transaction data in the target format to obtain transaction data in a second format, where the second format is a data format supported by the intelligent contract of the node.
And a processing module 503, configured to invoke the smart contract to process the transaction data in the second format.
In an alternative embodiment, the conversion module 502 converts the data format of the transaction data in the target format to obtain the transaction data in the second format, specifically, invokes the serialization tool library of the node to perform deserialization processing on the transaction data in the target format to obtain deserialized data; and converting the reverse-sequence data serving as the data format of the transaction data in the target format to obtain transaction data in a second format.
In an alternative embodiment, the processing module 503 is further configured to receive, through the communication module 501, a data query request sent by the user terminal; acquiring a query result in a second format from a blockchain in response to the data query request; converting the data format of the query result to obtain a query result in a target format; and sending the query result in the target format to the user terminal through the communication module 501, so that the user terminal converts the data format of the query result in the target format to obtain the query result in the first format, wherein the first format is the data format supported by the decentralizing application.
In the embodiment shown in fig. 5, the data processing device may receive the transaction data in the target format sent by the user terminal, and convert the data format of the transaction data in the target format to obtain the transaction data in the second format, so as to call the intelligent contract to process the transaction data in the second format, which implements a cross-language communication process between the decentralized application and the intelligent contract, reduces the data amount transmitted in the communication process, and improves the accuracy of data conversion.
Fig. 6 is a schematic structural diagram of a ue according to an embodiment of the present invention. The user terminal in the present embodiment as shown in fig. 6 may include: one or more processors 601, one or more input devices 602, one or more output devices 603, and memory 604. The processor 601, input device 602, output device 603, and memory 604 are connected by a bus or other means. Wherein the input device 502 may be an optional device. The input device 602, the output device 603 may be a standard wired or wireless communication interface. In one embodiment, the input device 602 may also include a touch screen, audio recorder, or the like. The output device 603 may also include a display screen, speakers, etc. In one embodiment, the touch screen and display screen may be replaced with a touch display screen. The memory 604 is used for storing a computer program comprising program instructions, and the processor 601 is used for executing the program instructions stored in the memory 604 to implement the various methods referred to above.
The memory 604 may include volatile memory (RAM), such as random-access memory (RAM); the memory 604 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Solid State Drive (SSD), etc.; memory 604 may also include a combination of the types of memory described above.
In one embodiment, the processor 601 may be a central processing unit (Central Processing Unit, CPU) which may also be other general purpose processors, i.e. microprocessors or any conventional processor. Memory 604 may include read-only memory and random access memory. Accordingly, the processor 601 and the memory 604 are not limited herein.
In one embodiment, the processor 601 invokes program instructions stored in the memory 604, for obtaining transaction data submitted by the decentralized application, the transaction data having a data format that is a first format; converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format; and sending the transaction data in the target format to a node of a blockchain network through an output device 603, so that the node converts the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by an intelligent contract of the node.
In one embodiment, when converting the data format of the transaction data to obtain the transaction data in the target format, the processor 601 invokes the program instruction stored in the memory 604, and is specifically configured to invoke the serialization tool library of the decentralization application to perform serialization processing on the transaction data, so as to obtain serialized data corresponding to the transaction data; and taking the serialized data as the transaction data in the target format obtained after the data format of the transaction data is converted.
In one embodiment, the serialization tool library comprises a protobuf library.
In one embodiment, the processor 601 invokes program instructions stored in the memory 604, and is further configured to send a data query request to the node via the output device 603; receiving a target format query result sent by the node in response to the data query request through an input device 602, wherein the target format query result is obtained by converting a data format of a second format query result by the node; and converting the data format of the query result in the target format to obtain a query result in a first format, wherein the first format is the data format supported by the decentralizing application.
It should be noted that, the specific operation process of the user terminal and the unit described above may refer to the related description in the foregoing embodiments, which is not repeated herein.
Referring to fig. 7, a schematic structural diagram of a node of a blockchain network according to an embodiment of the present invention is shown. The nodes of the blockchain network in this embodiment as shown in fig. 7 may include: one or more processors 701, one or more input devices 702, one or more output devices 703, and memory 704. The processor 701, input device 702, output device 703, and memory 704 are connected by a bus or other means. The input device 702, the output device 703 may be standard wired or wireless communication interfaces. Wherein the output device 703 is an optional device. The memory 704 is configured to store a computer program comprising program instructions, and the processor 701 is configured to execute the program instructions stored in the memory 704, so as to implement the various methods referred to above.
The memory 704 may include volatile memory (RAM), such as random-access memory (RAM); the memory 704 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Solid State Drive (SSD), etc.; memory 704 may also include combinations of the above types of memory.
In one embodiment, the processor 701 may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, i.e., a microprocessor or any conventional processor. Memory 704 may include read only memory and random access memory. Accordingly, the processor 701 and the memory 704 are not limited herein.
In one embodiment, the processor 701 invokes program instructions stored in the memory 704, for receiving, via the input device 702, transaction data in a target format sent by a user terminal, the transaction data in the target format being obtained by the user terminal converting a data format of transaction data submitted by a decentralizing application, the target format including a binary format; converting the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by the intelligent contract of the node; and calling the intelligent contract to process the transaction data in the second format.
In one embodiment, when converting the data format of the transaction data in the target format to obtain the transaction data in the second format, the processor 701 invokes the program instruction stored in the memory 704, and is specifically configured to invoke the serialization tool library of the node to perform deserialization processing on the transaction data in the target format to obtain deserialized data; and converting the reverse-sequence data serving as the data format of the transaction data in the target format to obtain transaction data in a second format.
In one embodiment, the processor 701 invokes program instructions stored in the memory 704, and is further configured to receive a data query request sent by the user terminal through the input device 702; acquiring a query result in a second format from a blockchain in response to the data query request; converting the data format of the query result to obtain a query result in a target format; and sending the query result in the target format to the user terminal through the output device 703, so that the user terminal converts the data format of the query result in the target format to obtain a query result in a first format, wherein the first format is the data format supported by the decentralizing application.
It should be noted that, the specific working process of the nodes and units of the blockchain network described above may refer to the relevant description in the foregoing embodiments, which is not repeated herein.
Those skilled in the art will appreciate that all or part of the processes in the methods of the embodiments described above may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a computer storage medium, and the computer storage medium may be a computer readable storage medium, where the program when executed may include processes in the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The above disclosure is only a few examples of the present invention, and it is not intended to limit the scope of the present invention, but it is understood by those skilled in the art that all or a part of the above embodiments may be implemented and equivalent changes may be made in the claims of the present invention.

Claims (8)

1. A data processing method, applied to a user terminal, the method comprising:
acquiring transaction data submitted by a decentralizing application, wherein the data format of the transaction data is a first format, and the decentralizing application is any one of a plurality of decentralizing applications running on the user terminal;
converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format;
acquiring blockchain network information included in the configuration file of the decentralizing application, and determining a blockchain network corresponding to the decentralizing application according to the blockchain network information;
transmitting the transaction data in the target format to a node of the blockchain network corresponding to the decentralizing application, so that the node converts the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by an intelligent contract of the node;
Sending a data query request to the node; receiving a target format query result sent by the node in response to the data query request, wherein the target format query result is obtained by converting the data format of a second format query result by the node;
and converting the data format of the query result in the target format to obtain a query result in a first format, wherein the first format is the data format supported by the decentralizing application.
2. The method of claim 1, wherein converting the data format of the transaction data to obtain the transaction data in the target format comprises:
calling a serialization tool library of the decentralization application to conduct serialization processing on the transaction data to obtain serialization data corresponding to the transaction data;
and taking the serialized data as the transaction data in the target format obtained after the data format of the transaction data is converted.
3. The method of claim 2, wherein the serialization tool library comprises a protobuf library.
4. A data processing method for nodes of a blockchain network, the method comprising:
Receiving transaction data in a target format, which is sent by a user terminal after determining a blockchain network corresponding to a decentralizing application according to blockchain network information included in a configuration file of the decentralizing application, wherein the transaction data in the target format is obtained by converting a data format of the transaction data submitted by the decentralizing application by the user terminal, the target format comprises a binary format, and the decentralizing application is any one of a plurality of decentralizing applications operated by the user terminal;
converting the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by the intelligent contract of the node;
invoking the intelligent contract to process the transaction data in the second format;
receiving a data query request sent by the user terminal; acquiring a query result in a second format from a blockchain in response to the data query request;
and converting the data format of the query result to obtain a query result in a target format, and sending the query result in the target format to the user terminal, so that the user terminal converts the data format of the query result in the target format to obtain a query result in a first format, wherein the first format is the data format supported by the decentralizing application.
5. The method of claim 4, wherein converting the data format of the transaction data in the target format to obtain the transaction data in the second format comprises:
invoking a serialization tool library of the node to perform deserialization processing on the transaction data in the target format to obtain deserialized data;
and converting the reverse-sequence data serving as the data format of the transaction data in the target format to obtain transaction data in a second format.
6. A data processing apparatus for use in a user terminal, the apparatus comprising:
the system comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring transaction data submitted by a decentralizing application, the data format of the transaction data is a first format, and the decentralizing application is any one of a plurality of decentralizing applications running on the user terminal;
the conversion module is used for converting the data format of the transaction data to obtain transaction data in a target format, wherein the target format comprises a binary format;
the acquisition module is further used for acquiring the blockchain network information included in the configuration file of the decentralizing application and determining a blockchain network corresponding to the decentralizing application according to the blockchain network information;
The communication module is used for sending the transaction data in the target format to the node of the block chain network corresponding to the decentralization application, so that the node converts the data format of the transaction data in the target format to obtain transaction data in a second format, and the second format is a data format supported by the intelligent contract of the node;
the communication module is further used for sending a data query request to the node; receiving a target format query result sent by the node in response to the data query request, wherein the target format query result is obtained by converting the data format of a second format query result by the node;
the conversion module is further configured to convert a data format of the query result in the target format to obtain a query result in a first format, where the first format is a data format supported by the decentralized application.
7. A data processing apparatus for use in a node of a blockchain network, the apparatus comprising:
the communication module is used for receiving transaction data in a target format, which is obtained by converting the data format of the transaction data submitted by the decentralizing application by the user terminal after the user terminal determines a blockchain network corresponding to the decentralizing application according to blockchain network information included in a configuration file of the decentralizing application, wherein the target format comprises a binary format, and the decentralizing application is any one of a plurality of decentralizing applications operated by the user terminal;
The conversion module is used for converting the data format of the transaction data in the target format to obtain transaction data in a second format, wherein the second format is a data format supported by the intelligent contract of the node;
the processing module is used for calling the intelligent contract to process the transaction data in the second format;
the communication module is further used for receiving a data query request sent by the user terminal;
the processing module is further used for responding to the data query request and acquiring a query result in a second format from a blockchain; converting the data format of the query result to obtain a query result in a target format;
the communication module is further configured to send the query result in the target format to the user terminal, so that the user terminal converts a data format of the query result in the target format to obtain a query result in a first format, where the first format is a data format supported by the decentralized application.
8. A computer storage medium having stored therein program instructions which, when executed, are adapted to carry out the method of any of claims 1-5.
CN202010129447.4A 2020-02-28 2020-02-28 Data processing method and device and computer storage medium Active CN111369237B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010129447.4A CN111369237B (en) 2020-02-28 2020-02-28 Data processing method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010129447.4A CN111369237B (en) 2020-02-28 2020-02-28 Data processing method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN111369237A CN111369237A (en) 2020-07-03
CN111369237B true CN111369237B (en) 2023-07-14

Family

ID=71212632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010129447.4A Active CN111369237B (en) 2020-02-28 2020-02-28 Data processing method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN111369237B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148674B (en) * 2020-10-12 2023-12-19 平安科技(深圳)有限公司 Log data processing method, device, computer equipment and storage medium
CN112511621B (en) * 2020-11-26 2022-12-30 青岛海尔科技有限公司 Data transmission method and device, storage medium, and electronic device
CN113094429B (en) * 2021-03-19 2022-05-24 杭州复杂美科技有限公司 Data processing method, data query method, computer device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060036A (en) * 2016-05-26 2016-10-26 布比(北京)网络技术有限公司 Decentralized consenting method and apparatus
CN107239479A (en) * 2017-03-28 2017-10-10 阿里巴巴集团控股有限公司 A kind of method and device of data storage and inquiry based on block chain
CN109359971A (en) * 2018-08-06 2019-02-19 阿里巴巴集团控股有限公司 Block chain method of commerce and device, electronic equipment
CN109691013A (en) * 2018-08-16 2019-04-26 区链通网络有限公司 Block chain communication method between nodes, device and storage medium, block catenary system
CN109698752A (en) * 2018-11-29 2019-04-30 南京南瑞信息通信科技有限公司 A kind of ERP System based on block chain
CN110008263A (en) * 2019-02-20 2019-07-12 顺丰科技有限公司 Dynamic organization's extended method and system under Hyperledger fabric cluster mode

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180285996A1 (en) * 2017-04-03 2018-10-04 FutureLab Consulting Inc. Methods and system for managing intellectual property using a blockchain
US10637645B2 (en) * 2017-05-11 2020-04-28 Microsoft Technology Licensing, Llc Cryptlet identity
CN110609679B (en) * 2019-09-17 2024-04-02 腾讯科技(深圳)有限公司 Data processing method, device, computer readable storage medium and computer equipment
CN110602125B (en) * 2019-09-23 2021-04-13 腾讯科技(深圳)有限公司 Data processing method, device, terminal and storage medium
CN110569251A (en) * 2019-09-23 2019-12-13 腾讯科技(深圳)有限公司 Data processing method, related equipment and computer readable storage medium
CN110599349A (en) * 2019-09-24 2019-12-20 腾讯科技(深圳)有限公司 Data processing method based on block chain network, related equipment and storage medium
CN110599182B (en) * 2019-09-27 2023-08-22 腾讯科技(深圳)有限公司 Resource management method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060036A (en) * 2016-05-26 2016-10-26 布比(北京)网络技术有限公司 Decentralized consenting method and apparatus
CN107239479A (en) * 2017-03-28 2017-10-10 阿里巴巴集团控股有限公司 A kind of method and device of data storage and inquiry based on block chain
CN109359971A (en) * 2018-08-06 2019-02-19 阿里巴巴集团控股有限公司 Block chain method of commerce and device, electronic equipment
CN109691013A (en) * 2018-08-16 2019-04-26 区链通网络有限公司 Block chain communication method between nodes, device and storage medium, block catenary system
CN109698752A (en) * 2018-11-29 2019-04-30 南京南瑞信息通信科技有限公司 A kind of ERP System based on block chain
CN110008263A (en) * 2019-02-20 2019-07-12 顺丰科技有限公司 Dynamic organization's extended method and system under Hyperledger fabric cluster mode

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于区块链技术在泛在电力物联网智能设备管理的研究应用;李立 等;《科技资讯》;第17卷(第34期);21-23,25 *

Also Published As

Publication number Publication date
CN111369237A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN111369237B (en) Data processing method and device and computer storage medium
CN111083225B (en) Data processing method and device in Internet of things platform and Internet of things platform
CN111683066B (en) Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium
CN110351325B (en) Data processing method and related equipment
CN109101664B (en) Data transmission method, device, equipment and medium for lightweight node
CN111144402A (en) OCR recognition accuracy calculation method, device, equipment and storage medium
CN110932918A (en) Log data acquisition method and device and storage medium
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
US10554726B1 (en) Remote device drivers for internet-connectable devices
US9313653B2 (en) Information processing device, server device, data communication system, data communication method, and computer-readable storage medium storing data communication program
CN110585724B (en) Method and device for updating form data in game client
CN111651338B (en) System and method for acquiring log formatting time
CN111949862B (en) Method and device for managing business task flow and electronic equipment
CN113923258A (en) Data processing method and data processing system
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN114637531A (en) Method and device for dynamically generating application program interface
CN112416698B (en) Expansion method and device of monitoring system, storage medium and electronic equipment
CN111538651A (en) Interface testing method, device, server and storage medium
CN111290806B (en) Calling method and device of application program interface, computer equipment and storage medium
CN111680475B (en) Data conversion method and device, electronic equipment and storage medium
CN114791996B (en) Information processing method, device, system, electronic equipment and storage medium
CN110191141B (en) Service calling information processing method and device and computer system
CN112311833B (en) Data updating method and device
CN111158928B (en) Distributed system and communication method
CN109376023B (en) Method and equipment for generating calling information and issuing return code group

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