IP Library › Granted Patent US 12,536,172
Granted Patent B2
US 12,536,172 · App. 18/747,068 · Granted Jan 27, 2026

Data query optimization method, electronic device and storage medium

Inventors: Chenchang Zhu (Beijing, CN); Jialin Feng (Beijing, CN)
Assignee: Beijing Baidu Netcom Science Technology Co., Ltd.
G06F16/24542G06F11/3409G06F16/2456
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,536,172
App. No.
18/747,068
Granted
Jan 27, 2026
Kind
B2
Abstract

Provided is a data query optimization method, an electronic device and a storage medium, relating to the field of data processing technology and in particular to the technical fields of distributed database, big data, cloud computing and others. The method includes: determining a plurality of candidate execution plans for a target query request; determining execution costs of the plurality of candidate execution plans; updating the execution costs of the plurality of candidate execution plans based on monitoring data of data nodes involved in the plurality of candidate execution plans, to obtain final costs of the plurality of candidate execution plans; and screening out a final execution plan for the target query request from the plurality of candidate execution plans based on the final costs of the plurality of candidate execution plans.

Claims (63)

1 . A data query optimization method, comprising:

determining a plurality of candidate execution plans for a target query request;

determining execution costs of the plurality of candidate execution plans;

updating the execution costs of the plurality of candidate execution plans based on monitoring data of data nodes involved in the plurality of candidate execution plans, to obtain final costs of the plurality of candidate execution plans, comprising:

for a candidate execution plan to be processed among the plurality of candidate execution plans, determining all operation nodes contained in the candidate execution plan to be processed;

updating a sub-cost of each operation node in the execution cost based on monitoring data of each data node involved in the operation node, wherein the operation node includes one or more data nodes, and the monitoring data of the data node comprises at least one of: processor usage rate of the data node, network status indicating connection between the data node and a network, network delay parameter indicating a delay condition of the data node, or task planning to be executed which refers to a planning of the data node for other tasks to be executed in addition to the candidate execution plan to be processed; and

aggregating updated sub-costs of the operation nodes contained in the candidate execution plan to be processed, to obtain the final cost of the candidate execution plan to be processed; and

screening out a final execution plan for the target query request from the plurality of candidate execution plans based on the final costs of the plurality of candidate execution plans.

2 . The method of claim 1 , wherein, in a case of the monitoring data comprises the processor usage rate, the updating the execution costs of the plurality of candidate execution plans comprises:

for a plurality of first target execution plans with differences between execution costs less than a first difference threshold, updating the execution costs of the plurality of first target candidate execution plans based on a positive correlation between the final cost and the processor usage rate.

3 . The method of claim 1 , wherein, in a case of the monitoring data comprises the network status, the updating the execution costs of the plurality of candidate execution plans comprises:

determining a degree of network congestion based on the network status; and

for a plurality of second target execution plans with differences between execution costs less than a second difference threshold, updating the execution costs of the plurality of second target candidate execution plans based on a positive correlation between the final cost and the degree of network congestion.

4 . The method of claim 1 , wherein, in a case of the monitoring data comprises the network delay parameter, the updating the execution costs of the plurality of candidate execution plans comprises:

for a plurality of third target execution plans with differences between execution costs less than a third difference threshold, updating the execution costs of the plurality of third target candidate execution plans based on a positive correlation between the final cost and the network delay parameter.

5 . The method of claim 1 , wherein, in a case of the monitoring data comprises the task planning to be executed, the updating the execution costs of the plurality of candidate execution plans comprises:

estimating the amount of node resources consumed by the task planning to be executed within a specified duration in future; and

for a plurality of fourth target execution plans with differences between execution costs less than a fourth difference threshold, updating the execution costs of the plurality of fourth target candidate execution plans based on a positive correlation between the final cost and the amount of node resources.

6 . The method of claim 1 , wherein obtaining the monitoring data comprises:

obtaining the pre-aggregated monitoring data periodically.

7 . An electronic device, comprising:

at least one processor; and

a memory connected in communication with the at least one processor;

wherein the memory stores an instruction executable by the at least one processor, and the instruction, when executed by the at least one processor, enables the at least one processor to execute:

determining a plurality of candidate execution plans for a target query request;

determining execution costs of the plurality of candidate execution plans;

updating the execution costs of the plurality of candidate execution plans based on monitoring data of data nodes involved in the plurality of candidate execution plans, to obtain final costs of the plurality of candidate execution plans, by:

for a candidate execution plan to be processed among the plurality of candidate execution plans, determining all operation nodes contained in the candidate execution plan to be processed;

updating a sub-cost of each operation node in the execution cost based on monitoring data of each data node involved in the operation node, wherein the operation node includes one or more data nodes, and the monitoring data of the data node comprises at least one of: processor usage rate of the data node, network status indicating connection between the data node and a network, network delay parameter indicating a delay condition of the data node, or task planning to be executed which refers to a planning of the data node for other tasks to be executed in addition to the candidate execution plan to be processed; and

aggregating updated sub-costs of the operation nodes contained in the candidate execution plan to be processed, to obtain the final cost of the candidate execution plan to be processed; and

screening out a final execution plan for the target query request from the plurality of candidate execution plans based on the final costs of the plurality of candidate execution plans.

8 . The electronic device of claim 7 , wherein, in a case of the monitoring data comprises the processor usage rate, the updating the execution costs of the plurality of candidate execution plans comprises:

for a plurality of first target execution plans with differences between execution costs less than a first difference threshold, updating the execution costs of the plurality of first target candidate execution plans based on a positive correlation between the final cost and the processor usage rate.

9 . The electronic device of claim 7 , wherein, in a case of the monitoring data comprises the network status, the updating the execution costs of the plurality of candidate execution plans comprises:

determining a degree of network congestion based on the network status; and

for a plurality of second target execution plans with differences between execution costs less than a second difference threshold, updating the execution costs of the plurality of second target candidate execution plans based on a positive correlation between the final cost and the degree of network congestion.

10 . The electronic device of claim 7 , wherein, in a case of the monitoring data comprises the network delay parameter, the updating the execution costs of the plurality of candidate execution plans comprises:

for a plurality of third target execution plans with differences between execution costs less than a third difference threshold, updating the execution costs of the plurality of third target candidate execution plans based on a positive correlation between the final cost and the network delay parameter.

11 . The electronic device of claim 7 , wherein, in a case of the monitoring data comprises the task planning to be executed, the updating the execution costs of the plurality of candidate execution plans comprises:

estimating the amount of node resources consumed by the task planning to be executed within a specified duration in future; and

for a plurality of fourth target execution plans with differences between execution costs less than a fourth difference threshold, updating the execution costs of the plurality of fourth target candidate execution plans based on a positive correlation between the final cost and the amount of node resources.

12 . The electronic device of claim 7 , wherein, obtaining the monitoring data comprises:

obtaining the pre-aggregated monitoring data periodically.

13 . A non-transitory computer-readable storage medium storing a computer instruction thereon, wherein the computer instruction is used to cause a computer to execute:

determining a plurality of candidate execution plans for a target query request;

determining execution costs of the plurality of candidate execution plans;

updating the execution costs of the plurality of candidate execution plans based on monitoring data of data nodes involved in the plurality of candidate execution plans, to obtain final costs of the plurality of candidate execution plans, by:

for a candidate execution plan to be processed among the plurality of candidate execution plans, determining all operation nodes contained in the candidate execution plan to be processed;

updating a sub-cost of each operation node in the execution cost based on monitoring data of each data node involved in the operation node, wherein the operation node includes one or more data nodes, and the monitoring data of the data node comprises at least one of: processor usage rate of the data node, network status indicating connection between the data node and a network, network delay parameter indicating a delay condition of the data node, or task planning to be executed which refers to a planning of the data node for other tasks to be executed in addition to the candidate execution plan to be processed; and

aggregating updated sub-costs of the operation nodes contained in the candidate execution plan to be processed, to obtain the final cost of the candidate execution plan to be processed; and

screening out a final execution plan for the target query request from the plurality of candidate execution plans based on the final costs of the plurality of candidate execution plans.

14 . The non-transitory computer-readable storage medium of claim 13 , wherein, in a case of the monitoring data comprises the processor usage rate, the updating the execution costs of the plurality of candidate execution plans comprises:

for a plurality of first target execution plans with differences between execution costs less than a first difference threshold, updating the execution costs of the plurality of first target candidate execution plans based on a positive correlation between the final cost and the processor usage rate.

15 . The non-transitory computer-readable storage medium of claim 13 , wherein, in a case of the monitoring data comprises the network status, the updating the execution costs of the plurality of candidate execution plans comprises:

determining a degree of network congestion based on the network status; and

for a plurality of second target execution plans with differences between execution costs less than a second difference threshold, updating the execution costs of the plurality of second target candidate execution plans based on a positive correlation between the final cost and the degree of network congestion.

16 . The non-transitory computer-readable storage medium of claim 13 , wherein, in a case of the monitoring data comprises the network delay parameter, the updating the execution costs of the plurality of candidate execution plans comprises:

for a plurality of third target execution plans with differences between execution costs less than a third difference threshold, updating the execution costs of the plurality of third target candidate execution plans based on a positive correlation between the final cost and the network delay parameter.

17 . The non-transitory computer-readable storage medium of claim 13 , wherein, in a case of the monitoring data comprises the task planning to be executed, the updating the execution costs of the plurality of candidate execution plans comprises:

estimating the amount of node resources consumed by the task planning to be executed within a specified duration in future; and

for a plurality of fourth target execution plans with differences between execution costs less than a fourth difference threshold, updating the execution costs of the plurality of fourth target candidate execution plans based on a positive correlation between the final cost and the amount of node resources.

18 . The non-transitory computer-readable storage medium of claim 13 , wherein, obtaining the monitoring data comprises:

obtaining the pre-aggregated monitoring data periodically.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 26, 2024
From: ZHU, CHENCHANG; FENG, JIALIN
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 068394/0922 →
Priority Claims (1)
CN 202311337622.9 · Oct 16, 2023 · national
Continuity (1)
Related Publication 20250124031A1 · Apr 17, 2025
References Cited (9)
US 7233939B1 · Ziauddin · 2007 [cited by examiner]
US 7984043B1 · Waas · 2011 [cited by examiner]
US 9460154B2 · Bellamkonda · 2016 [cited by examiner]
US 10496646B2 · Hill · 2019 [cited by examiner]
US 10614066B2 · Gawande · 2020 [cited by examiner]
US 11294961B2 · Kuwabara · 2022 [cited by examiner]
US 11907218B1 · Chakkappen · 2024 [cited by examiner]
US 12008005B2 · Kondiles · 2024 [cited by examiner]
US 20230359626A1 · Park · 2023 [cited by examiner]