IP Library Granted Patent US 11,550,821
Granted Patent B2
US 11,550,821 · App. 16/724,713 · Granted Jan 10, 2023

Adaptive resource allocation method and apparatus

Inventors: Zhiyong Jiang (Hangzhou, CN); Zhenkun Yang (Hangzhou, CN)
Assignee: Beijing OceanBase Technology Co., Ltd.
G06F16/283H04L67/60
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 11,550,821
App. No.
16/724,713
Granted
Jan 10, 2023
Kind
B2
Abstract

The present specification describes an adaptive resource allocation method and apparatus. One example method includes determining a request time, an execution time, and a response time corresponding to a service statement executed by the database system during a time period, wherein the request time is a time at which the service statement was executed by the database system, the execution time is an amount of time allocated for execution of the service statement by the database system, and the response time is an amount of time that elapsed between the request time and a time at which execution of the service statement ended; identifying a time segment of the time period based on the request time; determining a service type associated with the service statement; and updating a resource quota for the time segment based on the service type, the execution time, and the response time for the service statement.

Claims (69)

1. A computer-implemented method for managing a resource quota in a database system, comprising:

determining a request time, an execution time, and a response time corresponding to a service statement executed by the database system during a time period, wherein the request time is a time at which execution of the service statement by the database system begins, the execution time is an amount of time allocated for execution of the service statement by the database system, and the response time is an amount of time that elapsed between the request time and a time at which execution of the service statement ended;

identifying a time segment of the time period based on the request time;

setting an execution time threshold, wherein the execution time threshold is used for determining a service type associated with the service statement in the time segment;

for the time segment, selecting a service type associated with the service statement, wherein selecting the service type comprises

determining whether the execution time of the service statement is greater than the execution time threshold, and

if the execution time of the service statement in the time segment is greater than the execution time threshold, selecting a first type of service statement from at least two possible service types, or

if the execution time of the service statement in the time segment is not greater than the execution time threshold, selecting a second type of service statement from the at least two possible service types; and

updating the resource quota for the service statement in a same time segment of a next time period based on the determined service type, the execution time, and the response time for the service statement, wherein updating the resource quota comprises adjusting allocation of resources from resources comprising a central processing unit, memory, and input/output operations per second.

2. The computer-implemented method of claim 1 , wherein the service type is a transaction service or an analytical service.

3. The computer-implemented method of claim 1 , further comprising prior to updating the resource quota, calculating the resource quota for the time segment.

4. The computer-implemented method of claim 3 , wherein calculating the resource quota for the time segment includes:

determining a sum of execution times for a plurality of service statements of the service type that were executed in the time segment;

determining a sum of response times for the plurality of service statements of the service type that were executed in the time segment; and

calculating the resource quota based on the sum of the execution times and the sum of the response times.

5. The computer-implemented method of claim 4 , wherein calculating the resource quota based on the sum of the execution times, and the sum of the response times includes:

determining that the sum of the response times is greater than the sum of the execution times; and

in response to determining that the sum of the response times is greater than the sum of the execution times, decreasing the resource quota associated with the service type by a predetermined value.

6. The computer-implemented method of claim 4 , wherein calculating the resource quota based on the sum of the execution times, and the sum of the response times includes:

determining that the sum of the response times is less than the sum of the execution times; and

in response to determining that the sum of response times is less than the sum of execution times, decreasing the resource quota associated with the service type by a predetermined value.

7. The computer-implemented method of claim 1 , wherein the time period is one week and the time segment is a particular day during the time period.

8. A non-transitory computer-readable storage medium configured with instructions that, when executed by one or more computers, cause the one or more computers to perform operations comprising:

determining a request time, an execution time, and a response time corresponding to a service statement executed by a database system during a time period, wherein the request time is a time at which execution of the service statement by the database system begins, the execution time is an amount of time allocated for execution of the service statement by the database system, and the response time is an amount of time that elapsed between the request time and a time at which execution of the service statement ended;

identifying a time segment of the time period based on the request time;

setting an execution time threshold, wherein the execution time threshold is used for determining a service type associated with the service statement in the time segment;

for the time segment, selecting a service type associated with the service statement, wherein selecting the service type comprises

determining whether the execution time of the service statement is greater than the execution time threshold, and

if the execution time of the service statement in the time segment is greater than the execution time threshold, selecting a first type of service statement from at least two possible service types, or

if the execution time of the service statement in the time segment is not greater than the execution time threshold, selecting a second type of service statement from at least two possible service types; and

updating a resource quota for the service statement in a same time segment of a next time period based on the determined service type, the execution time, and the response time for the service statement, wherein updating the resource quota comprises adjusting allocation of resources from resources comprising a central processing unit, memory, and input/output operations per second.

9. The non-transitory computer-readable storage medium of claim 8 , wherein the service type is a transaction service or an analytical service.

10. The non-transitory computer-readable storage medium of claim 8 , wherein the operations further comprise:

prior to updating the resource quota, calculate the resource quota for the time segment.

11. The non-transitory computer-readable storage medium of claim 10 , wherein calculating the resource quota for the time segment includes:

determining a sum of execution times for a plurality of service statements of the service type that were executed in the time segment;

determining a sum of response times for the plurality of service statements of the service type that were executed in the time segment; and

calculating the resource quota based on the sum of the execution times and the sum of the response times.

12. The non-transitory computer-readable storage medium of claim 11 , wherein calculating the resource quota based on the sum of the execution times, and the sum of the response times includes:

determining that the sum of the response times is greater than the sum of the execution times; and

in response to determining that the sum of the response times is greater than the sum of the execution times, decreasing the resource quota associated with the service type by a predetermined value.

13. The non-transitory computer-readable storage medium of claim 11 , wherein calculating the resource quota based on the sum of the execution times, and the sum of the response times includes:

determining that the sum of the response times is less than the sum of the execution times; and

in response to determining that the sum of response times is less than the sum of execution times, decreasing the resource quota associated with the service type by a predetermined value.

14. The non-transitory computer-readable storage medium of claim 8 , wherein the time period is one week and the time segment is a particular day during the time period.

15. A system, comprising:

one or more computers; and

one or more computer-readable memories coupled to the one or more computers and configured with instructions that, when executed by the one or more computers, cause the one or more computers to perform operations comprising:

determining a request time, an execution time, and a response time corresponding to a service statement executed by a database system during a time period, wherein the request time is a time at which execution of the service statement by the database system begins, the execution time is an amount of time allocated for execution of the service statement by the database system, and the response time is an amount of time that elapsed between the request time and a time at which execution of the service statement ended;

identifying a time segment of the time period based on the request time;

setting an execution time threshold, wherein the execution time threshold is used for determining a service type associated with the service statement in the time segment;

for the time segment, selecting a service type associated with the service statement, wherein selecting the service type comprises

determining whether the execution time of the service statement is greater than the execution time threshold, and

if the execution time of the service statement in the time segment is greater than the execution time threshold, selecting a first type of service statement from at least two possible service types, or

if the execution time of the service statement in the time segment is not greater than the execution time threshold, selecting a second type of service statement from at least two possible service types; and

updating a resource quota for the service statement in a same time segment of a next time period based on the determined service type, the execution time, and the response time for the service statement, wherein updating the resource quota comprises adjusting allocation of resources from resources comprising a central processing unit, memory, and input/output operations per second.

16. The system of claim 15 , wherein the service type is a transaction service or an analytical service.

17. The system of claim 15 , wherein the operations further comprise:

prior to updating the resource quota, calculate the resource quota for the time segment.

18. The system of claim 17 , wherein calculating the resource quota for the time segment includes:

determining a sum of execution times for a plurality of service statements of the service type that were executed in the time segment;

determining a sum of response times for the plurality of service statements of the service type that were executed in the time segment; and

calculating the resource quota based on the sum of the execution times and the sum of the response times.

19. The system of claim 18 , wherein calculating the resource quota based on the sum of the execution times, and the sum of the response times includes:

determining that the sum of the response times is greater than the sum of the execution times; and

in response to determining that the sum of the response times is greater than the sum of the execution times, decreasing the resource quota associated with the service type by a predetermined value.

20. The system of claim 18 , wherein calculating the resource quota based on the sum of the execution times, and the sum of the response times includes:

determining that the sum of the response times is less than the sum of the execution times; and

in response to determining that the sum of response times is less than the sum of execution times, decreasing the resource quota associated with the service type by a predetermined value.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 27, 2021
From: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
To: BEIJING OCEANBASE TECHNOLOGY CO., LTD.
Reel/Frame 057349/0070 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 11, 2021
From: ADVANCED NEW TECHNOLOGIES CO., LTD.
To: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
Reel/Frame 055237/0137 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 30, 2020
From: JIANG, ZHIYONG; YANG, ZHENKUN
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 051672/0033 →