WO2018214897A1 - 一种数据库状态确定方法、一致性验证方法及装置 - Google Patents
一种数据库状态确定方法、一致性验证方法及装置 Download PDFInfo
- Publication number
- WO2018214897A1 WO2018214897A1 PCT/CN2018/087966 CN2018087966W WO2018214897A1 WO 2018214897 A1 WO2018214897 A1 WO 2018214897A1 CN 2018087966 W CN2018087966 W CN 2018087966W WO 2018214897 A1 WO2018214897 A1 WO 2018214897A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- state
- data
- database
- determining
- value
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2365—Ensuring data consistency and integrity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Definitions
- the present application relates to the field of computer technology, and in particular, to a database state determination method and apparatus, and a database consistency verification method and apparatus.
- each database When a computer stores data, it sometimes stores the same data in multiple different databases. Based on business needs, it is often required to maintain the synchronization of data storage in these different databases, that is, the data stored in each database is often Will be required to be consistent.
- blockchain technology after verification, multiple transaction records will be written into each node (corresponding database) that holds blockchain data, in order to ensure that new blocks accepted by each node are generated, each node The data stored in the corresponding database should be consistent. For example, in the case of a master-slave database in distributed storage, in order to facilitate data recovery in the primary database, data can be restored from the database (backup database), and the primary database is often required to be consistent with the data stored from the database.
- the data in the database is often many, when checking the consistency of the database, the data in the multiple databases are often not compared one by one, but by comparing the state values used to characterize the state of the data in the database.
- the data status in the database can be simply referred to as the database status.
- the state value is often obtained by calculating all the data in the database.
- the state value may be a hash value of the data in the database, then when determining the hash value, all the data in the database needs to be spliced to obtain a string, and then the string is used as an input of the hash function. The hash function is calculated to get the hash value. Then, when there are more data in the database, determining the state value of the database consumes more computing resources.
- the embodiment of the present application provides a database state determination method for solving the problem that the computing resource value is consumed when determining the database state value in the prior art.
- a database state determination method includes:
- the embodiment of the present application further provides a database state determining apparatus, which is used to solve the problem that the computing resource value is consumed when determining the database state value in the prior art.
- a database state determining device includes:
- a first determining unit that determines a state transition operation performed on the target database
- a second determining unit determining, according to the state value of the target database before performing the state transition operation, and the determined state transition operation, determining a state value of the target database after performing the state migration operation, the state value Used to characterize the state of the target database.
- a database consistency verification method comprising:
- a database consistency verification device includes:
- a state determining unit determining whether the state values of the first database and the second database to be verified are the same, and the state values of the first database and the second database are determined by the database state determining device provided by the application;
- the consistency determining unit determines that the states of the first database and the second database are consistent when determining that the state values of the first database and the second database are the same.
- the state value of the database performed by the state migration operation by determining the state transition operation performed on the target database, and then determining the state transition operation according to the determined state, and performing the state value of the database before the state migration operation Compared with the prior art, the state value of the database after performing the state migration operation does not need to perform calculation on all the data in the entire database, thereby avoiding consuming excessive computing resources.
- FIG. 1 is a schematic diagram of a data structure of a hash tree provided by the present application.
- FIG. 2 is a schematic flowchart of an implementation process of a database state determining method provided by the present application
- FIG. 3 is a schematic flowchart of an implementation process of a database consistency verification method provided by the present application.
- FIG. 4 is a schematic flowchart of an implementation process of a database state determination method provided by the present application.
- FIG. 5 is a schematic structural diagram of a database state determining apparatus provided by the present application.
- FIG. 6 is a schematic structural diagram of a database consistency verification apparatus provided by the present application.
- the essence of the blockchain is distributed database, and the change of each data in the blockchain. It will broadcast to each blockchain node of the whole network, and each node needs to have full and consistent data.
- data is often stored in multiple data units, and one data unit may be a block in a blockchain or a data unit composed of multiple blocks.
- a hash tree is constructed with a hash value of the data in each data unit, such as a Merkle Tree, and then the hash value of the root node of the hash tree is used as a database.
- the state value which in turn uniquely characterizes the state of the database.
- Figure 1 shows a data structure of a hash tree constructed for a database.
- the hash value of the data in each data unit is first calculated, and then the obtained The hash value is used as the value of the leaf node of the hash tree, and then the hash value of the parent node of each leaf node is calculated, and finally the hash value of the root node of the hash tree is obtained.
- the state value of the database needs to be re-determined. This requires repeating the above process of calculating the root node of the hash tree. If there is more data in the database, it is necessary to hash a large amount of data. This consumes more computing resources.
- the present application provides a database state determination method for determining a state of a target database by a state transition operation performed on a target database.
- the data state determination method provided by the present application will be described in detail below, and the execution body of the method may be a computing device, such as a database node in a distributed database, or a node in a blockchain.
- the execution body of the method may also be an application that implements the database state determination method provided by the present application.
- the implementation manner of the method will be described below by taking the execution body of the method as a computing device as an example. It will be understood that the execution of the method is merely an illustrative description of the computing device and should not be construed as limiting the method.
- FIG. 2 The schematic diagram of the implementation process of the database state determination method provided by the present application is as shown in FIG. 2, and includes the following steps:
- Step S101 determining a state transition operation performed on the target database
- the state transition operation herein may be a database operation that causes a state change of the database to be sent.
- the data may be a data write operation, a data update operation, or a data deletion operation.
- the state transition operation may include the processed data itself and the pair.
- the way data is processed, such as data write operations, contains the data to be written and the specific location where the data is written to the database.
- the target database here may be a database for which the state migration operation is directed, and the target database may be any database to which the state value is to be determined.
- the state transition operation is implemented by an object, and then the data operation object corresponding to the state transition operation can be determined. Determined; or, it may be determined according to a database operation statement corresponding to the state migration operation.
- the data manipulation object here is an object of data used to perform database operations in an object-oriented application.
- an "object” generally refers to an instance of a class loaded in memory, with related member variables and members. function.
- the state of the database after the state migration operation is performed can be determined.
- Step S102 Determine a state value of the target database after performing the state migration operation according to the state value of the target database before performing the state transition operation and the determined state transition operation.
- the state value here is used to characterize the state of the target database. Since the state value can be used to perform a consistency check on the target database, the state value can be used to uniquely characterize the data stored in the target database, such as It can be a hash value or a globally unique identifier.
- the hash value is obtained by hashing the input parameter through a hash function, and the global unique identifier may be an identifier allocated by the system for uniquely identifying the state of the database in the system.
- the state after the data change in the database is related to the state before the data change and the state transition operation
- the state value of the target database before the operation is performed, and the determined state can be determined.
- the migration operation determines the status value of the target database after the state migration operation is performed.
- the state migration operation may be determined by determining a manner in which the state operation operation corresponds to the data operation object, and then the object may be subsequently operated according to the determined data. And the status value of the target database before the state migration operation is performed to determine the state value of the target database after the state migration operation is performed.
- the state transition operation may also be uniquely characterized by a certain feature value, and the feature value of the state transition operation may be a hash value, or may be used for unique identification.
- the globally unique identifier of the state migration operation, etc. will not be described here.
- the data format of the feature value may be the same as or similar to the data format of the target database state value. .
- a hash value of the data operation object may be determined, and then determined according to the determined hash value of the data operation object and the state value of the target database before the state transition operation is performed.
- the status value of the target database after the state migration operation may be determined, and then determined according to the determined hash value of the data operation object and the state value of the target database before the state transition operation is performed.
- a serialization operation may be performed on the data manipulation object, and the serialization operation may state the state of the object.
- Information is converted to a format that can be stored or transmitted.
- the serialized data corresponding to the data operation object can be obtained.
- the data format of the serialized data can be, for example, a binary format, and the data in the binary format can be used as an input of the hash algorithm.
- the serialized data may be hashed to obtain a hash value of the serialized data, and the hash value of the serialized data may be used as the data operation object.
- the hash value may be used as the data operation object.
- each state transition operation of a node in a blockchain often corresponds to multiple data operation objects
- the data corresponding to the state transition operation When the operation object is serialized, each data operation object can be serialized separately, and then the obtained serialized data is spliced in order, and finally the obtained spliced serialized data is serialized as a state transition operation. data.
- the serialized data obtained is spliced in order, if the order of the state transition operations of each data operation object is fixed, the serialized data corresponding to each data operation object is spliced in the order of the execution state transition operation. And obtaining the serialized data after the splicing; if the order of performing the state transition operation of each data operation object is not fixed, splicing the serialized data corresponding to each data operation object according to the first predetermined order, and obtaining the spliced sequence Data. Then, the hash value of the stitched serialized data may be calculated by using a hash function, and the hash value of the stitched serialized data is used as a hash value of the data operation object corresponding to the state transition operation.
- the first predetermined order may be a preset splicing order. For example, if the format of the data in each data operation object is a key-value format, the sequence corresponding to each data operation object may be in the order of the key value from largest to smallest. The data is spliced.
- the hash value of the determined data operation object and the state value of the target database before the state migration operation may be determined, and after performing the state migration operation, The status value of the target database.
- the hash value of the data operation object and the state value of the target database before the state transition operation are performed may be spliced according to the second predetermined sequence to obtain spliced data, and the hash value of the spliced data is determined, and the splicing is performed.
- the hash value of the data is the status value of the target database after the state migration operation is performed.
- the first predetermined order and the second predetermined order herein may be a preset splicing order.
- the same splicing order should be followed when splicing the data, otherwise the data between the databases is consistent. It also causes the calculated state values to be different, and thus it is impossible to accurately check the consistency of each database.
- the split character can be used to ensure the uniqueness of the spliced data, and the preset split character can be placed at the splicing position of the data, wherein the preset Split characters can be pre-defined by the developer.
- the preset split character when splicing the serialized data corresponding to each data operation object, may be set between at least two serialized data to be spliced, and then set The serialized data after the preset split character is spliced to obtain the serialized data after splicing.
- the state transition operation performed on the target database is determined, and then the operation is migrated according to the determined state, and before the state migration operation is performed.
- the state value of the database can determine the state value of the database after the state migration operation is performed. Compared with the prior art, it is not necessary to perform calculation on all data in the entire database, thereby avoiding consuming excessive computing resources.
- the hash value of the node is calculated by using a tree structure such as a hash tree, so that there is no need to construct a tree structure in the embodiment of the present application, and there is no need to The hash value of the node is calculated to avoid consuming too much computing resources.
- serializing operations on data manipulation objects and hashing serialized data may consume certain computing resources, but in distributed databases, especially in distributed databases.
- the amount of data stored in the database is often very large, and the computing resources consumed by hashing the data in the database are much larger than the computing resources consumed by the above operations in the embodiment of the present application.
- the state value of the database can be determined, and the database can be consistently verified according to the determined state value.
- a database consistency verification method provided by the present application will be described in detail below.
- FIG. 3 The schematic diagram of the implementation process of the method is shown in FIG. 3, and includes the following steps:
- Step S201 determining whether the status values of the first database and the second database to be verified are the same;
- the first database and the second database are the databases to be verified. Then, the state values of the first database and the second database may be respectively determined according to the database state determining method provided in the embodiment of the present application. The relevant description in the application will not be repeated here.
- Step S202 If the status values of the first database and the second database are the same, determine that the states of the first database and the second database are consistent.
- the database state determination method of the present application is taken as an example in which the target database is a database of a node in the blockchain technology. Do further explanation.
- the blockchain application is described as a fabric block chain application
- the target database is a LevelDB database
- the database state value is a hash value.
- the LevelDB database may perform a state transition operation by the data operation object.
- the data operation object can write the data in the key-value format to the LevelDB database.
- the consensus algorithm ensures that the state transition operations between the nodes are consistent, and the order of the state transitions is consistent. .
- the hash value of the target database can be recalculated according to the operation.
- the implementation flow diagram of the process is as shown in FIG. 4, and includes the following steps:
- Step S301 Determine a data operation object corresponding to the state transition operation
- a single state transition operation often corresponds to multiple data manipulation objects.
- the transition i of the i-th state transition operation for the node can be expressed as a set ⁇ op1, op2..., opN ⁇ , where op is a shorthand for operation, indicating a single
- Step S302 serializing each data operation object into serialized data in a binary format
- Step S303 determining whether the order of each data operation object execution state migration operation is fixed, and if so, executing step S304; if not, executing step S305;
- Step S304 If the execution order of each data operation object is fixed, the serialized data corresponding to each data operation object is spliced according to the order of execution state transition operation, and the spliced serialized data is obtained, and the process proceeds to step S306;
- Step S305 If the execution order of each data operation object is not fixed, the serialized data corresponding to each data operation object is spliced according to the first predetermined order, and the spliced serialized data is obtained;
- the first preset order here may be in the order of the key values from large to small.
- Step S306 determining a hash value of the serialized data after the splicing as a hash value corresponding to the state transition operation;
- the spliced serialized data is used as the input of the hash algorithm, and the hash calculation is performed to obtain the hash value of the spliced serialized data, that is, the hash value Hash (Transition i ) of the state transition operation Transition i .
- Step S307 splicing the hash value corresponding to the state transition operation and the hash value H i-1 of the target database before performing the state migration operation according to the second predetermined sequence to obtain spliced data;
- Step S308 determining a hash value of the spliced data, the hash value of the data migration splicing operation after the hash value H i Transition i as the execution state of the target database.
- H i Hash(H i-1
- Hash (x) is a hash function, which means performing a hash operation on the input data x, and the hash function may be, for example, SHA3.
- the database state determining method when determining the hash value of the database after the data changes, determining the state transition operation Transition i performed on the target database, and then determining the hash value corresponding to the state transition operation.
- Hash (Transition i ) according to the hash value H i-1 of the database before the state migration operation is performed, the state value H i of the database after the state migration operation is performed can be determined. Compared with the prior art, it is not necessary to calculate all the data in the database of the entire node to calculate the hash value, and avoid consuming excessive computing resources.
- the hash value of the node is calculated by using a tree structure such as a hash tree, so that there is no need to construct a tree structure in the embodiment of the present application, and there is no need to The hash value of the node is calculated, further reducing the consumption of computing resources.
- the embodiment of the present application further provides a corresponding database state determining device. As shown in FIG. 5, the device specifically includes:
- the first determining unit 401 determines a state transition operation performed on the target database
- the second determining unit 402 determines, according to the state value of the target database before performing the state transition operation, and the determined state transition operation, a state value of the target database after performing the state migration operation, the state The value is used to characterize the state of the target database.
- the first determining unit 401 determines a data operation object for performing the state transition operation on the target database.
- the second determining unit 402 determines, according to the state value of the target database before performing the state transition operation, and the determined data operation object, a state value of the target database after performing the state migration operation.
- the second determining unit 402 specifically includes a first hash value determining subunit 403 and a first state value determining subunit 404, where:
- the first hash value determining subunit 403 determines a hash value of the data operation object
- the first state value determining subunit 404 determines, according to the determined hash value of the data operation object, and the state value of the target database before performing the state transition operation, to determine, after performing the state migration operation The status value of the target database.
- the first hash value determining subunit 403 specifically includes a serialization data determining subunit 405 and a second hash value determining subunit 406, where:
- the serialization data determining subunit 405 serializes the data operation object to obtain serialized data
- the second hash value determining subunit 406 determines a hash value of the serialized data, and uses a hash value of the serialized data as a hash value of the data operation object.
- the serialization data determining subunit 405 specifically includes a first splicing subunit 407 and a second splicing subunit 408:
- the first splicing subunit 407 determines, in the presence of more than one data operation object for performing the state migrating operation on the target database, and the sequence of each of the data operation objects performs a state migrating operation. And splicing the serialized data corresponding to each of the data operation objects in the order of performing the state transition operation to obtain the serialized data after the splicing;
- the second splicing sub-unit 408 in the presence of more than one data operation object for performing the state migrating operation on the target database, and the order of performing the state migrating operation of each of the data operation objects is uncertain, according to the first predetermined In sequence, the serialized data corresponding to each of the data operation objects is spliced to obtain spliced serialized data.
- the second splicing sub-unit 408 sets the preset splitting character between at least two serialized data, after setting the preset splitting character, in order to prevent different sets of data from being the same after splicing.
- Each serialized data is spliced to obtain spliced serialized data.
- the first state value determining subunit 404 performs, in a second predetermined order, a hash value of the data operation object and a state value of the target database before performing the state transition operation. Splicing to obtain spliced data;
- the target database is a database corresponding to any node in the blockchain.
- the status value is used to uniquely characterize features stored in the target database.
- the database state determining apparatus determines a state transition operation performed on the target database by determining a state transition value of the database after the data changes, and the state transition operation is a state migration operation that causes the data to undergo the change, and then Determining the state value of the database after performing the state migration operation according to the determined state migration operation and the state value of the database before the state migration operation is performed.
- the state transition operation is a state migration operation that causes the data to undergo the change
- the embodiment of the present application further provides a corresponding database consistency verification device.
- the device specifically includes:
- the determining unit 501 is configured to determine whether the status values of the first database and the second database to be verified are the same, and the status values of the first database and the second database are the devices according to any one of claims 10-16. definite;
- the consistency determining unit 502 determines that the states of the first database and the second database are consistent when determining that the state values of the first database and the second database are the same.
- a Programmable Logic Device (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by the user programming the device.
- HDL Hardware Description Language
- the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
- computer readable program code eg, software or firmware
- examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
- the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
- Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
- a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
- the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
- a typical implementation device is a computer.
- the computer can be, for example, a personal computer, a laptop computer, a cellular phone, 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.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, 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 disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
- the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
- program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
- the present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
- program modules can be located in both local and remote computer storage media including storage devices.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
Claims (18)
- 一种数据库状态确定方法,包括:确定对目标数据库执行的状态迁移操作;根据执行所述状态迁移操作前所述目标数据库的状态值以及所述状态迁移操作,确定执行所述状态迁移操作后所述目标数据库的状态值,所述状态值用于表征所述目标数据库的状态。
- 如权利要求1所述方法,确定对目标数据库执行的状态迁移操作,具体包括:确定用于对目标数据库执行所述状态迁移操作的数据操作对象;根据执行所述状态迁移操作前所述目标数据库的状态值以及所述状态迁移操作,确定执行所述状态迁移操作后所述目标数据库的状态值,具体包括:根据执行所述状态迁移操作前所述目标数据库的状态值,以及确定的所述数据操作对象,确定执行所述状态迁移操作后所述目标数据库的状态值。
- 如权利要求2所述方法,所述目标数据库为区块链数据库,根据执行所述状态迁移操作前所述目标数据库的状态值,以及确定的所述数据操作对象,确定执行所述状态迁移操作后所述目标数据库的状态值,具体包括:确定所述数据操作对象的哈希值;根据确定的所述数据操作对象的哈希值,以及执行所述状态迁移操作前所述目标数据库的状态值,确定执行所述状态迁移操作后所述目标数据库的状态值。
- 如权利要求3所述方法,确定所述数据操作对象的哈希值,具体包括:对所述数据操作对象进行序列化,得到序列化数据;确定所述序列化数据的哈希值,将所述序列化数据的哈希值作为所述数据操作对象的哈希值。
- 如权利要求4所述方法,若存在不止一个用于对目标数据库执行所述状态迁移操作的数据操作对象,则对所述数据操作对象进行序列化,得到序列 化数据,具体包括:若各所述数据操作对象执行状态迁移操作的顺序是固定的,则按照执行状态迁移操作的顺序,对各所述数据操作对象对应的序列化数据进行拼接,得到拼接后的序列化数据;若各所述数据操作对象执行状态迁移操作的顺序是不固定的,则按照第一预定顺序,对各所述数据操作对象对应的序列化数据进行拼接,得到拼接后的序列化数据。
- 如权利要求5所述方法,对各所述数据操作对象对应的序列化数据进行拼接,得到拼接后的序列化数据,具体包括:在对各所述数据操作对象对应的序列化数据进行拼接时,将预设分割字符设置于至少两个序列化数据之间,对设置预设分割字符后的各序列化数据进行拼接,得到拼接后的序列化数据。
- 如权利要求3所述方法,根据确定的所述数据操作对象的哈希值,以及执行所述状态迁移操作前所述目标数据库的状态值,确定执行所述状态迁移操作后所述目标数据库的状态值,具体包括:按照第二预定顺序,对所述数据操作对象的哈希值和执行所述状态迁移操作前所述目标数据库的状态值进行拼接,得到拼接数据;确定所述拼接数据的哈希值,将所述拼接数据的哈希值作为执行所述状态迁移操作后所述目标数据库的状态值。
- 如权利要求1-7任一所述方法,所述目标数据库为区块链中任一节点对应的数据库。
- 如权利要求1所述方法,所述状态值用于唯一地表征所述目标数据库中存储的数据的特征。
- 一种数据库一致性验证方法,包括:判断待校验的第一数据库和第二数据库的状态值是否相同,所述第一数据库和所述第二数据库的状态值是通过权利要求1-8任一权项所述方法确定的;若所述第一数据库和所述第二数据库的状态值相同,则确定所述第一数据库和所述第二数据库的状态一致。
- 一种数据库状态确定装置,包括:第一确定单元,确定对目标数据库执行的状态迁移操作;第二确定单元,根据执行所述状态迁移操作前所述目标数据库的状态值,以及确定的所述状态迁移操作,确定执行所述状态迁移操作后所述目标数据库的状态值,所述状态值用于表征所述目标数据库的状态。
- 如权利要求11所述装置,所述第一确定单元,确定用于对目标数据库执行所述状态迁移操作的数据操作对象;所述第二确定单元,根据执行所述状态迁移操作前所述目标数据库的状态值,以及确定的所述数据操作对象,确定执行所述状态迁移操作后所述目标数据库的状态值。
- 如权利要求12所述装置,所述第二确定单元具体包括第一哈希值确定子单元和第一状态值确定子单元,其中:所述第一哈希值确定子单元,确定所述数据操作对象的哈希值;所述第一状态值确定子单元,根据确定的所述数据操作对象的哈希值,以及执行所述状态迁移操作前所述目标数据库的状态值,确定执行所述状态迁移操作后所述目标数据库的状态值。
- 如权利要求13所述装置,所述第一哈希值确定子单元,具体包括序列化数据确定子单元和第二哈希值确定子单元,其中:所述序列化数据确定子单元,对所述数据操作对象进行序列化,得到序列化数据;所述第二哈希值确定子单元,确定所述序列化数据的哈希值,将所述序列化数据的哈希值作为所述数据操作对象的哈希值。
- 如权利要求14所述装置,所述序列化数据确定子单元,具体包括第一拼接子单元和第二拼接子单元:所述第一拼接子单元,在存在不止一个用于对目标数据库执行所述状态迁移操作的数据操作对象,且各所述数据操作对象执行状态迁移操作的顺序确定时,按照执行状态迁移操作的顺序,对各所述数据操作对象对应的序列化数据进行拼接,得到拼接后的序列化数据;所述第二拼接子单元,在存在不止一个用于对目标数据库执行所述状态迁移操作的数据操作对象,且各所述数据操作对象执行状态迁移操作的顺序不确定时,按照第一预定顺序,对各所述数据操作对象对应的序列化数据进行拼接,得到拼接后的序列化数据。
- 如权利要求13所述装置,所述第一状态值确定子单元,按照第二预定顺序,对所述数据操作对象的哈希值和执行所述状态迁移操作前所述目标数据库的状态值进行拼接,得到拼接数据;确定所述拼接数据的哈希值,将所述拼接数据的哈希值作为执行所述状态迁移操作后所述目标数据库的状态值。
- 如权利要求11-16任一所述装置,所述目标数据库为区块链中任一节点对应的数据库。
- 一种数据库一致性验证装置,包括:判断单元,判断待校验的第一数据库和第二数据库的状态值是否相同,所述第一数据库和所述第二数据库的状态值是通过权利要求10-16任一权项所述装置确定的;一致性确定单元,在确定所述第一数据库和所述第二数据库的状态值相同时,则确定所述第一数据库和所述第二数据库的状态一致。
Priority Applications (11)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2019121699A RU2725760C1 (ru) | 2017-05-25 | 2018-05-23 | Способ и устройство определения состояния базы данных и способ и устройство верификации согласованности |
CA3049831A CA3049831C (en) | 2017-05-25 | 2018-05-23 | Database state determining method and device, and consistency verifying method and device |
JP2019538236A JP6921206B2 (ja) | 2017-05-25 | 2018-05-23 | データベース状態決定方法およびデバイスならびに整合性検証方法およびデバイス |
EP18805650.1A EP3557452B1 (en) | 2017-05-25 | 2018-05-23 | Database state determining method and device, and consistency verifying method and device |
KR1020197020615A KR102231058B1 (ko) | 2017-05-25 | 2018-05-23 | 데이터베이스 상태 결정 방법 및 디바이스, 및 일관성 검증 방법 및 디바이스 |
AU2018274424A AU2018274424B2 (en) | 2017-05-25 | 2018-05-23 | Database state determining method and device, and consistency verifying method and device |
BR112019014478-1A BR112019014478A2 (pt) | 2017-05-25 | 2018-05-23 | Método para a determinação do estado da base de dados e dispositivo para a determinação do estado da base de dados |
SG11201906495TA SG11201906495TA (en) | 2017-05-25 | 2018-05-23 | Database state determining method and device, and consistency verifying method and device |
MX2019008383A MX2019008383A (es) | 2017-05-25 | 2018-05-23 | Metodo y dispositivo de determinacion de estado de base de datos, y metodo y dispositivo de verificacion de consistencia. |
PH12019501637A PH12019501637A1 (en) | 2017-05-25 | 2019-07-12 | Database state determining method and device, and consistency verifying method and device |
US16/665,200 US10789243B2 (en) | 2017-05-25 | 2019-10-28 | Database state determining method and device, and consistency verifying method and device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710377721.8 | 2017-05-25 | ||
CN201710377721.8A CN107247749B (zh) | 2017-05-25 | 2017-05-25 | 一种数据库状态确定方法、一致性验证方法及装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/665,200 Continuation US10789243B2 (en) | 2017-05-25 | 2019-10-28 | Database state determining method and device, and consistency verifying method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018214897A1 true WO2018214897A1 (zh) | 2018-11-29 |
Family
ID=60017352
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/087966 WO2018214897A1 (zh) | 2017-05-25 | 2018-05-23 | 一种数据库状态确定方法、一致性验证方法及装置 |
Country Status (14)
Country | Link |
---|---|
US (1) | US10789243B2 (zh) |
EP (1) | EP3557452B1 (zh) |
JP (1) | JP6921206B2 (zh) |
KR (1) | KR102231058B1 (zh) |
CN (1) | CN107247749B (zh) |
AU (1) | AU2018274424B2 (zh) |
BR (1) | BR112019014478A2 (zh) |
CA (1) | CA3049831C (zh) |
MX (1) | MX2019008383A (zh) |
PH (1) | PH12019501637A1 (zh) |
RU (1) | RU2725760C1 (zh) |
SG (1) | SG11201906495TA (zh) |
TW (1) | TWI710916B (zh) |
WO (1) | WO2018214897A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10789243B2 (en) | 2017-05-25 | 2020-09-29 | Alibaba Group Holding Limited | Database state determining method and device, and consistency verifying method and device |
Families Citing this family (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB201713046D0 (en) * | 2017-08-15 | 2017-09-27 | Nchain Holdings Ltd | Computer-implemented system and method |
CN107807982B (zh) * | 2017-10-27 | 2020-09-18 | 中国农业银行股份有限公司 | 一种异构数据库的一致性校验方法及装置 |
CN107729541A (zh) * | 2017-10-31 | 2018-02-23 | 咪咕数字传媒有限公司 | 一种数据处理方法、装置及计算机可读存储介质 |
US10866963B2 (en) | 2017-12-28 | 2020-12-15 | Dropbox, Inc. | File system authentication |
US11146407B2 (en) | 2018-04-17 | 2021-10-12 | Digicert, Inc. | Digital certificate validation using untrusted data |
CN108615156A (zh) * | 2018-05-09 | 2018-10-02 | 上海魅联信息技术有限公司 | 一种基于区块链的数据结构 |
CN109345159A (zh) * | 2018-08-21 | 2019-02-15 | 深圳市口袋网络科技有限公司 | 一种数据写入方法及装置、设备、存储介质 |
CN109446211B (zh) * | 2018-10-08 | 2020-08-14 | 联动优势科技有限公司 | 一种一致性校验方法及装置 |
TWI710238B (zh) * | 2018-12-17 | 2020-11-11 | 財團法人國家實驗研究院 | 分散式儲存系統之同步刪除方法 |
US11044096B2 (en) * | 2019-02-04 | 2021-06-22 | Accenture Global Solutions Limited | Blockchain based digital identity generation and verification |
US11122091B2 (en) * | 2019-04-16 | 2021-09-14 | FireMon, LLC | Network security and management system |
CN110175758A (zh) * | 2019-05-08 | 2019-08-27 | 杭州宇链科技有限公司 | 一种基于区块链的链上多层自动分润方法 |
KR102620584B1 (ko) * | 2019-05-17 | 2024-01-02 | 삼성에스디에스 주식회사 | 블록체인 기반 시스템에서 상태 db의 무결성을 보장하는 장치 및 그 방법 |
SG11202001975SA (en) * | 2019-07-11 | 2020-04-29 | Alibaba Group Holding Ltd | Shared blockchain data storage |
WO2019179540A2 (en) | 2019-07-11 | 2019-09-26 | Alibaba Group Holding Limited | Shared blockchain data storage |
EP3669280B1 (en) | 2019-07-11 | 2021-09-08 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
CN112559484A (zh) * | 2019-09-25 | 2021-03-26 | 伊姆西Ip控股有限责任公司 | 用于管理数据对象的方法、设备和计算机程序产品 |
CN111639952A (zh) * | 2020-05-28 | 2020-09-08 | 深圳壹账通智能科技有限公司 | 基于区块链的退货核验方法、***、服务器及终端 |
CN112463132B (zh) * | 2020-11-13 | 2023-06-06 | 四川新网银行股份有限公司 | 一种数据库切换工具及切换方法 |
CN113420036A (zh) * | 2021-06-22 | 2021-09-21 | 南方电网数字电网研究院有限公司 | 一种电网监控***内存库关系库一致性校验方法 |
US20230185670A1 (en) * | 2021-12-13 | 2023-06-15 | Scality, S.A. | Method and apparatus for monitoring storage system replication |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957858A (zh) * | 2010-09-27 | 2011-01-26 | 中兴通讯股份有限公司 | 数据比对方法和装置 |
CN102662946A (zh) * | 2012-02-20 | 2012-09-12 | 北京地拓科技发展有限公司 | 一种自动监测数据库中记录变化的方法和*** |
CN103678583A (zh) * | 2013-12-11 | 2014-03-26 | 北京华胜天成科技股份有限公司 | 结构化数据比较的方法及*** |
CN104346454A (zh) * | 2014-10-30 | 2015-02-11 | 上海新炬网络技术有限公司 | 基于Oracle数据库的数据一致性校验方法 |
CN104731792A (zh) * | 2013-12-19 | 2015-06-24 | ***股份有限公司 | 数据库一致性校验方法及***、定位数据库差异的方法及*** |
CN107247749A (zh) * | 2017-05-25 | 2017-10-13 | 阿里巴巴集团控股有限公司 | 一种数据库状态确定方法、一致性验证方法及装置 |
Family Cites Families (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03152992A (ja) | 1989-10-27 | 1991-06-28 | W R Grace & Co | 印刷回路板及びその製造方法 |
CN1054886A (zh) | 1990-03-19 | 1991-10-02 | 湖南省森林植物园 | 一种固体碳酸饮料的生产工艺 |
US9824107B2 (en) * | 2006-10-25 | 2017-11-21 | Entit Software Llc | Tracking changing state data to assist in computer network security |
CN102354292A (zh) * | 2011-09-21 | 2012-02-15 | 国家计算机网络与信息安全管理中心 | 主、备数据库记录一致性校验方法及*** |
US9697238B2 (en) * | 2012-03-01 | 2017-07-04 | Microsoft Technology Licensing, Llc | Drift detection and notification |
US9032247B2 (en) * | 2012-07-26 | 2015-05-12 | Apple Inc. | Intermediate database management layer |
JP2014059757A (ja) * | 2012-09-18 | 2014-04-03 | International Business Maschines Corporation | 木構造を有するデータを処理する装置、処理方法およびプログラム |
CN103164523A (zh) * | 2013-03-19 | 2013-06-19 | 华为技术有限公司 | 数据一致性检查方法、装置及*** |
CN103345521B (zh) * | 2013-07-17 | 2016-04-13 | 腾讯科技(深圳)有限公司 | 一种在哈希表数据库中处理键值的方法和装置 |
CN105447046A (zh) * | 2014-09-02 | 2016-03-30 | 阿里巴巴集团控股有限公司 | 一种分布式***数据一致性处理方法、装置和*** |
US9436923B1 (en) * | 2015-02-26 | 2016-09-06 | Skuchain, Inc. | Tracking unitization occurring in a supply chain |
SG11201708000PA (en) * | 2015-03-31 | 2017-10-30 | Nasdaq Inc | Systems and methods of blockchain transaction recordation |
CN106484690A (zh) * | 2015-08-24 | 2017-03-08 | 阿里巴巴集团控股有限公司 | 一种数据迁移的验证方法及装置 |
US9390154B1 (en) * | 2015-08-28 | 2016-07-12 | Swirlds, Inc. | Methods and apparatus for a distributed database within a network |
JP6452156B2 (ja) * | 2015-09-03 | 2019-01-16 | 日本電信電話株式会社 | 許諾情報管理システム、利用者端末、権利者端末、許諾情報管理方法、および、許諾情報管理プログラム |
US20170116693A1 (en) * | 2015-10-27 | 2017-04-27 | Verimatrix, Inc. | Systems and Methods for Decentralizing Commerce and Rights Management for Digital Assets Using a Blockchain Rights Ledger |
CN105488675B (zh) * | 2015-11-25 | 2019-12-24 | 布比(北京)网络技术有限公司 | 一种区块链的分布式共享总账构建方法 |
CN105976232B (zh) * | 2016-06-24 | 2020-04-28 | 深圳前海微众银行股份有限公司 | 资产交易方法和装置 |
CN106250721A (zh) * | 2016-07-28 | 2016-12-21 | 杭州云象网络技术有限公司 | 一种基于区块链的电子版权保护方法 |
CN106230808A (zh) | 2016-07-28 | 2016-12-14 | 杭州云象网络技术有限公司 | 一种基于区块链技术的个人征信***建设方法 |
CN106357405A (zh) * | 2016-09-19 | 2017-01-25 | 弗洛格(武汉)信息科技有限公司 | 一种基于区块链技术一致性算法的数据管理方法及*** |
-
2017
- 2017-05-25 CN CN201710377721.8A patent/CN107247749B/zh active Active
-
2018
- 2018-03-12 TW TW107108222A patent/TWI710916B/zh active
- 2018-05-23 RU RU2019121699A patent/RU2725760C1/ru active
- 2018-05-23 AU AU2018274424A patent/AU2018274424B2/en active Active
- 2018-05-23 KR KR1020197020615A patent/KR102231058B1/ko active IP Right Grant
- 2018-05-23 CA CA3049831A patent/CA3049831C/en active Active
- 2018-05-23 SG SG11201906495TA patent/SG11201906495TA/en unknown
- 2018-05-23 MX MX2019008383A patent/MX2019008383A/es unknown
- 2018-05-23 WO PCT/CN2018/087966 patent/WO2018214897A1/zh unknown
- 2018-05-23 BR BR112019014478-1A patent/BR112019014478A2/pt active Search and Examination
- 2018-05-23 JP JP2019538236A patent/JP6921206B2/ja active Active
- 2018-05-23 EP EP18805650.1A patent/EP3557452B1/en active Active
-
2019
- 2019-07-12 PH PH12019501637A patent/PH12019501637A1/en unknown
- 2019-10-28 US US16/665,200 patent/US10789243B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957858A (zh) * | 2010-09-27 | 2011-01-26 | 中兴通讯股份有限公司 | 数据比对方法和装置 |
CN102662946A (zh) * | 2012-02-20 | 2012-09-12 | 北京地拓科技发展有限公司 | 一种自动监测数据库中记录变化的方法和*** |
CN103678583A (zh) * | 2013-12-11 | 2014-03-26 | 北京华胜天成科技股份有限公司 | 结构化数据比较的方法及*** |
CN104731792A (zh) * | 2013-12-19 | 2015-06-24 | ***股份有限公司 | 数据库一致性校验方法及***、定位数据库差异的方法及*** |
CN104346454A (zh) * | 2014-10-30 | 2015-02-11 | 上海新炬网络技术有限公司 | 基于Oracle数据库的数据一致性校验方法 |
CN107247749A (zh) * | 2017-05-25 | 2017-10-13 | 阿里巴巴集团控股有限公司 | 一种数据库状态确定方法、一致性验证方法及装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3557452A4 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10789243B2 (en) | 2017-05-25 | 2020-09-29 | Alibaba Group Holding Limited | Database state determining method and device, and consistency verifying method and device |
Also Published As
Publication number | Publication date |
---|---|
SG11201906495TA (en) | 2019-08-27 |
TW201901484A (zh) | 2019-01-01 |
CA3049831A1 (en) | 2018-11-29 |
CN107247749A (zh) | 2017-10-13 |
EP3557452A4 (en) | 2020-01-22 |
EP3557452A1 (en) | 2019-10-23 |
BR112019014478A2 (pt) | 2020-05-26 |
MX2019008383A (es) | 2019-09-11 |
RU2725760C1 (ru) | 2020-07-06 |
KR102231058B1 (ko) | 2021-03-25 |
CN107247749B (zh) | 2020-08-25 |
PH12019501637A1 (en) | 2020-03-16 |
JP2020509451A (ja) | 2020-03-26 |
US20200057760A1 (en) | 2020-02-20 |
AU2018274424A1 (en) | 2019-08-01 |
JP6921206B2 (ja) | 2021-08-18 |
AU2018274424B2 (en) | 2020-07-02 |
US10789243B2 (en) | 2020-09-29 |
EP3557452B1 (en) | 2021-09-15 |
TWI710916B (zh) | 2020-11-21 |
KR20190096391A (ko) | 2019-08-19 |
CA3049831C (en) | 2021-12-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018214897A1 (zh) | 一种数据库状态确定方法、一致性验证方法及装置 | |
TWI718375B (zh) | 基於區塊鏈的資料處理方法及設備 | |
WO2018177250A1 (zh) | 一种基于区块链的数据处理方法及设备 | |
JP6790270B2 (ja) | ブロックチェーンベースのデータ処理方法およびデバイス | |
TWI679547B (zh) | 區塊鏈業務受理及業務共識方法及裝置 | |
JP6804668B2 (ja) | ブロックデータ検証方法および装置 | |
TWI694342B (zh) | 一種資料快取方法、裝置及系統 | |
WO2019192258A1 (zh) | 一种数据同步的方法、装置及设备 | |
WO2020233146A1 (zh) | 数据操作记录的存储方法、***、装置及设备 | |
US11144286B2 (en) | Generating synchronous digital circuits from source code constructs that map to circuit implementations | |
WO2020199709A1 (zh) | 一种刷新级联缓存的方法、***及设备 | |
US20200167527A1 (en) | Method, device, and apparatus for word vector processing based on clusters | |
WO2020168901A1 (zh) | 一种数据计算方法及引擎 | |
US20140278296A1 (en) | Selective importance sampling | |
CN106156050B (zh) | 一种数据处理方法及装置 | |
CN106843819B (zh) | 对象序列化的方法及装置 | |
KR102457152B1 (ko) | 프로그램의 중간표현에 대한 최적화 적용 가능성을 판단하는 방법 및 시스템 | |
CN110704039B (zh) | 应用开发过程中的配置数据处理方法以及装置 | |
US20140359625A1 (en) | Detection and correction of race conditions in workflows | |
US20170147221A1 (en) | Reducing cost of deserialization by skipping unused array regions | |
CN118276993A (zh) | 设置应用主题的方法、电子设备及存储介质 | |
CN117950746A (zh) | 业务处理方法、装置及设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18805650 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 3049831 Country of ref document: CA |
|
ENP | Entry into the national phase |
Ref document number: 2019538236 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20197020615 Country of ref document: KR Kind code of ref document: A |
|
REG | Reference to national code |
Ref country code: BR Ref legal event code: B01A Ref document number: 112019014478 Country of ref document: BR |
|
ENP | Entry into the national phase |
Ref document number: 2018805650 Country of ref document: EP Effective date: 20190715 |
|
ENP | Entry into the national phase |
Ref document number: 2018274424 Country of ref document: AU Date of ref document: 20180523 Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
REG | Reference to national code |
Ref country code: BR Ref legal event code: B01E Ref document number: 112019014478 Country of ref document: BR Free format text: REAPRESENTE A DECLARACAO REFERENTE AO DOCUMENTO DE PRIORIDADE DEVIDAMENTE ASSINADA, CONFORME ART. 408 C/C ART. 410, II, DO CODIGO DE PROCESSO CIVIL. |
|
ENP | Entry into the national phase |
Ref document number: 112019014478 Country of ref document: BR Kind code of ref document: A2 Effective date: 20190712 |