CN111506577B - Data operation method and device based on multiple state organization modes on block chain - Google Patents

Data operation method and device based on multiple state organization modes on block chain Download PDF

Info

Publication number
CN111506577B
CN111506577B CN202010284970.4A CN202010284970A CN111506577B CN 111506577 B CN111506577 B CN 111506577B CN 202010284970 A CN202010284970 A CN 202010284970A CN 111506577 B CN111506577 B CN 111506577B
Authority
CN
China
Prior art keywords
interface
blockchain
state organization
state
calling
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
CN202010284970.4A
Other languages
Chinese (zh)
Other versions
CN111506577A (en
Inventor
王晓亮
宁志伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Rivtower Technology Co Ltd
Original Assignee
Hangzhou Rivtower Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Rivtower Technology Co Ltd filed Critical Hangzhou Rivtower Technology Co Ltd
Priority to CN202010284970.4A priority Critical patent/CN111506577B/en
Publication of CN111506577A publication Critical patent/CN111506577A/en
Application granted granted Critical
Publication of CN111506577B publication Critical patent/CN111506577B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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
    • 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
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

One or more embodiments of the present specification disclose a method and apparatus for data manipulation on a blockchain based on multiple state organization, the method comprising: the method comprises the steps that an interface set is pre-configured in a blockchain, based on a plurality of state organization modes which are registered through mounting, the blockchain can support a plurality of state organization modes at the same time, and when a data operation request is processed, a matched operation interface can be called based on the determined operation content and mounting point of the data operation, and an operation method corresponding to the state organization mode is called in the operation interface. Therefore, a plurality of state organization modes are supported on the blockchain at the same time, so that a user can flexibly select according to own business requirements.

Description

Data operation method and device based on multiple state organization modes on block chain
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for data operation based on multiple state organization methods on a blockchain.
Background
Blockchain is a solution for solving the decentralized innovation of the multiparty trust problem by using the distributed ledger wall technology, and is the leading edge technology of the current society.
The world state of most existing blockchains is implemented in an organized manner using the merck compressed prefix tree (Merkle Patricia Tree, MPT). There are also many other ways of organizing the state of blockchain entries. For example, the library of Facebook employs a sparse merck tree (Sparse Merkle Tree, SMT); in addition, some federation chain projects directly employ the form of a traditional database to organize state in order to take care of traditional business systems.
Therefore, the current blockchain can only support a single state organization mode, and cannot meet the diversified business requirements of users.
Disclosure of Invention
The invention provides a data operation method, a device and an electronic device based on multiple state organization modes on a blockchain, so that multiple state organization modes are supported on the blockchain at the same time, and a user can flexibly select according to own service requirements.
To solve the above technical problems, one or more embodiments of the present specification are implemented as follows:
in a first aspect, a method for data manipulation on a blockchain based on multiple state organization is provided, including:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
In a second aspect, a data manipulation device based on multiple state organization on a blockchain is provided, including:
the determining module is used for determining the operation content and mounting point of the data operation based on the received data operation request;
the interface calling module is used for calling the matched operation interface from an interface set configured on the blockchain in advance based on the operation content;
the query module is used for querying a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and the method calling module is used for calling the operation method corresponding to the state organization mode in the operation interface.
In a third aspect, an electronic device is provided, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
In a fourth aspect, a computer-readable storage medium storing one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
As can be seen from the technical solutions provided in one or more embodiments of the present disclosure, an interface set is preconfigured in a blockchain, and based on a plurality of state organization modes that have been registered through mounting, the blockchain can support a plurality of state organization modes at the same time, and when a data operation request is processed, a matched operation interface can be invoked based on the determined operation content and mounting point of the current data operation, and an operation method corresponding to the state organization mode is invoked in the operation interface. Therefore, a plurality of state organization modes are supported on the blockchain at the same time, so that a user can flexibly select according to own business requirements.
Drawings
For a clearer description of one or more embodiments of the present description or of the solutions of the prior art, reference will be made below to the accompanying drawings which are used in the description of one or more embodiments or of the prior art, it being apparent that the drawings in the description below are only some of the embodiments described in the description, from which, without inventive faculty, other drawings can also be obtained for a person skilled in the art.
FIG. 1 is a block chain diagram illustrating a method of data manipulation based on multiple state organization according to an embodiment of the present disclosure.
FIG. 2 is a schematic diagram of a data manipulation device based on multiple state organization on a blockchain according to the embodiments of the present disclosure.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that those skilled in the art will better understand the technical solutions in this specification, a clear and complete description of the technical solutions in one or more embodiments of this specification will be provided below with reference to the accompanying drawings in one or more embodiments of this specification, and it is apparent that the one or more embodiments described are only a part of embodiments of this specification, not all embodiments. All other embodiments, which can be made by one or more embodiments of the present disclosure without inventive faculty, are intended to be within the scope of the present disclosure.
Example 1
Referring to fig. 1, a schematic diagram of steps of a data operation method based on a plurality of state organization modes on a blockchain is provided in an embodiment of the present disclosure, it should be understood that the method is applied to the blockchain, and an execution subject of the method may be a data operation device based on a plurality of state organization modes on the blockchain, and the device may be deployed in a blockchain network through an intelligent contract, and may specifically be a virtual machine executing the intelligent contract. The data manipulation method may include the steps of:
step 102: and determining the operation content and the mounting point of the data operation based on the received data operation request.
It should be understood that the operation content includes not only specific operation data, but also the operation type of the present operation. The operation types at least comprise: read operations, write operations, compute hash operations, snapshot restore operations.
The data operation request may be sent by a terminal outside the blockchain network, or may be sent by a node device in the blockchain network.
The data operation request may carry the operation content required by the current data operation and the mounting point corresponding to the state organization mode used by the current data operation. That is, the user can select different state organization modes to perform data operation according to the way of adding the mounting point in the data operation request according to the own requirement.
Step 104: and calling matched operation interfaces from an interface set configured on the blockchain in advance based on the operation content.
In the embodiment of the present specification, the interface set may be configured by: based on different operation types, abstractly defining a set of operation interfaces corresponding to each operation type; and respectively mounting a plurality of state organization modes maintained by the blockchain for each operation interface under a default root directory.
In concrete implementation, a set of public interfaces can be virtually generated according to different operation types, and a series of operation methods which need to be met in different state organization modes are abstracted. As shown with reference to Table 1, there are listed 5 common interfaces, read operations, write operations, computational hash operations, snapshot operations, and snapshot recovery operations. Each operation type is also defined with an interface function, and a description of each interface.
TABLE 1
The path corresponding to the read operation is, for example, 0xabcd/0x1 in mpt example and table_name/index/x_key in mysql example. The way of computing the root hash is not limited, but the root hash must also be changed if any of the values change.
It should be understood that each state organization may implement these interfaces, and the specific implementation is not limited. But must meet basic functional requirements such as writing a value to a particular path and then reading that path, the same value will be obtained. Taking a snapshot and then resuming the snapshot, the state must remain unchanged. Wherein a separate micro-service may be provided for each state organization.
Step 106: and inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point.
Firstly, there is a root state organization mode, which also implements the aforementioned interfaces, but is provided by default by the chain itself, and the mount point defaults to/root. Under the root directory, an operation registry is implemented. Referring to table 2, names of state organization schemes, mount points, micro-service information, and the like corresponding to data operations are recorded therein. It should be understood that table 2 only shows a partial state organization, but also includes other types of state organization, which are not listed here. Any of the operations described in the operation registry may be used in the blockchain network.
Name of the name Mounting point Microservice information
Mpt /root/mpt ip:port
Mysql /root/mysql ip:port
TABLE 2
Wherein the operation registry and the contracts of the operation registry can be realized in the form of native contracts.
In the embodiment of the present disclosure, the preset operation registry is obtained by registering under a root directory by sending a transaction. When the method is specifically implemented, the corresponding micro-service can be operated, then the registration is carried out under the catalog in a transaction sending mode, and the loading action is completed after the transaction is uplink, namely the registration is completed.
It should be appreciated that the registry of operations completed by registration may be updated, e.g., by adding or deleting state organization patterns therein. Therefore, the system can adapt to various requirements.
Thereafter, when executing step 106, a state organization manner matching with the items mounted by the mounting points may be queried from the preset operation registry based on the mounting points determined in step 102.
Step 108: and calling an operation method corresponding to the state organization mode in the operation interface.
An implementation scheme is that when the operation type of the operation content is a read operation and/or a write operation, the operation content further comprises an operation path;
step 108 is specifically performed as:
and firstly, cutting the mounting points from the operation path based on the determined state organization mode to obtain a relative path.
And secondly, calling an operation method corresponding to the state organization mode under the operation interface by taking the relative path as a parameter, and obtaining an operation return value.
Taking a read operation as an example, the intelligence is about in the process of executing in the virtual machine, if it is required to read a value in one operation path, such as/root/mpt/0 xabcd/0x1.
(1) The read operation interface of the root directory is called.
(2) And inquiring the corresponding specific state organization mode from the registry under the root directory.
Wherein, the query and the matching find mpt, the corresponding mounting point is/root/mpt, and the micro service information is ip: port.
(3) And cutting the operation path to obtain a relative path 0xabcd/0x1 after the mounting point path is removed.
(4) The read interface of the corresponding micro service is called mpt with the corresponding path 0xabcd/0x1 as a parameter to obtain a return value.
(5) And returning the return value to the virtual machine as the return value of the root directory read operation, namely the value to be read at this time.
In the embodiment of the present specification, the writing operation is similar, and will not be described here again.
In another implementation manner, when the operation type of the operation content is a hash operation, step 108 may be specifically performed as: calling a root hash method of each mounting point in a computing root hash interface; and hashing each root hash value with the content under the root directory to obtain a final state hash value.
In particular, when transactions in each block are completed and operations on states are completed, a state_root hash of the entire world state needs to be calculated. The blockchain may invoke a root_hash operation of the root directory. In root_hash implementation of the root directory, a root_hash method of each mounting point is called according to the registry, and a corresponding root_hash is obtained. And then, carrying out hash on the root_hash and the content stored in the root directory, so as to obtain a final state_root.
Snapshot and snapshot recovery, are also similar recursive operations. The blockchain may invoke a corresponding method of the root directory. The internal implementation of the method can recursively call the corresponding method of each instance mounted below while the related operation of the root directory is completed. The snapshot generated file may be placed in a designated directory. This directory is initially set as a configuration parameter for the blockchain. Recovery from the snapshot is also read from the specified directory. It should be appreciated that the principles of snapshot and snapshot recovery operations are similar to those described above for read and write operations and for computing hash operations, and are not described in detail herein.
It should be understood that, in this specification, a plurality of state organization manners are registered in the preset operation registry of the blockchain, where the plurality of state organization manners at least includes some or all of the following: merck compressed prefix tree, sparse merck tree, and relational database. Other state organization schemes that may be used in blockchain technology may also be included, and are not specifically recited herein.
Through the technical scheme, the interface set is preconfigured in the blockchain, the blockchain can simultaneously support a plurality of state organization modes based on the plurality of state organization modes which are registered through mounting, and when a data operation request is processed, a matched operation interface can be called based on the determined operation content and mounting point of the data operation, and an operation method corresponding to the state organization mode is called in the operation interface. Therefore, a plurality of state organization modes are supported on the blockchain at the same time, so that a user can flexibly select according to own business requirements.
Example two
Referring to fig. 2, which is a block chain data operation device based on multiple state organization methods according to an embodiment of the present disclosure, the device 200 may include:
the determining module 202 determines the operation content and mounting point of the data operation based on the received data operation request;
an interface calling module 204 that calls a matched operation interface from an interface set configured in advance on a blockchain based on the operation content;
the query module 206 queries a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and a method calling module 208, for calling the operation method corresponding to the state organization mode in the operation interface.
Optionally, as an embodiment, the operation content includes an operation type, and the operation type includes at least: read operations, write operations, compute hash operations, snapshot restore operations.
In a specific implementation manner of the embodiment of the present disclosure, when the operation type of the operation content is a read operation and/or a write operation, the operation content further includes an operation path;
the method calling module is specifically configured to, when calling an operation method corresponding to the state organization mode in the operation interface:
based on the determined state organization mode, the mounting points are segmented from the operation path to obtain a relative path;
and calling an operation method corresponding to the state organization mode under the operation interface by taking the relative path as a parameter, and obtaining an operation return value.
In yet another specific implementation manner of the embodiment of the present specification, the interface set is configured by:
based on different operation types, abstractly defining a set of operation interfaces corresponding to each operation type;
and respectively mounting a plurality of state organization modes maintained by the blockchain for each operation interface under a default root directory.
In still another specific implementation manner of the embodiment of the present disclosure, the preset operation registry is obtained by registering under a root directory by sending a transaction.
In another specific implementation manner of the embodiments of the present disclosure, when the operation type of the operation content is a hash operation, the method call module is specifically configured to:
calling a root hash method of each mounting point in a computing root hash interface;
and hashing each root hash value with the content under the root directory to obtain a final state hash value.
In still another specific implementation manner of this embodiment of the present disclosure, a plurality of state organization manners are registered in a preset operation registry of the blockchain, where the plurality of state organization manners at least includes some or all of the following: merck compressed prefix tree, sparse merck tree, and relational database.
Through the technical scheme, the interface set is preconfigured in the blockchain, the blockchain can simultaneously support a plurality of state organization modes based on the plurality of state organization modes which are registered through mounting, and when a data operation request is processed, a matched operation interface can be called based on the determined operation content and mounting point of the data operation, and an operation method corresponding to the state organization mode is called in the operation interface. Therefore, a plurality of state organization modes are supported on the blockchain at the same time, so that a user can flexibly select according to own business requirements.
Example III
Fig. 3 is a schematic structural view of an electronic device according to an embodiment of the present specification. Referring to fig. 3, at the hardware level, the electronic device includes a processor, and optionally 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, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 3, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs, and forms a data operation device based on a plurality of state organization modes on a block chain on a logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
The method performed by the apparatus disclosed in the embodiment shown in fig. 1 of the present specification may be applied to a processor or 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 by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic blocks disclosed in one or more embodiments of the present description 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 one or more embodiments of the present disclosure may be embodied directly in a hardware decoding processor or in a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may also execute the method of fig. 1 and implement the functions of the corresponding apparatus in the embodiment shown in fig. 1, which is not described herein.
Of course, in addition to the software implementation, the electronic device of the embodiments of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
Through the technical scheme, the interface set is preconfigured in the blockchain, the blockchain can simultaneously support a plurality of state organization modes based on the plurality of state organization modes which are registered through mounting, and when a data operation request is processed, a matched operation interface can be called based on the determined operation content and mounting point of the data operation, and an operation method corresponding to the state organization mode is called in the operation interface. Therefore, a plurality of state organization modes are supported on the blockchain at the same time, so that a user can flexibly select according to own business requirements.
Example IV
The present description also proposes a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, enable the portable electronic device to perform the method of the embodiment of fig. 1, and in particular to perform the method of:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
Through the technical scheme, the interface set is preconfigured in the blockchain, the blockchain can simultaneously support a plurality of state organization modes based on the plurality of state organization modes which are registered through mounting, and when a data operation request is processed, a matched operation interface can be called based on the determined operation content and mounting point of the data operation, and an operation method corresponding to the state organization mode is called in the operation interface. Therefore, a plurality of state organization modes are supported on the blockchain at the same time, so that a user can flexibly select according to own business requirements.
In summary, the foregoing description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the protection scope of the present specification.
The systems, devices, modules, or units illustrated in one or more of the embodiments described above may be implemented in particular by a computer chip or entity, or by a product having some function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, 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 storage media for a computer 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, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can 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 are also possible or may be advantageous.

Claims (12)

1. A method of data manipulation on a blockchain based on multiple state organization, comprising:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point, wherein the state organization mode is a merck compression prefix tree or a sparse merck tree or a relational database;
calling an operation method corresponding to the state organization mode in the operation interface;
the interface set is configured by: based on different operation types, abstractly defining a set of operation interfaces corresponding to each operation type; and respectively mounting a plurality of state organization modes maintained by the blockchain for each operation interface under a default root directory.
2. The method of claim 1, wherein the operation content includes an operation type, and the operation type at least includes:
read operations, write operations, compute hash operations, snapshot restore operations.
3. The method of claim 2, wherein when the operation type of the operation content is a read operation and/or a write operation, the operation content further includes an operation path;
the operation interface invokes an operation method corresponding to the state organization mode, and the operation interface specifically comprises the following steps:
based on the determined state organization mode, the mounting points are segmented from the operation path to obtain a relative path;
and calling an operation method corresponding to the state organization mode under the operation interface by taking the relative path as a parameter, and obtaining an operation return value.
4. The method of claim 1, wherein the preset operation registry is registered under a root directory by means of transmitting transactions.
5. The method of claim 2, wherein when the operation type of the operation content is a hash operation, invoking an operation method corresponding to the state organization manner in the operation interface, specifically comprising:
calling a root hash method of each mounting point in a computing root hash interface;
and hashing each root hash value with the content under the root directory to obtain a final state hash value.
6. The method of any of claims 1-5, wherein a plurality of state organization patterns are registered in a preset operation registry of the blockchain.
7. A data manipulation device on a blockchain based on multiple state organization, comprising:
the determining module is used for determining the operation content and mounting point of the data operation based on the received data operation request;
the interface calling module is used for calling the matched operation interface from an interface set configured on the blockchain in advance based on the operation content;
the query module queries a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point, wherein the state organization mode is a merck compression prefix tree or a sparse merck tree or a relational database;
the method calling module is used for calling an operation method corresponding to the state organization mode in the operation interface;
the interface set is configured by: based on different operation types, abstractly defining a set of operation interfaces corresponding to each operation type; and respectively mounting a plurality of state organization modes maintained by the blockchain for each operation interface under a default root directory.
8. The apparatus of claim 7, wherein the operation content includes an operation type, and the operation type includes at least:
read operations, write operations, compute hash operations, snapshot restore operations.
9. The apparatus of claim 8, wherein when the operation type of the operation content is a read operation and/or a write operation, the operation content further includes an operation path;
the method calling module is specifically configured to, when calling an operation method corresponding to the state organization mode in the operation interface:
based on the determined state organization mode, the mounting points are segmented from the operation path to obtain a relative path;
and calling an operation method corresponding to the state organization mode under the operation interface by taking the relative path as a parameter, and obtaining an operation return value.
10. The apparatus of any of claims 7-9, wherein a plurality of state organizations are registered in a preset operations registry of the blockchain.
11. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point, wherein the state organization mode is a merck compression prefix tree or a sparse merck tree or a relational database;
calling an operation method corresponding to the state organization mode in the operation interface;
the interface set is configured by: based on different operation types, abstractly defining a set of operation interfaces corresponding to each operation type; and respectively mounting a plurality of state organization modes maintained by the blockchain for each operation interface under a default root directory.
12. A computer readable storage medium storing one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform:
determining the operation content and mounting point of the data operation based on the received data operation request;
invoking a matched operation interface from an interface set configured on a blockchain in advance based on the operation content;
inquiring a state organization mode requested by the operation from a preset operation registry of the blockchain based on the mounting point, wherein the state organization mode is a merck compression prefix tree or a sparse merck tree or a relational database;
calling an operation method corresponding to the state organization mode in the operation interface;
the interface set is configured by: based on different operation types, abstractly defining a set of operation interfaces corresponding to each operation type; and respectively mounting a plurality of state organization modes maintained by the blockchain for each operation interface under a default root directory.
CN202010284970.4A 2020-04-13 2020-04-13 Data operation method and device based on multiple state organization modes on block chain Active CN111506577B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010284970.4A CN111506577B (en) 2020-04-13 2020-04-13 Data operation method and device based on multiple state organization modes on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010284970.4A CN111506577B (en) 2020-04-13 2020-04-13 Data operation method and device based on multiple state organization modes on block chain

Publications (2)

Publication Number Publication Date
CN111506577A CN111506577A (en) 2020-08-07
CN111506577B true CN111506577B (en) 2023-08-22

Family

ID=71875917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010284970.4A Active CN111506577B (en) 2020-04-13 2020-04-13 Data operation method and device based on multiple state organization modes on block chain

Country Status (1)

Country Link
CN (1) CN111506577B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368259A (en) * 2017-05-25 2017-11-21 阿里巴巴集团控股有限公司 A kind of method and apparatus that business datum is write in the catenary system to block
CN109492053A (en) * 2018-11-08 2019-03-19 北京百度网讯科技有限公司 Method and apparatus for accessing data
CN109857724A (en) * 2019-02-12 2019-06-07 众安信息技术服务有限公司 The method and apparatus for supporting multitype database is realized based on block chain
CN110334154A (en) * 2019-06-28 2019-10-15 阿里巴巴集团控股有限公司 Based on the classification storage method and device of block chain, electronic equipment
CN110535971A (en) * 2019-09-16 2019-12-03 腾讯科技(深圳)有限公司 Interface configuration processing method, device, equipment and storage medium based on block chain

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10447770B2 (en) * 2017-05-30 2019-10-15 Verizon Patent And Licensing Inc. Blockchain micro-services framework

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368259A (en) * 2017-05-25 2017-11-21 阿里巴巴集团控股有限公司 A kind of method and apparatus that business datum is write in the catenary system to block
CN109492053A (en) * 2018-11-08 2019-03-19 北京百度网讯科技有限公司 Method and apparatus for accessing data
CN109857724A (en) * 2019-02-12 2019-06-07 众安信息技术服务有限公司 The method and apparatus for supporting multitype database is realized based on block chain
CN110334154A (en) * 2019-06-28 2019-10-15 阿里巴巴集团控股有限公司 Based on the classification storage method and device of block chain, electronic equipment
CN110535971A (en) * 2019-09-16 2019-12-03 腾讯科技(深圳)有限公司 Interface configuration processing method, device, equipment and storage medium based on block chain

Also Published As

Publication number Publication date
CN111506577A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
US11626972B2 (en) Data processing method and apparatus
CN109669709B (en) Data migration method and data migration system for block chain upgrading
CN111898139B (en) Data reading and writing method and device and electronic equipment
CN107622091B (en) Database query method and device
CN107402821B (en) Access control method, device and equipment for shared resources
CN106878367B (en) Method and device for realizing asynchronous call of service interface
CN111651467B (en) Block chain node interface issuing and calling method and device
CN115002228A (en) Service cascade calling method and device, electronic equipment and storage medium
CN111949297B (en) Block chain intelligent contract upgrading method and device and electronic equipment
CN111506577B (en) Data operation method and device based on multiple state organization modes on block chain
CN111488371A (en) Data query method and device
CN116166747A (en) Block chain intelligent contract data processing method and device
CN112527792A (en) Data storage method, device, equipment and storage medium
CN110750271B (en) Service aggregation, method and device for executing aggregated service and electronic equipment
CN112464049B (en) Method, device and equipment for downloading number detail list
US20230138113A1 (en) System for retrieval of large datasets in cloud environments
CN114064594A (en) Data processing method and device
CN112487497A (en) Method and device for managing off-link files based on intelligent contracts and electronic equipment
CN111475807A (en) Detection method and device for movable storage equipment
CN112749189A (en) Data query method and device
CN116541397A (en) State data query method and device
CN117041980B (en) Network element management method and device, storage medium and electronic equipment
CN111461647B (en) Business collaboration processing method and system based on block chain
CN116975151A (en) Block chain event processing method and device
CN114610805A (en) Data processing method and device

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