Method for managing global objects in distributed database

By introducing hierarchical design of proxy modules, service modules and storage modules in distributed databases, the problem of low global object management efficiency in the existing technology is solved, efficient global object management and storage is realized, and efficient system operation is ensured in high concurrency situations.

CN119760026AActive Publication Date: 2025-04-04TIANJIN NANKAI UNIV GENERAL DATA TECH

Patent Information

Application Number
CN202510251758.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-04-04
Estimated Expiration
2045-03-05

AI Technical Summary

Technical Problem

In the prior art, global object management efficiency in distributed databases is low, and it is difficult to effectively manage key objects such as global transaction numbers, global timestamps and global sequence numbers.

Method used

The hierarchical design of proxy modules, service modules and storage modules is adopted. The proxy module resides on the computing nodes and data nodes, and is responsible for encapsulating and asynchronously processing global object requests; the service module is in the global object manager, and is responsible for generating and managing global objects; the storage module is responsible for saving and restoring global objects.

Benefits of technology

Through this design, the management efficiency of global objects is significantly improved, the system response delay is reduced, efficient operation is ensured in high concurrency situations, and the storage and recovery of global objects are effectively managed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760026A_ABST
    Figure CN119760026A_ABST
Patent Text Reader

Abstract

The invention provides a method for managing a global object in a distributed database, and the method comprises the steps: receiving a global object request packet sent by an agent module in the distributed database, and enabling the global object request packet to be obtained through the packaging of a global object request initiated by a calculation node or a data node through the agent module. And generating a response packet corresponding to the global object request packet based on the request type of the global object request. And returning the response packet to the computing node or the data node initiating the global object request, and storing the corresponding global object in the response packet in a storage module. And based on the corresponding global object in the response packet, updating the historical global object in the storage module to obtain an updated global object, wherein the updated global object is stored in a memory or a disk at the same time. According to the method provided by the invention, the global object can be efficiently managed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of distributed databases, and in particular to a method for managing global objects in a distributed database. Background Art

[0002] With the continuous development of science and technology, people's requirements for data processing are getting higher and higher. In a distributed database, some key objects need to be managed by a central node. Key objects can be global transaction numbers, global timestamps, global sequences, etc. They have uniqueness requirements and must be managed by a central node. The central node is responsible for maintaining these objects and quickly returning these objects after calculation based on requests from other nodes.

[0003] In the prior art, in order to achieve the above goals, a global object manager is designed separately to act as a central node. However, the management efficiency of key objects by the global object manager in the prior art is low.

[0004] Therefore, how to improve the management efficiency of key objects has become a technical problem that technical personnel in this field need to solve urgently. Summary of the invention

[0005] Based on the above problems, the present application provides a method for managing global objects in a distributed database. The method adopts a unique design of a proxy module, a service module and a storage module. The proxy module resides on a computing node and a data node, and is used to proxy the interaction between the computing node and the data node and the global object manager. The service module resides on the global object manager, is the core of the global object manager, and is responsible for processing requests from the proxy module. The storage module also resides on the global object manager and is responsible for the preservation and recovery of global objects. The unique design realizes efficient management of global objects in a distributed database.

[0006] The present application provides a method for managing global objects in a distributed database, the method comprising: Receiving a global object request packet sent by a proxy module in a distributed database, wherein the global object request packet is obtained by encapsulating a global object request initiated by a computing node or a data node through the proxy module, and each computing node and data node is provided with a proxy module; generating a response packet corresponding to the global object request packet based on a request type of the global object request; Returning the response packet to the computing node or data node that initiated the global object request, and storing the corresponding global object in the response packet in a storage module; The historical global object in the storage module is updated based on the corresponding global object in the response packet to obtain an updated global object, and the updated global object is simultaneously saved in the memory or the disk.

[0007] In a possible implementation, the generating a response packet corresponding to the global object request packet based on the request type of the global object request includes: If the request type of the global object request is a global transaction number type, a global transaction number is generated based on the historical global transaction number in the historical global object, and the global transaction number is a globally unique transaction number; The global transaction number is encapsulated as a response packet of the global object request packet.

[0008] In a possible implementation, the generating a response packet corresponding to the global object request packet based on the request type of the global object request includes: If the request type of the global object request is a global timestamp type, a global timestamp is generated based on the historical global timestamp in the historical global object or the clock source of the distributed database, and the global timestamp is a globally unique and monotonically increasing timestamp; The global timestamp is encapsulated as a response packet of the global object request packet.

[0009] In a possible implementation, the generating a response packet corresponding to the global object request packet based on the request type of the global object request includes: If the request type of the global object request is a global sequence number type, a global sequence number is generated based on the historical global sequence number in the historical global object, and the global sequence number is a globally unique sequence number; The global sequence number is encapsulated as a response packet of the global object request packet.

[0010] In a possible implementation, the method further includes: When the distributed database is restarted, the global objects in the memory of the computing node in the distributed database are restored based on the global objects stored in the storage module.

[0011] In a possible implementation, the proxy module includes at least two types of queues, and the method further includes: When the proxy module processes multiple global object requests, the multiple global object requests are added to the second type queue according to a preset rule; Process global object requests in the first queue; When the global object requests in the first-category queue are processed completely, the first-category queue and the second-category queue are switched through an atomic operation, and the global object requests in the first-category queue are continuously processed.

[0012] In a possible implementation, after the response packet is returned to the computing node or data node that initiated the global object request, the proxy module is put into a dormant state until it is awakened by receiving the next request and continues to process the new request.

[0013] The present application also provides a device for managing global objects in a distributed database, the device comprising: A receiving module, used to receive a global object request packet sent by a proxy module in a distributed database, wherein the global object request packet is obtained by encapsulating a global object request initiated by a computing node or a data node through the proxy module, and each computing node and data node is provided with a proxy module; A generating module, configured to generate a response packet corresponding to the global object request packet based on a request type of the global object request; A processing module, used for returning the response packet to the computing node or data node that initiated the global object request, and storing the corresponding global object in the response packet in a storage module; An updating module, used for updating the historical global object in the storage module based on the corresponding global object in the response packet to obtain an updated global object, wherein the updated global object is simultaneously saved to a memory or a disk; The global object management device is constructed based on computing nodes, and has all the capabilities of computing nodes.

[0014] The present application also provides an electronic device, the electronic device comprising a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the steps of the above-mentioned method for managing global objects in a distributed database according to the instructions in the computer program.

[0015] The present application also provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by an electronic device, the steps of the above-mentioned method for managing global objects in a distributed database are implemented.

[0016] Compared with the prior art, this application has the following beneficial effects: In the method provided by the present application, a hierarchical design of introducing a proxy module, a service module and a storage module in a distributed database greatly improves the management efficiency of global objects. As an intermediary of requests, the proxy module can encapsulate global object requests from computing nodes or data nodes and process them asynchronously. The design of the proxy module makes it possible to independently manage the life cycle of global object requests without directly relying on the business logic of computing nodes or data nodes. This design decouples request processing from other operations of computing nodes and data nodes, thereby improving the response efficiency of global object management. The proxy module of each node can respond to requests in a timely manner, avoiding performance bottlenecks when directly accessing the service module, and ensuring efficient operation of the system under high concurrency. The storage module of the global object performs intelligent updates and management between memory and disk. When a global object is updated, the storage module saves the updated object in memory and regularly synchronizes the updated object to disk. This mechanism ensures efficient storage of global objects, ensures data consistency and persistence, effectively reduces disk write pressure, and improves the performance of the entire database. Through the design of the proxy module, the processing task of the global object request is handed over to the service module to complete, avoiding the direct interaction between the computing nodes and data nodes and the global object manager, thereby reducing the response delay of the system. The service module is responsible for generating the corresponding response packet according to the request type. This process is independent and efficient, and has good concurrency capabilities, and can effectively cope with a large number of concurrent requests. Since the proxy module of each request node can process independently, the service module of the global object management device supports concurrency. The solution can be flexibly expanded to more computing nodes and data nodes, and the scalability of the system is effectively guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0018] Figure 1 A flowchart of a method for managing global objects in a distributed database provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of a device for managing global objects in a distributed database provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] As described above, in a distributed database, some key objects need to be managed by a central node. Key objects can be global transaction numbers, global timestamps, global sequences, etc. They have uniqueness requirements and must be managed by a central node. The central node is responsible for maintaining these objects and quickly returning them after calculation based on requests from other nodes.

[0020] After research, it was found that in order to achieve the above goals, a global object manager will be designed separately to act as the central node. This manager is usually designed independently, has a single function, supports only a small number of interfaces, and synchronizes data between the master and the backup through customized messages. When a node fails, the high availability capability is insufficient, which easily leads to data loss and other problems, making recovery difficult. In related technologies, the management efficiency of key objects through global object managers is low.

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] It is understandable that the method provided by the present application can be applied to a processing device, which is a processing device that can receive a global object request packet sent by a proxy module in a distributed database, such as a terminal device or a server that can receive a global object request packet sent by a proxy module in a distributed database. The method provided by the present application can be executed independently by a terminal device or a server, and can also be applied to a network scenario where a terminal device and a server communicate, and is executed by the cooperation of a terminal device and a server. Among them, the terminal device can be a computer, a mobile phone and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server.

[0023] Figure 1 A flowchart of a method for managing global objects in a distributed database provided by the present application, the method comprising the following steps: S101: Receive a global object request packet sent by a proxy module in a distributed database.

[0024] The service module receives the global object request packet sent by the proxy module in the distributed database. The global object request packet is obtained by encapsulating the global object request initiated by the computing node or data node through the proxy module. Each computing node and data node is provided with a proxy module.

[0025] Next, we will explain the different modules. The main function of the proxy module is to act as an intermediary between the computing node (CN), the data node (DN) and the service module. It is responsible for receiving requests from the computing node and the data node, forwarding them to the service module (Server), and returning the result to the requesting task after receiving the response from the service module.

[0026] When the proxy module is working, it initiates a request for global objects (such as global transaction number, global timestamp, sequence number, etc.) for the computing node or data node (CN / DN), and the task is submitted to the proxy module asynchronously. After receiving the request, the proxy module encapsulates the task information and forwards it to the service module through an asynchronous mechanism. After issuing the request, the proxy module enters a blocked state and waits for a response from the service module.

[0027] The proxy module maintains at least two types of queues, a first type queue and a second type queue. When the proxy module processes multiple global object requests, the multiple global object requests are added to the second type queue according to preset rules. The proxy module processes the global object requests in the first type queue. When the global object requests in the first type queue are processed, the proxy module switches the first type queue to the second type queue through atomic operations, and continues to process the global object requests in the first type queue.

[0028] The first type of queue can be the current request queue, and the second type of queue can be the pending request queue. Each time a request is processed, the proxy module exchanges the queues through atomic operations to ensure that the requests are processed in order.

[0029] The advantage of this design is that it can achieve high-concurrency processing of requests, reduce interference between requests, and improve the response efficiency of the system.

[0030] When the service module returns a response, the proxy module distributes the result to the corresponding task and wakes up the waiting task to complete the response. The proxy module also checks whether there is a new request to process. If there is a new request, it will continue to process the next request; if not, it will go into sleep mode.

[0031] The server module is the core part of the global object manager, responsible for receiving requests from the proxy module, performing calculations, and returning results. It is responsible for generating and managing global objects, such as the global transaction number (GXID), global timestamp, global sequence number, etc.

[0032] The service module is the core part of the global object manager, responsible for receiving requests from the proxy module, performing calculations, and returning results. It is responsible for generating and managing global objects, such as global transaction numbers, global timestamps, and global sequence numbers.

[0033] After startup, the service module will monitor the connection requests of the proxy modules and record the basic information of each proxy module.

[0034] When the proxy module sends a request, the service module performs the corresponding operation according to the request type. For example, when requesting a global transaction number, the service module generates a unique transaction number. When requesting a global timestamp, the service module generates a unique timestamp based on the current time and system status. When requesting a global sequence number, the service module increments and returns the current unique sequence number.

[0035] The service module is responsible for generating a globally unique transaction identifier to ensure that transaction numbers are not repeated in all distributed nodes. The service module ensures that the generated timestamp is unique in the distributed environment and remains consistent between nodes. Each node obtains a globally unique incremental sequence number through the service module to ensure that there are no duplicate sequence numbers in the system.

[0036] When processing each request, the service module will calculate according to the management rules of the global object to ensure that the result meets the consistency and uniqueness requirements of the system. After processing the request, the service module returns the result to the proxy module for subsequent processing.

[0037] The role of the storage module (Store) is to ensure the persistence and recovery of global objects. It is responsible for storing the latest values ​​of global objects and restoring global objects from disk when the system restarts or fails, ensuring high availability of the system.

[0038] When the service module generates a new global object (such as transaction number, timestamp, sequence number, etc.), the storage module will update it to the memory for fast access.

[0039] At the same time, the storage module periodically checks the difference between the global object in memory and the object value stored on disk. When the difference between the global object in memory and the disk is less than a certain threshold (threshold A), the storage module increases the object value on disk by a threshold (threshold B) and then writes it to disk to ensure that the object value on disk is large enough. This mechanism avoids frequent disk writes and improves performance.

[0040] When a global object is updated (for example, a new global timestamp or serial number is requested), the storage module ensures that the data in the memory is updated in a timely manner and periodically updates the object data in the disk and writes it back to the disk. The storage module reduces disk I / O operations and improves system performance by controlling the update frequency.

[0041] When the system restarts or fails, the storage module loads the latest global object value from the disk. Due to the above design, this value must be different from the value already used in the system, ensuring the uniqueness of the global object. To ensure the uniqueness and consistency of the global object, the storage module ensures that the restored global object value is greater than the used value to avoid conflicts or losses.

[0042] S102: Generate a response packet corresponding to the global object request packet based on the request type of the global object request.

[0043] The service module generates a response packet corresponding to the global object request packet based on the request type of the global object request.

[0044] In a possible implementation, if the request type of the global object request is a global transaction number type, the service module generates a global transaction number based on the historical global transaction number in the historical global object, and the global transaction number is guaranteed to be globally unique.

[0045] The service module encapsulates the global transaction number into a response packet of the global object request packet.

[0046] In another possible implementation, if the request type of the global object request is a global timestamp type, the service module generates a global timestamp based on the historical global timestamp in the historical global object or the clock source of the distributed database. The global timestamp is guaranteed to be globally unique and monotonically increasing.

[0047] The service module encapsulates the global timestamp as a response packet of the global object request packet.

[0048] In another possible implementation, if the request type of the global object request is a global sequence number type, the service module generates a global sequence number based on the historical global sequence numbers in the historical global objects, and the global sequence number is guaranteed to be globally unique.

[0049] The service module encapsulates the global sequence number as a response packet of the global object request packet.

[0050] In another possible implementation, a global object request may further include multiple request types, and multiple different request types may correspond to one global object request.

[0051] Global timestamps are used to identify the time sequence of transactions or operations in a distributed database, ensuring that the order of transaction processing is globally consistent across different nodes. Global timestamps are generally generated using a logical clock or based on the local clock of a node.

[0052] Global sequence numbers are mainly used to identify the order of data operations, such as assigning a unique sequence number to each operation in data insertion, update or deletion operations. The goal of global sequence number generation is to ensure uniqueness and incrementation in the global scope and avoid the occurrence of duplicate sequence numbers.

[0053] S103: Return the response packet to the computing node or data node that initiated the global object request, and save the corresponding global object in the response packet in the storage module.

[0054] The service module returns the response packet to the computing node or data node that initiated the global object request, and saves the corresponding global object in the response packet in the storage module.

[0055] S104: Based on the corresponding global object in the response packet, the historical global object in the storage module is updated to obtain an updated global object.

[0056] The service module updates the historical global object in the storage module based on the corresponding global object in the response packet to obtain an updated global object, and the updated global object is saved in the memory or disk at the same time.

[0057] In a possible implementation, after the distributed database is restarted, the service module may restore the global objects in the memory of the global object management device in the distributed database based on the global objects stored in the storage module.

[0058] In the method provided by the present application, a hierarchical design of a proxy module, a service module and a storage module is introduced in a distributed database, which greatly improves the management efficiency of global objects. As an intermediary of requests, the proxy module can encapsulate global object requests from computing nodes or data nodes and process them asynchronously. The design of the proxy module makes it possible to independently manage the life cycle of global object requests without directly relying on the business logic of computing nodes or data nodes. This design decouples request processing from other operations of computing nodes and data nodes, thereby improving the response efficiency of global object management. The proxy module of each node can respond to requests in a timely manner, avoiding the performance bottleneck when directly accessing the service module, and ensuring the efficient operation of the system under high concurrency. The storage module of the global object performs intelligent updates and management between memory and disk. When a global object is updated, the storage module saves the updated object in memory and regularly writes the updated object data in the disk back to the disk. This mechanism ensures the efficient storage of global objects, ensures the consistency and persistence of data, effectively reduces the pressure of disk writing, and improves the performance of the entire database. Through the design of the proxy module, the processing task of the global object request is handed over to the service module to complete, avoiding the direct interaction between the computing nodes and data nodes and the global object manager, thereby reducing the response delay of the system. The service module is responsible for generating the corresponding response packet according to the request type. This process is independent and efficient, and has good concurrency capabilities, and can effectively cope with a large number of concurrent requests. Since the proxy module of each request node can process independently, the service module of the global object management device supports concurrency. The solution can be flexibly expanded to more computing nodes and data nodes, and the scalability of the system is effectively guaranteed.

[0059] This application also provides a Figure 2 The schematic diagram of the structure of the global object management device in the distributed database shown in FIG. 200 includes: The receiving module 201 is used to receive a global object request packet sent by a proxy module in a distributed database, wherein the global object request packet is obtained by encapsulating a global object request initiated by a computing node or a data node through the proxy module, wherein each computing node is provided with a proxy module, a service module and a storage module, and each data node is provided with a proxy module; A generating module 202, configured to generate a response packet corresponding to the global object request packet based on the request type of the global object request; The processing module 203 is used to return the response packet to the computing node or data node that initiated the global object request, and save the corresponding global object in the response packet in the storage module; The updating module 204 is used to update the historical global object in the storage module based on the corresponding global object in the response packet to obtain an updated global object, and the updated global object is saved in the memory or disk at the same time.

[0060] In the device provided by the present application, a hierarchical design of a proxy module, a service module and a storage module is introduced in a distributed database, which greatly improves the management efficiency of global objects. As an intermediary of requests, the proxy module can encapsulate global object requests from computing nodes or data nodes and process them asynchronously. The design of the proxy module makes it possible to independently manage the life cycle of global object requests without directly relying on the business logic of computing nodes or data nodes. This design decouples request processing from other operations of computing nodes and data nodes, thereby improving the response efficiency of global object management. The proxy module of each node can respond to requests in a timely manner, avoiding performance bottlenecks when directly accessing the service module, and ensuring efficient operation of the system under high concurrency. The storage module of the global object performs intelligent updates and management between memory and disk. When a global object is updated, the storage module saves the updated object in memory and regularly updates the object data in the disk and writes it back to the disk. This mechanism ensures the efficient storage of global objects, ensures the consistency and persistence of data, effectively reduces the pressure of disk writing, and improves the performance of the entire database. Through the design of the proxy module, the processing task of the global object request is handed over to the service module to complete, avoiding the direct interaction between the computing nodes and data nodes and the global object manager, thereby reducing the response delay of the system. The service module is responsible for generating the corresponding response packet according to the request type. This process is independent and efficient, and has good concurrency capabilities, and can effectively cope with a large number of concurrent requests. Since the proxy module of each request node can process independently, the service module of the global object management device supports concurrency. The solution can be flexibly expanded to more computing nodes and data nodes, and the scalability of the system is effectively guaranteed.

[0061] An embodiment of the present application also provides a device for managing global objects in a distributed database, wherein the device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the steps of the method for managing global objects in a distributed database described in any embodiment of the present application.

[0062] In practical applications, the computer-readable storage medium may be any combination of one or more computer-readable media, which may be a computer-readable signal medium or a computer-readable storage medium.

[0063] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0064] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0065] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0066] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0067] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0068] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for managing global objects in a distributed database, characterized in that: include: Receiving a global object request packet sent by a proxy module in a distributed database, wherein the global object request packet is obtained by encapsulating a global object request initiated by a computing node or a data node through the proxy module, and each computing node and data node is provided with a proxy module; generating a response packet corresponding to the global object request packet based on a request type of the global object request; Returning the response packet to the computing node or data node that initiated the global object request, and storing the corresponding global object in the response packet in a storage module; The historical global object in the storage module is updated based on the corresponding global object in the response packet to obtain an updated global object, and the updated global object is simultaneously saved in the memory or the disk.

2. The method according to claim 1, characterized in that The generating a response packet corresponding to the global object request packet based on the request type of the global object request comprises: If the request type of the global object request is a global transaction number type, a global transaction number is generated based on the historical global transaction number in the historical global object, and the global transaction number is a globally unique transaction number; The global transaction number is encapsulated as a response packet of the global object request packet.

3. The method according to claim 1, characterized in that The generating a response packet corresponding to the global object request packet based on the request type of the global object request comprises: If the request type of the global object request is a global timestamp type, a global timestamp is generated based on the historical global timestamp in the historical global object or the clock source of the distributed database, and the global timestamp is a globally unique and monotonically increasing timestamp; The global timestamp is encapsulated as a response packet of the global object request packet.

4. The method according to claim 1, characterized in that: The generating a response packet corresponding to the global object request packet based on the request type of the global object request comprises: If the request type of the global object request is a global sequence number type, a global sequence number is generated based on the historical global sequence number in the historical global object, and the global sequence number is a globally unique sequence number; The global sequence number is encapsulated as a response packet of the global object request packet.

5. The method according to claim 1, characterized in that The method further comprises: When the distributed database is restarted, the global objects in the memory of the computing node in the distributed database are restored based on the global objects stored in the storage module.

6. The method according to claim 1, characterized in that The proxy module includes at least two types of queues, and the method further includes: When the proxy module processes multiple global object requests, the multiple global object requests are added to the second type queue according to a preset rule; Process global object requests in the first queue; When the global object requests in the first-category queue are processed completely, the first-category queue and the second-category queue are switched through an atomic operation, and the global object requests in the first-category queue are continuously processed.

7. The method according to claim 1, characterized in that When the response packet is returned to the computing node or data node that initiated the global object request, the proxy module is put into a dormant state until it is awakened by receiving the next request and continues to process the new request.

8. A device for managing global objects in a distributed database, characterized in that: include: A receiving module, used to receive a global object request packet sent by a proxy module in a distributed database, wherein the global object request packet is obtained by encapsulating a global object request initiated by a computing node or a data node through the proxy module, and each computing node and data node is provided with a proxy module; A generating module, configured to generate a response packet corresponding to the global object request packet based on a request type of the global object request; A processing module, used for returning the response packet to the computing node or data node that initiated the global object request, and storing the corresponding global object in the response packet in a storage module; An updating module, used for updating the historical global object in the storage module based on the corresponding global object in the response packet to obtain an updated global object, wherein the updated global object is simultaneously saved to a memory or a disk; The global object management device is constructed based on computing nodes, and has all the capabilities of computing nodes.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the method for managing global objects in a distributed database as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method for managing global objects in a distributed database according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Transaction identification operation method and system, and computer readable storage medium

    CN108984571A

  • Transaction management method based on distributed database

    CN109408201A

  • Method for generating globally unique serial number

    CN110674187A

  • Database processing method and device

    CN113297231A

  • Global transaction management method and system, electronic equipment and storage medium

    CN114625949A

Cited By

  • Visibility judgment method and device, equipment, medium and product

    CN121277956A