CN112131298B - Data conversion method and device based on block chain - Google Patents

Data conversion method and device based on block chain Download PDF

Info

Publication number
CN112131298B
CN112131298B CN202011308164.2A CN202011308164A CN112131298B CN 112131298 B CN112131298 B CN 112131298B CN 202011308164 A CN202011308164 A CN 202011308164A CN 112131298 B CN112131298 B CN 112131298B
Authority
CN
China
Prior art keywords
data
model
original
producer
original data
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
CN202011308164.2A
Other languages
Chinese (zh)
Other versions
CN112131298A (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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202011308164.2A priority Critical patent/CN112131298B/en
Publication of CN112131298A publication Critical patent/CN112131298A/en
Application granted granted Critical
Publication of CN112131298B publication Critical patent/CN112131298B/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/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
    • 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
    • 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/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present specification provides a block chain-based data conversion method and apparatus; the method is applied to a block chain system and can comprise the following steps: in response to a certificate storing transaction submitted by a data producer, associating original data contained in the certificate storing transaction with a model identifier of a target data model to store onto a block chain, wherein the original data has a corresponding data identifier, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer; and responding to an acquisition transaction containing the data identification submitted by a data user, acquiring the original data and a target data model corresponding to the model identification stored in association with the original data according to the data identification, and converting the original data through the target data model so as to be acquired by the data user.

Description

Data conversion method and device based on block chain
Technical Field
One or more embodiments of the present disclosure relate to the field of block chain technologies, and in particular, to a data conversion method and apparatus based on a block chain.
Background
The block chain technology (also called as distributed book technology) is a decentralized distributed database technology, has the characteristics of decentralization, openness and transparency, no tampering, trustiness and the like, and is suitable for application scenes with high requirements on data reliability.
Disclosure of Invention
In view of the above, one or more embodiments of the present disclosure provide a method and apparatus for data conversion based on a block chain.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, a method for data conversion based on a block chain is provided, where the method is applied to a block chain system, and the method includes:
in response to a certificate storing transaction submitted by a data producer, associating original data contained in the certificate storing transaction with a model identifier of a target data model to store onto a block chain, wherein the original data has a corresponding data identifier, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer;
and responding to an acquisition transaction containing the data identification submitted by a data user, acquiring the original data and a target data model corresponding to the model identification stored in association with the original data according to the data identification, and converting the original data through the target data model so as to be acquired by the data user.
According to a second aspect of one or more embodiments of the present specification, there is provided a block chain-based data uploading method applied to a data producer, the method including:
generating original data in a first format, and determining a target data model for converting the data in the first format into the data in a second format according to the second format negotiated by the data producer and the data consumer in advance, wherein the original data has a corresponding data identifier;
submitting a deposit transaction containing model identifications of the original data and the target data model to a blockchain system, associating the original data and the model identifications to a blockchain by the blockchain system, enabling the blockchain system to respond to an acquisition transaction containing the data identifications submitted by a data user, acquiring the original data and the target data model corresponding to the model identifications of the original data association deposit according to the data identifications, converting the original data through the target data model, and providing the converted original data to the data user.
According to a third aspect of one or more embodiments of the present specification, there is provided a block chain-based data acquisition method applied to a data consumer, the method including:
creating an acquisition transaction containing a data identifier of original data generated by a data producer according to a first format, wherein the original data and a model identifier of a target data model are associated and verified to a block chain, and the target data model is used for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer;
submitting the acquisition transaction to a blockchain system, so that the blockchain system acquires the original data and a target data model corresponding to a model identifier associated with the original data for evidence storage according to the data identifier, and converts the original data through the target data model;
and acquiring the data converted by the block chain system.
According to a fourth aspect of one or more embodiments of the present specification, there is provided a block chain-based data conversion apparatus applied to a block chain system, the apparatus including:
the certificate storing unit is used for responding to certificate storing transaction submitted by a data producer, associating original data contained in the certificate storing transaction with a model identifier of a target data model to store the certificate to a block chain, wherein the original data has a corresponding data identifier, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data of the first format into data of a second format negotiated by the data producer and a data consumer in advance;
and the conversion unit is used for responding to the acquisition transaction containing the data identification submitted by a data user, acquiring the original data and a target data model corresponding to the model identification related to the original data for evidence storage according to the data identification, and converting the original data through the target data model so as to be acquired by the data user.
According to a fifth aspect of one or more embodiments of the present specification, there is provided a blockchain-based data uploading apparatus applied to a data producer, the apparatus including:
the generating unit is used for generating original data in a first format, determining a target data model for converting the data in the first format into the data in a second format according to the second format negotiated in advance by the data producer and the data consumer, wherein the original data has a corresponding data identifier;
and the submitting unit is used for submitting the evidence storage transaction containing the model identifications of the original data and the target data model to a blockchain system, associating the original data and the model identifications to a blockchain by the blockchain system, enabling the blockchain system to respond to the acquisition transaction containing the data identifications submitted by a data user, acquiring the original data and the target data model corresponding to the model identifications of the original data associated with the evidence storage according to the data identifications, converting the original data through the target data model and then providing the converted original data to the data user.
According to a sixth aspect of one or more embodiments of the present specification, there is provided a block chain-based data acquisition apparatus applied to a data user, the apparatus including:
a creation unit that creates an acquisition transaction including a data identifier of original data generated by a data producer in a first format, the original data being associated with a model identifier of a target data model for storing onto a block chain, the target data model being used to convert the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer;
the submitting unit is used for submitting the acquisition transaction to a blockchain system, so that the blockchain system acquires the original data and a target data model corresponding to a model identifier associated with the original data for evidence storage according to the data identifier, and converts the original data through the target data model;
and the acquisition unit acquires the data converted by the block chain system.
According to a seventh aspect of one or more embodiments of the present specification, there is provided an electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method according to any one of the first, second and third aspects by executing the executable instructions.
According to an eighth aspect of one or more embodiments of the present specification, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to any one of the first, second and third aspects.
Drawings
FIG. 1 is an architectural diagram of a blockchain-based data processing system, according to an exemplary embodiment.
Fig. 2 is a flowchart of a data conversion method based on a block chain according to an exemplary embodiment.
FIG. 3 is a schematic diagram of creating an intelligent contract, provided by an exemplary embodiment.
FIG. 4 is a schematic diagram of invoking an intelligent contract, provided by an exemplary embodiment.
Fig. 5 is a flowchart of a data uploading method based on a blockchain according to an exemplary embodiment.
Fig. 6 is a flowchart of a data acquisition method based on a blockchain according to an exemplary embodiment.
FIG. 7 is an interaction diagram of a data producer uploading a data model in accordance with an exemplary embodiment.
FIG. 8 is an interaction diagram for uploading raw data by a data producer according to an exemplary embodiment.
FIG. 9 is an interaction diagram for a data consumer to obtain data, according to an exemplary embodiment.
Fig. 10 is a schematic diagram of an apparatus according to an exemplary embodiment.
Fig. 11 is a block diagram of a data conversion apparatus based on a block chain according to an exemplary embodiment.
Fig. 12 is a schematic structural diagram of another apparatus provided in an exemplary embodiment.
Fig. 13 is a block diagram of a data uploading apparatus based on a blockchain according to an exemplary embodiment.
Fig. 14 is a schematic structural diagram of another apparatus provided in an exemplary embodiment.
Fig. 15 is a block diagram of a data acquisition apparatus based on a block chain according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Data can be transmitted between a data producer and a data consumer, so that the cooperative business between the two is completed. The data producer is used as a source for producing data and is responsible for generating original data; the data user can further process the original data generated by the data producer to realize specific service. For example, The IOT (The Internet of Things) device, as a data producer, may collect data of an environment in a preset dimension, where The data may reflect state information of The environment in The preset dimension; for example, parameters of an environment in dimensions of temperature, sound, humidity, brightness, and the like may be collected by the IOT device. Then, the data user can analyze the state of the environment based on the data generated by the data producer, so that the environment can be monitored and managed according to the analysis result of the data user.
However, there is a problem of non-uniformity of data formats between the data producer and the data consumer, so that the data consumer may not be able to accurately read the original data for analysis. For example, if the data producer and the data consumer are not the same entity, the data consumer may not be able to identify the data format of the data generated by the data producer. As another example, for the same service, multiple different data producers may be involved, and the data formats adopted by the different data producers are different, and the data consumers cannot identify all types of data formats. For another example, a complete event may be completed only by assistance of a plurality of different raw data in the same service, that is, a plurality of different data producers exist, and then the different raw data need to be summarized to obtain summarized data in a standard format; for example, fire alarm needs data collected by various devices such as temperature, smoke, spray heads and the like to assist completion.
The present specification aims to provide a data processing scheme based on a block chain, which provides format standardized data to be analyzed and processed by a data user, thereby solving the problem of data format compatibility, helping the data user to quickly process data, and improving the data analysis efficiency of the data user.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an architecture of a data processing system based on a blockchain according to an exemplary embodiment. As shown in fig. 1, the system may include a data consumer 11, a number of data producers 12-14, a blockchain system 15, and a network 16.
Data consumer 11 may be a physical server containing a stand-alone host, or data consumer 11 may be a virtual server hosted by a cluster of hosts. In the technical solution of one or more embodiments of the present specification, the data generated by the associated data producer is acquired by the data consumer 11, so that the acquired data is processed and analyzed, and a business cooperating with the associated data producer is realized.
The data producers 12-14 may include cameras, smart voice devices, temperature sensors, smoke alarms, wearable devices (e.g., smart glasses, smart watches, etc.), etc., and the description is not intended to be limiting. In the operation process, the data producer generates original data by collecting information for the data consumer to analyze and process.
In the multi-party collaboration and data sharing scenario, the blockchain system 15 is used to store the original data uploaded by the data producer and convert the original data into a data format matched with the data consumer for use by the data consumer when the data consumer requests to obtain the data.
And the network 16 for interaction between the data consumer 11, the data producers 12-14, and the blockchain system 15 may include various types of wired or wireless networks. For example, the Network 16 may include the Public Switched Telephone Network (PSTN) and the Internet. The data consumer 11 and the blockchain system 15, and the data producers 12-14 and the blockchain system 15 can establish long connections to transmit data through the network 16.
The block chain-based data processing scheme of the present specification will be described in detail below from the perspective of each of the above-described parties.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data transformation method based on a blockchain according to an exemplary embodiment. As shown in fig. 2, the method applied to the block chain system may include the following steps:
step 202, in response to a certificate storing transaction submitted by a data producer, associating original data included in the certificate storing transaction with a model identifier of a target data model to store a certificate onto a block chain, wherein the original data has a corresponding data identifier, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer.
The data formats adopted by the data producer and the associated data consumer differ: the data producer generates raw data in a first format, while the data consumer processes the data in a second format. For example, before establishing an association with a data consumer (i.e. when collaborating to complete a certain service), the data producer is configured to generate data according to a first format, and the data consumer can only recognize data in a second format, but the data producer cannot upgrade the data format or the upgrade cost is high. Alternatively, the same data producer is associated with a plurality of different data consumers, that is, the data producer provides the original data generated by the data producer to the different data consumers, respectively, and each data consumer adopts a different data format. Or, if the data using party needs to use data of a plurality of different data producing parties, the raw data of the different data producing parties needs to be summarized to obtain summarized data in a standard format, and then data analysis is performed based on the summarized data, and each data producing party cannot adopt the standard format to generate the raw data.
Taking the collected temperature information as an example, the first format of the temperature data generated by the data producer is as follows: the temperature unit is in centigrade degree, and is accurate to 3 bits after decimal point; and the second format adopted by the data user is: the temperature unit is in Kelvin, and is accurate to 1 bit after decimal point.
In view of the above difference in data format, the second format adopted by the data consumer may be negotiated in advance between the data producer and the data consumer. After the second format is obtained through negotiation, a user of the data production party can define a data model according to the data format of the user, and upload the data model to a preset database, wherein the data model is used for converting data generated by the data production party according to the first format into data in the second format. And meanwhile, distributing model identification for the defined data model for subsequent binding with corresponding original data. For example, the model identification may be generated by the data producer, or by a database storing the data model. The database for storing the data model may be a block chain system, or may be other conventional centralized databases, which is not limited in this specification.
Based on the predefined data model, after the data producer generates the raw data in the first format, the data producer may determine a target data model for converting the data in the first format into the data in the second format, thereby binding the generated raw data with the target data model. In particular, the data producer may create a LC transaction that includes model identifications of the raw data and the target data model, and submit the LC transaction to the blockchain system. Then, after receiving the evidence deposit transaction, the blockchain system can extract the model identifications of the original data and the target data model from the evidence deposit transaction in response to the evidence deposit transaction so as to associate the evidence deposit with the blockchain, thereby realizing the binding between the original data and the corresponding data model.
And 204, responding to the acquisition transaction containing the data identification submitted by the data user, acquiring the original data and a target data model corresponding to the model identification of the original data correlation certificate according to the data identification, and converting the original data through the target data model so as to be acquired by the data user.
Based on the original data generated by the data producer storing and certifying the data producer on the blockchain, the data consumer can obtain the data identifier of the required original data, so as to create an acquisition transaction containing the data identifier to request the blockchain system to acquire the corresponding original data. For example, after associating the certified original data and the corresponding model identifier on the blockchain is completed, the data producer may inform the data consumer of the data identifier of the certified original data. Or, the data user can monitor the data stored in the blockchain, and then request the monitored original data from the blockchain system after monitoring the original data stored in the blockchain.
After receiving an acquisition transaction submitted by a data user, the blockchain system can respond to the acquisition transaction, acquire corresponding original data according to a data identifier included in the acquisition transaction, and acquire a model identifier associated with the original data for evidence storage, so as to acquire a target data model corresponding to the model identifier. Further, the block chain system can convert the acquired original data through the target data model, and then output the converted data to be acquired by a data user.
Through the above-mentioned manner in which the original data are uploaded by the data producer and the format conversion is performed on the original data by the blockchain system through the target data model bound to the original data, the data format standardization can be achieved (i.e., all the original data are finally converted into the second format adopted by the data consumer). For the data user, when the data generated by the associated data producer needs to be analyzed, the format standardized data can be directly acquired without executing the format conversion operation, so that the data analysis efficiency of the data user is improved. For a data producer, data producers of different manufacturers and different versions (that is, different data producers adopt different data formats) can realize conversion of data formats by defining a data model matched with the data format adopted by the data producer, so that data compatibility with a data consumer is completed.
In the technical scheme of the specification, a data producer is used as a data manager and can perform authority management on the access authority of original data uploaded by the data producer. Specifically, the data producer may define access authority information of the data consumer for data generated by the data consumer, the access authority information indicating that the data producer authorizes the data consumer to access, and for data that the data producer does not authorize the data consumer to access, the data producer should be treated as sensitive data of the data producer for privacy. Therefore, after receiving the acquisition transaction submitted by the data user for the original data, the blockchain system can acquire the original data and the access authority information of the data generated by the data user for the data producer, so that the sensitive data in the original data can be determined according to the access authority information, and the sensitive data can be subjected to privacy processing. For example, sensitive data may be masked, deleted, encrypted, modified into a random string, and so forth.
In an embodiment, similar to the data model, after the data producer defines the access right information, the data producer may associate the information identifier of the access right information with the original data and send the information identifier to the blockchain system, so that the blockchain system associates and stores the original data and the information identifier onto the blockchain. For example, the data producer may record the original data, the model identifier of the target data model, and the information identifier of the access right information in the aforementioned certification transaction, and the blockchain system may associate the original data with the model identifier and the information identifier on the blockchain in response to the certification transaction. Based on the fact that the block chain is associated with the evidence and has the information identification of the original data and the access authority information, when the block chain system responds to the acquisition transaction, the corresponding access authority information can be acquired according to the information identification of the original data associated with the evidence.
In another embodiment, when generating the access right information, the data producer may declare its producer identity and the user identity of the corresponding data user with respect to the access right information, thereby indicating the authorizer and the authorized party of the access right. Then, when the blockchain system responds to the acquisition transaction, the corresponding access authority information can be acquired according to the user identity of the data user and the producer identity of the data producer.
Based on the mode of controlling the access authority by defining the access authority information, the data producer can autonomously control the access authority of the original data generated by the data producer, so that sensitive data of the data producer can be effectively prevented from being leaked while the data is provided for the data consumer, and privacy protection is realized.
In the technical solution of the present specification, the data producer may cooperate with a plurality of data consumers, that is, the raw data generated by the data producer may need to be provided to a plurality of different data consumers, and the second format adopted by each data consumer may also be different. Thus, the data producer may define a different data model for each data consumer, which data models correspond to the respective data consumers (in the second format). Then, when uploading the self-generated original data to the blockchain system, the data producer can write the original data and the model identifications of the data models matched with the data consumers in the evidence storing transaction, so that the blockchain system can associate the original data in the evidence storing transaction with all the model identifications on the blockchain for evidence storing. Then, based on the fact that the blockchain comprises a plurality of model identifications associated with the original data for storage, when the blockchain system responds to an acquisition transaction submitted by any data user, the user identification of the data user can be acquired first, and then a data model matched with the user identification in the data model corresponding to the model identification associated with the original data for storage is determined, so that the original data is converted through the determined data model. By the above mode, under the condition that the data is provided by a plurality of different data users in the data production direction, the block chain system can convert the data format of the original data uploaded by the data production direction into the data format adopted by the data user requesting to acquire the data, so that the data user can conveniently analyze and process the data requested to acquire.
For example, a data producer may assert a consumer identity for a respective data consumer in a respective data model defined for each data consumer, and the blockchain system may determine, for format conversion, a data model corresponding to the data consumer submitting the acquisition transaction based on the asserted consumer identity in the data model. Or, the data producer may establish a mapping relationship between the model identifier and the user identifier for the data model and the data user having a corresponding relationship. Furthermore, when the data producer uploads the original data, the established mapping relation and the original data can be submitted to the block chain for association certificate storage through certificate storage transaction. Then, after the block chain system acquires the original data, the user identity of the data user submitting the acquired transaction can be acquired, the model identity corresponding to the user identity is determined according to the mapping relation of the original data and the associated certificate, and the data model corresponding to the determined model identity is acquired for format conversion.
For blockchain systems, whether public, private, or alliance, intelligent contracts may be deployed and invoked. Taking the ethernet house as an example, the support user creates and/or invokes some complex logic in the ethernet house network, which is the biggest challenge of the ethernet house to distinguish from the bitcoin blockchain technology. The core of the ethernet plant as a programmable blockchain is the ethernet plant virtual machine (EVM), each ethernet plant node can run the EVM. The EVM is a well-behaved virtual machine, which means that a variety of complex logic can be implemented through it. The user issuing and invoking smart contracts in the etherhouse is running on the EVM.
For example, as shown in fig. 3, after Bob sends a transaction containing information to create an intelligent contract to the ethernet network, the EVM of node 1 may execute the transaction and generate a corresponding contract instance. The data field of the transaction holds the code (e.g., bytecode) of the smart contract, and the to field of the transaction is an empty account. After the agreement is achieved between the nodes through the consensus mechanism, the contract is successfully created, and the subsequent user can call the contract. After the contract is created, a contract account corresponding to the intelligent contract appears on the blockchain and has a specific address, and the contract code and the account storage are stored in the contract account. The behavior of the intelligent contract is controlled by the contract code, while the account storage of the intelligent contract preserves the state of the contract. In other words, an intelligent contract causes a virtual account to be generated on a blockchain that contains a contract code and an account store (Storage).
Further, as shown in fig. 4, still taking the ethernet house as an example, after Bob sends a transaction invoking the smart contract to the ethernet house network, the EVM of node 1 may execute the transaction and generate a corresponding contract instance. The from field of the transaction in FIG. 4 is the address of the account from which the intelligent contract was initiated, and "0 x692a70d2 …" in the to field represents the address of the intelligent contract being invoked, and the value field is the value in EtherFang that is the Tai currency value, and the data field of the transaction holds the method and parameters for invoking the intelligent contract. The intelligent contract can be independently executed at each node in the blockchain network in a specified mode, and all execution records and data are stored on the blockchain, so that after the transaction is completed, transaction certificates which cannot be tampered and cannot be lost are stored on the blockchain.
Therefore, the above operations performed by the blockchain system can be realized by the intelligent contract. For example, the blockchain system may be a federation chain in which members of a federation include a data producer and a data consumer. In this case, after negotiating with the data user to obtain the second format, the data producer may define a target data model for converting the data in the first format into the data in the second format, then develop an intelligent contract for performing format conversion on the original data generated by the data producer based on the data model, and deploy the intelligent contract on the block chain system for the data user to call when the original data needs to be acquired, thereby completing the process of format conversion. In other words, the acquisition transaction submitted by the data consumer is used to invoke the smart contract. The intelligent contract is defined with format conversion codes, and the target data model and the original data are used as the input data of the intelligent contract, so that the format conversion codes can be executed to convert the acquired original data according to the target data model. For other operations executed by the blockchain system, the other operations can be realized by defining corresponding contract codes in the intelligent contract, and the principle is similar to that described above and is not described herein again.
To avoid data leakage, a Trusted Execution Environment (TEE) may be deployed at a block chain node of the block chain system and the intelligent contract described above is guaranteed to be executed in the TEE. Specifically, the contract code of the intelligent contract may be read into the TEE, and the data model and access rights information described above may be read into the TEE, thereby performing format conversion and privacy protection operations within the TEE.
The TEE is a trusted execution environment that is based on a secure extension of the CPU hardware and is completely isolated from the outside. TEE was originally proposed by Global Platform to address the secure isolation of resources on mobile devices, providing a trusted and secure execution environment for applications parallel to the operating system. The Trust Zone technology of ARM realizes the real commercial TEE technology at the earliest. Along with the rapid development of the internet, the security requirement is higher and higher, and more requirements are provided for the TEE by mobile equipment, cloud equipment and a data center. The concept of TEE has also been developed and expanded at a high rate. The concept now referred to as TEE has been a more generalized TEE than the concept originally proposed. For example, server chip manufacturers Intel, AMD, etc. have introduced hardware-assisted TEE in turn and enriched the concept and characteristics of TEE, which have gained wide acceptance in the industry. The mention of TEE now is more generally directed to such hardware assisted TEE techniques. Unlike the mobile terminal, the cloud access requires remote access, and the end user is not visible to the hardware platform, so the first step of using the TEE is to confirm the authenticity and credibility of the TEE. Therefore, the current TEE technology introduces a remote attestation mechanism which is endorsed by a hardware manufacturer (mainly a CPU manufacturer) and ensures that a user can verify the TEE state through a digital signature technology. Meanwhile, the security requirement which cannot be met by only safe resource isolation is also met, and further data privacy protection is also provided. Commercial TEE including Intel SGX, AMD SEV also provide memory encryption techniques, limiting trusted hardware within the CPU, with the data of the bus and memory being ciphertext to prevent snooping by malicious users. For example, TEE technology such as intel's software protection extensions (SGX) isolates code execution, remote attestation, secure configuration, secure storage of data, and trusted paths for executing code. Applications running in the TEE are secured and are almost impossible to access by third parties.
Taking the Intel SGX technology as an example, SGX provides an enclosure (also called enclave), that is, an encrypted trusted execution area in memory, and a CPU protects data from being stolen. Taking the example that the first block link point adopts a CPU supporting SGX, a part of an area EPC (enclosure Page Cache, Enclave Page Cache, or Enclave Page Cache) may be allocated in the memory by using a newly added processor instruction, and data therein is encrypted by an Encryption engine mee (memory Encryption engine) in the CPU. The encrypted content in the EPC is decrypted into plaintext only after entering the CPU. Therefore, in the SGX, a user may not trust an operating System, a VMM (Virtual Machine Monitor), or even a BIOS (Basic Input Output System), and only need to trust the CPU to ensure that private data is not leaked. In practical application, the private data can be encrypted and then transmitted to the enclosure in a ciphertext form, and the corresponding secret key is transmitted to the enclosure through remote certification. Then, the operation is performed by using the data under the encryption protection of the CPU, and the result is returned in a ciphertext form. In this mode, not only can the powerful calculation be utilized, but also data leakage is not worried about.
In a blockchain system employing an account model, blockchain accounts may include external accounts, contract accounts, and the like. The external accounts are typically owned by a user (individual or organization), while the contract accounts correspond to smart contracts deployed in a blockchain. The structure of each type of account is similar, and may include, for example, a Nonce field, a Balance field, a Code field, a Storage field, and so on. The value of the Nonce field of each account starts from 0, and the value of the Nonce field is sequentially increased along with the transaction initiated by the corresponding account, so that the Nonce values contained in each transaction initiated by the account are different, thereby avoiding replay attack. The Balance field is used to store the Balance. The Code field is used to hold the Code of the smart contract, and thus the Code field of the external account is typically empty. The Storage field is used for storing the value of the account at the corresponding node in the state tree.
Thus, the data producer can publish the data model to the blockchain for evidence storage. Alternatively, for blockchain systems that employ account models, the data models may be stored in contract accounts for intelligent contracts that are deployed by the data producer onto the blockchain. For example, it may be stored in the above-mentioned intelligent contract for format conversion of the original data; of course, any other intelligent contracts may be deployed for storing the data model. Alternatively, the data model may also be stored in an external account of the data producer.
Similarly, the data producer may issue access rights information onto the blockchain for credentialing. Alternatively, for a blockchain system employing an account model, the access rights information may be stored in a contract account of an intelligent contract deployed by the data producer onto the blockchain. For example, it may be stored in the above-mentioned intelligent contract for format conversion of the original data; of course, any other intelligent contract may be deployed for storing access rights information. Alternatively, the access right information may also be stored in an external account of the data producer.
Taking the data model as an example, the data model can be stored in a Storage field of a contract account or an external account; of course, the field for storing the data by using the blockchain account is not limited in the present specification. For example, the account field of the blockchain account can be modified, and other fields are additionally added for storing the data.
Of course, the original data, the data model and the access right information generated by the data producer may be stored in the same blockchain, or may be stored in different blockchains, which is not limited in this specification, wherein for the case where the original data, the data model and the access right information are stored in different blockchains, the data stored in other blockchains may be obtained by cross-linking the blockchain link points in the blockchain system that responds to the obtained transaction. Alternatively, the data model and the access right information can be stored in other databases different from the blockchain, and the blockchain system acquires the data in the database under the chain through a prediction machine mechanism.
Corresponding to the above embodiment of the blockchain system side, the present specification also proposes embodiments of the data producer side and the data consumer side, and the description related to the embodiment of the blockchain system side can also be applied to these embodiments, which is not described again below.
Referring to fig. 5, fig. 5 is a flowchart illustrating a data uploading method based on a blockchain according to an exemplary embodiment. As shown in fig. 5, the method is applied to a data producer, and may include the following steps:
step 502, generating original data in a first format, and determining a target data model for converting the data in the first format into the data in a second format according to the second format negotiated in advance by the data producer and the data consumer, wherein the original data has a corresponding data identifier.
Step 504, submitting a deposit transaction including the model identifier of the original data and the target data model to a blockchain system, associating the deposit transaction including the original data and the model identifier with a blockchain by the blockchain system, enabling the blockchain system to respond to an acquisition transaction including the data identifier submitted by a data user, acquiring the original data and the target data model corresponding to the model identifier of the original data associated with the deposit according to the data identifier, converting the original data through the target data model, and providing the converted original data to the data user.
As described above, the blockchain system is configured to use the target data model and the original data as the import data of the pre-deployed intelligent contract, and execute the format conversion code defined in the intelligent contract to convert the original data according to the target data model.
As described above, the data producer may also generate access right information of the data consumer for the data produced by the data producer, where the access right information is used to instruct the blockchain system to determine sensitive data in the original data so as to perform privacy processing on the sensitive data.
As described above, the data producer may also submit the access right information to the blockchain system, so that the blockchain system associates and stores the original data and the information identifier of the access right information onto the blockchain, where the access right information is obtained by the blockchain system according to the information identifier of the access right information associated and stored with the original data; alternatively, the first and second electrodes may be,
and the access authority information is acquired by the block chain system according to the user identity of the data user and the producer identity of the data producer.
As mentioned above, the access right information is stored on the blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
As mentioned above, the blockchain includes a plurality of model identifiers associated with the original data, and the blockchain system is configured to obtain a user identifier of the data user, and determine a data model matching the user identifier in the data model corresponding to the model identifier associated with the original data, so as to convert the original data through the determined data model.
As previously described, the target data model is deposited on the blockchain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
Referring to fig. 6, fig. 6 is a flowchart illustrating a data obtaining method based on a blockchain according to an exemplary embodiment. As shown in fig. 6, the method applied to the data user may include the following steps:
step 602, creating an acquisition transaction including a data identifier of raw data generated by a data producer according to a first format, the raw data being associated with a model identifier of a target data model for storing onto a block chain, the target data model being configured to convert the data of the first format into data of a second format pre-negotiated by the data producer and a data consumer.
Step 604, submitting the acquisition transaction to a blockchain system, so that the blockchain system acquires the original data and a target data model corresponding to a model identifier associated with the original data and storing evidence according to the data identifier, and converts the original data through the target data model.
Step 606, obtaining the data after the block chain system conversion.
As described above, the blockchain system is configured to use the target data model and the original data as the import data of the pre-deployed intelligent contract, and execute the format conversion code defined in the intelligent contract to convert the original data according to the target data model.
As described above, the blockchain system is configured to obtain access right information of the data consumer for the data generated by the data producer, and determine sensitive data in the original data according to the access right information to perform privacy processing on the sensitive data.
As described above, the original data and the information identifier of the access right information are associated and verified to a block chain, and the block chain system is configured to obtain the access right information according to the information identifier of the access right information associated and verified with the original data; alternatively, the first and second electrodes may be,
and the block chain system is used for acquiring the access authority information according to the user identity of the data user and the producer identity of the data producer.
As mentioned above, the access right information is stored on the blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
As mentioned above, the blockchain includes a plurality of model identifiers associated with the original data, and the blockchain system is configured to obtain a user identifier of the data user, and determine a data model matching the user identifier in the data model corresponding to the model identifier associated with the original data, so as to convert the original data through the determined data model.
As previously described, the target data model is deposited on the blockchain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
For ease of understanding, the data processing scheme of the present specification is described in detail below with reference to fig. 7-9.
Referring to fig. 7, fig. 7 is an interaction diagram of uploading a data model by a data producer according to an exemplary embodiment. As shown in fig. 7, the interactive process may include the following steps:
at step 702, the data producer defines a data model.
After establishing a cooperative relationship with the data producer, the data consumer may inform the data producer of the data format (i.e., the second format) adopted by the data consumer. The user of the data producer may define a data model according to the second format and the first format adopted by the user, and the data model may be used as a basis for converting the data in the first format into the data in the second format. Meanwhile, a user of the data production party can develop an intelligent contract for carrying out format conversion on the original data generated by the user according to the data model, and the intelligent contract is deployed on the block chain system and is called by the data user when the original data needs to be acquired, so that the intelligent contract is matched with the corresponding data model to complete the process of format conversion.
The specific content of the data model can be flexibly set according to actual requirements. For example, an IOT device temperature sensor and a humidity sensor are arranged in a greenhouse, and the temperature sensor and the humidity sensor are used as data production parties to collect temperature and humidity respectively and upload the collected data to a blockchain system. Meanwhile, the control center of the greenhouse is used as a data user to analyze and process the data so as to control and process the temperature and the humidity of the greenhouse. The data format required by the control center is shown in table 1:
Figure 899258DEST_PATH_IMAGE001
then, the following data model may be defined:
{ "category": IoT "," properties ": {" dataType ": FLOAT", "description": temperature of the object ",
"identifier":"Temp","max":"100.0","min":"-100.0","required":true,"unit":"
c. ", {" dataType ": FLOAT", "description": humidity of the object ",
"identifier":"Humidity","max":"100.0","min":"0.0","required":true,"unit":"%rh"}]}”。
step 704, the data producing direction block chain system uploads the data model.
The data producer can create a certificate deposit transaction, and write the data model into the certificate deposit transaction, so that the certificate deposit transaction is submitted to the blockchain system, and the data model is issued to the blockchain for certificate deposit.
Step 706, the blockchain system verifies the data model.
In step 708, the data producer obtains the model identifier MID output by the block chain system.
Model identifications MID can be assigned to the certified data models by the blockchain system for subsequent binding with corresponding raw data. The MID may be generated by a data producer, or by a blockchain system, among other things. For example, a transaction hash TxHash (transaction serial number) of a credited transaction containing a data model may be used as the MID of the data model.
The data producer can be used as a manager of the original data generated by the data producer, and can carry out authority management on the access authority of the original data. Specifically, the data producer may define access rights information for data generated by the data consumer for the data, the access rights information indicating data fields in the raw data that the data producer is authorized to access by the data consumer. The specific content of the access authority information can be flexibly set according to actual requirements. For example, the access right information may define corresponding access rights for a data field in a first format, and may also define corresponding access rights for a data field in a second format, which is not limited in this specification. Similar to the data model described above, the data producer may issue the defined access right information to the blockchain for storage, and the process is similar to the embodiment shown in fig. 7 and is not described herein again.
Referring to fig. 8, fig. 8 is an interaction diagram of uploading raw data by a data producer according to an exemplary embodiment. As shown in fig. 8, the interactive process may include the following steps:
step 802, the data producer collects information and generates raw data.
And step 804, the data producer determines a target data model and binds the corresponding MID with the original data.
And after acquiring corresponding information, the data producer generates original data according to a first format adopted by the data producer. For example, the data producer may locally package the collected information in a first format; or the data production side can also access the cloud side, and the collected information is sent to the cloud side so as to be packaged by the cloud server.
Meanwhile, a target data model used for converting the data from the first format to the second format is determined based on the second format negotiated with the data user in advance, and the MID of the target data model and the original data are written into the evidence storing transaction so as to bind the MID and the original data.
At step 806, the data producer creates a deposit transaction.
Step 808, the data producer submits a transaction for deposit verification to the blockchain system.
Step 810, the blockchain system associates the certified raw data with the MID.
At step 812, the data producer obtains the data ID of the original data.
The evidence storing transaction comprises the MID of the target data model and original data, the block chain system can carry out consensus on the evidence storing transaction after receiving the evidence storing transaction, and the evidence storing transaction is issued to the block chain for evidence storing after the consensus passes. The transaction hash TxHash of the deposit transaction containing the original data can be used as the data ID of the original data.
Referring to fig. 9, fig. 9 is an interaction diagram for a data consumer to obtain data according to an exemplary embodiment. As shown in fig. 9, the interactive process may include the following steps:
in step 902, the data consumer obtains the data ID.
Based on the original data generated by the data producer on the blockchain, the data consumer can acquire the data ID of the required original data, so as to create an acquisition transaction containing the data ID to request the blockchain system to acquire the corresponding original data. For example, after the association of the certified original data and the corresponding MID on the blockchain is completed, the data producer may inform the data consumer of the data ID of the certified original data. Or, the data user can monitor the data stored in the blockchain, and then after monitoring the original data stored in the blockchain, request the blockchain system for the monitored original data based on the monitored data ID.
At step 904, the data consumer creates an acquisition transaction for the raw data.
At step 906, the data usage direction submits an acquisition transaction to the blockchain system.
In step 908, the blockchain system executes the intelligent contract to obtain the original data according to the data ID.
Taking the data ID as the TxHash of the certificate-storing transaction as an example, the TxHash of the certificate-storing transaction containing the original data recorded in the transaction is obtained. The block chain system can search and obtain corresponding certificate storing transaction according to the TxHash, so that the original data stored in the certificate storing transaction and the MID of the corresponding data model are read.
In step 910, the blockchain system obtains the target data model corresponding to the MID stored in association with the original data.
In step 912, the blockchain system obtains the corresponding privilege model.
In one embodiment, similar to the data model, the data producer may obtain the information ID of the access right information during the process of uploading the access right information, and then may send the information ID of the access right information in association with the original data to the blockchain system, so that the blockchain system verifies the original data in association with the information ID onto the blockchain. For example, the data producer may record the original data, the MID of the target data model, and the information ID of the access right information in the certification transaction, and the blockchain system may package the certification transaction into blocks to be issued to the blockchain for certification. Under the condition, the block chain system can extract and obtain the TxHash of the certificate-storing transaction recorded in the transaction, search and obtain the corresponding certificate-storing transaction according to the TxHash, thereby reading the original data stored in the certificate-storing transaction, the MID of the corresponding data model and the information ID of the access authority information, and obtaining the corresponding access authority information according to the information ID in the certificate-storing transaction.
In another embodiment, when generating the access right information, the data producer may declare its producer identity and the user identity of the corresponding data user in the access right information, thereby indicating the authorizer and the authorized party of the access right. For example, the account address of the respective blockchain account may be used as the identification. After receiving the acquisition transaction, the blockchain system can extract the TxHash of the certificate-storing transaction recorded in the acquisition transaction, and search for the corresponding certificate-storing transaction according to the TxHash, so that the account address (namely the account address of the data producer) owered of the transaction sender recorded in the from field of the certificate-storing transaction can be read. Meanwhile, the account address of the transaction sender (i.e., the account address of the data user) callerid recorded in the get transaction from field may be read. Then the blockchain system can obtain the corresponding access rights information according to the owner id and the callerid.
In step 914, the blockchain system transforms the raw data through the target data model.
In step 916, the blockchain system performs privacy processing through the privilege model.
At step 918, the data consumer obtains the format standardized data.
As an example of the data model in fig. 7, the intelligent contract may use the data model as a basis, and convert the data field and the corresponding value of the obtained original data according to the requirement defined in the data model. For example, if the raw data is t =26.834 ° C and h =30, then format conversion by the above data model may result in format normalized data "{ Temp =26.8 ° C, and huminity =30.0% }".
For another example, if the temperature unit adopted by the partial temperature sensor in the greenhouse is kelvin, a conversion mode for converting kelvin into celsius degrees can be defined in the data model, and then the intelligent contract can perform value conversion according to the data model. For example, if the raw data is t =300K and h =30, format conversion by the data model may result in format normalized data "{ Temp =26.8 ℃, Humidity =30.0% }".
Assuming that the access rights information indicates that the data field "Temp" is sensitive data, the intelligent contract may delete the data field "Temp =26.8 ℃ and eventually may result in the format standardized data" { Humidity =30.0% } ".
At step 920, the data user analyzes the format standardized data.
Corresponding to the method embodiments, the present specification also provides device embodiments.
FIG. 10 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 10, at the hardware level, the apparatus includes a processor 1002, an internal bus 1004, a network interface 1006, a memory 1008, and a non-volatile memory 1010, although it may also include hardware required for other services. The processor 1002 reads a corresponding computer program from the nonvolatile memory 1010 into the memory 1008 and then runs the computer program, thereby forming a data conversion device based on a block chain on a logical level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 11, in a software implementation, the apparatus applied to the blockchain system may include:
the evidence storing unit 1101 is used for associating original data contained in evidence storing transaction and model identification of a target data model to a block chain in response to the evidence storing transaction submitted by a data producer, wherein the original data has corresponding data identification, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data in the first format into data in a second format negotiated by the data producer and a data consumer in advance;
the conversion unit 1102 is configured to, in response to an acquisition transaction including the data identifier submitted by a data user, acquire the original data and a target data model corresponding to a model identifier stored in association with the original data according to the data identifier, and convert the original data through the target data model so as to be acquired by the data user.
Optionally, the conversion unit 1102 is specifically configured to:
taking the target data model and the original data as the input data of the pre-deployed intelligent contract;
and executing format conversion codes defined in the intelligent contract to convert the original data according to the target data model.
Optionally, the method further includes:
the privacy protection unit 1103 obtains access right information of the data consumer for the data generated by the data producer, and determines sensitive data in the original data according to the access right information, so as to perform privacy processing on the sensitive data.
Alternatively to this, the first and second parts may,
the evidence storing unit 1101 is further configured to associate the original data and the information identifier of the access right information to store evidence onto a block chain; the privacy protection unit 1103 is specifically configured to: acquiring the access authority information according to the information identification of the original data associated with the certificate; alternatively, the first and second electrodes may be,
the privacy protection unit 1103 is specifically configured to: and acquiring the access authority information according to the user identity of the data user and the producer identity of the data producer.
Optionally, the access right information is stored in a blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
Optionally, the block chain includes a plurality of model identifiers associated with the original data for evidence storage; the device further comprises:
and a model determining unit 1104 for acquiring the user identity of the data user, and determining a data model matching the user identity in the data model corresponding to the model identity of the original data associated certificate so as to convert the original data through the determined data model.
Optionally, the target data model is stored in a block chain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
FIG. 12 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 12, at the hardware level, the apparatus includes a processor 1202, an internal bus 1204, a network interface 1206, a memory 1208, and a non-volatile memory 1210, although other hardware required for services may be included. The processor 1202 reads a corresponding computer program from the non-volatile memory 1210 into the memory 1208 and then runs the computer program, thereby forming a data uploading device based on the block chain on a logic level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 13, in a software implementation, the apparatus applied to a data producer may include:
a generating unit 1301, configured to generate original data in a first format, and determine a target data model for converting the data in the first format into data in a second format according to a second format negotiated in advance between the data producer and the data consumer, where the original data has a corresponding data identifier;
a submitting unit 1302, configured to submit a deposit transaction including the model identifier of the original data and the target data model to a blockchain system, so that the blockchain system associates the original data and the model identifier with each other and deposits onto a blockchain, so that the blockchain system, in response to an acquisition transaction including the data identifier submitted by a data user, acquires the original data and a target data model corresponding to the model identifier of the original data associated with the deposit according to the data identifier, converts the original data through the target data model, and provides the converted original data to the data user.
Optionally, the blockchain system is configured to use the target data model and the original data as entry data of a pre-deployed intelligent contract, and execute a format conversion code defined in the intelligent contract to convert the original data according to the target data model.
Optionally, the generating unit 1301 is further configured to:
and generating access authority information of the data using party for the data generated by the data producing party, wherein the access authority information is used for instructing the blockchain system to determine sensitive data in the original data so as to perform privacy processing on the sensitive data.
Alternatively to this, the first and second parts may,
further comprising: the privacy protection unit 1303, configured to submit the access right information to the blockchain system, so that the blockchain system associates and stores the original data and the information identifier of the access right information onto a blockchain, where the access right information is obtained by the blockchain system according to the information identifier of the original data associated and stored information; alternatively, the first and second electrodes may be,
and the access authority information is acquired by the block chain system according to the user identity of the data user and the producer identity of the data producer.
Optionally, the access right information is stored in a blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
Optionally, the blockchain includes a plurality of model identifiers associated with the original data for storing the certificate, and the blockchain system is configured to obtain a user identifier of the data user, and determine a data model, which is matched with the user identifier, in the data model corresponding to the model identifier associated with the original data for storing the certificate, so as to convert the original data through the determined data model.
Optionally, the target data model is stored in a block chain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
FIG. 14 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to FIG. 14, at the hardware level, the device includes a processor 1402, an internal bus 1404, a network interface 1406, a memory 1408, and a non-volatile storage 1410, although other hardware required for service may be included. The processor 1402 reads a corresponding computer program from the non-volatile memory 1410 into the memory 1408 and then runs, forming a data acquisition device based on a block chain on a logical level. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 15, in a software implementation, the apparatus is applied to a data consumer, and may include:
a creating unit 1501 that creates an acquisition transaction including a data identifier of original data generated by a data producer according to a first format, the original data being associated with a model identifier of a target data model for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer and being certified onto a block chain;
a submitting unit 1502, which submits the acquisition transaction to a blockchain system, so that the blockchain system acquires the original data and a target data model corresponding to a model identifier associated with the original data and storing evidence according to the data identifier, and converts the original data through the target data model;
the obtaining unit 1503 obtains the data converted by the block chain system.
Optionally, the blockchain system is configured to execute an intelligent contract to obtain the original data according to the data identifier of the original data included in the acquisition transaction, and obtain a target data model corresponding to a model identifier of a certificate associated with the original data.
Optionally, the blockchain system is configured to acquire access right information of the data consumer for the data generated by the data producer, and determine sensitive data in the original data according to the access right information to perform privacy processing on the sensitive data.
Alternatively to this, the first and second parts may,
the original data and the information identification of the access authority information are associated and verified to a block chain, and the block chain system is used for acquiring the access authority information according to the information identification associated and verified with the original data; alternatively, the first and second electrodes may be,
and the block chain system is used for acquiring the access authority information according to the user identity of the data user and the producer identity of the data producer.
Optionally, the access right information is stored in a blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
Optionally, the blockchain includes a plurality of model identifiers associated with the original data for storing the certificate, and the blockchain system is configured to obtain a user identifier of the data user, and determine a data model, which is matched with the user identifier, in the data model corresponding to the model identifier associated with the original data for storing the certificate, so as to convert the original data through the determined data model.
Optionally, the target data model is stored in a block chain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (23)

1. A data conversion method based on a block chain is applied to a block chain system, and the method comprises the following steps:
in response to a certificate storing transaction submitted by a data producer, associating original data contained in the certificate storing transaction with a model identifier of a target data model to store onto a block chain, wherein the original data has a corresponding data identifier, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer;
in response to an acquisition transaction containing the data identifier submitted by a data user, acquiring the original data and a target data model corresponding to a model identifier stored in association with the original data according to the data identifier, and converting the original data through the target data model to be acquired by the data user, the method comprises the following steps: and taking the target data model and the original data as the input data of a pre-deployed intelligent contract, and executing a format conversion code defined in the intelligent contract so as to convert the original data according to the target data model.
2. The method of claim 1, further comprising:
acquiring access authority information of the data using party for the data generated by the data producing party;
determining sensitive data in the original data according to the access authority information;
and carrying out privacy processing on the sensitive data.
3. The method of claim 2, wherein the first and second light sources are selected from the group consisting of,
further comprising: associating and storing the original data and the information identifier of the access authority information to a block chain; the obtaining of the access right information of the data using party to the data generated by the data producing party includes: acquiring the access authority information according to the information identification of the original data associated with the certificate; alternatively, the first and second electrodes may be,
the obtaining of the access right information of the data using party to the data generated by the data producing party includes: and acquiring the access authority information according to the user identity of the data user and the producer identity of the data producer.
4. The method of claim 2, wherein the access rights information is certified on a blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
5. The method of claim 1, wherein the blockchain comprises a plurality of model identifiers for storing certificates associated with the raw data; the method further comprises the following steps:
acquiring a user identity of the data user;
and determining a data model matched with the user identity identifier in the data model corresponding to the model identifier of the original data associated storage certificate, so as to convert the original data through the determined data model.
6. The method of claim 1, the target data model is deposited on a blockchain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
7. A data uploading method based on a block chain is applied to a data producer and comprises the following steps:
generating original data in a first format, and determining a target data model for converting the data in the first format into the data in a second format according to the second format negotiated by the data producer and the data consumer in advance, wherein the original data has a corresponding data identifier;
submitting a credentialing transaction comprising the model identification of the raw data and the target data model to a blockchain system, associating, by the blockchain system, the raw data with the model identification for crediting onto a blockchain, causing the blockchain system to respond to a fetch transaction submitted by a data consumer that includes the data identification, obtaining the original data and a target data model corresponding to the model identification of the original data correlation evidence according to the data identification, and the original data is converted by the target data model and then provided to a data user, the blockchain system is used for taking the target data model and the original data as the reference data of the pre-deployed intelligent contract, and executing format conversion codes defined in the intelligent contract to convert the original data according to the target data model.
8. The method of claim 7, further comprising:
and generating access authority information of the data using party for the data generated by the data producing party, wherein the access authority information is used for instructing the blockchain system to determine sensitive data in the original data so as to perform privacy processing on the sensitive data.
9. The method of claim 8, wherein the first and second light sources are selected from the group consisting of,
further comprising: submitting the access authority information to the blockchain system so that the blockchain system associates and stores the original data and the information identifier of the access authority information onto a blockchain, wherein the access authority information is acquired by the blockchain system according to the information identifier of the original data associated and stored certificate; alternatively, the first and second electrodes may be,
and the access authority information is acquired by the block chain system according to the user identity of the data user and the producer identity of the data producer.
10. The method of claim 8, wherein the access rights information is certified on a blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
11. The method according to claim 7, wherein the blockchain includes a plurality of model identifiers stored in association with the original data, and the blockchain system is configured to obtain a user identifier of the data user and determine a data model matching the user identifier in the data model corresponding to the model identifier stored in association with the original data, so as to convert the original data through the determined data model.
12. The method of claim 7, the target data model is deposited on a blockchain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
13. A data acquisition method based on a block chain is applied to a data user, and the method comprises the following steps:
creating an acquisition transaction containing a data identifier of original data generated by a data producer according to a first format, wherein the original data and a model identifier of a target data model are associated and verified to a block chain, and the target data model is used for converting the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer;
submitting the acquisition transaction to a blockchain system, so that the blockchain system acquires the original data and a target data model corresponding to a model identifier associated with the original data for evidence storage according to the data identifier, and converts the original data through the target data model, wherein the blockchain system is used for taking the target data model and the original data as input data of a pre-deployed intelligent contract and executing a format conversion code defined in the intelligent contract to convert the original data according to the target data model;
and acquiring the data converted by the block chain system.
14. The method of claim 13, wherein the blockchain system is configured to obtain access right information of the data consumer for the data generated by the data producer, and determine sensitive data in the original data according to the access right information to perform privacy processing on the sensitive data.
15. The method of claim 14, wherein the first and second light sources are selected from the group consisting of,
the original data and the information identification of the access authority information are associated and verified to a block chain, and the block chain system is used for acquiring the access authority information according to the information identification associated and verified with the original data; alternatively, the first and second electrodes may be,
and the block chain system is used for acquiring the access authority information according to the user identity of the data user and the producer identity of the data producer.
16. The method of claim 14, wherein the access rights information is certified on a blockchain; or the access authority information is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; or, the access right information is stored in an external account of the data producer.
17. The method according to claim 13, wherein the blockchain includes a plurality of model identifiers stored in association with the original data, and the blockchain system is configured to obtain a user identifier of the data user and determine a data model matching the user identifier in the data model corresponding to the model identifier stored in association with the original data, so as to transform the original data through the determined data model.
18. The method of claim 13, the target data model is deposited on a blockchain; or, the target data model is stored in a contract account of an intelligent contract, and the intelligent contract is deployed to a block chain by the data producer; alternatively, the target data model is stored in an external account of the data producer.
19. A data conversion device based on block chains, which is applied to a block chain system, the device comprises:
the certificate storing unit is used for responding to certificate storing transaction submitted by a data producer, associating original data contained in the certificate storing transaction with a model identifier of a target data model to store the certificate to a block chain, wherein the original data has a corresponding data identifier, the original data is generated by the data producer according to a first format, and the target data model is used for converting the data of the first format into data of a second format negotiated by the data producer and a data consumer in advance;
the conversion unit is used for responding to an acquisition transaction containing the data identification submitted by a data user, acquiring the original data and a target data model corresponding to a model identification stored in association with the original data according to the data identification, and converting the original data through the target data model so as to be acquired by the data user, and comprises the following steps: and taking the target data model and the original data as the input data of a pre-deployed intelligent contract, and executing a format conversion code defined in the intelligent contract so as to convert the original data according to the target data model.
20. A data uploading device based on a block chain is applied to a data producer and comprises:
the generating unit is used for generating original data in a first format, determining a target data model for converting the data in the first format into the data in a second format according to the second format negotiated in advance by the data producer and the data consumer, wherein the original data has a corresponding data identifier;
a submitting unit for submitting a deposit transaction containing the original data and the model identification of the target data model to a blockchain system, to associate the raw data with the model identification for crediting onto a blockchain by the blockchain system, to cause the blockchain system to respond to a fetch transaction submitted by a data consumer that includes a data identification for the raw data, obtaining the original data and a target data model corresponding to the model identification of the original data correlation evidence according to the data identification, and the original data is converted by the target data model and then provided to a data user, the blockchain system is used for taking the target data model and the original data as the reference data of the pre-deployed intelligent contract, and executing format conversion codes defined in the intelligent contract to convert the original data according to the target data model.
21. A blockchain-based data acquisition apparatus for use by a data consumer, the apparatus comprising:
a creation unit that creates an acquisition transaction including a data identifier of original data generated by a data producer in a first format, the original data being associated with a model identifier of a target data model for storing onto a block chain, the target data model being used to convert the data of the first format into data of a second format negotiated in advance by the data producer and a data consumer;
the submitting unit is used for submitting the acquisition transaction to a blockchain system so that the blockchain system acquires the original data and a target data model corresponding to a model identifier associated with the original data and storing evidence according to the data identifier and converts the original data through the target data model, and the blockchain system is used for taking the target data model and the original data as input parameter data of a pre-deployed intelligent contract and executing a format conversion code defined in the intelligent contract so as to convert the original data according to the target data model;
and the acquisition unit acquires the data converted by the block chain system.
22. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-18 by executing the executable instructions.
23. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 18.
CN202011308164.2A 2020-11-19 2020-11-19 Data conversion method and device based on block chain Active CN112131298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011308164.2A CN112131298B (en) 2020-11-19 2020-11-19 Data conversion method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011308164.2A CN112131298B (en) 2020-11-19 2020-11-19 Data conversion method and device based on block chain

Publications (2)

Publication Number Publication Date
CN112131298A CN112131298A (en) 2020-12-25
CN112131298B true CN112131298B (en) 2021-06-29

Family

ID=73852092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011308164.2A Active CN112131298B (en) 2020-11-19 2020-11-19 Data conversion method and device based on block chain

Country Status (1)

Country Link
CN (1) CN112131298B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113301132B (en) * 2021-05-12 2022-07-08 苏州域乎区块链科技有限公司 Transaction subscription system and method based on alliance chain
CN113469815A (en) * 2021-09-02 2021-10-01 支付宝(杭州)信息技术有限公司 Data management method and device
CN113591162B (en) * 2021-09-29 2022-02-15 金蝶软件(中国)有限公司 Block chain evidence storing method and device and computer equipment
CN114357508B (en) * 2021-12-27 2024-06-14 东北大学秦皇岛分校 Internet of things data sharing system and method based on predictors and blockchain
CN113992336B (en) * 2021-12-30 2022-03-29 常州唯实智能物联创新中心有限公司 Encryption network offline data trusted exchange method and device based on block chain
CN114500651B (en) * 2022-01-27 2023-06-30 成都质数斯达克科技有限公司 Block chain data transmission method, device and equipment and readable storage medium
CN117521148B (en) * 2023-12-29 2024-04-02 苏州元脑智能科技有限公司 Information interaction method and device based on block chain, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110473094A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Data grant method and device based on block chain
CN110826096A (en) * 2019-10-29 2020-02-21 杭州趣链科技有限公司 Data source sharing method based on block chain
CN111324645A (en) * 2018-12-14 2020-06-23 北京沃东天骏信息技术有限公司 Data processing method and device for block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324645A (en) * 2018-12-14 2020-06-23 北京沃东天骏信息技术有限公司 Data processing method and device for block chain
CN110473094A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Data grant method and device based on block chain
CN110826096A (en) * 2019-10-29 2020-02-21 杭州趣链科技有限公司 Data source sharing method based on block chain

Also Published As

Publication number Publication date
CN112131298A (en) 2020-12-25

Similar Documents

Publication Publication Date Title
CN112131298B (en) Data conversion method and device based on block chain
CN111461723B (en) Data processing system, method and device based on block chain
CN109584066B (en) Privacy transaction based on block chain and application method and device thereof
CN111008228A (en) Method and device for inquiring account privacy information in block chain
CN110992027A (en) Efficient transaction method and device for realizing privacy protection in block chain
EP3788522A1 (en) System and method for mapping decentralized identifiers to real-world entities
CN111222157A (en) Method and device for inquiring block chain private data
CN110245947B (en) Receipt storage method and node combining conditional restrictions of transaction and user types
CN110263544B (en) Receipt storage method and node combining transaction type and judgment condition
CN111753335B (en) Editing method and device for block content
CN110264192B (en) Receipt storage method and node based on transaction type
TWI725709B (en) Data storage method, device and equipment
CN112101938B (en) Digital seal using method and device based on block chain and electronic equipment
CN111047321A (en) Service processing method and device, electronic equipment and storage medium
CN110264197B (en) Receipt storage method and node combining event function type and judgment condition
WO2019013773A1 (en) Secure token passing via blockchains
CN110263089B (en) Receipt storage method and node combining conditional restrictions of transaction and event types
CN111178840A (en) Service processing method, device, system, electronic equipment and storage medium
WO2020108152A1 (en) Method, device and electronic equipment for preventing misuse of identity data
CN113946877A (en) Data security calculation method, system, computer equipment, storage medium and terminal
CN113704775A (en) Service processing method based on distributed digital identity and related device
CN111464655A (en) Block chain-based Internet of things data management method and system
CN115296794A (en) Key management method and device based on block chain
CN116451280A (en) Asset management method and device based on blockchain
Ismail et al. Edge IoT-cloud framework based on blockchain

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40043797

Country of ref document: HK