A strong consistency query request processing method, device and equipment and a storage medium

CN122925472APending Publication Date: 2026-10-16JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611171036.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-16

Smart Images

  • Figure CN122925472A_ABST
    Figure CN122925472A_ABST
Patent Text Reader

Abstract

The application discloses a strong consistency query request processing method and device, equipment and storage medium, belongs to the technical field of distributed database, the method is executed by the computing node in the distributed database, including: when receiving the strong consistency query request issued by the client, recording the request processing time of the strong consistency query request, the target list snapshot corresponding to the strong consistency query request is pulled from the global transaction manager through the global transaction snapshot update work thread, and the list snapshot time of the target list snapshot is recorded;According to the request processing time and the list snapshot time, the strong consistency query request is processed.The application solves the problem of insufficient freshness of the global transaction active list snapshot existing in the existing strong consistency query processing mechanism, greatly improves the timeliness of the global transaction active list snapshot under the premise of not significantly increasing the pressure of the global transaction manager, and reduces the query retry rate of a single strong consistency query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed database technology, and in particular to a method, apparatus, device, and storage medium for processing strongly consistent query requests. Background Technology

[0002] Distributed databases achieve horizontal scaling by relying on sharded storage across multiple data nodes (DNs), but global transaction consistency remains a core technical challenge. For strongly consistent query scenarios in distributed databases (such as GoldenDB), data visibility determination must rely on the global transaction activity list maintained by the Global Transaction Manager (GTM) as a unified snapshot benchmark. This ensures that query results only display the final data from all committed transactions, filtering out intermediate dirty data generated by uncommitted distributed transactions and avoiding the problem of fragmented data views across shards.

[0003] However, existing strong consistency query processing mechanisms suffer from insufficient freshness of the global transaction active list snapshot: Compute Nodes (CNs) passively and serially pull global transaction active list snapshots from the Global Transaction Identifier (GTM). Within the request-response cycle of a single snapshot, all new query requests reuse the same outdated snapshot data. Insufficient freshness of the global transaction active list snapshot leads to a large number of row GTIDs (Global Transaction Identifiers) hitting the active transaction set, frequently triggering query retries. This significantly increases the processing time of a single strong consistency query, slows down its execution efficiency, and ultimately reduces the overall query throughput of the distributed database. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and storage medium for processing strongly consistent query requests, in order to solve the problem of insufficient freshness of the global transaction active list snapshot in existing strongly consistent query processing mechanisms. Without significantly increasing the pressure on the global transaction manager, it improves the timeliness of the global transaction active list snapshot and reduces the query retry rate of a single strongly consistent query.

[0005] According to one aspect of the present invention, a strongly consistent query request processing method is provided, the method being executed by a computing node in a distributed database, the method comprising: When a strongly consistent query request is received from the client, the request processing time of the strongly consistent query request is recorded. The global transaction snapshot update worker thread pulls the target list snapshot corresponding to the strongly consistent query request from the global transaction manager and records the snapshot time of the target list snapshot. Strongly consistent query requests are processed based on the request processing time and the list snapshot time.

[0006] According to another aspect of the present invention, a strongly consistent query request processing apparatus is provided, which is deployed on a computing node of a distributed database, the apparatus comprising: The time acquisition module is used to record the request processing time of a strong consistent query request when it is received from the client. It also uses the global transaction snapshot update worker thread to pull the target list snapshot corresponding to the strong consistent query request from the global transaction manager and record the snapshot time of the target list snapshot. The strongly consistent query request processing module is used to process strongly consistent query requests based on the request processing time and the list snapshot time.

[0007] 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 at least one processor; wherein, The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the strongly consistent query request processing method of any embodiment of the present invention.

[0008] 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 strongly consistent query request processing method of any embodiment of the present invention.

[0009] 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 strongly consistent query request processing method of any embodiment of the present invention.

[0010] In the technical solution of this invention, when a computing node in a distributed database receives a strongly consistent query request from a client, it records the request processing time of the strongly consistent query request. It then uses a global transaction snapshot update worker thread to pull a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager and records the snapshot time of the target list snapshot. Subsequently, the computing node processes the strongly consistent query request based on the request processing time and the snapshot time. Compared to the existing strongly consistent query processing mechanism where the computing node passively and serially pulls a snapshot of the global transaction active list from the global transaction manager, and new query requests added within the snapshot request response period can only reuse the delayed snapshot, the above technical solution allows the computing node to pull a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager in real time upon receiving the request. Furthermore, it compares the request processing time of the strongly consistent query request with the snapshot time of the corresponding target list snapshot, and only processes the strongly consistent query request if the request processing time is not later than the snapshot time. This effectively solves the problem of insufficient freshness of the global transaction active list snapshot in the existing strong consistency query processing mechanism. Without significantly increasing the pressure on the global transaction manager, it greatly improves the timeliness of the global transaction active list snapshot, reduces query retries caused by outdated snapshots, thereby reducing the query retry rate of a single strong consistency query, shortening the query processing time, improving the execution efficiency of a single strong consistency query, and thus improving the overall query throughput of the distributed database.

[0011] 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

[0012] 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.

[0013] Figure 1 This is a flowchart of a strongly consistent query request processing method provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of a strongly consistent query request processing method provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of a strongly consistent query request processing device according to Embodiment 3 of the present invention; Figure 4This is a schematic diagram of the structure of an electronic device that implements the strongly consistent query request processing method of the present invention. Detailed Implementation

[0014] 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.

[0015] It should be noted that the terms "target," 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 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.

[0016] Example 1 Figure 1 This is a flowchart of a strongly consistent query request processing method provided in Embodiment 1 of the present invention. This embodiment is applicable to processing strongly consistent query requests in a distributed database (e.g., GoldenDB). The method can be executed by a strongly consistent query request processing device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, this method is executed by a computing node in a distributed database, and the method includes: S101. Upon receiving a strongly consistent query request from the client, record the request processing time of the strongly consistent query request, and use the global transaction snapshot update worker thread to pull the target list snapshot corresponding to the strongly consistent query request from the global transaction manager, and record the snapshot time of the target list snapshot.

[0017] The Global Transaction Manager is the core component for global transaction management in a distributed database. It is responsible for allocating GTIDs for global distributed transactions, maintaining the global active transaction list in real time, and recovering the GTID status after a transaction commit or rollback. It provides unified, globally consistent transaction snapshot data to all computing nodes in the distributed database. The global active transaction list is an ordered set maintained by the Global Transaction Manager, recording the GTIDs of all currently uncommitted or unrolled distributed transactions.

[0018] A strong consistency query request refers to a query request that carries global consistency semantics and relies on the global transaction active list maintained by the global transaction manager for global visibility verification. The request processing time refers to the moment the strong consistency query request reaches the compute node. The global transaction snapshot update worker thread refers to a dedicated background thread deployed within the compute node, used to periodically poll the global transaction manager and refresh the global transaction snapshot when the compute node receives a strong consistency query request. The target list snapshot refers to a static read-only copy of the global transaction active list successfully pulled from the global transaction manager by the compute node corresponding to the strong consistency query request. The list snapshot time refers to the moment the target list snapshot is successfully pulled.

[0019] Specifically, for each compute node in the distributed database, when it receives a strongly consistent query request from a client, it records the request processing time. Simultaneously, it wakes up the global transaction snapshot update worker thread, which continuously sends snapshot pull requests to the global transaction manager at preset minimum time intervals until a snapshot of the global transaction active list is successfully retrieved from the global transaction manager. At this point, it stops sending snapshot pull requests and uses the successfully retrieved global transaction active list snapshot as the target list snapshot corresponding to the strongly consistent query request. Simultaneously, the compute node records the snapshot time of the target list snapshot.

[0020] Here, a snapshot pull request refers to a request to obtain a snapshot of the global transaction active list. A global transaction active list snapshot is a static read-only copy generated by the global transaction manager when processing a snapshot pull request initiated by a compute node through a global transaction snapshot update worker thread, performing an instantaneous copy of the internally maintained global transaction active list. The preset minimum time interval refers to a pre-set minimum time difference between two proactive pulls of a global transaction active list snapshot from the global transaction manager; optionally, the preset minimum time interval can be preset based on the expert experience or experimental experience of those skilled in the art, and this embodiment of the invention does not specifically limit it.

[0021] Understandably, when a compute node in a distributed database receives a strongly consistent query request from a client, it continuously sends snapshot pull requests to the global transaction manager at a preset minimum time interval through a global transaction snapshot update worker thread to obtain a snapshot of the target list corresponding to the strongly consistent query request. For example, if compute node A in the distributed database receives strongly consistent query request 1 from a client at time T0, it wakes up the global transaction snapshot update worker thread, which continuously sends snapshot pull requests to the global transaction manager at a preset minimum time interval to obtain a snapshot of the target list corresponding to strongly consistent query request 1. If compute node A receives strongly consistent query request 2 from a client at time T1, it will again wake up the global transaction snapshot update worker thread, which will continue to send snapshot pull requests to the global transaction manager at a preset minimum time interval to obtain a snapshot of the target list corresponding to strongly consistent query request 2, without waiting for the snapshot reuse cycle at time T0 to end. Compared to the existing strong consistency query processing mechanism where computing nodes passively and serially pull snapshots of the global transaction active list from the global transaction manager, the new enhanced consistency query request can obtain the latest global transaction active list snapshot in a timely manner without waiting for the snapshot reuse period to end, thereby shortening the snapshot lag time and improving the freshness of the global transaction active list snapshot.

[0022] Optionally, to reduce the network interaction pressure between the compute node and the global transaction manager in high-concurrency batch strong consistency query scenarios, after obtaining the target list snapshot corresponding to the strong consistency query request and recording the snapshot time of the target list snapshot, the target list snapshot and the snapshot time can be synchronously broadcast to the shared cache.

[0023] In this context, for each computing node in a distributed database, the shared cache area refers to the data cache area shared by all execution threads within that computing node.

[0024] Specifically, taking the case where computing node A in a distributed database receives a strongly consistent query request 1 from a client at time T0, after computing node A obtains the target list snapshot and the snapshot time of the target list snapshot corresponding to strongly consistent query request 1, it synchronously broadcasts the target list snapshot and the snapshot time of the target list snapshot to the shared cache of computing node A. This allows all execution threads within computing node A to directly reuse the target list snapshot and its snapshot time without having to repeatedly send snapshot fetch requests to the global transaction manager. This avoids a large number of concurrent strongly consistent query requests flooding the global transaction manager, thereby reducing the network interaction pressure between computing nodes and the global transaction manager in high-concurrency batch strongly consistent query scenarios.

[0025] Optionally, to prevent the global transaction snapshot update worker thread from continuously sending snapshot pull requests to the global transaction manager during the idle period of the compute node, eliminating unnecessary network interactions and CPU resource consumption when the compute node is idle, reducing invalid access to the global transaction manager, and improving the overall resource utilization of the distributed database, the global transaction snapshot update worker thread can also be controlled to enter a sleep state when no strongly consistent query request is received within a preset period of time.

[0026] Specifically, for each computing node in the distributed database, if no strongly consistent query request is received within a preset time period, the global transaction snapshot update worker thread within that computing node is controlled to enter a sleep state.

[0027] S102. Process the strongly consistent query request based on the request processing time and the list snapshot time.

[0028] The strongly consistent query request includes a strongly consistent query statement. Specifically, based on the request processing time of the strongly consistent query request and the snapshot time of its corresponding target list snapshot, the strongly consistent query request is processed according to a preset strongly consistent query request processing algorithm.

[0029] In the technical solution of this invention, when a computing node in a distributed database receives a strongly consistent query request from a client, it records the request processing time of the strongly consistent query request. It then uses a global transaction snapshot update worker thread to pull a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager and records the snapshot time of the target list snapshot. Subsequently, the computing node processes the strongly consistent query request based on the request processing time and the snapshot time. Compared to the existing strongly consistent query processing mechanism where the computing node passively and serially pulls a snapshot of the global transaction active list from the global transaction manager, and new query requests added within the snapshot request response period can only reuse the delayed snapshot, the above technical solution allows the computing node to pull a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager in real time upon receiving the request. Furthermore, it compares the request processing time of the strongly consistent query request with the snapshot time of the corresponding target list snapshot, and only processes the strongly consistent query request if the request processing time is not later than the snapshot time. This effectively solves the problem of insufficient freshness of the global transaction active list snapshot in the existing strong consistency query processing mechanism. Without significantly increasing the pressure on the global transaction manager, it greatly improves the timeliness of the global transaction active list snapshot, reduces query retries caused by outdated snapshots, thereby reducing the query retry rate of a single strong consistency query, shortening the query processing time, improving the execution efficiency of a single strong consistency query, and thus improving the overall query throughput of the distributed database.

[0030] Example 2 Figure 2 This is a flowchart of a strongly consistent query request processing method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment further optimizes the "processing of strongly consistent query requests according to the request processing time and the list snapshot time," providing an optional implementation scheme. It should be noted that parts not detailed in this embodiment can be referred to in the relevant descriptions of other embodiments. For example... Figure 2 As shown, this method is executed by a computing node in a distributed database, and the method includes: S201. Upon receiving a strongly consistent query request from the client, record the request processing time of the strongly consistent query request, and use the global transaction snapshot update worker thread to pull the target list snapshot corresponding to the strongly consistent query request from the global transaction manager, and record the snapshot time of the target list snapshot.

[0031] Strongly consistent query requests include strongly consistent query statements.

[0032] S202. Check if the request processing time is later than the list snapshot time.

[0033] Specifically, if the processing time of a strongly consistent query request is detected to be no later than the snapshot time of its corresponding target list snapshot, then S203 to S204 are executed; if the processing time of a strongly consistent query request is detected to be later than the snapshot time of its corresponding target list snapshot, then S205 is executed.

[0034] S203. Send a strong consistency query statement to the target data node corresponding to the strong consistency query request, and receive the query result set returned by the target data node.

[0035] It should be noted that for each compute node in the distributed database, upon receiving a strongly consistent query request, a target execution thread is created to handle that request. The target data node is the data node that communicates with the target execution thread. It should also be noted that the query result set contains a global transaction identifier corresponding to each row of business data.

[0036] Specifically, taking the case where computing node A in the distributed database receives a strong consistency query request 1 from the client at time T0, if computing node A detects that the request processing time 1 of strong consistency query request 1 is not later than the list snapshot time 1 of its corresponding target list snapshot, it sends the strong consistency query statement in strong consistency query request 1 to the target data node corresponding to strong consistency query request 1, and receives the query result set fed back by the target data node corresponding to strong consistency query request 1.

[0037] S204. Based on the query result set and the snapshot of the target list, determine the subsequent processing actions.

[0038] Specifically, the system checks if a global transaction identifier exists in the query result set within the target list snapshot; if so, it retryes the query; otherwise, it returns the query result set to the client.

[0039] More specifically, continuing with the example of compute node A in the distributed database receiving a strongly consistent query request 1 from the client at time T0, compute node A, upon detecting the presence of any global transaction identifier within the query result set in the target list snapshot corresponding to strongly consistent query request 1, performs a query retry. That is, compute node A re-fetches the target list snapshot corresponding to strongly consistent query request 1 from the global transaction manager through the global transaction snapshot update worker thread, and records the snapshot time 1 of the target list snapshot; then, it re-executes S202 to S205. If compute node A detects that no global transaction identifier within the query result set exists in the target list snapshot corresponding to strongly consistent query request 1, it returns the query result set to the client.

[0040] S205. Temporarily suspend processing of strongly consistent query requests and wait for the next snapshot pull result from the global transaction snapshot update worker thread.

[0041] Specifically, continuing with the example of computing node A in the distributed database receiving a strong consistency query request 1 from the client at time T0, if computing node A detects that the request processing time 1 of the strong consistency query request 1 is later than the list snapshot time 1 of its corresponding target list snapshot, it will temporarily not process the strong consistency query request 1 and wait for the next snapshot pull result of the global transaction snapshot update worker thread until the list snapshot time of the next snapshot pull result is later than the request processing time 1, and then execute S203 to S204.

[0042] Compared to existing strong consistency query processing mechanisms where compute nodes passively and serially pull snapshots of the global transaction active list from the global transaction manager, and new query requests within the snapshot request response period can only reuse lagging snapshots, the technical solution of this invention records the request processing time of a strong consistency query request when a compute node in the distributed database receives such a request. It then pulls a snapshot of the target list corresponding to the strong consistency query request from the global transaction manager in real time and records the snapshot time of the target list snapshot. Subsequently, it compares the request processing time with the snapshot time, and only processes the strong consistency query request if the request processing time is not later than the snapshot time. This ensures the legality and validity of the snapshot timeline upon which the strong consistency query relies, avoids data visibility checks caused by outdated snapshots, reduces invalid query retries from the source, and solves the problem of insufficient freshness of the global transaction active list snapshot in existing strong consistency query processing mechanisms. Without significantly increasing the pressure on the global transaction manager, it greatly improves the timeliness of the global transaction active list snapshot, reduces the query retry rate of a single strong consistency query, thereby improving the execution efficiency of a single strong consistency query and ultimately increasing the overall query throughput of the distributed database.

[0043] Example 3 Figure 3 This is a schematic diagram of a strongly consistent query request processing device provided in Embodiment 3 of the present invention. This embodiment is applicable to processing strongly consistent query requests in a distributed database (e.g., GoldenDB). The device can be implemented in hardware and / or software and can be configured in an electronic device. Figure 3 As shown, the device is deployed on a computing node of a distributed database, and the device includes: The time acquisition module 301 is used to record the request processing time of a strong consistency query request when it receives a strong consistency query request from the client, and to pull the target list snapshot corresponding to the strong consistency query request from the global transaction manager through the global transaction snapshot update worker thread, and record the snapshot time of the target list snapshot. The strong consistency query request processing module 302 is used to process strong consistency query requests based on the request processing time and the list snapshot time.

[0044] In the technical solution of this invention, when a computing node in a distributed database receives a strongly consistent query request from a client, it records the request processing time of the strongly consistent query request. It then uses a global transaction snapshot update worker thread to pull a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager and records the snapshot time of the target list snapshot. Subsequently, the computing node processes the strongly consistent query request based on the request processing time and the snapshot time. Compared to the existing strongly consistent query processing mechanism where the computing node passively and serially pulls a snapshot of the global transaction active list from the global transaction manager, and new query requests added within the snapshot request response period can only reuse the delayed snapshot, the above technical solution allows the computing node to pull a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager in real time upon receiving the request. Furthermore, it compares the request processing time of the strongly consistent query request with the snapshot time of the corresponding target list snapshot, and only processes the strongly consistent query request if the request processing time is not later than the snapshot time. This effectively solves the problem of insufficient freshness of the global transaction active list snapshot in the existing strong consistency query processing mechanism. Without significantly increasing the pressure on the global transaction manager, it greatly improves the timeliness of the global transaction active list snapshot, reduces query retries caused by outdated snapshots, thereby reducing the query retry rate of a single strong consistency query, shortening the query processing time, improving the execution efficiency of a single strong consistency query, and thus improving the overall query throughput of the distributed database.

[0045] Optionally, a strongly consistent query request may include a strongly consistent query statement; The strongly consistent query request processing module 302 includes: The query result set receiving unit is used to send a strongly consistent query statement to the target data node corresponding to the strongly consistent query request and receive the query result set fed back by the target data node if it is detected that the request processing time is not later than the list snapshot time. The follow-up processing action determination unit is used to determine the follow-up processing action based on the query result set and the target list snapshot; The deferred processing unit is used to temporarily suspend the processing of strongly consistent query requests if the processing time is detected to be later than the list snapshot time, and wait for the next snapshot pull result from the global transaction snapshot update worker thread.

[0046] Optional, the subsequent processing action determination unit is specifically used for: Check if a global transaction identifier exists in the query result set within the snapshot of the target list; If so, then retry the query; If not, the query result set will be returned to the client.

[0047] Optionally, the real-time acquisition module 301 is specifically used for: The global transaction snapshot update worker thread continuously sends snapshot pull requests to the global transaction manager at a preset minimum time interval until it successfully pulls a snapshot of the global transaction active list from the global transaction manager. Then it stops sending snapshot pull requests to the global transaction manager and uses the successfully pulled snapshot of the global transaction active list as the target list snapshot corresponding to the strong consistency query request.

[0048] Optionally, the device may also include: The snapshot broadcast module is used to synchronously broadcast the target list snapshot and the snapshot time to the shared cache after obtaining the target list snapshot corresponding to the strongly consistent query request and recording the snapshot time of the target list snapshot.

[0049] Optionally, the device may also include: The snapshot update worker thread control module is used to control the global transaction snapshot update worker thread to enter a sleep state when no strong consistency query request is received within a preset period of time.

[0050] The strongly consistent query request processing apparatus provided in the embodiments of the present invention can execute the strongly consistent query request processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing each strongly consistent query request processing method.

[0051] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0052] Example 4 Figure 4 A schematic diagram of an electronic device 10, which 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.

[0053] like Figure 4As 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 into the RAM 13 from storage unit 18. The RAM 13 can 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.

[0054] 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.

[0055] 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, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as strongly consistent query request processing methods.

[0056] In some embodiments, the strong consistency query request processing method 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 strong consistency query request processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the strong consistency query request processing method by any other suitable means (e.g., by means of firmware).

[0057] 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.

[0058] 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.

[0059] 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.

[0060] 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).

[0061] 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.

[0062] 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.

[0063] 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.

[0064] 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 processing strongly consistent query requests, characterized in that, The method, executed by a computing node in a distributed database, includes: Upon receiving a strongly consistent query request from the client, the request processing time of the strongly consistent query request is recorded. The global transaction snapshot update worker thread pulls the target list snapshot corresponding to the strongly consistent query request from the global transaction manager and records the snapshot time of the target list snapshot. The strongly consistent query request is processed based on the request processing time and the list snapshot time.

2. The method according to claim 1, characterized in that, The strongly consistent query request includes a strongly consistent query statement; The step of processing the strongly consistent query request based on the request processing time and the list snapshot time includes: If it is detected that the request processing time is not later than the list snapshot time, then the strong consistency query statement is sent to the target data node corresponding to the strong consistency query request, and the query result set fed back by the target data node is received; Based on the query result set and the snapshot of the target list, determine the subsequent processing actions; If the processing time of the request is detected to be later than the snapshot time of the list, the strongly consistent query request will not be processed temporarily, and the process will wait for the next snapshot fetch result of the global transaction snapshot update worker thread.

3. The method according to claim 2, characterized in that, The step of determining subsequent processing actions based on the query result set and the snapshot of the target list includes: Detect whether the global transaction identifier within the query result set exists in the snapshot of the target list; If so, then retry the query; If not, the query result set will be returned to the client.

4. The method according to claim 1, characterized in that, The worker thread is updated by pulling a snapshot of the target list corresponding to the strongly consistent query request from the global transaction manager through a global transaction snapshot, including: The global transaction snapshot update worker thread continuously sends snapshot pull requests to the global transaction manager at a preset minimum time interval until it successfully pulls a snapshot of the global transaction active list from the global transaction manager. Then, it stops sending snapshot pull requests to the global transaction manager and uses the successfully pulled snapshot of the global transaction active list as the target list snapshot corresponding to the strong consistency query request.

5. The method according to claim 4, characterized in that, After obtaining the target list snapshot corresponding to the strongly consistent query request and recording the snapshot time of the target list snapshot, the method further includes: The target list snapshot and the list snapshot time are simultaneously broadcast to the shared cache.

6. The method according to claim 1, characterized in that, The method further includes: If no strongly consistent query request is received within a preset time period, the global transaction snapshot update worker thread is controlled to enter a sleep state.

7. A strongly consistent query request processing apparatus, characterized in that, The device, deployed on a computing node of a distributed database, includes: The time acquisition module is used to record the request processing time of the strong consistency query request when it receives a strong consistency query request from the client, and to pull the target list snapshot corresponding to the strong consistency query request from the global transaction manager through the global transaction snapshot update worker thread, and record the list snapshot time of the target list snapshot. The strongly consistent query request processing module is used to process the strongly consistent query request based on the request processing time and the list snapshot time.

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 strongly consistent query request processing 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 strongly consistent query request processing method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the strongly consistent query request processing method according to any one of claims 1-6.