Disclosure of Invention
The embodiment of the specification provides a data interaction system, a data interaction method and data interaction equipment based on a block chain, and aims to solve the problems of untimely time and potential safety hazards existing in a data interaction scheme in the prior art.
In order to solve the above technical problem, the embodiments of the present specification adopt the following technical solutions:
in a first aspect, a data interaction system based on a blockchain is provided, where the data interaction system includes:
at least two data interaction objects and N contract addresses, wherein N is a natural number; the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects serves as a terminal node, and each of the N contract addresses serves as a connection node;
n data interaction protocols are agreed between at least two data interaction objects, and N contract addresses correspond to the N data interaction protocols one to one;
the block chain contract conversion module is used for intelligently analyzing the data interaction protocol and converting the data interaction protocol into N block chain intelligent contracts;
and the data interaction system performs data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts.
In a second aspect, a data interaction method based on a block chain is provided, where the method includes:
acquiring N data interaction protocols based on N electronic contracts between at least two data interaction objects, wherein N is a natural number, N contract addresses correspond to the N data interaction protocols one by one, the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects is used as a terminal node, and each of the N contract addresses is used as a connection node;
intelligently analyzing the data interaction protocol, and converting the data interaction protocol into N block chain intelligent contracts;
and performing data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts.
In a third aspect, an electronic device is provided, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
acquiring N data interaction protocols based on N electronic contracts between at least two data interaction objects and N contract addresses, wherein N is a natural number, the N contract addresses correspond to the N data interaction protocols one by one, the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects is used as a terminal node, and each of the N contract addresses is used as a connection node;
intelligently analyzing the data interaction protocol, and converting the data interaction protocol into N block chain intelligent contracts;
and performing data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts.
In a fourth aspect, a computer-readable storage medium is provided that stores one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
acquiring N data interaction protocols based on N electronic contracts between at least two data interaction objects and N contract addresses, wherein N is a natural number, the N contract addresses correspond to the N data interaction protocols one by one, the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects is used as a terminal node, and each of the N contract addresses is used as a connection node;
intelligently analyzing the data interaction protocol, and converting the data interaction protocol into N block chain intelligent contracts;
and performing data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
by the technical scheme, the contract framework is realized by the contract template technology, and each contract can distribute data to two or more data interaction objects, so that the whole contract framework can support data interaction protocol nesting at any level, nesting and flexible design of the data interaction protocols are realized, and pluggable effects are achieved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the embodiments in the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
It should be noted that, in the embodiment of this specification, the related block chain data interaction scheme is implemented by a hierarchical structure, a contract framework is implemented by a contract template technology, and each contract can distribute data to two or more data interaction objects, so that the framework of the whole contract can support data interaction protocol nesting at any level, implement nesting and flexible design of data interaction protocols, and achieve pluggable effects.
Example one
Referring to fig. 1, a data interaction system based on a blockchain provided for an embodiment of the present specification is characterized in that the data interaction system includes:
at least two data interaction objects and N contract addresses, wherein N is a natural number; the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects serves as a terminal node, and each of the N contract addresses serves as a connection node;
n data interaction protocols are agreed between at least two data interaction objects, and N contract addresses correspond to the N data interaction protocols one to one;
referring to fig. 1, the block chain contract conversion module starts to convert from the protocol between the endmost data interaction objects from bottom to top until all data interaction protocols are converted into block chain intelligent contracts; when the data interaction system receives data to be distributed, referring to fig. 6, the data interaction system performs data distribution from a root connection node from top to bottom until the data to be distributed completes all data distribution based on a block chain intelligent contract; the number of the data interaction objects and the contract addresses connected under each contract address is arbitrary.
In a common exemplary embodiment, for example, when the tree topology is an N-level tree topology and each level tree topology has only one contract address, the data interaction system is shown with reference to fig. 2; it should be noted that the quantity correspondence between the data interaction objects and the data interaction protocols does not necessarily satisfy this relationship, and may be any quantity correspondence, and is not limited to the quantity correspondence described in fig. 2.
Referring to fig. 2, the block chain contract converting module is configured to perform intelligent analysis on the data interaction protocol, and convert the data interaction protocol into N block chain intelligent contracts, specifically:
the block chain contract conversion module starts to convert from the protocol between the data interaction objects at the tail end from bottom to top, generates an Nth block chain intelligent contract based on the data interaction protocol conversion between the data interaction objects connected under the Nth contract address, and stores the Nth contract address;
generating an N-1 block chain intelligent contract based on a data interaction protocol between a data interaction object connected under the N contract address and a data interaction object connected under the N-1 contract address, the data interaction object connected under the N-1 contract address and the N contract address, and storing the N-1 block chain intelligent contract into the N-1 contract address; and so on, until all data interaction protocols are completely converted into the intelligent contract of the block chain.
Referring to fig. 7, the data interaction system performs data allocation between the at least two data interaction objects based on the N blockchain intelligent contracts, specifically:
the data interaction system performs data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts, specifically:
when the data interaction system receives data to be distributed, the data interaction system distributes the data from a root connecting node from top to bottom, the data to be distributed is stored into a first contract address, and the first contract address distributes the data to a data interaction object and a second contract address which are connected under the first contract address based on a first data interaction protocol; sequentially iterating until the N-1 contract address allocates data to the data interaction object and the N contract address connected under the N-1 contract address based on the N-1 data interaction protocol; finally, the Nth contract address distributes data to all data interaction objects connected under the Nth contract address based on the Nth data interaction protocol.
In a general exemplary embodiment, referring to fig. 3, the system includes N +1 data interaction objects, N contract addresses, and N data interaction protocols; it should be noted that the quantity correspondence between the data interaction objects and the data interaction protocols does not necessarily satisfy this relationship, and may be any quantity correspondence, and is not limited to the quantity correspondence described in fig. 3;
referring to FIG. 8, when N is 1, the first contract address is used to assign data to the first data interaction object and the second data interaction object based on the first data interaction protocol; when N >1, for N contract addresses, the N-1 st contract address is used for distributing data to the N-1 st data interaction object and the N contract address based on the N-1 st data interaction protocol; finally, the Nth contract address is used for distributing data to the Nth data interaction object and the (N + 1) th data interaction object based on the Nth data interaction protocol.
Optionally, the data interaction protocol includes at least two data interaction subprotocols and at least two execution conditions, each data interaction subprotocol corresponds to one execution condition, when the execution conditions are met, the corresponding data interaction subprotocols are executed, and there is no intersection between the execution conditions.
Example two
The electronic apparatus of the embodiment of the present specification is described in detail below with reference to fig. 5. Referring to fig. 5, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a Non-Volatile Memory (Non-Volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (Extended Industry standard architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the content recommendation device on a logic level. And the processor is used for executing the program stored in the memory and is specifically used for executing the method operation executed when the server is taken as an execution main body.
The method disclosed in the embodiment shown in fig. 4 in this specification can be applied to a processor, or can be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method of fig. 4 and implement the functions of the data interaction system in the embodiment shown in fig. 4, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
EXAMPLE III
The present specification embodiments also provide a computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform operations comprising:
acquiring N data interaction protocols based on N electronic contracts between at least two data interaction objects and N contract addresses, wherein N is a natural number, the N contract addresses correspond to the N data interaction protocols one by one, the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects is used as a terminal node, and each of the N contract addresses is used as a connection node;
intelligently analyzing the data interaction protocol, and converting the data interaction protocol into N block chain intelligent contracts;
and performing data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts.
The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Example four
Referring to fig. 4, a schematic diagram of a method for a block chain consensus apparatus provided in an embodiment of the present disclosure is shown, where the method mainly includes:
acquiring N data interaction protocols based on N electronic contracts of at least two data interaction objects, wherein N is a natural number, N contract addresses correspond to the N data interaction protocols one by one, the at least two data interaction objects and the N contract addresses jointly form a tree topology structure, each of the at least two data interaction objects is used as a terminal node, and each of the N contract addresses is used as a connection node;
intelligently analyzing the data interaction protocol, and converting the data interaction protocol into N block chain intelligent contracts;
and performing data distribution between the at least two data interaction objects based on the N blockchain intelligent contracts.
In the embodiment of the specification, the contract framework is realized by a contract template technology, and each contract can distribute data to two or more data interaction objects, so that the whole contract framework can support data interaction protocol nesting at any level, nesting and flexible design of the data interaction protocols are realized, and pluggable effects are achieved.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.
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. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
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 tape magnetic disk storage 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 embodiments in the present specification are all described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.