CN114461605A - Method, device and equipment for realizing multi-version of transaction data of memory multidimensional database - Google Patents

Method, device and equipment for realizing multi-version of transaction data of memory multidimensional database Download PDF

Info

Publication number
CN114461605A
CN114461605A CN202210023248.4A CN202210023248A CN114461605A CN 114461605 A CN114461605 A CN 114461605A CN 202210023248 A CN202210023248 A CN 202210023248A CN 114461605 A CN114461605 A CN 114461605A
Authority
CN
China
Prior art keywords
current copy
base version
version
transaction
copy object
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
CN202210023248.4A
Other languages
Chinese (zh)
Other versions
CN114461605B (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.)
Beijing Yuannian Technology Co ltd
Original Assignee
Beijing Yuannian 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 Beijing Yuannian Technology Co ltd filed Critical Beijing Yuannian Technology Co ltd
Priority to CN202210023248.4A priority Critical patent/CN114461605B/en
Publication of CN114461605A publication Critical patent/CN114461605A/en
Application granted granted Critical
Publication of CN114461605B publication Critical patent/CN114461605B/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/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a device for realizing multi-version transaction data of a memory multi-dimensional database, electronic equipment and a computer readable storage medium, wherein the method for realizing multi-version transaction data of the memory multi-dimensional database comprises the following steps: when the transaction starting operation is executed, acquiring a current copy object associated with a base version object of the cube; the transaction starting operation is used for performing read operation or write operation on the current copy object by the transaction, and the base version object and the current copy object are stored in a data structure; traversing the data structure to judge whether the base version object is the same as the current copy object; and under the condition that the base version object is different from the current copy object, executing the merging operation between the base version object and the current copy object according to a preset sequence. According to the embodiment of the application, the data can be rapidly and concurrently executed, and the data consistency of the database system is ensured.

Description

Method, device and equipment for realizing multi-version of transaction data of memory multidimensional database
Technical Field
The present application relates to the field of multi-version implementation of transaction data in a multidimensional memory database, and in particular, to a method and an apparatus for multi-version implementation of transaction data in a multidimensional memory database, an electronic device, and a computer-readable storage medium.
Background
When a multi-version concurrency control (MVCC) provides concurrency access to a database, an obtained memory read in a transaction is processed, so that the concurrency problem that a read operation is blocked by a write operation, namely, the read operation and the write operation are separated, the read operation does not influence the write operation, and the write operation does not influence the read operation.
At present, in the related technology, read-write separation is realized through Mysql or postgre and through a read-write lock, and the system performance is low, so that data cannot be rapidly executed concurrently, and the data consistency of a database system cannot be ensured.
Therefore, how to implement data quickly and concurrently to ensure data consistency of a database system is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The embodiment of the application provides a method and a device for realizing multi-version of transaction data of a memory multidimensional database, electronic equipment and a computer readable storage medium, which can enable data to be executed quickly and concurrently and ensure data consistency of a database system.
In a first aspect, an embodiment of the present application provides a method for implementing multiple versions of transaction data in a multidimensional memory database, including:
when the transaction starting operation is executed, acquiring a current copy object associated with a base version object of the cube; the transaction starting operation is used for the transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in a data structure;
traversing the data structure to determine whether the base version object and the current copy object are the same;
and under the condition that the base version object is different from the current copy object, executing the merging operation between the base version object and the current copy object according to a preset sequence.
Optionally, when the transaction opening operation is executed, acquiring a current copy object associated with the base version object of the cube includes:
when the transaction starting operation is executed, judging whether the current copy object is stored in the data structure;
if the current copy object is stored in the data structure, directly acquiring the current copy object;
and if the current copy object is not stored in the data structure, creating a corresponding current copy object by using the base version object, and storing the current copy object in the data structure.
Optionally, traversing the data structure to determine whether the base version object and the current copy object are the same includes:
the data structure is traversed to determine whether the tree of the base version object and the tree of the current copy object are the same.
Optionally, when the base version object and the current copy object are not the same, performing a merge operation between the base version object and the current copy object according to a preset order, where the merge operation includes:
and combining the tree of the base version object and the tree of the current copy object according to a preset sequence under the condition that the tree of the base version object and the tree of the current copy object are different.
Optionally, the method further includes:
in the event that the current copy object is not the latest version object and no other threads reference the base version object, the base version object is deleted.
Optionally, the method further includes:
when the base version object is inquired or deleted, reference counting addition or deletion is carried out on the base version object.
Optionally, the method further includes:
in the event that the merge operation between the base version object and the current copy object fails to execute, a rollback operation is performed.
In a second aspect, an embodiment of the present application provides an apparatus for implementing multiple versions of transaction data in a multidimensional memory database, including:
the acquisition module is used for acquiring a current copy object associated with a base version object of the cube when a transaction starting operation is executed; the transaction starting operation is used for the transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in a data structure;
the traversal module is used for traversing the data structure to judge whether the base version object is the same as the current copy object;
and the merging module is used for executing merging operation between the base version object and the current copy object according to a preset sequence under the condition that the base version object and the current copy object are different.
Optionally, the obtaining module is configured to:
when the transaction starting operation is executed, judging whether the current copy object is stored in the data structure;
if the current copy object is stored in the data structure, directly acquiring the current copy object;
and if the current copy object is not stored in the data structure, creating a corresponding current copy object by using the base version object, and storing the current copy object in the data structure.
Optionally, the traversal module is configured to:
the data structure is traversed to determine whether the tree of the base version object and the tree of the current copy object are the same.
Optionally, the merging module is configured to:
and combining the tree of the base version object and the tree of the current copy object according to a preset sequence under the condition that the tree of the base version object and the tree of the current copy object are different.
Optionally, the method further includes:
and the deleting module is used for deleting the base version object under the condition that the current copy object is not the latest version object and no other thread references the base version object.
Optionally, the method further includes:
and the reference count management module is used for increasing or deleting the reference count of the base version object when the base version object is inquired or deleted.
Optionally, the method further includes:
and the rollback operation execution module is used for executing the rollback operation under the condition that the merging operation between the base version object and the current copy object fails to be executed.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the method for implementing the multi-version of the transaction data of the memory multidimensional database as shown in the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the method for implementing the multi-version of the transaction data of the memory multidimensional database shown in the first aspect is implemented.
The method, the device, the electronic equipment and the computer readable storage medium for realizing the multi-version of the transaction data of the memory multi-dimensional database can enable the data to be executed quickly and concurrently, and ensure the data consistency of a database system.
The method for realizing the multi-version of the transaction data of the memory multidimensional database comprises the following steps: when the transaction starting operation is executed, acquiring a current copy object associated with a base version object of the cube; the transaction starting operation is used for the transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in a data structure; traversing the data structure to determine whether the base version object and the current copy object are the same; under the condition that the base version object is different from the current copy object, the merging operation between the base version object and the current copy object is executed according to the preset sequence, so that the data can be quickly executed in a concurrent manner, and the data consistency of the database system is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments or the technical solutions in the prior art are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained according to these drawings by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a method for implementing multiple versions of transaction data in a multidimensional memory database according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an apparatus for implementing multiple versions of transaction data in a multidimensional memory database according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
At present, in the related technology, read-write separation is realized through Mysql or postgre and through a read-write lock, and the system performance is low, so that data cannot be rapidly executed concurrently, and the data consistency of a database system cannot be ensured.
In order to solve the prior art problems, embodiments of the present application provide a method and an apparatus for implementing a multi-version of transaction data in a multidimensional memory database, an electronic device, and a computer-readable storage medium. First, a method for implementing multi-version transaction data of a multidimensional memory database provided in the embodiment of the present application is described below.
Fig. 1 is a flowchart illustrating a method for implementing a multi-version of transaction data in a multidimensional memory database according to an embodiment of the present application. As shown in fig. 1, the method for implementing the multi-version of the transaction data in the memory multidimensional database includes:
s101, when a transaction starting operation is executed, acquiring a current copy object associated with a base version object of a cube; the transaction starting operation is used for the transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in the data structure.
In one embodiment, when a transaction open operation is performed, acquiring a current copy object associated with a base version object of a cube includes:
when the transaction starting operation is executed, judging whether the current copy object is stored in the data structure;
if the current copy object is stored in the data structure, directly acquiring the current copy object;
and if the current copy object is not stored in the data structure, creating a corresponding current copy object by using the base version object, and storing the current copy object in the data structure.
Specifically, an object (cube dataversion) in synchronization with the cube life cycle aims to store a base version of the cube, that is, the most initial version is required only after the cube is created. The concept of version here can be understood as one cube data object that can be manipulated. cubeDataVersion may provide functionality to query the current version and add and delete versions. A data structure is maintained that stores a version corresponding to the version number.
When a transaction is read or written, an action of opening the transaction needs to be executed, and the opening transaction can create a copy, which is an object that can be read and written by a subsequent transaction. Meanwhile, a data structure (cube dataversionref) needs to be maintained, and the data structure stores copy information corresponding to the cube object. Thus, at the time of opening the transaction, if a copy of the current cube object already exists in the copy data structure. Then the copy is directly returned, and all subsequent read-write operations can use the copy. If not, a copy needs to be created. Creating a copy of its object is done using cupedataversion. And inserts the replica object into the cubeDataVersionRef.
S102, traversing the data structure to judge whether the base version object and the current copy object are the same.
S103, under the condition that the base version object and the current copy object are different, executing the merging operation between the base version object and the current copy object according to a preset sequence.
In one embodiment, traversing the data structure to determine whether the base version object and the current copy object are the same comprises:
the data structure is traversed to determine whether the tree of the base version object and the tree of the current copy object are the same.
In one embodiment, in a case that the base version object and the current copy object are not the same, performing a merge operation between the base version object and the current copy object according to a preset order includes:
and combining the tree of the base version object and the tree of the current copy object according to a preset sequence under the condition that the tree of the base version object and the tree of the current copy object are different.
Specifically, if the cubeDataVersionRef is traversed before submission, if no new tree in a new copy is found, the operation may be an unrelated transaction read-write operation, and then the operation is not directly returned, so that a subsequent process can be avoided, and the efficiency of the whole system is improved. If the situation of a new tree is found, whether the current version is the same as the latest version needs to be judged, if not, tree merging needs to be carried out, namely, different parts of the copy tree and the base version tree are replaced to generate a new tree, meanwhile, a new version is generated, the new version is inserted into the cubeDataVersion to enable the new version to become the latest version, if the new version is the same, only the current cubeDataVersion needs to be updated, and meanwhile, the copy object which is traversed once needs to be deleted.
In one embodiment, further comprising: in the event that the current copy object is not the latest version object and no other threads reference the base version object, the base version object is deleted.
Deleting the base version associated with the replica object needs to satisfy the condition that the current version is not the latest version and no other thread refers to the base version associated with the replica any more to delete the base version associated with the replica.
In one embodiment, further comprising: when the base version object is inquired or deleted, reference counting addition or deletion is carried out on the base version object.
For the reference count management of versions, all query versions need to be added or deleted corresponding to the reference count of the base version.
For lock management, the last lock is needed when the merge is submitted, and it is ensured that the merge actions of all threads are necessarily sequential. And the reference counting confusion of the locking processing mode is required for the increment and the deletion of the reference counting.
In one embodiment, further comprising: in the event that the merge operation between the base version object and the current copy object fails to execute, a rollback operation is performed.
The commit merge is theoretically successful in general, but a failure situation may also occur. If the commit merge fails, the failure needs to be returned to the upper logic, and meanwhile, the current system is guaranteed not to allow any operation. And correspondingly rolling back the data generated at the failure moment.
The transaction rollback is very simple to realize under the current scheme, only the original base tree needs to be reserved, and no new tree is generated after failure, so that no complex rollback action exists.
According to the method for realizing the multi-version of the transaction data of the memory multidimensional database, the transaction data and the transaction element object are decoupled and separated, and only the transaction data need to be concerned; the transaction submission and combination fails, the transaction is not down, only the correct transaction rollback is required to be ensured, and meanwhile, the user is not allowed to further operate before the failure problem is solved; the transaction multi-version is basically processed without lock, and queuing is performed only at the moment needing merging, so that the system performance is greatly improved, the concurrent execution can be performed quickly under the condition that a tree does not need to be merged, and the data consistency of a database system is ensured.
Fig. 2 is a schematic structural diagram of an apparatus for implementing a multi-version of transaction data in a multidimensional memory database according to an embodiment of the present application, and as shown in fig. 2, the apparatus for implementing a multi-version of transaction data in a multidimensional memory database includes:
an obtaining module 201, configured to obtain a current copy object associated with a base version object of a cube when a transaction starting operation is executed; the transaction starting operation is used for the transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in a data structure;
a traversal module 202, configured to traverse the data structure to determine whether the base version object and the current copy object are the same;
and the merging module 203 is configured to, when the base version object and the current copy object are not the same, perform a merging operation between the base version object and the current copy object according to a preset order.
In one embodiment, the obtaining module 201 is configured to:
when the transaction starting operation is executed, judging whether the current copy object is stored in the data structure;
if the current copy object is stored in the data structure, directly acquiring the current copy object;
and if the current copy object is not stored in the data structure, creating a corresponding current copy object by using the base version object, and storing the current copy object in the data structure.
In one embodiment, traversal module 202 is configured to: the data structure is traversed to determine whether the tree of the base version object and the tree of the current copy object are the same.
In one embodiment, the merge module 203 is configured to: and combining the tree of the base version object and the tree of the current copy object according to a preset sequence under the condition that the tree of the base version object and the tree of the current copy object are different.
In one embodiment, further comprising:
and the deleting module is used for deleting the base version object under the condition that the current copy object is not the latest version object and no other thread references the base version object.
In one embodiment, further comprising:
and the reference count management module is used for increasing or deleting the reference count of the base version object when the base version object is inquired or deleted.
In one embodiment, further comprising:
and the rollback operation execution module is used for executing the rollback operation under the condition that the merging operation between the base version object and the current copy object fails to be executed.
Each module/unit in the apparatus shown in fig. 2 has a function of implementing each step in fig. 1, and can achieve the corresponding technical effect, and for brevity, the description is not repeated here.
Fig. 3 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
The electronic device may comprise a processor 301 and a memory 302 in which computer program instructions are stored.
Specifically, the processor 301 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 302 may include removable or non-removable (or fixed) media, where appropriate. The memory 302 may be internal or external to the electronic device, where appropriate. In particular embodiments, memory 302 may be non-volatile solid-state memory.
In one embodiment, the Memory 302 may be a Read Only Memory (ROM). In one embodiment, the ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), Electrically Alterable ROM (EAROM), or flash memory, or a combination of two or more of these.
The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement the transaction data multi-version implementation method of the memory multidimensional database in any of the above embodiments.
In one example, the electronic device may also include a communication interface 303 and a bus 310. As shown in fig. 3, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 to complete communication therebetween.
The communication interface 303 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiment of the present application.
Bus 310 includes hardware, software, or both to couple the components of the electronic device to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hypertransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 310 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
In addition, in combination with the method for implementing the multi-version of the transaction data of the memory multidimensional database in the above embodiments, embodiments of the present application may provide a computer-readable storage medium for implementation. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement the method for implementing the multi-version of the transaction data of the multidimensional memory database in any of the above embodiments.
It is to be understood that the present application is not limited to the particular arrangements and instrumentality described above and shown in the attached drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present application are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based computer instructions which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As described above, only the specific embodiments of the present application are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.

Claims (10)

1. A transaction data multi-version realization method of a memory multi-dimensional database is characterized by comprising the following steps:
when the transaction starting operation is executed, acquiring a current copy object associated with a base version object of the cube; the transaction starting operation is used for a transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in a data structure;
traversing the data structure to determine whether the base version object and the current replica object are the same;
and under the condition that the base version object and the current copy object are different, executing the merging operation between the base version object and the current copy object according to a preset sequence.
2. The method for implementing the multi-version of the transaction data in the memory multidimensional database according to claim 1, wherein the obtaining the current copy object associated with the base version object of the cube when the transaction opening operation is performed comprises:
when the transaction starting operation is executed, judging whether the current copy object is stored in the data structure;
if the current copy object is stored in the data structure, directly acquiring the current copy object;
and if the current copy object is not stored in the data structure, creating a corresponding current copy object by using the base version object, and storing the current copy object in the data structure.
3. The method as claimed in claim 1, wherein traversing the data structure to determine whether the base version object and the current copy object are the same comprises:
traversing the data structure to determine whether the tree of the base version object and the tree of the current replica object are the same.
4. The method for implementing the multi-version of the transaction data of the memory multidimensional database as claimed in claim 3, wherein in the case that the base version object and the current copy object are not the same, the merging operation between the base version object and the current copy object is performed according to a preset sequence, which includes:
and combining the tree of the base version object and the tree of the current copy object according to a preset sequence under the condition that the tree of the base version object and the tree of the current copy object are different.
5. The method for implementing the multi-version of the transaction data in the multidimensional memory database according to claim 1, further comprising:
deleting the base version object if the current replica object is not the latest version object and no other threads reference the base version object.
6. The method for implementing the multi-version of the transaction data in the multidimensional memory database according to claim 1, further comprising:
and when the base version object is inquired or deleted, increasing or deleting the reference count of the base version object.
7. The method for implementing the multi-version of the transaction data in the multidimensional memory database according to claim 1, further comprising:
performing a rollback operation if the merge operation between the base version object and the current copy object fails to perform.
8. A transaction data multi-version realization device of a memory multidimensional database is characterized by comprising the following steps:
the acquisition module is used for acquiring a current copy object associated with a base version object of the cube when a transaction starting operation is executed; the transaction starting operation is used for a transaction to perform read operation or write operation on the current copy object, and the base version object and the current copy object are stored in a data structure;
a traversal module, configured to traverse the data structure to determine whether the base version object and the current copy object are the same;
and the merging module is used for executing merging operation between the base version object and the current copy object according to a preset sequence under the condition that the base version object and the current copy object are different.
9. An electronic device, characterized in that the electronic device comprises: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements a method for implementing a multi-version of transaction data for a memory multidimensional database as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, wherein the computer-readable storage medium has stored thereon computer program instructions, which when executed by a processor, implement the method for implementing the multi-version of transaction data of the memory multidimensional database according to any one of claims 1 to 7.
CN202210023248.4A 2022-01-10 2022-01-10 Transaction data multi-version implementation method, device and equipment of memory multi-dimensional database Active CN114461605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210023248.4A CN114461605B (en) 2022-01-10 2022-01-10 Transaction data multi-version implementation method, device and equipment of memory multi-dimensional database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210023248.4A CN114461605B (en) 2022-01-10 2022-01-10 Transaction data multi-version implementation method, device and equipment of memory multi-dimensional database

Publications (2)

Publication Number Publication Date
CN114461605A true CN114461605A (en) 2022-05-10
CN114461605B CN114461605B (en) 2023-07-04

Family

ID=81409170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210023248.4A Active CN114461605B (en) 2022-01-10 2022-01-10 Transaction data multi-version implementation method, device and equipment of memory multi-dimensional database

Country Status (1)

Country Link
CN (1) CN114461605B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050149583A1 (en) * 2003-12-29 2005-07-07 Rajagopal Baskaran Customizable metadata merging framework
US20070022120A1 (en) * 2005-07-25 2007-01-25 Microsoft Corporation Caching and modifying portions of a multi-dimensional database on a user device
US20170011082A1 (en) * 2015-07-07 2017-01-12 Futurewei Technologies, Inc. Mechanisms for merging index structures in molap while preserving query consistency
US9778876B1 (en) * 2016-04-01 2017-10-03 Sas Institute Inc. Load balanced access to distributed storage of data cubes
CN111090663A (en) * 2019-12-25 2020-05-01 上海金仕达软件科技有限公司 Transaction concurrency control method, device, terminal equipment and medium
CN112559496A (en) * 2020-12-24 2021-03-26 百果园技术(新加坡)有限公司 Distributed database transaction atomicity realization method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050149583A1 (en) * 2003-12-29 2005-07-07 Rajagopal Baskaran Customizable metadata merging framework
US20070022120A1 (en) * 2005-07-25 2007-01-25 Microsoft Corporation Caching and modifying portions of a multi-dimensional database on a user device
US20170011082A1 (en) * 2015-07-07 2017-01-12 Futurewei Technologies, Inc. Mechanisms for merging index structures in molap while preserving query consistency
CN108140024A (en) * 2015-07-07 2018-06-08 华为技术有限公司 Merge index structure in MOLAP and keep the mechanism of inquiry consistency
US9778876B1 (en) * 2016-04-01 2017-10-03 Sas Institute Inc. Load balanced access to distributed storage of data cubes
CN111090663A (en) * 2019-12-25 2020-05-01 上海金仕达软件科技有限公司 Transaction concurrency control method, device, terminal equipment and medium
CN112559496A (en) * 2020-12-24 2021-03-26 百果园技术(新加坡)有限公司 Distributed database transaction atomicity realization method and device

Also Published As

Publication number Publication date
CN114461605B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
US20180203888A1 (en) Multi-Version Concurrency Control Method in Database and Database System
CN109977274B (en) Data query and verification method, system, equipment and storage medium
US10346381B2 (en) Atomic update operations in a data storage system
US8666981B2 (en) Bottom-up optimistic latching method for index trees
CN108153784A (en) Synchrodata treating method and apparatus
US20120221538A1 (en) Optimistic, version number based concurrency control for index structures with atomic, non-versioned pointer updates
CN110706101B (en) Method and apparatus for concurrently executing transactions in a blockchain
CN109086382B (en) Data synchronization method, device, equipment and storage medium
CN108121774B (en) Data table backup method and terminal equipment
CN115145697A (en) Database transaction processing method and device and electronic equipment
CN115237444A (en) Concurrent control method, device and equipment based on version number and storage medium
CN111382198B (en) Data recovery method, device, equipment and storage medium
CN108287772B (en) Data backup system and method, computer readable storage medium and electronic device
JP4139613B2 (en) Data processing method
CN112434108A (en) Database synchronization method, device and equipment
CN114461605A (en) Method, device and equipment for realizing multi-version of transaction data of memory multidimensional database
US11347689B2 (en) Method, device and computer program product for event ordering
CN114896641A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN114328591A (en) Transaction execution method, device, equipment and storage medium
CN114490543A (en) Transaction log implementation method, device, equipment and medium for memory multidimensional database
CN114579662A (en) Memory database synchronization method, system, equipment and storage medium
US10417214B2 (en) Non-transitory computer-readable storage medium, database control method and database control device
CN115576659A (en) Metadata object implementation and metadata transaction management method for multidimensional database
CN117348915B (en) Automatic kernel code synchronization method and system
CN112416951B (en) Data transfer method and device and computer storage medium

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