Row and column data synchronization method and device, equipment and medium

By using a transaction ID mechanism and relay log replay technology in the HTAP database, the problem of poor real-time synchronization of row and column data was solved, and the real-time freshness and visibility of column data were achieved, thus meeting the real-time analysis requirements of the HTAP database.

CN121765013APending Publication Date: 2026-03-31JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In HTAP databases, the real-time synchronization of row and column data is poor, resulting in insufficient freshness and visibility of column data, which cannot meet the requirements of real-time analysis.

Method used

By issuing business statements carrying transaction IDs to distributed row storage nodes, write-ahead logs are generated, and relay logs are replayed in distributed column storage nodes. Combined with the transaction ID mechanism, incomplete relay logs are selectively replayed first to ensure data freshness and visibility.

Benefits of technology

It achieves real-time freshness and visibility of columnar data, improves the efficiency and accuracy of data synchronization, and meets the real-time analysis needs of HTAP databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765013A_ABST
    Figure CN121765013A_ABST
Patent Text Reader

Abstract

The invention discloses a row and column data synchronization method and device, equipment and a medium. The method comprises the following steps: issuing a business statement carrying a transaction ID (Identity) to a distributed row storage node, wherein the business statement is used for indicating the distributed row storage node to execute the business statement and generate a corresponding pre-writing log; receiving a replayed transaction ID fed back by the distributed column storage node after the relay log is replayed; the relay log is obtained by analyzing a pre-writing log; and if the replayed transaction ID does not meet a line and column storage data visibility condition, issuing a data query statement carrying an allocated transaction ID to a distributed column storage node to indicate the distributed column storage node to selectively and preferentially replay a relay log pair according to the allocated transaction ID carried by the data query statement, and feeding back the playback result to the computing node. According to the embodiment of the invention, the freshness and visibility of the column storage data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database management technology, and in particular to a method, apparatus, device and medium for synchronizing row and column data. Background Technology

[0002] With the advent of the big data era, the computation and storage of database systems have faced enormous challenges. Consequently, the industry has proposed Hybrid Transactional / Analytical Processing (HTAP) databases to address the challenges of massive data scenarios, supporting both fast and efficient online transaction processing and real-time data analysis.

[0003] In HTAP databases, row storage and column storage are typically used to support transaction processing (OLTP) and analytical processing (OLAP) workloads, respectively. Because these two storage formats serve different purposes, they often exist with independent physical structures. Therefore, to ensure data consistency throughout the system and the real-time nature of analysis results, data synchronization between row and column storage is essential.

[0004] Existing HTAP database architectures suffer from poor real-time synchronization of row and column data. This results in the data freshness in column storage failing to meet the requirements of real-time analysis, or data already existing in row storage remaining invisible in column storage. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and medium for synchronizing row and column data to improve the freshness and visibility of column-stored data.

[0006] According to one aspect of the present invention, a row and column data synchronization method is provided, comprising:

[0007] A business statement carrying a transaction ID is issued to the distributed row storage node, which is used to instruct the distributed row storage node to execute the business statement and generate the corresponding write-ahead log; the transaction ID is assigned by the global transaction management module in the HTAP database and is used to mark business statements within the same transaction;

[0008] The system receives the replayed transaction IDs from the distributed column storage nodes after replaying the relay log; the relay log is obtained by parsing the write-ahead log.

[0009] If the replayed transaction ID does not meet the row-column storage data visibility condition, a data query statement carrying the allocated transaction ID is sent to the distributed column storage node. This is used to instruct the distributed column storage node to selectively and preferentially replay the relay log pair according to the allocated transaction ID carried in the data query statement, and to feed back the replay result to the compute node.

[0010] According to another aspect of the present invention, a row and column data synchronization device is provided, comprising:

[0011] The business processing module is used to issue business statements carrying transaction IDs to the distributed row storage nodes, which instruct the distributed row storage nodes to execute the business statements and generate corresponding write-ahead logs; the transaction IDs are assigned by the global transaction management module in the HTAP database and are used to mark business statements within the same transaction;

[0012] The feedback receiving module is used to receive the replayed transaction IDs fed back by the distributed column storage nodes after replaying the relay log; the relay log is obtained by parsing the write-ahead log;

[0013] The query processing module is used to send a data query statement carrying the allocated transaction ID to the distributed column storage node if the replayed transaction ID does not meet the row-column storage data visibility condition. This is used to instruct the distributed column storage node to selectively and preferentially replay the relay log pair according to the allocated transaction ID carried by the data query statement, and to feed back the replay result to the computing node.

[0014] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the row and column data synchronization method according to any embodiment of the present invention.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the row and column data synchronization method according to any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the row and column data synchronization method according to any embodiment of the present invention.

[0017] This invention uses a relay log to replay data from row storage to column storage to ensure data freshness. Combined with a transaction ID mechanism, it enables real-time querying and priority processing of data replay progress to ensure data visibility.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1A This is a flowchart of a row and column data synchronization method according to an embodiment of the present invention;

[0021] Figure 1B This is a schematic diagram of a database structure provided according to an embodiment of the present invention;

[0022] Figure 1C This is a schematic diagram of a relay log usage process according to an embodiment of the present invention;

[0023] Figure 1D This is a schematic diagram of the log content of a relay log according to an embodiment of the present invention;

[0024] Figure 2 This is a flowchart of a row and column data synchronization method according to another embodiment of the present invention;

[0025] Figure 3 This is a schematic diagram of a row and column data synchronization device according to another embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of the structure of an electronic device that implements an embodiment of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] Figure 1A This is a flowchart illustrating a row-column data synchronization method according to an embodiment of the present invention. This embodiment is applicable to situations requiring the synchronization of row-store data to column-store data in an HTAP database. The method can be executed by a row-column data synchronization device, which can be implemented in hardware and / or software and can be configured in an electronic device with corresponding data processing capabilities. Figure 1A As shown, the method includes:

[0030] S110: Issue a business statement carrying a transaction ID to the distributed row storage node.

[0031] S120: Receive the replayed transaction ID from the distributed column storage node after replaying the relay log.

[0032] S130. If the replayed transaction ID does not meet the row-column storage data visibility condition, a data query statement carrying the allocated transaction ID is sent to the distributed column storage node.

[0033] The transaction ID is assigned by the global transaction management module in the HTAP database and is used to identify business statements within the same transaction. The HTAP database is structured as follows: Figure 1B As shown.

[0034] Specifically, when a client sends a business statement, the compute node (CN) receives the statement and requests a transaction ID for that statement from the Global Transaction Management module (GTM). The compute node parses the business statement to determine its type. If the statement type is Data Definition Language (DDL), it sends the business statement carrying the transaction ID to the corresponding Distributed Row-Column Hybrid Storage Node (HDN) for execution, according to the built-in sharding algorithm rules. If the statement type is Data Manipulation Language (DDL), it is still sent to the corresponding Distributed Row-Column Hybrid Storage Node (HybridDN) for execution, but the metadata change information needs to be synchronized to the Metadata Management Module (MDS), which then broadcasts it to other compute nodes.

[0035] like Figure 1C As shown, the distributed row-column hybrid storage node consists of distributed row storage nodes (DNs) and distributed column storage nodes (VDNs). After a business statement is sent to the distributed row-column hybrid storage node, it is first executed on the distributed row storage node side. During execution, the distributed row storage node synchronously records a write-ahead (WAL) log. The log generation module parses the WAL log generated by the distributed row storage node to generate a relay log with a fixed format. If parsing fails, the log generation module records the transaction ID and issues an alarm after a retry. After executing the business statement, the distributed row storage node synchronizes the execution result to the compute node.

[0036] The log consumption component parses the relay log and uses an internal protocol to replay the data to the distributed column storage node. If replay fails, the log consumption module records the transaction ID of the failed replay and issues an alarm after a retry. After the distributed column storage node completes the replay, it records the transaction ID from the relay log that has been replayed and reports it to the compute node as the replayed transaction ID. At this point, the row-store business data has been synchronized to the column storage, and the compute node also uses the replayed transaction ID reported by the distributed column storage node to determine the corresponding data and complete the row-column synchronization.

[0037] When it is necessary to determine the visibility of row and column store data, the client issues a Data Query (DQL) statement. After receiving the data query statement, the CN obtains the allocated transaction ID from the global transaction management module, and analyzes whether the distributed column store node has replayed all the information in the relay log based on the replayed transaction ID. If all the information in the relay log has been replayed, the replayed transaction ID is determined to meet the row and column store data visibility conditions; otherwise, if all the information in the relay log has not been replayed, the replayed transaction ID is determined not to meet the row and column store data visibility conditions.

[0038] When it is determined that the replayed transaction ID does not meet the visibility conditions of row and column storage data, the compute node sends the data query statement and the allocated transaction ID to the distributed column storage node of the relevant shard. The distributed column storage node selectively replays the relay log pair according to the query statement and the allocated transaction ID it carries, and feeds back the replay result to the compute node after the replay is completed. This enables the accurate data that has been committed in row storage to be retrieved from column storage, thus meeting the visibility requirements.

[0039] This invention uses a relay log to replay data from row storage to column storage to ensure data freshness. Combined with a transaction ID mechanism, it enables real-time querying and priority processing of data replay progress to ensure data visibility.

[0040] Optionally, based on the above embodiments, the transaction ID is monotonically increasing, and the row and column data visibility condition includes that the replayed transaction ID is not less than the largest ID among the allocated transaction IDs.

[0041] Specifically, to facilitate transaction ID management, the global transaction management module controls transaction IDs to monotonically increase when allocating them. When it's necessary to determine whether the distributed column storage node has replayed all information in the relay log, it's only necessary to analyze the relationship between the replayed transaction IDs and the largest ID among the allocated transaction IDs. If the former is not less than the latter, it indicates that the distributed column storage node has replayed all information in the relay log, satisfying the row-column storage data visibility condition; if the former is less than the latter, it indicates that the distributed column storage node has not replayed all information in the relay log, not satisfying the row-column storage data visibility condition.

[0042] Based on the above embodiments, optionally, the relay log records the data changes of tables involved in different transactions, with the transaction ID as the dimension. The data changes include the table name, the statement type for the table operation, and the primary key of the table.

[0043] Specifically, such as Figure 1D As shown, the relay log records data changes to tables involved in different transactions, organized by transaction (CT) ID. Each transaction mainly includes the following: TAB is the table name (e.g., T1, T2, T3), OP is the statement type for the table operation, PK is the table's primary key, and COL1 to COLn are the columns involved in the modification. The values ​​for each column are stored in memory column-by-column to improve query efficiency. Furthermore, if the memory occupied by the relay log exceeds a set threshold, the excess content is persisted to a file to handle scenarios involving very large transactions.

[0044] Based on the above embodiments, optionally, the distributed column storage node selectively prioritizes the replay of relay log pairs according to the allocated transaction ID carried by the data query statement, including:

[0045] Based on the allocated transaction ID carried by the data query statement and the transaction ID in each relay log, determine the first relay log that needs to be replayed first and the second relay log that does not need to be replayed first.

[0046] The first relay log is replayed first, and the second relay log is replayed according to the original logic.

[0047] Specifically, the distributed column storage node calculates the transaction ID difference between the replayed transaction ID and the largest ID of the allocated transaction ID carried in the business statement. It then retrieves the tables involved in the business query statement within this difference range from the relay log. Based on the involved tables, it scans the relay logs within this transaction ID difference range and replays these relay logs sequentially to the distributed column storage node according to the transaction ID order. For relay logs of tables not involved, the replay process continues according to the original logic. Then, it combines the replayed data with the data for data merging. For INSERT type logs, it adds new data; for UPDATE type logs, it updates existing data based on the values ​​of the updated columns in the relay log; and for DELETE type logs, it deletes rows of existing data based on the primary key information. This completes the data update. Finally, the result set calculated from the business query statement is returned to the computation node.

[0048] Figure 2 This is a flowchart illustrating a row-column data synchronization method according to another embodiment of the present invention. This embodiment is an optimization and improvement based on the above embodiments. Figure 2 As shown, the method includes:

[0049] S210: Issue a business statement carrying a transaction ID to the distributed row storage node.

[0050] S220. If the distributed row storage node reports that the business statement was executed successfully, then the transaction corresponding to the business statement in the write-ahead log is set to a replayable state.

[0051] Specifically, after the distributed row storage node executes the business statement, it synchronizes the execution result to the compute node. If the business statement is executed successfully on all shards, the compute node sets the corresponding transaction to a replayable state in the relay log. If the business statement fails to execute on some shards, the compute node generates a rollback reverse statement for the corresponding transaction, which is then executed by the distributed row storage node. The compute node then sets the transaction to a non-replayable state in the relay log.

[0052] S230: Receive the replayed transaction ID from the distributed column storage node after replaying the relay log.

[0053] S240. If the replayed transaction ID does not meet the row-column storage data visibility condition, a data query statement carrying the allocated transaction ID is sent to the distributed column storage node.

[0054] Optionally, based on the above embodiments, the method further includes:

[0055] If the replayed transaction ID satisfies the row-column storage data visibility condition, a data query statement is sent to the distributed column storage node to instruct the distributed column storage node to execute the data query statement and return the query result.

[0056] Specifically, when the replayed transaction ID meets the row-column storage data visibility conditions, the compute node can directly send the data query statement to the distributed column storage node of the relevant shard for execution. At this time, the distributed column storage node has already replayed all the changed data generated by the row-store transactions. Then, the operators of the distributed column storage node only need to use the data stored in the distributed column storage node to perform calculations and return the query calculation results to the compute node.

[0057] This invention improves the efficiency of data synchronization between rows and columns by updating the status of transactions corresponding to business statements in the write-ahead log in a timely manner.

[0058] Figure 3 This is a schematic diagram of a row and column data synchronization device provided in another embodiment of the present invention. Figure 3 As shown, the device includes:

[0059] The business processing module 310 is used to issue business statements carrying transaction IDs to the distributed row storage nodes, which instruct the distributed row storage nodes to execute the business statements and generate corresponding write-ahead logs; the transaction IDs are assigned by the global transaction management module in the HTAP database and are used to mark business statements within the same transaction.

[0060] The feedback receiving module 320 is used to receive the replayed transaction IDs fed back by the distributed column storage nodes after replaying the relay log; the relay log is obtained by parsing the write-ahead log;

[0061] The query processing module 330 is used to send a data query statement carrying the allocated transaction ID to the distributed column storage node if the replayed transaction ID does not meet the row-column storage data visibility condition. This is used to instruct the distributed column storage node to selectively and preferentially replay the relay log pair according to the allocated transaction ID carried by the data query statement, and to feed back the replay result to the computing node.

[0062] The row and column data synchronization device provided in the embodiments of the present invention can execute the row and column data synchronization method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0063] Optionally, the relay log records the data changes of tables involved in different transactions, with the transaction ID as the dimension. The data changes include the table name, the statement type for the table operation, and the table's primary key.

[0064] Optionally, the distributed column storage node selectively prioritizes replaying relay log pairs based on the allocated transaction ID carried in the data query statement, including:

[0065] Based on the allocated transaction ID carried by the data query statement and the transaction ID in each relay log, determine the first relay log that needs to be replayed first and the second relay log that does not need to be replayed first.

[0066] The first relay log is replayed first, and the second relay log is replayed according to the original logic.

[0067] Optionally, the device further includes:

[0068] The query response module is used to send a data query statement to the distributed column storage node if the replayed transaction ID meets the row-column storage data visibility condition, thereby instructing the distributed column storage node to execute the data query statement and return the query result.

[0069] Optionally, the device further includes:

[0070] The status setting module is used to set the transaction corresponding to the business statement in the write-ahead log to a replayable state if the distributed row storage node reports that the business statement was executed successfully.

[0071] Optionally, the transaction ID is monotonically increasing, and the row and column data visibility condition includes that the replayed transaction ID is not less than the largest ID among the allocated transaction IDs.

[0072] The row and column data synchronization device described in further detail can also execute the row and column data synchronization method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0073] Figure 4A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0074] like Figure 4 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0075] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0076] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as row and column data synchronization methods.

[0077] In some embodiments, the row-column data synchronization method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the row-column data synchronization method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the row-column data synchronization method by any other suitable means (e.g., by means of firmware).

[0078] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0079] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0080] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0081] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0082] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0083] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0084] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0085] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for synchronizing row and column data, characterized in that, The method, applied to compute nodes in an HTAP database, includes: A business statement carrying a transaction ID is issued to the distributed row storage node, which is used to instruct the distributed row storage node to execute the business statement and generate the corresponding write-ahead log; the transaction ID is assigned by the global transaction management module in the HTAP database and is used to mark business statements within the same transaction; The system receives the replayed transaction IDs from the distributed column storage nodes after replaying the relay log; the relay log is obtained by parsing the write-ahead log. If the replayed transaction ID does not meet the row-column storage data visibility condition, a data query statement carrying the allocated transaction ID is sent to the distributed column storage node. This is used to instruct the distributed column storage node to selectively and preferentially replay the relay log pair according to the allocated transaction ID carried in the data query statement, and to feed back the replay result to the compute node.

2. The method according to claim 1, characterized in that, The relay log records data changes to tables involved in different transactions, using transaction ID as the dimension. The data changes include the table name, the statement type for the table operation, and the table's primary key.

3. The method according to claim 2, characterized in that, The distributed column storage node selectively prioritizes replaying relay log pairs based on the allocated transaction ID carried in the data query statement, including: Based on the allocated transaction ID carried by the data query statement and the transaction ID in each relay log, determine the first relay log that needs to be replayed first and the second relay log that does not need to be replayed first. The first relay log is replayed first, and the second relay log is replayed according to the original logic.

4. The method according to claim 1, characterized in that, The method further includes: If the replayed transaction ID satisfies the row-column storage data visibility condition, a data query statement is sent to the distributed column storage node to instruct the distributed column storage node to execute the data query statement and return the query result.

5. The method according to claim 1, characterized in that, Before obtaining the replayed transaction ID obtained after the distributed column storage node replays the relay log, the process also includes: If the distributed row storage node reports that the business statement was executed successfully, the transaction corresponding to the business statement in the write-ahead log is set to a replayable state.

6. The method according to claim 1, characterized in that, The transaction ID is monotonically increasing, and the row and column data visibility condition includes that the replayed transaction ID is not less than the largest ID among the allocated transaction IDs.

7. A row and column data synchronization device, characterized in that, The device includes: The business processing module is used to issue business statements carrying transaction IDs to the distributed row storage nodes, which instruct the distributed row storage nodes to execute the business statements and generate corresponding write-ahead logs; the transaction IDs are assigned by the global transaction management module in the HTAP database and are used to mark business statements within the same transaction; The feedback receiving module is used to receive the replayed transaction IDs fed back by the distributed column storage nodes after replaying the relay log; the relay log is obtained by parsing the write-ahead log; The query processing module is used to send a data query statement carrying the allocated transaction ID to the distributed column storage node if the replayed transaction ID does not meet the row-column storage data visibility condition. This is used to instruct the distributed column storage node to selectively and preferentially replay the relay log pair according to the allocated transaction ID carried by the data query statement, and to feed back the replay result to the computing node.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the row and column data synchronization method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the row and column data synchronization method of any one of claims 1-6.

10. A computer program product, characterized in that, The computer-readable storage medium includes a computer program that, when executed by a processor, implements the row and column data synchronization method of any one of claims 1-6.