Data processing method and device for distributed database, equipment, medium and product
By encapsulating batch data update statements using an encapsulation protocol in a distributed database to generate data update requests, all data updates can be completed in a single interaction while ensuring strong consistency. This solves the performance bottleneck problem caused by frequent interactions between computing nodes and data nodes and improves processing efficiency.
Patent Information
- Application Number
- CN202511107688.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-21
AI Technical Summary
In distributed databases, existing technologies suffer from performance bottlenecks and reduced processing efficiency due to frequent interactions between computing nodes and data nodes when handling large-scale data updates.
A packaging protocol is used to encapsulate batch data update statements, generate data update requests, and complete all data updates in a single interaction, ensuring strong consistency.
It significantly improves the performance of distributed databases when processing large amounts of data in batches, reduces CPU and network resource consumption, and ensures the efficient and stable operation of the system.
Smart Images

Figure CN120994675A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database technology, and in particular to a data processing method, apparatus, device, medium, and product for a distributed database. Background Technology
[0002] In the banking, securities, and other financial industries, there is often a need to batch correct large amounts of customer information. At the database level, this manifests as operations on large volumes of data using Data Manipulation Language (DML) commands (such as "update", "delete", and "merge into"). GoldenDB, a distributed database, is known for its strong consistency. However, when updating data, it first queries the compute nodes. Only after the compute nodes confirm that the data has not been processed by other distributed transactions does it issue the actual update command to the data nodes.
[0003] Currently, data updates involve interaction between compute nodes and data nodes. Each record is updated before the next record is updated. If the table contains n records, the compute nodes and data nodes need to interact n times to complete a full table update. While this approach ensures strong consistency, when handling large-scale data, the frequent interactions between compute nodes and data nodes significantly prolong statement execution time, drastically reducing performance and becoming a bottleneck for the efficient operation of distributed databases. Summary of the Invention
[0004] This invention provides a data processing method, apparatus, device, medium, and product for distributed databases, to improve the performance of distributed databases in batch processing large amounts of data.
[0005] According to one aspect of the present invention, a data processing method for a distributed database is provided, applied to a computing node, the method comprising:
[0006] Obtain batch data update statements sent by the client; the data update statements include data addition statements, data deletion statements, or data sorting statements;
[0007] The batch data update statement is encapsulated based on the encapsulation protocol to obtain a data update request;
[0008] The data update request is sent to the data node so that the data node updates the data based on the data update request.
[0009] According to another aspect of the present invention, a data processing method for a distributed database is provided, applied to data nodes, the method comprising:
[0010] Get the data update request sent by the compute node;
[0011] The data update request is parsed based on the encapsulation protocol to obtain a patterned statement and data to be updated; wherein, the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated;
[0012] The data in the distributed database is updated based on the patterned statement and the data to be updated.
[0013] According to another aspect of the present invention, a data processing apparatus for a distributed database is provided, configured on a computing node, the apparatus comprising:
[0014] The batch update statement acquisition module is used to acquire batch data update statements sent by the client; the data update statements include data addition statements, data deletion statements, or data sorting statements.
[0015] The data update request determination module is used to encapsulate the batch data update statement based on the encapsulation protocol to obtain the data update request;
[0016] The data update request sending module is used to send the data update request to the data node so that the data node can update the data based on the data update request.
[0017] According to another aspect of the present invention, a data processing apparatus for a distributed database is provided, configured on a data node, the apparatus comprising:
[0018] The data update request acquisition module is used to acquire data update requests sent by compute nodes;
[0019] The data update request parsing module is used to parse the data update request based on the encapsulation protocol to obtain a patterned statement and data to be updated; wherein, the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated;
[0020] The data update module is used to update the data in the distributed database according to the patterned statement and the data to be updated.
[0021] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0022] At least one processor; and
[0023] A memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the data processing method of the distributed database according to any embodiment of the present invention.
[0025] 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 data processing method of the distributed database according to any embodiment of the present invention.
[0026] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the data processing method of a distributed database according to any embodiment of the present invention.
[0027] The technical solution of this invention involves acquiring batch data update statements sent by the client; these data update statements include data addition statements, data deletion statements, or data sorting statements; encapsulating the batch data update statements based on an encapsulation protocol to obtain a data update request; and sending the data update request to the data nodes so that the data nodes can update the data based on the data update request. Compared to the traditional approach of updating one piece of data per interaction, this invention's computing nodes encapsulate batch data update statements into a single request and send it to the data nodes through a new batch encapsulation protocol, enabling the data nodes to perform batch data updates. In other words, this invention can complete all data updates with a single interaction, significantly improving the performance of batch processing large amounts of data using DML statements in distributed databases while maintaining strong consistency.
[0028] 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
[0029] 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.
[0030] Figure 1 This is a flowchart of a data processing method for a distributed database according to an embodiment of the present invention;
[0031] Figure 2This is a flowchart of a data processing method for a distributed database according to an embodiment of the present invention;
[0032] Figure 3 This is a schematic diagram of the structure of a data processing device for a distributed database according to an embodiment of the present invention;
[0033] Figure 4 This is a schematic diagram of the structure of a data processing device for a distributed database according to an embodiment of the present invention;
[0034] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the distributed database data processing method of the present invention. Detailed Implementation
[0035] 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.
[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of 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.
[0037] Furthermore, it should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of batch data update statements and other related data involved in the technical solution of this invention all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0038] Figure 1This is a flowchart illustrating a data processing method for a distributed database according to an embodiment of the present invention. This embodiment is applicable to situations where distributed databases such as GoldenDB suffer from low execution efficiency when processing large amounts of data using DML statements. The method can be executed by a distributed database data processing device, which can be implemented in hardware and / or software. This data processing device can be configured in an electronic device that carries the data processing function of the distributed database, such as a server corresponding to a computing node. Figure 1 As shown, the method includes:
[0039] S110. Obtain the batch data update statement sent by the client.
[0040] In this embodiment, a data update statement refers to a statement used to update data in a distributed database, such as a DML statement; optionally, data update statements include data addition statements such as update, data deletion statements such as delete, or data sorting statements such as merge into.
[0041] Specifically, when a client needs to update a distributed database, it sends batch data update statements to the computing nodes, such as the `merge into when matched then update` statement, which updates all matched records. For example, `MERGE INTO products pUSING products_history ph ON(p.product_id=ph.product_id)WHEN MATCHED THEN UPDATE SET p.product_name=ph.product_name`.
[0042] Furthermore, the compute node queries all data in the table corresponding to the batch data update statement, and if it determines that the data has not been operated on by other distributed transactions, it executes the subsequent steps.
[0043] S120. Encapsulate the batch data update statement based on the encapsulation protocol to obtain the data update request.
[0044] In this embodiment, the encapsulation protocol refers to the protocol used to encapsulate batch data update statements; optionally, the encapsulation protocol includes protocol type, patterned statement length, patterned statement, amount of data to be updated, number of placeholders in the patterned statement, data type of the field corresponding to each placeholder, and concatenation of the actual field value to be updated corresponding to each placeholder; the specific encapsulation protocol is shown in the table below:
[0045]
[0046] Here, `command` is a 1-byte new protocol type. `patterned_stmt_length` is the length of the patterned SQL statement, i.e., the length of the patterned statement. `patterned_stmt` is the patterned SQL; taking the example statement, the patterned SQL is as follows: `UPDATE products P SET p.product_name=? WHERE p.product_id=?`. `batch_num` is the amount of data to be updated in the batch. `num_params` is the number of placeholders in the patterned statement. `parameter_type` is the data type of the field corresponding to each placeholder. `parameter_value` is the concatenation of the actual field value to be updated corresponding to each placeholder.
[0047] A data update request is a request used to instruct data nodes to update their data in a unified manner.
[0048] An alternative approach involves encapsulating a batch data update statement based on an encapsulation protocol to obtain a data update request. This includes: performing a pattern transformation on the batch data update statement to obtain a patterned statement; determining the data to be updated based on the batch data update statement; the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated; and encapsulating the patterned statement and the data to be updated based on the encapsulation protocol to obtain the data update request.
[0049] Specifically, the batch data update statements are transformed into pattern statements, such as "UPDATE products P SET p.product_name=? WHERE p.product_id=?". Then, the data to be updated is determined from the batch update statements, including the field types to be updated, the amount of data to be updated, and the actual field values to be updated. Finally, according to the encapsulation protocol, the pattern statements and the data to be updated are encapsulated to obtain the data update request.
[0050] Understandably, by encapsulating a large number of data update statements through an encapsulation protocol, it is possible to complete the update of all data with a single interaction with the data node.
[0051] S130. Send a data update request to the data node so that the data node can update the data based on the data update request.
[0052] Specifically, the compute node sends a data update request to the data node; correspondingly, after receiving the data update request, the data node parses the data update request into a code stream to obtain a batch data update statement and the data to be updated, and then performs the data update based on the batch data update statement and the data to be updated.
[0053] Furthermore, the data nodes feed back the data update results to the compute nodes; the compute nodes then feed back the data update results to the client.
[0054] The technical solution of this invention involves acquiring batch data update statements sent by the client; these data update statements include data addition statements, data deletion statements, or data sorting statements; encapsulating the batch data update statements based on an encapsulation protocol to obtain a data update request; and sending the data update request to the data nodes so that the data nodes can update the data based on the data update request. Compared to the traditional approach of updating one piece of data per interaction, this invention's computing nodes encapsulate batch data update statements into a single request and send it to the data nodes through a new batch encapsulation protocol, enabling the data nodes to perform batch data updates. In other words, this invention can complete all data updates with a single interaction, significantly improving the performance of batch processing large amounts of data using DML statements in distributed databases while maintaining strong consistency.
[0055] This invention effectively solves the problem of low execution efficiency of GoldenDB distributed database when processing large amounts of data using DML statements in distributed scenarios, significantly reducing CPU and other resource consumption and network interaction, and providing strong support for the efficient and stable operation of distributed database systems.
[0056] Figure 2 This is a flowchart illustrating a data processing method for a distributed database according to an embodiment of the present invention. This embodiment is applicable to situations where distributed databases such as GoldenDB suffer from low execution efficiency when processing large amounts of data using DML statements. The method can be executed by a distributed database data processing device, which can be implemented in hardware and / or software. This data processing device can be configured in an electronic device that carries the data processing function of the distributed database, such as a server corresponding to a data node. Figure 2 As shown, the method includes:
[0057] S210. Obtain the data update request sent by the compute node.
[0058] In this embodiment, a data update request refers to a request used to instruct data nodes to update their data uniformly.
[0059] Specifically, data nodes receive data update requests sent by compute nodes.
[0060] S220. Based on the encapsulation protocol, the data update request is parsed to obtain the patterned statement and the data to be updated.
[0061] In this embodiment, the encapsulation protocol refers to the protocol used to encapsulate batch data update statements; optionally, the encapsulation protocol includes protocol type, patterned statement length, patterned statement, amount of data to be updated, number of placeholders in the patterned statement, data type of the field corresponding to each placeholder, and concatenation of the actual field value to be updated corresponding to each placeholder.
[0062] The data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated.
[0063] Specifically, the data nodes parse the code stream of the data update request based on the encapsulation protocol to obtain the patterned statement and the data to be updated.
[0064] S230. Update the data in the distributed database according to the patterned statement and the data to be updated.
[0065] Specifically, the data nodes update the data in the distributed database sequentially based on the patterned statements and the data to be updated, and then feed the data update results back to the computing nodes.
[0066] The technical solution provided by this invention involves acquiring data update requests sent by computing nodes; parsing the data update requests based on an encapsulation protocol to obtain patterned statements and data to be updated; wherein, the data to be updated includes the type of field to be updated, the amount of data to be updated, and the actual field value to be updated; and updating the data in the distributed database according to the patterned statements and the data to be updated. In this technical solution, data nodes parse data update requests through a new batch encapsulation protocol to obtain batch data update statements, thereby achieving batch data updates. In other words, this invention can complete all data updates with a single interaction, significantly improving the performance of batch processing large amounts of data using DML statements in distributed databases while ensuring strong consistency.
[0067] Figure 3 This is a schematic diagram of a data processing device for a distributed database according to an embodiment of the present invention. This embodiment is applicable to situations where distributed databases such as GoldenDB suffer from low execution efficiency when processing large amounts of data using DML statements. The data processing device for this distributed database can be implemented in hardware and / or software, and can be configured in an electronic device that carries the data processing function of the distributed database, such as a server corresponding to a computing node. Figure 3 As shown, the device includes:
[0068] The batch update statement acquisition module 310 is used to acquire batch data update statements sent by the client; the data update statements include data addition statements, data deletion statements, or data sorting statements.
[0069] The data update request determination module 320 is used to encapsulate batch data update statements based on the encapsulation protocol to obtain data update requests;
[0070] The data update request sending module 330 is used to send data update requests to data nodes so that the data nodes can update the data based on the data update requests.
[0071] The technical solution of this invention involves acquiring batch data update statements sent by the client; these data update statements include data addition statements, data deletion statements, or data sorting statements; encapsulating the batch data update statements based on an encapsulation protocol to obtain a data update request; and sending the data update request to the data nodes so that the data nodes can update the data based on the data update request. Compared to the traditional approach of updating one piece of data per interaction, this invention's computing nodes encapsulate batch data update statements into a single request and send it to the data nodes through a new batch encapsulation protocol, enabling the data nodes to perform batch data updates. In other words, this invention can complete all data updates with a single interaction, significantly improving the performance of batch processing large amounts of data using DML statements in distributed databases while maintaining strong consistency.
[0072] Optionally, the data update request determination module 320 is specifically used for:
[0073] Perform pattern transformation on batch data update statements to obtain patterned statements;
[0074] The data to be updated is determined based on the batch data update statement; the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated.
[0075] Based on the encapsulation protocol, the patterned statement and the data to be updated are encapsulated to obtain the data update request.
[0076] Optionally, the encapsulation protocol includes the protocol type, the length of the patterned statement, the patterned statement, the amount of data to be updated, the number of placeholders in the patterned statement, the data type of the field corresponding to each placeholder, and concatenating the actual field value to be updated corresponding to each placeholder.
[0077] The distributed database data processing device provided in the embodiments of the present invention can execute the distributed database data processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0078] Figure 4This is a schematic diagram of a data processing device for a distributed database according to an embodiment of the present invention. This embodiment is applicable to situations where distributed databases such as GoldenDB suffer from low execution efficiency when processing large amounts of data using DML statements. The data processing device can be implemented in hardware and / or software, and can be configured in an electronic device that carries the data processing function of the distributed database, such as a server corresponding to a data node. Figure 4 As shown, the device includes:
[0079] The data update request acquisition module 410 is used to acquire data update requests sent by computing nodes.
[0080] The data update request parsing module 420 is used to parse the data update request based on the encapsulation protocol to obtain the patterned statement and the data to be updated; wherein, the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated;
[0081] The data update module 430 is used to update data in the distributed database based on patterned statements and data to be updated.
[0082] The technical solution provided by this invention involves acquiring data update requests sent by computing nodes; parsing the data update requests based on an encapsulation protocol to obtain patterned statements and data to be updated; wherein, the data to be updated includes the type of field to be updated, the amount of data to be updated, and the actual field value to be updated; and updating the data in the distributed database according to the patterned statements and the data to be updated. In this technical solution, data nodes parse data update requests through a new batch encapsulation protocol to obtain batch data update statements, thereby achieving batch data updates. In other words, this invention can complete all data updates with a single interaction, significantly improving the performance of batch processing large amounts of data using DML statements in distributed databases while ensuring strong consistency.
[0083] Optionally, the encapsulation protocol includes the protocol type, the length of the patterned statement, the patterned statement, the amount of data to be updated, the number of placeholders in the patterned statement, the data type of the field corresponding to each placeholder, and concatenating the actual field value to be updated corresponding to each placeholder.
[0084] The distributed database data processing device provided in the embodiments of the present invention can execute the distributed database data processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0085] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.
[0086] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the distributed database data processing method of the present invention.
[0087] Figure 5 A schematic diagram of an electronic device 10 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.
[0088] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0089] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0090] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 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 11 performs the various methods and processes described above, such as data processing methods for distributed databases.
[0091] In some embodiments, the data processing method for the distributed database may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data processing method for the distributed database described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data processing method for the distributed database by any other suitable means (e.g., by means of firmware).
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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).
[0096] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include 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.
[0097] 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.
[0098] 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.
[0099] 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 data processing method for a distributed database, characterized in that, Applied to compute nodes, the method includes: Obtain batch data update statements sent by the client; the data update statements include data addition statements, data deletion statements, or data sorting statements; The batch data update statement is encapsulated based on the encapsulation protocol to obtain a data update request; The data update request is sent to the data node so that the data node updates the data based on the data update request.
2. The method according to claim 1, characterized in that, The process of encapsulating the batch data update statements based on the encapsulation protocol to obtain a data update request includes: The batch data update statements are transformed into patterned statements. The data to be updated is determined according to the batch data update statement; the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated. Based on the encapsulation protocol, the patterned statement and the data to be updated are encapsulated to obtain a data update request.
3. The method according to claim 2, characterized in that, The encapsulation protocol includes the protocol type, the length of the patterned statement, the patterned statement, the amount of data to be updated, the number of placeholders in the patterned statement, the data type of the field corresponding to each placeholder, and the concatenation of the actual field value to be updated corresponding to each placeholder.
4. A data processing method for a distributed database, characterized in that, Applied to data nodes, the method includes: Get the data update request sent by the compute node; The data update request is parsed based on the encapsulation protocol to obtain a patterned statement and data to be updated; wherein, the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated; The data in the distributed database is updated based on the patterned statement and the data to be updated.
5. The method according to claim 4, characterized in that, The encapsulation protocol includes the protocol type, the length of the patterned statement, the patterned statement, the amount of data to be updated, the number of placeholders in the patterned statement, the data type of the field corresponding to each placeholder, and the concatenation of the actual field value to be updated corresponding to each placeholder.
6. A data processing device for a distributed database, characterized in that, Configured on a computing node, the device includes: The batch update statement acquisition module is used to acquire batch data update statements sent by the client; the data update statements include data addition statements, data deletion statements, or data sorting statements. The data update request determination module is used to encapsulate the batch data update statement based on the encapsulation protocol to obtain the data update request; The data update request sending module is used to send the data update request to the data node so that the data node can update the data based on the data update request.
7. A data processing device for a distributed database, characterized in that, Configured on a data node, the device includes: The data update request acquisition module is used to acquire data update requests sent by compute nodes; The data update request parsing module is used to parse the data update request based on the encapsulation protocol to obtain a patterned statement and data to be updated; wherein, the data to be updated includes the field type to be updated, the amount of data to be updated, and the actual field value to be updated; The data update module is used to update the data in the distributed database according to the patterned statement and the data to be updated.
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 data processing method for the distributed database according to any one of claims 1-5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the data processing method for the distributed database as described in any one of claims 1-5.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the data processing method for a distributed database according to any one of claims 1-5.
Citation Information
Patent Citations
Distributed database data batch processing method and device
CN110069565A
Data updating method and device, equipment and storage medium
CN116186051A
Batch execution method of database operation statements, storage medium and equipment
CN116719834A
Data batch insertion method for distributed database
CN118332010A