Clock updating method, device, database and computer storage medium
By controlling the interaction between the equipment and the computing nodes in the distributed system, allocating and updating timestamps, the problems of clock consistency and single point failure in the distributed system are solved, and efficient clock management and system performance improvement are achieved.
Patent Information
- Application Number
- CN202110125290.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-01-29
AI Technical Summary
In distributed systems, the global clock management equipment in the prior art is loaded by a large amount, the clock update effect is affected by the performance of a single device, and equipment failures will affect the entire system.
By interacting between the control device and the computing node, the control device allocates and sends a start time stamp, the calculation node updates the local clock, and generates a return time stamp after the transaction is completed. The control device determines the transaction end time stamp to ensure clock consistency.
The consistency of clocks of each node in a distributed system is achieved, maintenance is simplified, system performance is improved, and the impact of single point of failure is avoided.
Smart Images

Figure CN113420034B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of electronic information technology, and in particular to a clock updating method, device, database and computer storage medium. Background Art
[0002] In a distributed system, the devices of each node need to update the clock in the process of processing transactions to determine the processing time of each transaction. In related technologies, distributed consistency transactions are implemented through global clocks, and a device is used to uniformly manage the clock of the entire distributed system. However, this will cause a large load on the device, and the effect of clock updates is also affected by the performance of a single device. If the device fails, it will have a greater impact on the entire system; HLC (Hybrid Logical Clock) hybrid physical logical clock HLC is another algorithm and technology for implementing global consistency distributed consistency transactions. HLC does not require global nodes to generate timestamps. The devices of each node in the distributed system independently update their own clocks, which is more complicated to implement. Summary of the invention
[0003] In view of this, embodiments of the present application provide a clock updating method, device, database and computer storage medium to solve some or all of the above problems.
[0004] According to a first aspect of an embodiment of the present application, a distributed database is provided, which includes: a control device and at least one computing node; when the target transaction starts, the control device assigns a start timestamp to the target transaction and updates the local clock of the control device; sends the start timestamp to at least one computing node participating in the target transaction; the computing node updates the local clock of the computing node according to the start timestamp; after the target transaction is processed, a return timestamp is generated and the local clock of the computing node is updated; the return timestamp is sent to the control device; the control device determines the end timestamp of the target transaction according to at least one return timestamp, updates the local clock of the control device, and sends the end timestamp of the target transaction to at least one computing node.
[0005] According to the second aspect of an embodiment of the present application, a clock updating method is provided, which is applied to a management and control device, and includes: at the start of a target transaction, assigning a start timestamp to the target transaction and updating a local clock; sending a start timestamp to at least one computing node participating in the target transaction; receiving at least one return timestamp returned by at least one computing node; determining an end timestamp of the target transaction based on at least one return timestamp, and updating the local clock; and sending an end timestamp to at least one computing node participating in the target transaction.
[0006] According to the third aspect of an embodiment of the present application, a clock update method is provided, which is applied to a computing node, including: receiving the start timestamp of a target transaction sent by a control device; updating the local clock of the computing node according to the start timestamp; after the target transaction is processed, generating a return timestamp and updating the local clock; sending the return timestamp to the control device; receiving the end timestamp of the target transaction sent by the control device, and updating the local clock.
[0007] According to the fourth aspect of an embodiment of the present application, a management and control device is provided, including: a clock management module, used to assign a start timestamp to a target transaction when the target transaction starts, and to update a local clock; a sending module, used to send a start timestamp to at least one computing node participating in the target transaction; a receiving module, used to receive at least one return timestamp returned by at least one computing node; the clock management module is also used to determine an end timestamp of the target transaction based on at least one return timestamp, and to update the local clock; the sending module is also used to send an end timestamp to at least one computing node participating in the target transaction.
[0008] According to the fifth aspect of an embodiment of the present application, a computing node is provided, including: a receiving module for receiving the start timestamp of a target transaction sent by a control device; a clock management module for updating a local clock of the computing node according to the start timestamp; after the target transaction is processed, a return timestamp is generated and the local clock is updated; a sending module for sending a return timestamp to the control device; the receiving module is also used to receive the end timestamp of the target transaction sent by the control device; the clock management module is also used to update the local clock according to the end timestamp.
[0009] According to the sixth aspect of the embodiments of the present application, an electronic device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the clock update method of the second aspect or the third aspect.
[0010] According to a seventh aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the clock update method of the second aspect or the third aspect is implemented.
[0011] The clock updating method, device, database and computer storage medium provided by the embodiments of the present application, the start timestamp of the target transaction is allocated by the control device and sent uniformly to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent, which is simpler to implement and easy to maintain, and improves the overall performance. In addition, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] 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 recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0013] Figure 1 A schematic diagram of a scenario of a clock updating method provided in Embodiment 1 of the present application;
[0014] Figure 2 A flowchart of a clock updating method provided in Embodiment 1 of the present application;
[0015] Figure 3 A flowchart of a clock updating method provided in Embodiment 2 of the present application;
[0016] Figure 4 An information interaction diagram of a clock updating method provided in Embodiment 3 of the present application;
[0017] Figure 5 A schematic diagram of a connection pool provided in Example 3 of the present application;
[0018] Figure 6 A visibility judgment schematic diagram provided in Embodiment 3 of the present application;
[0019] Figure 7 A schematic diagram of a multi-version chain provided in Example 3 of the present application;
[0020] Figure 8 A schematic diagram of a test effect provided in Example 3 of the present application;
[0021] Fig. 9Another schematic diagram of test results provided in Example 3 of the present application;
[0022] Fig.10 A structural block diagram of a control device provided in Example 4 of the present application;
[0023] Fig.11 A structural block diagram of a computing node provided in Embodiment 5 of the present application;
[0024] Fig.12 A structural diagram of a distributed database provided in Example 6 of the present application;
[0025] Fig.13 A schematic diagram of the structure of an electronic device provided in Example 7 of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0027] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0028] Embodiment 1
[0029] The first embodiment of the present application provides a clock update method, which is applied to a control device, which can be a network device such as a server, a relay device, a device-to-device (D2D) device, etc. For ease of understanding, the application scenario of the clock update method provided in the first embodiment of the present application is described, referring to Figure 1 As shown, Figure 1 A scenario diagram of a clock updating method provided in Example 1 of the present application. Figure 1 The scenario shown includes a management and control device 101 , a computing node 102 , and a client device 103 .
[0030] The control device 101 and the computing node 102 can be network devices such as servers, relay devices, and end-to-end devices. The control device 101 and the computing node 102 can be integrated into one device or can be two separate devices. For example, the control device 101 and the computing node 102 can be two processors in one device; for another example, the control device 101 and the computing node 102 can be two servers in a cabinet; for another example, the control device 101 and the computing node 102 can be two separate servers. Of course, here we only take the server as an example. It should be noted that the control device 101 and at least one computing node 102 can form a distributed system, for example, it can be a distributed database. The control device 101 plays a coordinating role in the distributed system. For example, when starting a transaction, the control device 101 sends a message to at least one computing node 102 participating in the transaction, so that at least one computing node 102 processes the transaction.
[0031] The client device 103 can be a terminal device such as a smart phone, a tablet computer, a laptop computer, or a cloud device such as a server. It should be noted that the control device 101, the computing node 102, and the client device 103 can access the network and communicate with each other through the network. In this application, the network includes a local area network (English: Local Area Network, LAN), a wide area network (English: Wide Area Network, WAN), and a mobile communication network; such as the World Wide Web (English: World Wide Web, WWW), Long Term Evolution (English: Long Term Evolution, LTE) network, 2G network (English: 2nd Generation Mobile Network), 3G network (English: 3rd Generation Mobile Network), 5G network (English: 5th Generation Mobile Network), etc. Of course, this is just an exemplary description.
[0032] It should be noted that in this application, the control device may also be a coordination node, and the computing node may also be a data storage node or a computing node. Figure 1As shown, the client device 103 sends a request message to the control device 101, and the control device 101 starts to process the corresponding target transaction according to the request information, assigns a start timestamp to the target transaction, and updates the local clock according to the start timestamp; the control device 101 sends a start timestamp to at least one computing node 102 participating in the target transaction; each computing node 102 updates its own local clock according to the start timestamp, and processes the target transaction. After processing the target transaction, it generates its own return timestamp and sends the return timestamp to the control device 101; the control device 101 determines the end timestamp of the target transaction according to the return timestamp sent by each data storage device 102, updates the local clock according to the end timestamp, and sends the end timestamp to at least one computing node 102 participating in the target transaction; each computing node updates its own local clock according to the end timestamp.
[0033] Combination Figure 1 The scenario shown in the figure is used to describe in detail the clock updating method provided in the first embodiment of the present application. It should be noted that: Figure 1 This is just an application scenario of the clock update method provided in the first embodiment of the present application, and does not mean that the clock update method must be applied to Figure 1 The scene shown, see Figure 2 As shown, Figure 2 A flowchart of a clock updating method provided in Embodiment 1 of the present application, the clock updating method is applied to a control device, comprising the following steps:
[0034] Step 201: When a target transaction starts, a start timestamp is assigned to the target transaction and a local clock is updated.
[0035] The target transaction is the transaction to be processed, which can be any transaction. A transaction is a program execution unit that accesses and possibly updates various data items in a database. A transaction consists of all operations performed between the start of a transaction and the end of a transaction. For example, a transaction can be a Structured Query Language (SQL) statement, a group of SQL statements, or an entire program. The start timestamp is used to indicate the start time of the target transaction. The local clock is a time variable maintained by the management and control device based on the physical clock. The local clock can be a physical clock, a logical clock, or a hybrid of a physical clock and a logical clock. Specifically, the physical clock refers to the actual time. For example, the value of the physical clock can be 15:23:34, and the value of the physical clock is the current specific time. The logical clock can be a mark used to maintain the order of transactions. For example, the logical clock can be a 16-bit binary number. Every time a transaction is completed, the logical clock can be increased by 1 to ensure the order between transactions. The hybrid clock refers to a value that represents the transaction order by combining the physical clock and the logical clock. The hybrid clock can be composed of a physical clock and a logical clock. For example, the value of the hybrid clock can be represented by a 32-bit binary number, in which the first 16 bits represent the physical clock and the last 16 bits represent the logical clock. Of course, this is just an example.
[0036] Optionally, in a specific implementation method, when the target transaction starts, a start timestamp is assigned to the target transaction and the local clock is updated, including: when the target transaction starts, obtaining the current physical clock of the management and control device; aligning the current physical clock with the physical clock of the local hybrid clock to obtain the aligned current physical clock, the local clock including the physical clock and the logical clock; determining the larger value between the aligned current physical clock and the current value of the local clock as the start timestamp, and using the start timestamp as the latest value of the local clock. Exemplarily, a binary number can be used to represent the local clock, the high bit of the binary number represents the physical clock, and the low bit represents the logical clock, that is, the binary bit corresponding to the physical clock is before the binary bit corresponding to the logical clock. The local clock can be represented by an m-bit binary number, and the logical clock can be represented by an n-bit binary number, where m and n are both integers greater than 0. Taking m=48 and n=16 as an example, the last 16 bits of the local clock represent the logical clock, and the bits before the 16 bits represent the physical clock. The current physical clock can be shifted left by 16 bits to be aligned with the physical clock of the local clock; or 16 bits can be added after the current physical clock, and the value of these 16 bits can be supplemented with 0 to complete the physical clock alignment with the local clock. The accuracy of the physical clock can be in milliseconds. Of course, this is just an exemplary description. Optionally, the ClockNow() function can be used to implement it, and max_ts is used to represent the local clock. Then, in the ClockNow() function, max_ts = max{max_ts, local_phys_ts}, where local_phys_ts represents the current physical clock aligned with the physical clock of the local clock, that is, the current physical clock after 16 bits left shift. The larger value of the current physical clock and the current value of the local clock is determined as the start timestamp, which can ensure that the start timestamp is the latest time point and avoid disorder between multiple transactions.
[0037] Step 202: Send a start timestamp to at least one computing node participating in the target transaction.
[0038] The control device sends a start timestamp to at least one computing node participating in the target transaction, and the computing nodes participating in the target transaction update their respective local clocks according to the start timestamp. The local clock of the computing node can be the same as the local clock of the control device, which is not repeated here. It should be noted that in one implementation, the control device can send a start timestamp to all computing nodes participating in the target transaction, so that the clocks of all computing nodes participating in the target transaction can be kept consistent.
[0039] Step 203: Receive at least one return timestamp returned by at least one computing node.
[0040] The return timestamp of a computing node is determined based on the time when the computing node completes the target transaction. Because each computing node independently maintains a local clock and the time when each computing node completes the target transaction is not necessarily exactly the same, the return timestamps determined by each computing node are not necessarily the same.
[0041] Step 204: Determine the end timestamp of the target transaction according to at least one returned timestamp, and update the local clock.
[0042] Optionally, in one implementation, determining the end timestamp of the target transaction according to at least one returned timestamp includes: determining the timestamp with the largest value among the at least one returned timestamp as the end timestamp, and updating the local clock according to the end timestamp. Determining the return timestamp with the largest value as the end timestamp of the target transaction can make the end timestamp of the target transaction unified and the largest value among all computing nodes, avoid the end timestamp of the transaction completed before the target transaction being smaller than the end timestamp of the target transaction, and ensure that there is no disorder between transactions.
[0043] Exemplarily, when the local clock is updated using the end timestamp, the larger value between the end timestamp and the current value of the local clock can be determined as the latest value of the local clock. For example, this can be implemented using the ClockUpdate() function, with max_ts representing the local clock. In the ClockUpdate() function, max_ts = max{max_ts, commit_ts}, where commit_ts represents the return timestamp with the largest value. Of course, this is just an exemplary description.
[0044] Step 205: Send an end timestamp to at least one computing node participating in the target transaction.
[0045] At least one computing node may update a respective local clock according to the end timestamp.
[0046] In the clock updating method provided in the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and uniformly sent to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent, which is simpler to implement and easy to maintain, and improves the overall performance. In addition, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced.
[0047] Embodiment 2
[0048] Combination Figure 1 In the scenario shown, Embodiment 2 of the present application provides a clock updating method, which is applied to a computing node. Figure 1 This is just one application scenario of the clock update method provided in the second embodiment of the present application, and does not mean that the clock update method must be applied to Figure 1 The scene shown, see Figure 3 As shown, Figure 3 A flowchart of a clock updating method provided in Embodiment 2 of the present application, the method comprising the following steps:
[0049] Step 301: Receive the start timestamp of the target transaction sent by the management and control device.
[0050] Step 302: Update the local clock of the computing node according to the start timestamp.
[0051] Each computing node participating in the target transaction will receive the start timestamp, which can ensure that the local clocks of each computing node are consistent after being updated according to the start timestamp. If the values of the local clocks of each computing node are different before updating the local clocks, the values will be basically consistent after updating the local clocks.
[0052] Optionally, in a specific implementation, updating the local clock of the computing node according to the start timestamp includes: determining the larger value of the start timestamp and the current value of the local clock as the latest value of the local clock. Exemplarily, the ClockUpdate() function can be used for implementation, and max_ts is used to represent the local clock. In the ClockUpdate() function, max_ts = max{max_ts, start_ts}, where start_ts represents the start timestamp of the target transaction. Of course, this is only an exemplary description.
[0053] Step 303: After the target transaction is processed, a return timestamp is generated and the local clock is updated.
[0054] Optionally, in one implementation, after the target transaction is processed, a return timestamp is generated and the local clock is updated, including: after the target transaction is processed, the current physical clock of the computing node is obtained; the current physical clock is aligned with the physical clock of the local clock to obtain the aligned current physical clock, the local clock includes the physical clock and the logical clock; the value obtained by adding 1 to the larger value of the aligned current physical clock and the current value of the local clock is determined as the return timestamp, and the return timestamp is used as the latest value of the local clock. The value obtained by adding 1 to the larger value of the aligned current physical clock and the current value of the local clock is determined as the return timestamp, which can ensure that the return timestamp determined by the computing node is the maximum value that can be determined by the computing node, and will not conflict with the time of other transactions, avoiding disorder. Exemplarily, it can be implemented using the ClockTick() function, and max_ts is used to represent the local clock. In the ClockTick() function, max_ts=max{max_ts,local_phys_ts}+1, where local_phys_ts represents the current physical clock aligned with the physical clock of the local clock.
[0055] Step 304: Send a return timestamp to the control device.
[0056] Step 305: Receive the end timestamp of the target transaction sent by the management and control device, and update the local clock.
[0057] The method of updating the local clock according to the end timestamp is the same as the updating method in step 302, and will not be repeated here.
[0058] In the clock updating method provided in the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and uniformly sent to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent, which is simpler to implement and easy to maintain, and improves the overall performance. In addition, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced.
[0059] Embodiment 3
[0060] Combination Figure 1In the scenario shown in the figure, based on the data updating method described in the above-mentioned embodiment 1 and embodiment 2, embodiment 3 of the present application provides a data updating method, which is applied to a distributed database. Of course, this embodiment is only described by taking a distributed database as an example. The distributed database may include the following: Figure 1 At least one control device and at least one computing node are shown. The control device can also be a coordination node (English: Coordinator Node, CN), and the data device can be a computing node (English: Data Node, DN). Each node in the distributed database maintains a local hybrid clock (in this embodiment, the local clock is a local hybrid clock as an example for explanation), represented by the variable max_ts, and three ways to update max_ts are defined here: ClockNow() function, used to distribute clocks, max_ts = max{max_ts, local_phys_ts}, local_phys_ts is the current physical clock of the local node shifted left by 16 bits (aligned with the physical clock of the local hybrid clock), and returns max_ts; ClockUpdate() function, used to update max_ts, that is, max_ts = max{new_ts, max_ts}, new_ts is the newly acquired timestamp; ClockTick(), used to read max_ts incrementally, max_ts = max{max_ts, local_phys_ts}+1, and returns max_ts. Based on the above description, refer to Figure 4 As shown, Figure 4 This is an information interaction diagram of a clock updating method provided in Embodiment 3 of the present application, the method comprising the following steps:
[0061] Step 401: The management and control device receives an SQL request sent by a client device, and starts a target transaction according to the SQL request.
[0062] Step 402: When the target transaction starts, the management and control device assigns a start timestamp to the target transaction and updates the local clock.
[0063] Here, allocating the start timestamp and updating the local clock can be completed simultaneously in one execution operation using the ClockNow() function. The manner of allocating the start timestamp and updating the local clock is described in detail in the first embodiment and will not be repeated here.
[0064] Step 403: The management and control device sends a start timestamp to at least one computing node participating in the target transaction.
[0065] The control device can also generate distributed query execution instructions based on SQL requests, send query execution instructions to at least one computing node participating in the target transaction, and process the target transaction on each computing node where the data is located. It should be noted that a connection pool is usually used between the control device and the computing nodes to support multiplexing connections between multiple sessions to reduce the number of network connections within the cluster. Figure 5 As shown, a connection pool is set on the control device and the computing node. The connection pool can also be a connection management module. Taking the control device A as an example, the connection pool of the control device A stores the address information of each computing node that has established a connection with the control device A, and retains the data transmission process between the control device A and each computing node that has established a connection. When the control device A needs to transmit data to the computing node, there is no need to establish a new process or a connection. The data can be directly transmitted to the computing node through the existing process and the stored address information.
[0066] Step 404: The computing node updates the local clock according to the start timestamp.
[0067] You can use the ClockUpdate() function to update the local clock with the start timestamp as new_ts.
[0068] Step 405: The computing node processes the target transaction, generates a return timestamp after the target transaction is processed, and updates the local clock.
[0069] The ClockTick() function can be used to determine the return timestamp. When the return timestamp is determined, the local clock is updated. Alternatively, the latest value of the local clock can be determined and the latest value of the local clock can be determined as the return timestamp. The method of generating the return timestamp and updating the local clock is described in detail in the second embodiment and will not be repeated here.
[0070] Step 406: The computing node sends a return timestamp to the management and control device.
[0071] Step 407: The management and control device determines the end timestamp of the target transaction according to the at least one received return timestamp, and updates the local clock.
[0072] Combined with steps 405-407, in a specific application scenario, the user's operation on the client device can trigger the completion of the target transaction processing. After the user triggers the completion of the target transaction processing, the control device sends a pre-commit command to the computing node participating in the target transaction processing, and the computing node enters the pre-commit state. The computing node can add a pre-commit mark to the target transaction to mark the target transaction entering the pre-commit stage, and generate a return timestamp, and send the return timestamp to the control device. After the control device receives the return timestamp sent by the computing node, it determines the return timestamp with the largest value as the end timestamp of the target transaction, and then uses the ClockUpdate() function to use the end timestamp as new_ts to update the local clock.
[0073] Step 408: The management and control device sends an end timestamp to at least one computing node participating in the target transaction.
[0074] Step 409: The computing node updates the local clock according to the end timestamp of the target transaction.
[0075] In combination with the above steps 401-409, when the target transaction involves multiple computing nodes (computing nodes), taking computing node 1 and computing node b as examples, before processing the target transaction, the local clock of computing node 1 is n, and after completing the target transaction, the local clock of computing node 1 is updated to n+1, and the submission timestamp submitted by computing node 1 to the control device is n+1; before processing the target transaction, the local clock of computing node b is m, and after completing the target transaction, the local clock of computing node b is updated to m+1, and the submission timestamp submitted by computing node b to the control device is m+1, and both m and n are binary integers; the control device determines the larger value between n+1 and m+1 as the end timestamp of the target transaction, for example, if n is greater than m, then n+1 is the end timestamp; if n is less than m, then m+1 is the end timestamp. Taking n greater than m and the end timestamp n+1 as an example, the management and control device sends the end timestamp to computing node 1 and computing node b. Both computing node 1 and computing node b update their local clocks to n+1. At this time, the clocks of computing node 1 and computing node b are consistent.
[0076] For different transactions, for example, transaction T1 and transaction T2, the start timestamp and end timestamp of transaction T1 and transaction T2 are different. In a distributed database, the data modification in transaction T1 may not be visible to transaction T2. Figure 6 As shown, Figure 6 A visibility judgment schematic diagram provided for Example 3 of the present application.
[0077] If transaction T1 does not enter the pre-commit phase, the data modifications of transaction T1 are not visible to transaction T2;
[0078] If transaction T1 has entered the pre-commit phase, wait until transaction T1 is committed before determining whether the data modification of transaction T1 is visible to transaction T2.
[0079] If transaction T1 has ended / committed, compare the end timestamp of transaction T1 with the start timestamp of transaction T2. If the start timestamp of transaction T2 is greater than or equal to the end timestamp of transaction T1, the data modification of transaction T1 is visible to transaction T2, that is, during the processing of transaction T2, the modified data of transaction T1 can be obtained.
[0080] Based on the method described in steps 401-409, and Figure 6 The visibility judgment shown is illustrated here with three specific examples.
[0081] In the first example, taking computing node 1, transaction T1 and transaction T2 as examples, if transaction T1 has not entered the pre-commit phase when transaction T2 scans the modification of transaction T1, then T1 is not visible to T2, and the start timestamp of transaction T2 is less than the end timestamp of transaction T1. Because in the pre-commit phase of transaction T1, the end timestamp of transaction T1 is greater than or equal to the return timestamp of computing node 1 to transaction T1, and transaction T1 has not been pre-committed, therefore, commit_ts_T1>max_ts>=start_ts_T2, where commit_ts_T1 represents the end timestamp of transaction T1, max_ts represents the current value of the local clock of computing node 1, and start_ts_T2 represents the start timestamp of transaction T2. Since the end timestamp of transaction T1 and the start timestamp of transaction T2 are unified in the entire distributed system, the condition commit_ts_T1>start_ts_T2 is true for any node.
[0082] If transaction T2 scans the modification of transaction T1, and transaction T1 has entered the pre-commit stage, transaction T2 needs to wait for transaction T1 to be committed, that is, transaction T1 ends. If transaction T1 is not completed at a certain computing node when transaction T2 starts, that is, no return timestamp is generated, then according to the proof in the previous paragraph, commit_ts_T1>start_ts_T2, then when computing node 1 waits until transaction T1 ends, the modification of transaction T1 is not visible to transaction T2. Therefore, the modification of transaction T1 is visible to transaction T2 if and only if, when transaction T2 starts, all computing nodes participating in the target transaction have generated a return timestamp for transaction T1, that is, when the start timestamp of transaction T2 is greater than or equal to the end timestamp of transaction T1, the modification of transaction T1 is visible to transaction T2.
[0083] In the second example, take read transactions and write transactions as examples. Multi-version concurrency control (MVCC) allows write transactions to not block read transactions. When a write transaction generates a new version, if the commit timestamp of the write transaction is less than or equal to the start timestamp of the read transaction, the read transaction can read the visible version. The read transaction traverses from the old version to the new version until it finds a version visible to it. Therefore, to ensure the order of transactions, the commit timestamp of the multi-version chain is monotonically increasing. Conflicts between write transactions and write transactions are deserialized through tuple locks (tuple locks) to achieve concurrent writing of the same version chain. Locks can also be used to ensure the monotonically increasing commit timestamp of the version chain. For example Figure 7 As shown, Figure 7 A multi-version chain schematic diagram is provided for Example 3 of the present application. In computing node 1, transaction T1 is the start transaction of the previous version, transaction T2 is the end transaction of the previous version, and is the start transaction of the current version. There are concurrent transactions T2 and T3. If transaction T2 obtains the lock first, transaction T3 needs to wait until transaction T2 ends before obtaining the lock. In this case, transaction T2 obtains the lock first and is committed first. When transaction T2 is committed, max_ts>=commit_ts_T2, where max_ts represents the local clock of computing node 1, and commit_ts_T2 represents the end timestamp of transaction 2. Transaction T3 obtains the lock after transaction T2 ends. After transaction T3 is processed, it is committed, commit_ts_T3>=prepare_ts_DN1=max{max_ts,local_phys_ts}+1. prepare_ts_DN1 represents the return timestamp of transaction T3. Therefore, commit_ts_T3>max_ts>=commit_ts_T2, and the version chain timestamp is incremented.
[0084] In the third example, external consistency is explained. Taking transaction T1 and transaction T2 as examples, external consistency means that transaction T1 is submitted and returned to the client, and then transaction T2 is initiated (it can be a different client). The later executed transaction T2 can see the modification results of transaction T1 completed online. For clients connected to the same coordination node CN, the coordination node CN uses the end timestamp of transaction T1 to update the local clock max_ts_CN. Transaction T1 returns to the client and initiates a request for transaction T2 (it can come from a different client). The start timestamp of transaction T2 is start_ts_T2 = max{max_ts_CN, local_phys_ts}> = max_ts_CN>commit_ts_T1, where commit_ts_T1 represents the end timestamp of transaction T1, and local_phys_ts represents the current physical clock of the coordination node CN. Therefore, the start timestamp of transaction T2 is greater than the end timestamp of transaction T1, so transaction T2 can see the modification of transaction T1.
[0085] For clients connected to different coordination nodes CN, consistency can be achieved through the Precision Time Protocol (PTP). PTP can be used to control the clock skew between different coordination nodes CN in a distributed system within 1us, and the network delay between the client and the coordination node CN is much larger than the clock offset, so disorder will not occur.
[0086] The clock update method provided by this application can not only ensure the consistency of the clocks between nodes in a distributed system, reduce the impact of single-point performance and single-point failure on the entire system, but also has better stability and horizontal expansion capabilities. Taking the TPC-C benchmark test based on the Transaction Processing Performance Council (TPC) as an example, Figure 8 As shown, Figure 8 A test effect diagram provided for Example 3 of this application uses a distributed database containing 100 nodes, 100,000 warehouses, and 40.5 million simulated clients to run a standard TPC-C load for one hour, measuring the number of transactions processed per minute as the performance result. Figure 8 The test results show that after the system is preheated for 8 minutes, the transaction processing throughput enters a steady state and maintains a stable throughput for one hour with minimal performance fluctuations. The final statistics show that the number of new order transactions processed per minute in the one-hour steady state is 51.48 million. Compared with the 600,000 transactions processed by a single machine in one hour, this solution can be applied to distributed systems with more nodes to achieve horizontal expansion. Moreover, Fig. 9 As shown, the transaction processing latency in this solution is also maintained at an extremely low level, with the 50th percentile latency of the transaction being only 8.1 milliseconds, and the processing performance is better.
[0087] In the clock updating method provided by the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and sent uniformly to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing node in the process of processing transactions, the clocks of the control device and the computing node can always be kept consistent. Moreover, because the control device and the computing node each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failure is reduced. Furthermore, compared with HLC using hybrid logical clock decentralization and maintaining and updating the clock through communication between each computing node, this solution maintains the consistency of the clock through the interaction between the control device and the computing node, which is simpler to implement, easier and more convenient to maintain, and has better processing performance.
[0088] Embodiment 4:
[0089] Based on the method described in the above embodiment 1, the fourth embodiment of the present application provides a control device for executing the method described in the above embodiment 1, such as Fig.10 As shown, the control device 100 includes:
[0090] The clock management module 1001 is used to assign a start timestamp to the target transaction and update the local clock when the target transaction starts;
[0091] A sending module 1002, configured to send a start timestamp to at least one computing node participating in a target transaction;
[0092] The receiving module 1003 is used to receive at least one return timestamp returned by at least one computing node;
[0093] The clock management module 1001 is further used to determine the end timestamp of the target transaction according to at least one returned timestamp, and update the local clock;
[0094] The sending module 1002 is further configured to send an end timestamp to at least one computing node participating in the target transaction.
[0095] Optionally, in one embodiment of the present application, the clock management module 1001 is used to obtain the current physical clock of the managed device when the target transaction starts; align the current physical clock with the physical clock of the local hybrid clock to obtain the aligned current physical clock, where the local clock includes the physical clock and the logical clock; determine the larger value between the aligned current physical clock and the current value of the local clock as the start timestamp, and use the start timestamp as the latest value of the local clock.
[0096] Optionally, in one embodiment of the present application, the clock management module 1001 is used to determine a timestamp with a maximum value in at least one returned timestamp as an end timestamp, and update a local clock according to the end timestamp.
[0097] In the data processing device provided by the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and uniformly sent to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent. Moreover, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced.
[0098] Embodiment 5
[0099] Based on the method described in the above embodiment 2, the fifth embodiment of the present application provides a computing node for executing the method described in the above embodiment 2, such as Fig.11 As shown, the computing node 110 includes:
[0100] The receiving module 1101 is used to receive the start timestamp of the target transaction sent by the management and control device;
[0101] The clock management module 1102 is used to update the local clock of the computing node according to the start timestamp; after the target transaction is processed, generate a return timestamp and update the local clock;
[0102] The sending module 1103 is used to send a return timestamp to the control device;
[0103] The receiving module 1101 is further used to receive the end timestamp of the target transaction sent by the management and control device; the clock management module is further used to update the local clock according to the end timestamp.
[0104] Optionally, in one embodiment of the present application, the clock management module 1102 is used to determine the larger value between the start timestamp and the current value of the local clock as the latest value of the local clock.
[0105] Optionally, in one embodiment of the present application, the clock management module 1102 is used to obtain the current physical clock of the computing node after the target transaction processing is completed; align the current physical clock with the physical clock of the local clock to obtain the aligned current physical clock, and the local clock includes the physical clock and the logical clock; add 1 to the larger value of the aligned current physical clock and the current value of the local clock, and determine the value obtained as the return timestamp, and use the return timestamp as the latest value of the local clock.
[0106] In the data processing device provided by the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and uniformly sent to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent. Moreover, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced.
[0107] Embodiment 6
[0108] Based on the clock update method described in the above embodiments 1 to 3, as well as the control device described in the fourth embodiment and the computing node described in the fifth embodiment, the sixth embodiment of the present application provides a distributed database, such as Fig.12 As shown, the distributed database 120 includes: a control device 100 as described in the fourth embodiment, and at least one computing node 110 as described in the fifth embodiment.
[0109] Wherein, when the target transaction starts, the control device assigns a start timestamp to the target transaction and updates the local clock of the control device; sends the start timestamp to at least one computing node participating in the target transaction;
[0110] The computing node updates the local clock of the computing node according to the start timestamp; after the target transaction is processed, a return timestamp is generated and the local clock of the computing node is updated; and the return timestamp is sent to the control device;
[0111] The control device determines the end timestamp of the target transaction according to the at least one returned timestamp, updates the local clock of the control device, and sends the end timestamp of the target transaction to the at least one computing node.
[0112] Optionally, in one embodiment of the present application, when the target transaction starts, the control device obtains the current physical clock of the control device; aligns the current physical clock with the physical clock of the local clock of the control device to obtain the aligned current physical clock, where the local clock includes the physical clock and the logical clock; determines the larger value between the current value of the aligned current physical clock and the current value of the local clock of the control device as the start timestamp, and uses the start timestamp as the latest value of the local clock of the control device.
[0113] Optionally, in one embodiment of the present application, the control device determines the timestamp with the largest value in at least one returned timestamp as the end timestamp, and updates the local clock of the control device according to the end timestamp.
[0114] Optionally, in one embodiment of the present application, the computing node determines the larger value between the start timestamp and the current value of the local clock of the computing node as the latest value of the local clock of the computing node.
[0115] Optionally, in one embodiment of the present application, after the target transaction is completed, the computing node obtains the current physical clock of the computing node; aligns the current physical clock with the physical clock of the computing node's local clock to obtain the aligned current physical clock, where the computing node's local clock includes a physical clock and a logical clock; adds 1 to the larger value of the aligned current physical clock and the current value of the computing node's local clock, and determines the value obtained as the return timestamp, and uses the return timestamp as the latest value of the computing node's local clock.
[0116] Optionally, in one embodiment of the present application, the target transaction is a write transaction; when the target transaction starts, the computing node determines whether there is a write transaction that has acquired a lock; if no write transaction has acquired a lock, the target transaction acquires a lock.
[0117] Optionally, in one embodiment of the present application, when a write transaction already exists to acquire a lock, the computing node waits for the write transaction to end and then acquires a lock for the target transaction.
[0118] Embodiment 7
[0119] Based on the methods described in the above embodiments 1 to 3, the seventh embodiment of the present application provides an electronic device for executing the methods described in the above embodiments 1 to 3, referring to Fig.13 As shown, Fig.13 This is a structural diagram of an electronic device provided in Example 7 of the present application. The specific embodiments of the present application do not limit the specific implementation of the electronic device.
[0120] like Fig.13As shown, the electronic device 130 may include: a processor (processor) 1302 , a communication interface (Communications Interface) 1304 , a memory (memory) 1306 , and a communication bus 1308 .
[0121] in:
[0122] The processor 1302 , the communication interface 1304 , and the memory 1306 communicate with each other via a communication bus 1308 .
[0123] The communication interface 1304 is used to communicate with other electronic devices such as terminal devices or servers.
[0124] The processor 1302 is used to execute the program 1310, and specifically can execute the relevant steps in the above method embodiment.
[0125] Specifically, the program 1310 may include program codes, which include computer operation instructions.
[0126] The processor 1302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0127] The memory 1306 is used to store the program 1310. The memory 1306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0128] The program 1310 can be specifically used to enable the processor 1302 to execute any method in the aforementioned embodiments 1 to 3.
[0129] The specific implementation of each step in program 1310 can refer to the corresponding description of the corresponding steps and units in the above-mentioned clock update method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0130] In the electronic device provided in the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and uniformly sent to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent. Moreover, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced.
[0131] Embodiment 8
[0132] Based on the methods described in the above-mentioned embodiments 1 to 3, embodiment 8 of the present application provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the methods described in embodiments 1 to 3 are implemented.
[0133] In the computer storage medium provided in the embodiment of the present application, the start timestamp of the target transaction is allocated by the control device and uniformly sent to the computing nodes participating in the target transaction, so that the clocks of the control device and the computing nodes are consistent. When the target transaction processing is completed, the control device determines the end timestamp of the target transaction based on at least one return timestamp returned by at least one computing node, so that all computing nodes participating in the target transaction have a unified end timestamp. Through the interaction between the control device and the computing nodes in the process of processing transactions, the clocks of the control device and the computing nodes can always be kept consistent. Moreover, because the control device and the computing nodes each maintain a local clock and do not rely on one device, the bottleneck of single-point performance is avoided and the impact of single-point failures is reduced.
[0134] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0135] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the clock update method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the clock update method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the clock update method shown herein.
[0136] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0137] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A distributed database, comprising: Management and control equipment and at least one computing node; When the target transaction starts, the control device assigns a start timestamp to the target transaction and updates the local clock of the control device; Sending the start timestamp to at least one computing node participating in the target transaction; The computing node updates the local clock of the computing node according to the start timestamp; after the target transaction is processed, generates a return timestamp and updates the local clock of the computing node; Sending the return timestamp to the control device; The control device determines the end timestamp of the target transaction based on at least one return timestamp, updates the local clock of the control device, and sends the end timestamp of the target transaction to the at least one computing node, wherein the end timestamp of the target transaction is determined based on at least one return timestamp, and the local clock of the control device is updated, including: determining the timestamp with the largest value among the at least one return timestamp as the end timestamp, and updating the local clock of the control device according to the end timestamp.
2. The distributed database according to claim 1, wherein: When the target transaction starts, the control device obtains the current physical clock of the control device; The current physical clock is aligned with the physical clock of the local clock of the control device to obtain the aligned current physical clock, wherein the local clock includes a physical clock and a logical clock; the larger value between the current value of the aligned current physical clock and the current value of the local clock of the control device is determined as the start timestamp, and the start timestamp is used as the latest value of the local clock of the control device.
3. The distributed database according to claim 1, wherein: The computing node determines a larger value between the start timestamp and the current value of the local clock of the computing node as the latest value of the local clock of the computing node.
4. The distributed database according to claim 1, wherein: After the target transaction is processed, the computing node obtains the current physical clock of the computing node; Aligning the current physical clock with the physical clock of the local clock of the computing node to obtain the aligned current physical clock, where the local clock of the computing node includes a physical clock and a logical clock; The value obtained by adding 1 to the larger value of the aligned current physical clock and the current value of the local clock of the computing node is determined as the return timestamp, and the return timestamp is used as the latest value of the local clock of the computing node.
5. The distributed database according to claim 1, wherein: The target transaction is a write transaction; The computing node determines whether there is a write transaction that has acquired a lock when the target transaction starts; If no write transaction has already acquired a lock, a lock is acquired for the target transaction.
6. The distributed database according to claim 5, wherein: When a write transaction already exists to acquire a lock, the computing node waits for the write transaction to end and then acquires a lock for the target transaction.
7. A clock updating method, applied to a control device, comprising: When the target transaction starts, assign a start timestamp to the target transaction and update the local clock; Sending the start timestamp to at least one computing node participating in the target transaction; receiving at least one return timestamp sent by the at least one computing node; Determining the end timestamp of the target transaction according to the at least one returned timestamp, and updating the local clock, including: determining the timestamp with the largest value among the at least one returned timestamp as the end timestamp, and updating the local clock of the management and control device according to the end timestamp; The end timestamp is sent to the at least one computing node participating in the target transaction.
8. The method according to claim 7, wherein: When the target transaction starts, assigning a start timestamp to the target transaction and updating a local clock includes: When the target transaction starts, obtaining the current physical clock of the control device; Aligning the current physical clock with the physical clock of the local clock to obtain the aligned current physical clock, where the local clock includes a physical clock and a logical clock; A larger value between the aligned current physical clock and the current value of the local clock is determined as the start timestamp, and the start timestamp is used as the latest value of the local clock.
9. A clock updating method, applied to a computing node, comprising: Receive the start timestamp of the target transaction sent by the control device; Updating a local clock of the computing node according to the start timestamp; After the target transaction is processed, a return timestamp is generated and the local clock is updated; Sending the return timestamp to the control device; Receive the end timestamp of the target transaction sent by the management and control device, and update the local clock, wherein the end timestamp is a timestamp with the largest value among at least one of the returned timestamps, and updating the local clock includes: updating the local clock according to the end timestamp.
10. The method according to claim 9, wherein: After the target transaction is processed, generating a return timestamp and updating the local clock include: After the target transaction is processed, obtaining the current physical clock of the computing node; Aligning the current physical clock with the physical clock of the local clock to obtain the aligned current physical clock, where the local clock includes a physical clock and a logical clock; A value obtained by adding 1 to the larger value of the aligned current physical clock and the current value of the local clock is determined as the return timestamp, and the return timestamp is used as the latest value of the local clock.
11. A control device, comprising: A clock management module, used to assign a start timestamp to the target transaction and update a local clock when the target transaction starts; A sending module, configured to send the start timestamp to at least one computing node participating in the target transaction; A receiving module, configured to receive at least one return timestamp returned by the at least one computing node; The clock management module is further used to determine the end timestamp of the target transaction according to the at least one returned timestamp and update the local clock, including: determining the timestamp with the largest value among the at least one returned timestamp as the end timestamp, and updating the local clock of the management and control device according to the end timestamp; The sending module is further configured to send the end timestamp to the at least one computing node participating in the target transaction.
12. A computing node, comprising: A receiving module, used to receive the start timestamp of the target transaction sent by the control device; A clock management module, configured to update a local clock of the computing node according to the start timestamp; After the target transaction is processed, a return timestamp is generated and the local clock is updated, including: determining a timestamp with a maximum value among at least one of the return timestamps as an end timestamp, and updating the local clock of the management and control device according to the end timestamp; A sending module, used for sending the return timestamp to the control device; The receiving module is further configured to receive an end timestamp of the target transaction sent by the control device; The clock management module is further used to update the local clock according to the end timestamp.
13. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the clock updating method according to any one of claims 7 to 10.
14. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the clock updating method according to any one of claims 7 to 10 is implemented.
Citation Information
Patent Citations
Distributed transaction processing method, coordination device, database and electronic equipment
CN110018884A
Distributed transaction consistency realization method and device
CN110196760A