CN111506577A - 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
CN111506577A
CN111506577A CN202010284970.4A CN202010284970A CN111506577A CN 111506577 A CN111506577 A CN 111506577A CN 202010284970 A CN202010284970 A CN 202010284970A CN 111506577 A CN111506577 A CN 111506577A
Authority
CN
China
Prior art keywords
interface
block chain
state organization
calling
state
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.)
Granted
Application number
CN202010284970.4A
Other languages
Chinese (zh)
Other versions
CN111506577B (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

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/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 data operation method and apparatus based on multiple state organization modes on a blockchain, the method including: the method comprises the steps of configuring an interface set in a block chain in advance, enabling the block chain to simultaneously support multiple state organization modes based on the multiple state organization modes which are registered by mounting, calling a matched operation interface based on determined operation content and mounting points of data operation at this time when a data operation request is processed, and calling an operation method corresponding to the state organization mode in the operation interface. Therefore, multiple state organization modes are simultaneously supported on the block chain, and a user can flexibly select the state organization modes according to the service requirement of the user.

Description

Data operation method and device based on multiple state organization modes on block chain
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a data operation method and apparatus based on multiple state organization modes on a block chain.
Background
The blockchain is a decentralized and innovative solution for solving the multi-party trust problem by using a distributed book technology, and is a leading-edge technology of the current society.
For example, L ibra of Facebook adopts Sparse Merkel Tree (SMT), and in addition, some alliance chain items directly adopt a table mode of a traditional database to organize the state in order to take care of a traditional service system.
Therefore, the current block chain can only support a single state organization mode and cannot meet the diversified service requirements of users.
Disclosure of Invention
One or more embodiments of the present disclosure provide a data operation method, an apparatus, and an electronic device based on multiple state organization modes on a block chain, so as to support multiple state organization modes on the block chain at the same time, and enable a user to flexibly select the data operation method, apparatus, and electronic device according to their own service requirements.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in a first aspect, a data operation method based on multiple state organization modes on a block chain is provided, including:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain 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 operation apparatus based on multiple state organization modes on a block chain is provided, including:
the determining module is used for determining the operation content and the mounting point of the data operation based on the received data operation request;
the interface calling module calls a matched operation interface from an interface set configured on a block chain 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 block chain 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, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain 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 is presented, storing one or more programs which, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain 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 specification, an interface set is pre-configured in a blockchain, and based on multiple state organization manners that have been registered by mounting, the blockchain can simultaneously support multiple state organization manners, 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 of this time, and an operation method corresponding to the state organization manner is called in the operation interface. Therefore, multiple state organization modes are simultaneously supported on the block chain, and a user can flexibly select the state organization modes according to the service requirement of the user.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, reference will now be made briefly to the attached drawings, which are needed in the description of one or more embodiments or prior art, and it should be apparent that the drawings in the description below are only some of the embodiments described in the specification, and that other drawings may be obtained by those skilled in the art without inventive exercise.
Fig. 1 is a schematic step diagram of a data operation method based on a multiple state organization manner on a block chain according to an embodiment of the present disclosure.
Fig. 2 is a schematic structural diagram of a data operation apparatus based on a multi-state organization manner on a block chain according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
In order to make the technical solutions in the present specification better understood, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present specification, and it is obvious that the one or more embodiments described are only a part of the embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.
Example one
Referring to fig. 1, a schematic step diagram of a data operation method based on multiple state organization manners on a blockchain provided by an embodiment of the present specification is provided, 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 multiple state organization manners on the blockchain, and the device may be deployed in a blockchain network through an intelligent contract, and specifically may 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 an operation type of the operation. The operation types at least include: read operation, write operation, hash calculation operation, snapshot operation, and snapshot recovery operation.
The data operation request may be sent by a terminal outside the blockchain network, or may also be sent by a node device within the blockchain network.
The data operation request may carry operation content required by the data operation and a mount point corresponding to a state organization mode used by the data operation. That is to say, the user can select different state organization modes to perform data operation according to the way of adding mounting points in the data operation request according to the own needs.
Step 104: and based on the operation content, calling a matched operation interface from an interface set configured on the block chain in advance.
In this embodiment, the interface set may be configured by: abstract defining a set of operation interfaces corresponding to each operation type based on different operation types; and mounting a plurality of state organization modes maintained by the block chain for each operation interface under a default root directory.
During concrete implementation, a set of common interfaces can be virtualized according to different operation types, so that a series of operation methods required to be met by different state organization modes can be abstracted. Referring to table 1, 5 common interfaces of read operation, write operation, compute hash operation, snapshot operation, and snapshot restore operation are listed here. Each operation type is also defined with interface functions, and a specification for each interface.
Figure BDA0002448147070000051
TABLE 1
Among them, the read operation corresponds to a path, such as 0xabcd/0x1 in the case of mpt and table _ name/index/x _ key in the case of mysql. The operation of computing the root hash is not limited in the manner in which it is computed, but if any one of the values changes, the root hash must also change.
It should be understood that each state organization may implement the interfaces described above, and the specific implementation is not limited. But must satisfy basic functional requirements such as writing a value to a particular path and then reading that path to obtain the same value. Taking a snapshot and then resuming the snapshot, the state must remain unchanged. Wherein a separate microservice may be provided for each state organization.
Step 106: and inquiring the state organization mode requested by the operation from a preset operation registry of the block chain based on the mounting point.
First there is a root state organization, which also implements the aforementioned interfaces, but is provided by the chain itself by default, with the mount point defaulted as a/root. Under the root directory, an operation registry is implemented. Referring to table 2, the name of the state organization mode, the mount point, the micro service information, etc. corresponding to the data operation are recorded. It should be understood that table 2 only shows a partial state organization, and also includes other types of state organizations, which are not listed here. All that is in the operation registry can be used in the blockchain network.
Name (R) Hanging point Micro service information
Mpt /root/mpt ip:port
Mysql /root/mysql ip:port
TABLE 2
Wherein the operating registry and the contracts of the operating registry are implemented in the form of native contracts.
In the embodiment of the present specification, the preset operation registry is obtained by registering under the root directory by means of a transaction. During specific implementation, the corresponding micro-service can be operated, then registration is carried out under a follow-up catalog in a transaction issuing mode, and after the transaction is linked up, mounting action is finished, namely registration is finished.
It should be appreciated that the operational registry in which registration is complete may be updated, e.g., adding or deleting state organizations therein. Therefore, the device can adapt to various demand environments.
Thereafter, when step 106 is executed, a status organization mode matching the items mounted by the mounting point can be inquired from the preset operation registry based on the mounting point determined in step 102.
Step 108: and calling an operation method corresponding to the state organization mode in the operation interface.
When the operation type of the operation content is a read operation and/or a write operation, the operation content also comprises an operation path;
step 108 is specifically performed as:
firstly, based on a determined state organization mode, the mounting points are segmented from the operation path to obtain a relative path.
And step two, calling the 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 the read operation as an example, the intelligent agent is in the process of executing in the virtual machine, and if necessary, reads the value in an operation path, such as/root/mpt/0 xabcd/0x 1.
①, a read operation interface to call the root directory.
②, searching the registry under the root directory for its corresponding specific state organization mode.
The found result of the query and the matching is mpt, the corresponding mounting point is/root/mpt, and the micro-service information is ip: port.
③, the operation path is cut to obtain a relative path 0xabcd/0x1 after the mounting point path is removed.
④, calling the read interface of the micro service corresponding to mpt by taking the relative path 0xabcd/0x1 as a parameter to obtain a return value.
⑤, 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 embodiments of the present specification, the writing operation is similar to the operation, and is not described herein again.
In another implementation, when the operation type of the operation content is a hash calculation operation, step 108 may be specifically implemented as: calling a root hash method of each mounting point in the root hash interface; and hashing each root hash value and the content in the root directory to obtain a final state hash value.
In particular implementation, after the transaction in each block is completed and the operation on the state is also 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 the root directory root _ hash implementation, a root _ hash method of each mount point is called according to the registry to obtain a corresponding root _ hash. And then, hashing the root _ hash and the content stored under the root directory to obtain the final state _ root.
Snapshot and snapshot restore are also similar recursive operations. The blockchain may call a corresponding method of the root directory. The internal implementation of the method can make the relevant operation of the root directory and recursively call the corresponding method of each instance mounted below. The files generated by the snapshot can be placed in a specified directory. This directory is set as a configuration parameter for the block chain from the beginning. The recovery from the snapshot is also read from the specified directory. It should be understood that the principles of the snapshot and snapshot restore operations are similar to the principles of the read-write operations and the compute hash operations described above and will not be 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 block chain, and the plurality of state organization manners at least include some or all of the following: a merkel compressed prefix tree, a sparse merkel tree, and a relational database. Other state organization schemes that may be used in blockchain techniques may also be included and are not listed here.
According to the technical scheme, the interface set is pre-configured in the block chain, the block chain can simultaneously support multiple state organization modes based on the multiple state organization modes which pass the mounting registration, and when a data operation request is processed, the matched operation interface can be called based on the determined operation content and mounting point of the data operation, and the operation method corresponding to the state organization mode is called in the operation interface. Therefore, multiple state organization modes are simultaneously supported on the block chain, and a user can flexibly select the state organization modes according to the service requirement of the user.
Example two
Referring to fig. 2, a data operation apparatus based on a multi-state organization manner on a block chain provided in an embodiment of the present disclosure may include:
the determining module 202 determines the operation content and the mounting point of the data operation based on the received data operation request;
the interface calling module 204 is used for calling a matched operation interface from an interface set configured on a block chain in advance based on the operation content;
the query module 206 is configured to query a state organization manner requested by the current operation from a preset operation registry of the block chain based on the mount point;
and the method calling module 208 calls the operation method corresponding to the state organization mode in the operation interface.
Optionally, as an embodiment, the operation content includes an operation type, where the operation type at least includes: read operation, write operation, hash calculation operation, snapshot operation, and snapshot recovery operation.
In a specific implementation manner of the embodiment of the present specification, 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 call module is specifically configured to, when calling an operation method corresponding to the state organization scheme in the operation interface:
based on the determined state organization mode, segmenting the mounting points from the operation path to obtain a relative path;
and calling the 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 another specific implementation manner of the embodiment of the present specification, the interface set is configured by:
abstract defining a set of operation interfaces corresponding to each operation type based on different operation types;
and mounting a plurality of state organization modes maintained by the block chain for each operation interface under a default root directory.
In another specific implementation manner of the embodiment of the present specification, the preset operation registry is obtained by registering under a root directory by means of a transaction.
In another specific implementation manner of the embodiment of the present specification, 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 the root hash interface;
and hashing each root hash value and the content in the root directory to obtain a final state hash value.
In yet another specific implementation manner of the embodiment of the present specification, a plurality of state organization manners are registered in a preset operation registry of the block chain, where the plurality of state organization manners at least include some or all of the following: a merkel compressed prefix tree, a sparse merkel tree, and a relational database.
According to the technical scheme, the interface set is pre-configured in the block chain, the block chain can simultaneously support multiple state organization modes based on the multiple state organization modes which pass the mounting registration, and when a data operation request is processed, the matched operation interface can be called based on the determined operation content and mounting point of the data operation, and the operation method corresponding to the state organization mode is called in the operation interface. Therefore, multiple state organization modes are simultaneously supported on the block chain, and a user can flexibly select the state organization modes according to the service requirement of the user.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 3, 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, 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 connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (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. 3, but this 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 a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form a data operation device based on a plurality of state organization modes on the block chain on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain 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 according to the embodiment shown in fig. 1 of the present specification may be implemented in or 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 methods, steps, and logic blocks disclosed in one or more 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 one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware 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. 1 and implement the functions of the corresponding apparatus in the embodiment shown in fig. 1, 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.
According to the technical scheme, the interface set is pre-configured in the block chain, the block chain can simultaneously support multiple state organization modes based on the multiple state organization modes which pass the mounting registration, and when a data operation request is processed, the matched operation interface can be called based on the determined operation content and mounting point of the data operation, and the operation method corresponding to the state organization mode is called in the operation interface. Therefore, multiple state organization modes are simultaneously supported on the block chain, and a user can flexibly select the state organization modes according to the service requirement of the user.
Example four
Embodiments of the present specification also propose 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, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular for performing the method of:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
According to the technical scheme, the interface set is pre-configured in the block chain, the block chain can simultaneously support multiple state organization modes based on the multiple state organization modes which pass the mounting registration, and when a data operation request is processed, the matched operation interface can be called based on the determined operation content and mounting point of the data operation, and the operation method corresponding to the state organization mode is called in the operation interface. Therefore, multiple state organization modes are simultaneously supported on the block chain, and a user can flexibly select the state organization modes according to the service requirement of the user.
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 present specification shall be included in the protection scope of the present specification.
The system, apparatus, module or unit illustrated in one or more of the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with a certain functionality. 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 described in a progressive manner, and the same and similar parts among the embodiments are 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.
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.

Claims (14)

1. A data operation method based on a plurality of state organization modes on a block chain comprises the following steps:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
2. The method of claim 1, wherein the operation content includes an operation type, and the operation type at least includes: read operation, write operation, hash calculation operation, snapshot operation, and snapshot recovery operation.
3. The method according to claim 2, 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;
calling an operation method corresponding to the state organization mode in the operation interface, which specifically comprises the following steps:
based on the determined state organization mode, segmenting the mounting points from the operation path to obtain a relative path;
and calling the 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 set of interfaces is configured by:
abstract defining a set of operation interfaces corresponding to each operation type based on different operation types;
and mounting a plurality of state organization modes maintained by the block chain for each operation interface under a default root directory.
5. The method of claim 1, wherein the pre-defined operational registry is registered under the root directory by means of a send transaction.
6. The method according to claim 2, wherein when the operation type of the operation content is a hash operation, the method for calling the operation corresponding to the state organization mode in the operation interface specifically includes:
calling a root hash method of each mounting point in the root hash interface;
and hashing each root hash value and the content in the root directory to obtain a final state hash value.
7. The method according to any one of claims 1 to 6, wherein a plurality of state organization modes are registered in a preset operation registry of the block chain, and the plurality of state organization modes at least comprise part or all of the following: a merkel compressed prefix tree, a sparse merkel tree, and a relational database.
8. A data operation device based on a plurality of state organization modes on a block chain comprises:
the determining module is used for determining the operation content and the mounting point of the data operation based on the received data operation request;
the interface calling module calls a matched operation interface from an interface set configured on a block chain 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 block chain 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.
9. The apparatus of claim 8, wherein the operation content includes an operation type, and the operation type at least includes: read operation, write operation, hash calculation operation, snapshot operation, and snapshot recovery operation.
10. The apparatus according to claim 9, 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 call module is specifically configured to, when calling an operation method corresponding to the state organization scheme in the operation interface:
based on the determined state organization mode, segmenting the mounting points from the operation path to obtain a relative path;
and calling the 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.
11. The apparatus of claim 8, the set of interfaces configured by:
abstract defining a set of operation interfaces corresponding to each operation type based on different operation types;
and mounting a plurality of state organization modes maintained by the block chain for each operation interface under a default root directory.
12. The apparatus according to any one of claims 8 to 11, wherein a plurality of state organizations are registered in a preset operation registry of the block chain, and the plurality of state organizations include at least some or all of the following: a merkel compressed prefix tree, a sparse merkel tree, and a relational database.
13. 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 the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
14. 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:
determining the operation content and the mounting point of the data operation based on the received data operation request;
based on the operation content, calling a matched operation interface from an interface set configured on a block chain in advance;
inquiring a state organization mode requested by the operation from a preset operation registry of the block chain based on the mounting point;
and calling an operation method corresponding to the state organization mode in the operation interface.
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 true CN111506577A (en) 2020-08-07
CN111506577B 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 (6)

* 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
US20180352033A1 (en) * 2017-05-30 2018-12-06 Verizon Patent And Licensing Inc. Blockchain micro-services framework
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

Patent Citations (6)

* 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
US20180352033A1 (en) * 2017-05-30 2018-12-06 Verizon Patent And Licensing Inc. Blockchain micro-services framework
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
CN111506577B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN109669709B (en) Data migration method and data migration system for block chain upgrading
CN108599973B (en) Log association method, device and equipment
CN109298926B (en) Method and device for entering resource transfer party into resource transfer platform and electronic equipment
CN111260469A (en) Block chain-based evidence storing method, block chain-based evidence storing query method, corresponding device and electronic equipment
CN113204432A (en) Transaction processing method and device in block chain and electronic equipment
CN111225018A (en) Request message processing method and device and electronic equipment
CN114900546B (en) Data processing method, device and equipment and readable storage medium
CN110704423B (en) Excitation information acquisition method and device, storage medium and electronic equipment
CN110851207B (en) State transition management method and device, electronic equipment and storage medium
CN107451204B (en) Data query method, device and equipment
CN109345081B (en) Data acquisition method and device and electronic equipment
CN111414207A (en) Page construction method, device and equipment
CN111651467A (en) Block chain link point interface issuing and calling method and device
CN108647102B (en) Service request processing method and device of heterogeneous system and electronic equipment
CN109145621B (en) Document management method and device
CN111488371A (en) Data query method and device
CN110083602B (en) Method and device for data storage and data processing based on hive table
CN111506577A (en) Data operation method and device based on multiple state organization modes on block chain
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
CN114064594A (en) Data processing method and device
CN110688430B (en) Method and device for obtaining data bypass and electronic equipment
CN110032564B (en) Method and device for determining association relation of data table
CN112487497A (en) Method and device for managing off-link files based on intelligent contracts and electronic equipment
CN110018844B (en) Management method and device of decision triggering scheme and electronic equipment

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