IP Library › Granted Patent US 12,314,253
Granted Patent B2
US 12,314,253 · App. 18/521,723 · Granted May 27, 2025

Methods, systems, electronic devices, and storage media for database transaction processing

Inventors: Jinliang Xiao (Hangzhou, CN); Shanyan Gao (Hangzhou, CN); Fusheng Han (Hangzhou, CN)
Assignee: Beijing OceanBase Technology Co., Ltd.
G06F16/2379G06F16/27
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,314,253
App. No.
18/521,723
Filed
Nov 28, 2023
Granted
May 27, 2025
Kind
B2
Art Unit
2167
USPC
707/703
Abstract

Methods, systems, electronic devices and computer-readable media for database transaction processing are provided. In an example, after determining to perform primary-secondary switching of a copy, a first server records a context of a database transaction that is currently being executed, sends the context to a second server, and switches a primary copy stored in the first server to a secondary copy. The second server switches a secondary copy stored in the second server to a primary copy, and continues execution of the database transaction based on the context after completing the switching.

Claims (55)

1. A computer-implemented method for database transaction processing, comprising:

after determining to perform primary-secondary switching of a copy, recording, by a first server, a context of a database transaction that is currently being executed; and

sending, by the first server, the context to a second server; and

switching, by the first server, a primary copy stored in the first server to a secondary copy; and

switching, by the second server, a secondary copy stored in the second server to a primary copy; and

continuing execution of the database transaction, by the second server, based on the context after switching the secondary copy stored in the second server to the primary copy; and

determining, by the first server, a remaining execution duration corresponding to an additional database transaction that is currently being executed; and

determining, by the first server, whether the remaining execution duration is less than a predetermined duration; and

in response to determining that the remaining execution duration is less than the predetermined duration, updating, by the first server, the predetermined duration to the remaining execution duration; and

switching, by the first server, an additional primary copy stored in the first server to an additional secondary copy after the predetermined duration.

2. The computer-implemented method according to claim 1 , wherein the computer-implemented method further comprises:

after determining to perform primary-secondary switching of a copy, stopping, by the first server, starting a new database transaction, and stopping executing a new statement in the database transaction that is currently being executed.

3. The computer-implemented method according to claim 1 , wherein the first server determines, based on a received switching instruction, to perform primary-secondary switching of a copy, and the received switching instruction is sent by a third server to the first server.

4. The computer-implemented method according to claim 3 , wherein the received switching instruction is generated by the third server based on a load level of the first server.

5. The computer-implemented method according to claim 3 , wherein the received switching instruction is generated by the third server based on an upgrade or maintenance plan of the first server.

6. The computer-implemented method according to claim 1 , wherein the switching, by a first server, a primary copy stored in the first server to a secondary copy comprises:

switching, by the first server, the primary copy stored in the first server to the secondary copy after the predetermined duration.

7. The computer-implemented method according to claim 1 , wherein the context comprises to-be-operated data and a state machine that correspond to the database transaction that is currently being executed.

8. A computer-implemented system for database transaction processing, comprising:

a first server comprising at least one first processor coupled to at least one first storage, wherein the at least one first storage stores first instructions for execution by the at least one first processor to:

after determining to perform primary-secondary switching of a copy,

record a context of a database transaction that is currently being executed, and

send the context to a second server; and

switch a primary copy stored in the first server to a secondary copy; and

the second server comprising at least one second processor coupled to at least one second storage, wherein the at least one second storage stores second instructions for execution by the at least one second processor to:

switch a secondary copy stored in the second server to a primary copy; and

continue execution of the database transaction based on the context after switching the secondary copy stored in the second server to the primary copy; and wherein the first instructions are for execution by the at least one first processor to:

determine a remaining execution duration corresponding to an additional database transaction that is currently being executed; and

determine whether the remaining execution duration is less than a predetermined duration; and

in response to determining that the remaining execution duration is less than the predetermined duration, update the predetermined duration to the remaining execution duration; and

switch an additional primary copy stored in the first server to an additional secondary copy after the predetermined duration.

9. The computer-implemented system according to claim 8 , wherein the first instructions are for execution by the at least one first processor to:

after determining to perform primary-secondary switching of a copy, stop starting a new database transaction, and stop executing a new statement in the database transaction that is currently being executed.

10. The computer-implemented system according to claim 8 , wherein the first instructions are for execution by the at least one first processor to determine, based on a received switching instruction, to perform primary-secondary switching of a copy, wherein the received switching instruction is sent by a third server to the first server.

11. The computer-implemented system according to claim 10 , wherein the received switching instruction is generated by the third server based on a load level of the first server.

12. The computer-implemented system according to claim 10 , wherein the received switching instruction is generated by the third server based on an upgrade or maintenance plan of the first server.

13. The computer-implemented system according to claim 8 , wherein the first instructions are for execution by the at least one first processor to switch the primary copy stored in the first server to the secondary copy after the predetermined duration.

14. The computer-implemented system according to claim 8 , wherein the context comprises to-be-operated data and a state machine that correspond to the database transaction that is currently being executed.

15. An electronic device, comprising:

at least one processor; and

at least one storage, configured to store instructions that, when executed by the at least one processor, perform one or more operations comprising:

after determining to perform primary-secondary switching of a copy, recording a context of a database transaction that is currently being executed; and

sending the context to a second server; and

switching a primary copy stored in a first server to a secondary copy, so that the second server continues execution of the database transaction based on the context after switching a secondary copy stored in the second server to a primary copy; and

determining a remaining execution duration corresponding to an additional database transaction that is currently being executed; and

determining whether the remaining execution duration is less than a predetermined duration; and

in response to determining that the remaining execution duration is less than the predetermined duration, updating the predetermined duration to the remaining execution duration; and

switching an additional primary copy stored in the first server to an additional secondary copy after the predetermined duration.

16. The electronic device according to claim 15 , wherein the one or more operations further comprise:

after determining to perform primary-secondary switching of a copy, stopping, by the first server, starting a new database transaction, and stopping executing a new statement in the database transaction that is currently being executed.

17. The electronic device according to claim 15 , wherein the determining to perform primary-secondary switching of a copy is based on a received switching instruction, and the received switching instruction is sent by a third server to the first server.

18. The electronic device according to claim 17 , wherein the received switching instruction is generated by the third server based on a load level of the first server, or an upgrade or maintenance plan of the first server.

19. The electronic device according to claim 15 , wherein the switching a primary copy stored in the first server to a secondary copy comprises:

switching the primary copy stored in the first server to the secondary copy after the predetermined duration.

20. The electronic device according to claim 15 , wherein the context comprises to-be-operated data and a state machine that correspond to the database transaction that is currently being executed.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 12, 2024
From: XIAO, JINLIANG; GAO, SHANYAN; HAN, FUSHENG
To: BEIJING OCEANBASE TECHNOLOGY CO., LTD.
Reel/Frame 066112/0465 →
Priority Claims (1)
CN 202110642105.7 · Jun 9, 2021 · national
Continuity (2)
Continuation PCTCN2022093816 · May 19, 2022
Related Publication 20240104089A1 · Mar 28, 2024
References Cited (16)
US 11500744B2 · Shen · 2022 [cited by examiner]
US 20030014526A1 · Pullara · 2003 [cited by examiner]
US 20150301910A1 · Sathyanarayana · 2015 [cited by examiner]
CN 102737088 · 2012 [cited by applicant]
CN 103793296 · 2014 [cited by applicant]
CN 105122260 · 2015 [cited by applicant]
CN 108984569 · 2018 [cited by applicant]
CN 109936481 · 2019 [cited by applicant]
CN 112346912 · 2021 [cited by applicant]
CN 113254536 · 2021 [cited by applicant]
CN 117370078 · 2024 [cited by applicant]
JP 2003186722 · 2003 [cited by applicant]
WO WO2022257719 · 2022 [cited by applicant]
WO WO2023142543 · 2023 [cited by applicant]
International Preliminary Report on Patentability in Appin. No. PCT/CN2022/093816, mailed on Dec. 21, 2023, 11 pages (with English translation). [cited by applicant]
International Search Report and Written Opinion in AppIn. No. PCT/CN2022/093816, mailed on Aug. 16, 2022, 14 pages (with English translation). [cited by applicant]