Cross-database query method, device, equipment and storage medium

By dynamically evaluating computing power and network bandwidth between central and edge devices, decomposing query operations and assigning tasks, the problems of insufficient computing power on edge devices and transmission delays on central devices are solved, and efficient collaborative processing across database architectures is achieved.

CN120407600BActive Publication Date: 2025-09-30BEIJING XIJUN DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510898832.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-09-30
Estimated Expiration
2045-07-01

AI Technical Summary

Technical Problem

In the edge-center cross-database architecture, edge devices crash or delay due to insufficient computing power, and central devices respond too long due to data transmission delays, failing to meet real-time requirements.

Method used

The central device evaluates the available computing power and network bandwidth of the edge device, dynamically decomposes the query operation, assigns appropriate tasks to the edge device for processing, and transmits the data to the central device for processing when necessary, thus achieving fine-grained task division.

Benefits of technology

In extreme scenarios with low computing power and poor network, it can avoid edge device crashes and central device overloads, shorten query response time, and improve system stability and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407600B_ABST
    Figure CN120407600B_ABST
Patent Text Reader

Abstract

The present application discloses a cross-database query method, apparatus, device and storage medium, which relates to the field of computer technology. The method includes: when the target available computing power value and target network bandwidth of the target edge device are both small, the central device decomposes the query operation associated with the target edge device into multiple query sub-operations, assigns the target query sub-operation in the multiple query sub-operations to the target edge device for processing, receives the first sub-processing result fed back by the target edge device, obtains the third target processing result based on the first sub-processing result and other query sub-operations, and feeds back the query response to the business terminal based on the third target processing result and other processing results associated with other edge devices. This method can reduce production interruptions and shorten the response time of queries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a cross-database query method, apparatus, device, and storage medium. Background Art

[0002] Cross-database query refers to the technology of simultaneously accessing multiple different databases (which may belong to different types, different manufacturers, and different deployment environments) in a single query operation, and integrating, correlating, or analyzing the data in these databases. It can break the boundaries of a single database and realize cross-source access and collaborative processing of data.

[0003] In the edge-center cross-database architecture, data processing faces a dilemma. Edge devices typically store real-time business data, but due to their limited memory and computing power, they struggle to handle complex computing tasks. For example, when it is necessary to query the average energy consumption of multiple edge devices and their sub-devices over the past hour, forcing the edge devices to process such complex queries may cause device resource exhaustion or even a crash, leading to production interruptions. Conversely, if all business data is transmitted to the central device for processing, although the central device has powerful computing capabilities, significant delays will occur during data transmission, especially when multiple edge devices are transmitting simultaneously, resulting in excessively long query response times and unable to meet business scenarios with high real-time requirements.

[0004] Therefore, under the edge-center cross-database architecture, the industry needs a cross-database query method to reduce production interruptions and shorten query response time. Summary of the Invention

[0005] The present application provides a cross-database query method, apparatus, device, and storage medium, which can reduce production interruptions and shorten query response time.

[0006] To achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a cross-database query method, which is applied to a cross-database architecture consisting of a central device and multiple edge devices. The method includes:

[0008] The central device receives a query request sent by the service terminal;

[0009] The central device obtains the target available computing power value of the target edge device and the target network bandwidth between the central device and the target edge device according to the query request;

[0010] The central device determines whether the target available computing power value is greater than or equal to a first computing power threshold, and obtains a first determination result;

[0011] If the first judgment result indicates that the target available computing power value is less than the first computing power threshold, the central device determines whether the target network bandwidth is greater than or equal to the bandwidth threshold to obtain a second judgment result;

[0012] If the second judgment result indicates that the target network bandwidth is less than the bandwidth threshold, the central device decomposes the query operation associated with the target edge device to obtain multiple query sub-operations, selects a target query sub-operation from the multiple query sub-operations, assigns the target query sub-operation to the target edge device for processing, receives the first sub-processing result fed back by the target edge device, obtains a third target processing result based on the first sub-processing result and other query sub-operations, and feeds back a query response to the service terminal based on the third target processing result and other processing results associated with other edge devices. Other query sub-operations are operations other than the target query sub-operation in the multiple query sub-operations, and the other edge devices are devices other than the target edge device in the multiple edge devices.

[0013] Optionally, the method further includes:

[0014] If the first judgment result indicates that the target available computing power value is greater than or equal to the first computing power threshold, the central device will assign the query operation associated with the target edge device to the target edge device for processing, receive the first target processing result fed back by the target edge device, and feed back a query response to the business terminal based on the first target processing result and other processing results associated with other edge devices.

[0015] Optionally, the method further includes:

[0016] If the second judgment result indicates that the target network bandwidth is greater than or equal to the bandwidth threshold, the central device instructs the target edge device to transmit the data related to the query request to the central device, processes the data related to the query request, and obtains a second target processing result. Based on the second target processing result and other processing results associated with other edge devices, a query response is fed back to the service terminal.

[0017] Optionally, selecting a target query sub-operation from multiple query sub-operations includes:

[0018] Obtaining the required computing power value corresponding to each query sub-operation according to a preset first mapping relationship between the reference query sub-operation and the reference required computing power value;

[0019] Select the top N query sub-operations corresponding to the top N required computing power values ​​in ascending order; wherein the sum of the top N required computing power values ​​is less than the target available computing power value.

[0020] Optionally, obtaining a target available computing power value of a target edge device includes:

[0021] Get the target number of available CPU cores, target CPU load, target maximum number of CPU cores, target available memory, and target total memory of the target edge device;

[0022] A target available computing power value is determined based on the target available number of CPU cores, the target CPU load, the target maximum number of CPU cores, the target available memory, and the target total memory.

[0023] Optionally, the method further includes:

[0024] Obtaining a mission plan for the target edge device;

[0025] The central device assigns the query operation associated with the target edge device to the target edge device for processing, including:

[0026] When the task plan representation of the target edge device indicates that there is no target task within a preset time period in the future, the central device assigns the query operation associated with the target edge device to the target edge device for processing;

[0027] The target task is a task whose computing power required for execution is greater than or equal to the second computing power threshold.

[0028] Optionally, the method further includes:

[0029] The central device sends a task processing time threshold to each edge device, so that each edge device feeds back a processing result within the processing time threshold.

[0030] In a second aspect, the present application provides a cross-database query device, which is applied to a cross-database architecture consisting of a central device and multiple edge devices, and the device includes:

[0031] A receiving module, configured to receive a query request sent by a service terminal;

[0032] An acquisition module, configured to acquire a target available computing power value of a target edge device and a target network bandwidth between the target edge device and the target edge device according to the query request;

[0033] a judgment module, configured to judge whether the target available computing power value is greater than or equal to a first computing power threshold, and obtain a first judgment result; if the first judgment result indicates that the target available computing power value is less than the first computing power threshold, then judge whether the target network bandwidth is greater than or equal to a bandwidth threshold, and obtain a second judgment result;

[0034] A query module is used to decompose the query operation associated with the target edge device to obtain multiple query sub-operations if the second judgment result indicates that the target network bandwidth is less than the bandwidth threshold, select a target query sub-operation from the multiple query sub-operations, assign the target query sub-operation to the target edge device for processing, receive a first sub-processing result fed back by the target edge device, obtain a third target processing result based on the first sub-processing result and other query sub-operations, and feed back a query response to the service terminal based on the third target processing result and other processing results associated with other edge devices, where other query sub-operations are operations other than the target query sub-operation in the multiple query sub-operations, and the other edge devices are devices other than the target edge device in the multiple edge devices.

[0035] In a third aspect, the present application provides a computing device, including a memory and a processor;

[0036] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program for executing the method as described in any one of the first aspects.

[0038] It can be seen from the above technical solution that this application has at least the following beneficial effects:

[0039] The present application provides a cross-database query method, which is applied to a cross-database architecture composed of a central device and multiple edge devices. In this method, after receiving the query request sent by the business terminal, the central device obtains the available computing power value of each edge device and the network bandwidth between each edge device. Taking the target edge device as an example, when the target available computing power value of the target edge device is less than the first computing power threshold and the target network bandwidth is less than the bandwidth threshold, the central device does not adopt the traditional simple and crude processing method, but first decomposes the query operation associated with the target edge device to obtain multiple query sub-operations. These query sub-operations are not all executed by the target edge device, and multiple query sub-operations are obtained. In the operation, the target query sub-operation is selected and the target query sub-operation is assigned to the target edge device for processing. In this way, when the target available computing power is low, the target edge device can also perform business processing without crashing and obtain the first sub-processing result; and, because the target edge device processes part of the data, it does not need to transmit all the data to the central device, but only transmits part of the data, such as the first sub-processing result obtained after the target edge device processes it. In this way, when the network bandwidth is poor, the target edge device can also transmit a small amount of data to the central device with low latency. The central device obtains the third target processing result based on the first sub-processing result and other query sub-operations. The processing method for other edge devices is similar, and other processing results are obtained. The central device feeds back the query response to the business terminal based on the third target processing result and other processing results associated with other edge devices. As can be seen, the technical solution of this application accurately resolves the core contradictions in the edge-center architecture by evaluating both computing power and network and breaking down query operations into layers. In extreme scenarios with low computing power and poor network conditions, it prevents edge devices from crashing due to "intensive computing" and central devices from being overloaded due to "full collection," achieving optimal coordination of "light work at the edge and heavy work at the center." Through fine-grained task division, a balance is struck between device stability, transmission efficiency, and real-time computing, reducing production interruptions and shortening query response times.

[0040] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution or beneficial effect is included in at least one embodiment. Therefore, the description of a technical feature, technical solution or beneficial effect in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be implemented without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0042] Figure 2 A flowchart of a cross-database query method provided in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of a cross-database query device provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The terms "first", "second" and "third" in this application specification and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.

[0046] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0047] like Figure 1As shown, this figure is a schematic diagram of an application scenario provided by an embodiment of the present application, which is an equipment monitoring system for a smart factory. The equipment monitoring system includes a central device 101 and multiple edge devices 102. Among them, the edge device 102 can be an industrial robot used for equipment monitoring, equipped with an embedded database (such as SQLite (a database) or TimescaleDB (a database)), which stores equipment status data (such as motor speed, temperature, and energy consumption) in real time. The computing power of a single device database is limited (for example, a CPU with a quad-core 1.5GHz and 4GB of memory). The central device 101 uses a MySQL cluster to store plant-wide equipment data (such as equipment information) and is responsible for complex business analysis (such as energy consumption comparison across production lines and equipment failure prediction).

[0048] In the above scenario, the business requirement is to query the average energy consumption of each production line (consisting of multiple devices) over the past hour. Each edge device needs to filter data within a time window from the local table (device_data) and associate it with the device metadata table (device_meta) to obtain the production line ID to which the device belongs. The central device groups the energy consumption data for each device by production line ID and calculates the average energy consumption.

[0049] However, edge devices cannot handle complex aggregation tasks: the device_data table of a single device may contain more than 100,000 data items per hour. When the edge device's database (such as SQLite) performs association and group aggregation, the CPU usage will soar to more than 90%, causing delays in other control tasks of the edge device (such as robot motion control), and failing to meet the real-time requirements of industrial control (the control cycle must be <1ms); the cost of directly moving the calculation to the central device: if the preprocessing of the edge device is skipped and the raw data (100,000 items / device × 100 devices = 10 million data items) is directly transmitted to the central device, the 5G network has a single round-trip delay of about 10ms. High-frequency transmission (such as one query per second) will accumulate a delay of 100ms / time, and consume bandwidth of 50MB / s (assuming each data item is 50 bytes), resulting in a network IO bottleneck for the central device. In reality, an edge device may generate a large amount of invalid data due to sensor anomalies. When the edge device's database processes the WHERE time > '2024-05-14 14:00:00' filter (filtering data within the past hour), a full table scan is performed due to missing indexes, taking 200ms (far exceeding the edge device's 1ms control cycle). Ultimately, the task times out, interrupting production line monitoring.

[0050] This shows that in the edge-center cross-database architecture, the current cross-database query solution has unreasonable task allocation, which will lead to problems with production terminals and long query response times.

[0051] In view of this, an embodiment of the present application provides a cross-database query method, which is applied to the scenario of the cross-database architecture composed of the above-mentioned central device and multiple edge devices. The method includes:

[0052] The central device receives a query request sent by a service terminal, and then obtains the available computing power value of each edge device and the network bandwidth between the central device and the edge device based on the query request. Taking the target edge device as an example, when the target available computing power value of the target edge device is less than the first computing power threshold and the target network bandwidth is less than the bandwidth threshold, the central device does not adopt a traditional simple and crude processing method. Instead, it first decomposes the query operation associated with the target edge device to obtain multiple query sub-operations. These query sub-operations are not all executed by the target edge device. The target query sub-operation is selected from the multiple query sub-operations and assigned to the target edge device for processing. In this way, even if the target available computing power is low, the target edge device can still perform business processing without crashing and obtain a first sub-processing result. In addition, because the target edge device processes a portion of the data, it does not need to transmit all the data to the central device. Instead, it only transmits a portion of the data, such as the first sub-processing result obtained after the target edge device processes it. In this way, even if the network bandwidth is poor, the target edge device can also transmit a small amount of data to the central device with low latency. The central device obtains a third target processing result based on the first sub-processing result and the other query sub-operations. The processing method for other edge devices is similar, and other processing results are obtained. The central device feeds back the query response to the business terminal based on the third target processing result and other processing results associated with other edge devices. It can be seen that the technical solution of the present application accurately solves the core contradiction in the edge-center architecture through the dual-dimensional evaluation of computing power and network and the hierarchical decomposition of query operations: in extreme scenarios with low computing power and poor network, it not only avoids the collapse of edge devices due to "strong computing", but also prevents the central device from being overloaded due to "full collection", and realizes the optimal coordination of "the edge does light work and the center does heavy work". Through fine-grained task division, a balance is found between equipment stability, transmission efficiency, and real-time computing, reducing production interruptions and shortening query response time.

[0053] Among them, the above application scenarios are only exemplary introductions. The technical solution of this application can also be applied to other application scenarios, which will not be repeated here.

[0054] like Figure 2As shown in FIG, this figure is a flowchart of a cross-database query method provided in an embodiment of the present application, the method comprising:

[0055] S201: The central device receives a query request sent by a service terminal.

[0056] Central devices are devices with powerful computing capabilities, such as servers. Business terminals are terminals related to business. Central devices can receive query requests sent by business terminals. Query requests are used to query business-related data.

[0057] S202: The central device obtains the target available computing power value of the target edge device and the target network bandwidth between the central device and the target edge device according to the query request.

[0058] Edge devices are devices deployed at the edge and have relatively low computing power. In this application, the computing power of an edge device is less than that of a central device. The computing power of a central device can be tens or even hundreds of times greater than that of an edge device. Multiple edge devices are connected to the central device via a network, allowing the central device to exchange information with each edge device.

[0059] In some examples, after receiving a query request, the central device can obtain the available computing power value of each edge device and the network bandwidth between the central device and the edge device based on the query request. The available computing power value refers to the computing power value currently available for use by the edge device. For example, if the computing power value is 100% and the current value is 60%, the available computing power value is 40%.

[0060] For ease of understanding, the following description will be given using a target edge device among multiple edge devices as an example. In some embodiments, the central device may obtain a target available computing power value of the target edge device and a target network bandwidth between the central device and the target edge device.

[0061] The central device can obtain the target number of available CPU cores, target CPU load, target maximum number of CPU cores, target available memory, and target total memory of the target edge device; then determine the target available computing power value based on the target number of available CPU cores, target CPU load, target maximum number of CPU cores, target available memory, and target total memory. Specifically, the target available computing power value can be calculated using the following formula:

[0062]

[0063] in, Indicates the target available computing power value, Indicates the maximum number of target CPU cores. Indicates the number of available CPU cores of the target. Indicates the target CPU load (current CPU load), Indicates the remaining degree of CPU resources. is the first weight coefficient, Indicates the target available memory, Indicates the total target memory, Represents the second weight coefficient.

[0064] The central device can obtain the target network upload bandwidth and the target network maximum bandwidth (in Mbps) between the central device and the target edge device, and then calculate the target network bandwidth using the following formula:

[0065]

[0066] in, Indicates the target network bandwidth, Indicates the maximum bandwidth of the target network. Indicates the target network upload bandwidth, for example, the current network upload bandwidth.

[0067] After obtaining the target available computing power value and target network bandwidth, the central device can perform subsequent logical judgments and then select a data query solution.

[0068] In this application, the query solution is not fixed, but is dynamically adjusted based on the available computing power of the edge device and the network bandwidth between each edge device and the central device, so as to achieve collaborative optimal query.

[0069] S203: The central device determines whether the target available computing power value is greater than or equal to a first computing power threshold.

[0070] If yes, execute S204; if no, execute S205. The central device determines whether the target available computing power value is greater than or equal to the first computing power threshold, obtaining a first determination result. If the first determination result indicates that the target available computing power value is greater than or equal to the first computing power threshold, execute S204; if the first determination result indicates that the target available computing power value is less than the first computing power threshold, execute S205.

[0071] S204. The central device assigns the query operation associated with the target edge device to the target edge device for processing, receives the first target processing result fed back by the target edge device, and feeds back a query response to the service terminal based on the first target processing result and other processing results associated with other edge devices.

[0072] Other edge devices are devices other than the target edge device among the multiple edge devices.

[0073] When the target available computing power value is greater than or equal to the first computing power threshold, it indicates that there is still a large available computing power value for the target edge device. Therefore, the central device can assign query operations to the target edge device without causing a major impact on the target edge device itself.

[0074] After receiving the query operation assigned by the central device, the target edge device performs relevant business processing based on the query operation, such as data filtering and aggregation, to obtain a first target processing result. The first target processing result can be a minimum unit processing result. After obtaining the first target processing result, the target edge device can feed the first target processing result back to the central device.

[0075] For other edge devices, there will also be other processing results associated with other edge devices. The task allocation method for other edge devices is similar to that for the target edge device, and is based on the available computing power and network bandwidth of the edge device. In this way, the central device can obtain the first target processing result and other processing results associated with other edge devices, and then feedback the query response to the business terminal based on the first target processing result and other processing results. Exemplarily, the central device processes the first target processing result and other processing results (which can be determined by business needs, such as aggregation processing) to obtain a query response that matches the query request.

[0076] In an embodiment of the present application, the central device determines whether the available computing power value of the edge device meets the first computing power threshold, and preferentially assigns the query operation to the edge device for processing, thereby reducing the computing pressure of the central device and avoiding performance bottlenecks or increased delays caused by centralized processing; the central device allocates tasks based on the real-time computing power status (such as whether the computing power of the edge device is sufficient), realizes dynamic matching of the computing power resources of the edge device, improves the resource utilization of the overall system, and avoids idle or wasted computing power.

[0077] In some embodiments, the central device can also obtain the task plan of the target edge device. When the task plan of the target edge device indicates that there is no target task within a preset time period in the future, the central device will assign the query operation associated with the target edge device to the target edge device for processing. The target task is a task whose computing power value required to execute the task is greater than or equal to the second computing power threshold.

[0078] In an embodiment of the present application, the central device obtains the task plan of the target edge device in advance, thereby knowing the target edge device's demand for computing power in a future preset time period. If there is no target task, it indicates that the demand for computing power in the future preset time period is small, and it is suitable to assign all query operations to the target edge device.

[0079] If a target task exists, it indicates a high demand for computing power within a preset time period, making it inappropriate to assign all query operations to the target edge device. In this case, the central device can decompose the query operation and assign appropriate query sub-operations to the target edge device. For details, see the subsequent S207.

[0080] S205: The central device determines whether the target network bandwidth is greater than or equal to the bandwidth threshold.

[0081] If yes, then execute S206; if no, then execute S207. The central device determines whether the target network bandwidth is greater than or equal to the bandwidth threshold, obtaining a second determination result. If the second determination result indicates that the target network bandwidth is greater than or equal to the bandwidth threshold, then execute S206; if the second determination result indicates that the target network bandwidth is less than the bandwidth threshold, then execute S207.

[0082] S206. The central device instructs the target edge device to transmit data related to the query request to the central device, processes the data related to the query request, obtains a second target processing result, and feeds back a query response to the service terminal based on the second target processing result and other processing results associated with other edge devices.

[0083] When the target available computing power value is less than the first computing power threshold and the target network bandwidth is greater than or equal to the bandwidth threshold, it means that the available computing power of the target edge device is insufficient, but the network bandwidth between the target edge device and the central device is good. In this way, the central device can instruct the target edge device to transmit the data related to this query request to the central device. After the central device receives the data related to the query request transmitted by the target edge device, it can process the data to obtain the second target processing result. Similar to S205, the central device can also obtain other processing results associated with other edge devices, and then feedback the query response to the business terminal based on the second target processing result and other processing results associated with other edge devices. Since the network bandwidth between the target edge device and the central device is large, the transmission of all relevant data will not have a major impact on the network, and the data transmission can also be completed in a short time, thereby ensuring the timeliness of the query.

[0084] In an embodiment of the present application, the central device instructs the edge device to transmit data to the central device only when the network bandwidth of the edge device meets the bandwidth threshold (such as a high-bandwidth link), thereby avoiding network congestion or transmission timeout caused by forced transmission in low-bandwidth scenarios, and improving the timeliness of query requests; when the network bandwidth between the edge device and the central device is high, the edge device transmits the relevant data back to the central device. When the network bandwidth between the edge device and the central device is low, the edge device gives priority to local processing, thereby matching bandwidth capabilities with task requirements and avoiding waste of network resources.

[0085] S207. The central device decomposes the query operation associated with the target edge device to obtain multiple query sub-operations, selects the target query sub-operation from the multiple query sub-operations, assigns the target query sub-operation to the target edge device for processing, receives the first sub-processing result fed back by the target edge device, obtains the third target processing result based on the first sub-processing result and other query sub-operations, and feeds back a query response to the business terminal based on the third target processing result and other processing results associated with other edge devices.

[0086] Other query sub-operations are operations other than the target query sub-operation among the multiple query sub-operations.

[0087] When the target available computing power value is less than the first computing power threshold and the target network bandwidth is less than the bandwidth threshold, the central device may decompose the query operation associated with the target edge device to obtain multiple query sub-operations. In some examples, the edge devices have different types or functions, and thus different query operations are associated with different edge devices. When the central device determines that the available computing power value of the edge device is less than the first computing power threshold and the network bandwidth is less than the bandwidth threshold, it may decompose the query operation associated with the edge device.

[0088] After the central device decomposes the query operation, it can select a target query sub-operation from multiple query sub-operations and assign it to the target edge device for processing. This target query sub-operation is an operation suitable for the target edge device to execute, ensuring that it does not affect other control tasks of the target edge device and reducing the amount of data transmitted to the central device after the target query sub-operation is executed.

[0089] In some embodiments, the central device can obtain the required computing power value corresponding to each query sub-operation based on a pre-set first mapping relationship between the reference query sub-operation and the reference required computing power value, and then select the top N query sub-operations corresponding to the top N required computing power values ​​in order from small to large; among which, the sum of the top N required computing power values ​​is less than the target available computing power value, and the top N query sub-operations are the above-mentioned target query sub-operations.

[0090] In an embodiment of the present application, when the available computing power value of the edge device is less than the first computing power threshold, the central device assigns tasks whose sum of computing power requirements is less than the available computing power value to the edge device. This will not affect other control tasks of the edge device, thereby avoiding insufficient computing power, memory overflow, or even crash of the edge device.

[0091] After receiving the target query sub-operation assigned by the central device, the target edge device can perform data processing based on the target query sub-operation (depending on the type of query sub-operation, such as filtering) to obtain a first sub-processing result, and then transmit this first sub-processing result to the central device. At this point, because the target edge device has already processed the data, the amount of data that needs to be transmitted to the central device is reduced, and it is no longer necessary to transmit all the data to the central device. Therefore, even if the network bandwidth is less than the bandwidth threshold, the first sub-processing result can be transmitted to the central device with low latency.

[0092] After the central device receives the first sub-processing result, it can continue to process the first sub-processing result based on other query sub-operations to obtain a third target processing result, and then feedback the query response to the business terminal based on the third target processing result and other processing results associated with other edge devices.

[0093] In this application, by dynamically evaluating the available computing power of edge devices, the central device can accurately determine their processing capabilities. When the computing power of the edge device is lower than the first computing power threshold and the network bandwidth is less than the bandwidth threshold, complex query tasks (such as cross-table aggregation, multi-condition association) are not directly assigned to prevent the edge device from crashing or production interruption due to resource exhaustion. Instead, the tasks are first decomposed and the edge devices are allowed to handle simple tasks. For example, in the industrial Internet of Things scenario, old edge devices only undertake lightweight tasks such as data filtering and local aggregation, while heavy tasks such as global aggregation are moved to the central device. This not only utilizes the real-time data local processing capabilities of the edge device and reduces the amount of data required to be transmitted, but also avoids its overload and reduces the failure rate of the edge device. After the amount of data required to be transmitted is reduced, low-latency data transmission can be achieved under low bandwidth conditions, thereby further ensuring the timeliness of the query.

[0094] In some embodiments, the central device can also send a task processing time threshold to each edge device. After the edge device receives the task processing time threshold, it can compare the task processing time threshold with the expected processing time. When the task processing time threshold is greater than or equal to the expected processing time, data processing is performed normally. When the task processing time is less than the expected processing time, the data processing speed needs to be increased. For example, for the same type of data, the processing amount is reduced. For example, in the scenario of determining the average current of the device in the past hour, there are 10,000 data in the past hour. If all 10,000 data are processed, the task processing time threshold will not be met. At this time, the data amount can be reduced proportionally before processing, for example, only 8,000 data are processed.

[0095] In order to make the technical solution of this application clearer, examples are given below.

[0096] In this example, multiple edge devices include a first edge device, a second edge device, and a third edge device. The first computing power threshold is 60%, the bandwidth threshold is 50Mbps, the first available computing power value of the first edge device is 80%, the second available computing power value of the second edge device is 20%, the second network bandwidth between the second edge device and the central device is 100Mbps, the third available computing power value of the third edge device is 50%, and the third network bandwidth between the third edge device and the central device is 40Mbps.

[0097] In the technical solution of this application, the central device receives a query request sent by the service terminal and needs to perform a cross-database query:

[0098] Because the first available computing power value is greater than the first computing power threshold, the central device assigns the query operation associated with the first edge device to the first edge device for processing and receives the first processing result fed back by the first edge device. Because the second available computing power value is less than the first computing power threshold and the second network bandwidth is greater than the bandwidth threshold, the central device instructs the second edge device to transmit data related to the query request to the central device. The central device processes the data related to the query request and obtains a second processing result. Because the third available computing power value is less than the first computing power threshold and the third network bandwidth is less than the bandwidth threshold, the central device decomposes the query operation associated with the third edge device into multiple query sub-operations, selects a target query sub-operation from the multiple query sub-operations, assigns the target query sub-operation to the third edge device for processing, receives the first sub-processing result fed back by the third edge device, and obtains a third processing result based on the first sub-processing result and the other query sub-operations. After obtaining the first, second, and third processing results, the central device feeds back a query response to the service terminal based on these three processing results.

[0099] Based on the above description, the embodiment of the present application provides a cross-database query method, which is applied to a cross-database query architecture in which a central device collaborates with multiple edge devices. Through dynamic resource evaluation and task allocation strategies, it realizes the refined scheduling of computing power and network resources, significantly improving the efficiency, reliability and flexibility of cross-database queries. The present application constructs a three-level response mechanism of computing power priority judgment-bandwidth auxiliary decision-task intelligent decomposition, which can dynamically adjust the processing strategy according to the real-time status of the edge device, avoiding the processing bottleneck of a single central node and fully releasing the local processing potential of the edge device, forming an intelligent query system that adapts to complex distributed environments.

[0100] Combined with the above Figures 1 to 2 The cross-database query method provided in the embodiment of the present application is introduced in detail. The apparatus and device provided in the embodiment of the present application will be introduced below in conjunction with the accompanying drawings.

[0101] like Figure 3 As shown in FIG, this figure is a schematic diagram of a cross-database query device provided in an embodiment of the present application, the device comprising:

[0102] Receiving module 301, used to receive a query request sent by a service terminal;

[0103] An acquisition module 302 is configured to acquire a target available computing power value of a target edge device and a target network bandwidth between the target edge device and the target edge device according to the query request;

[0104] The judgment module 303 is configured to determine whether the target available computing power value is greater than or equal to a first computing power threshold, thereby obtaining a first judgment result; if the first judgment result indicates that the target available computing power value is less than the first computing power threshold, then determine whether the target network bandwidth is greater than or equal to a bandwidth threshold, thereby obtaining a second judgment result;

[0105] The query module 304 is used to decompose the query operation associated with the target edge device to obtain multiple query sub-operations if the second judgment result indicates that the target network bandwidth is less than the bandwidth threshold, select a target query sub-operation from the multiple query sub-operations, assign the target query sub-operation to the target edge device for processing, receive a first sub-processing result fed back by the target edge device, obtain a third target processing result based on the first sub-processing result and other query sub-operations, and feed back a query response to the business terminal based on the third target processing result and other processing results associated with other edge devices. Other query sub-operations are operations other than the target query sub-operation in the multiple query sub-operations, and the other edge devices are devices other than the target edge device in the multiple edge devices.

[0106] Optionally, the query module 304 is also used to assign the query operation associated with the target edge device to the target edge device for processing if the first judgment result indicates that the target available computing power value is greater than or equal to the first computing power threshold, receive the first target processing result fed back by the target edge device, and feed back a query response to the business terminal based on the first target processing result and other processing results associated with other edge devices.

[0107] Optionally, the query module 304 is also used to instruct the target edge device to transmit data related to the query request to the central device if the second judgment result indicates that the target network bandwidth is greater than or equal to the bandwidth threshold, process the data related to the query request, and obtain a second target processing result; and feedback a query response to the business terminal based on the second target processing result and other processing results associated with other edge devices.

[0108] Optionally, the query module 304 is specifically used to obtain the required computing power value corresponding to each query sub-operation based on a first mapping relationship between a pre-set reference query sub-operation and a reference required computing power value; select the top N query sub-operations corresponding to the top N required computing power values ​​in order from small to large; wherein the sum of the top N required computing power values ​​is less than the target available computing power value.

[0109] Optionally, the acquisition module 302 is specifically used to obtain the target available CPU core number, target CPU load, target maximum CPU core number, target available memory and target total memory of the target edge device; and determine the target available computing power value based on the target available CPU core number, the target CPU load, the target maximum CPU core number, the target available memory and the target total memory.

[0110] Optionally, the acquisition module 302 is further configured to acquire a task plan of the target edge device;

[0111] The query module 304 is specifically used to assign the query operation associated with the target edge device to the target edge device for processing when the task plan representation of the target edge device indicates that there is no target task within a preset time period in the future; the target task is a task whose computing power value required for execution is greater than or equal to the second computing power threshold.

[0112] Optionally, the apparatus further includes a sending module, configured to send a task processing time threshold to each edge device, so that each edge device feeds back a processing result within the processing time threshold.

[0113] The cross-database query device according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above-mentioned other operations and / or functions of each module / unit of the cross-database query device are respectively to realize Figure 2 For the sake of brevity, the corresponding processes of the various methods in the illustrated embodiments are not described again here.

[0114] The present application also provides a computing device. Figure 4 As shown, this figure is a schematic diagram of a computing device provided by an embodiment of the present application, and the computing device 400 includes a bus 401, a processor 402, a communication interface 403 and a memory 404. The processor 402, the memory 404 and the communication interface 403 communicate with each other via the bus 401.

[0115] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0116] The processor 402 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0117] The communication interface 403 is used for communicating with the outside.

[0118] Memory 404 may include volatile memory, such as random access memory (RAM). Memory 404 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0119] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the aforementioned cross-database query method.

[0120] Specifically, in the implementation Figure 3 In the case of the embodiment shown, and Figure 3 When each module or unit of the cross-database query device described in the embodiment is implemented by software, the execution Figure 3 The software or program code required for the functions of each module / unit in the system may be partially or completely stored in the memory 404. The processor 402 executes the program code corresponding to each unit stored in the memory 404 to perform the aforementioned cross-database query method.

[0121] Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the cross-database query method described above.

[0122] The present application also provides a computer program product comprising one or more computer instructions that, when loaded and executed on a computing device, fully or partially generate the process or function described in the present application.

[0123] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0124] When the computer program product is executed by a computer, the computer performs any of the aforementioned cross-database query methods. The computer program product may be a software installation package, and when any of the aforementioned cross-database query methods is needed, the computer program product may be downloaded and executed on the computer.

[0125] The descriptions of the processes or structures corresponding to the above figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0126] The above description is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A cross-database query method, characterized in that: Applied to a cross-database architecture consisting of a central device and multiple edge devices, the method includes: The central device receives a query request sent by the service terminal; The central device obtains the target available computing power value of the target edge device and the target network bandwidth between the central device and the target edge device according to the query request; The central device determines whether the target available computing power value is greater than or equal to a first computing power threshold, and obtains a first determination result; If the first judgment result indicates that the target available computing power value is less than the first computing power threshold, the central device determines whether the target network bandwidth is greater than or equal to the bandwidth threshold to obtain a second judgment result; If the second judgment result indicates that the target network bandwidth is less than the bandwidth threshold, the central device decomposes the query operation associated with the target edge device to obtain multiple query sub-operations, selects a target query sub-operation from the multiple query sub-operations, assigns the target query sub-operation to the target edge device for processing, receives the first sub-processing result fed back by the target edge device, obtains a third target processing result based on the first sub-processing result and other query sub-operations, and feeds back a query response to the service terminal based on the third target processing result and other processing results associated with other edge devices. Other query sub-operations are operations other than the target query sub-operation in the multiple query sub-operations, and the other edge devices are devices other than the target edge device in the multiple edge devices.

2. The method according to claim 1, characterized in that The method further comprises: If the first judgment result indicates that the target available computing power value is greater than or equal to the first computing power threshold, the central device will assign the query operation associated with the target edge device to the target edge device for processing, receive the first target processing result fed back by the target edge device, and feed back a query response to the business terminal based on the first target processing result and other processing results associated with other edge devices.

3. The method according to claim 1, characterized in that The method further comprises: If the second judgment result indicates that the target network bandwidth is greater than or equal to the bandwidth threshold, the central device instructs the target edge device to transmit the data related to the query request to the central device, processes the data related to the query request, and obtains a second target processing result. Based on the second target processing result and other processing results associated with other edge devices, a query response is fed back to the service terminal.

4. The method according to claim 1, wherein The selecting a target query sub-operation from the plurality of query sub-operations includes: Obtaining the required computing power value corresponding to each query sub-operation according to a preset first mapping relationship between the reference query sub-operation and the reference required computing power value; Select the top N query sub-operations corresponding to the top N required computing power values ​​in ascending order; wherein the sum of the top N required computing power values ​​is less than the target available computing power value.

5. The method according to claim 1, wherein Obtaining the target available computing power value of the target edge device includes: Get the target number of available CPU cores, target CPU load, target maximum number of CPU cores, target available memory, and target total memory of the target edge device; A target available computing power value is determined based on the target available number of CPU cores, the target CPU load, the target maximum number of CPU cores, the target available memory, and the target total memory.

6. The method according to claim 2, characterized in that The method further comprises: Obtaining a mission plan for the target edge device; The central device assigns the query operation associated with the target edge device to the target edge device for processing, including: When the task plan representation of the target edge device indicates that there is no target task within a preset time period in the future, the central device assigns the query operation associated with the target edge device to the target edge device for processing; The target task is a task whose computing power required for execution is greater than or equal to the second computing power threshold.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The central device sends a task processing time threshold to each edge device, so that each edge device feeds back a processing result within the processing time threshold.

8. A cross-database query device, characterized in that: Applied to a cross-database architecture consisting of a central device and multiple edge devices, the apparatus includes: A receiving module, configured to receive a query request sent by a service terminal; An acquisition module, configured to acquire a target available computing power value of a target edge device and a target network bandwidth between the target edge device and the target edge device according to the query request; a judgment module, configured to determine whether the target available computing power value is greater than or equal to a first computing power threshold, and obtain a first judgment result; if the first judgment result indicates that the target available computing power value is less than the first computing power threshold, then determine whether the target network bandwidth is greater than or equal to a bandwidth threshold, and obtain a second judgment result; A query module is used to decompose the query operation associated with the target edge device to obtain multiple query sub-operations if the second judgment result indicates that the target network bandwidth is less than the bandwidth threshold, select a target query sub-operation from the multiple query sub-operations, assign the target query sub-operation to the target edge device for processing, receive a first sub-processing result fed back by the target edge device, obtain a third target processing result based on the first sub-processing result and other query sub-operations, and feed back a query response to the service terminal based on the third target processing result and other processing results associated with other edge devices, where other query sub-operations are operations other than the target query sub-operation in the multiple query sub-operations, and the other edge devices are devices other than the target edge device in the multiple edge devices.

9. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cross-database data query method and device and readable medium

    CN111767304A

  • Data query method, device and electronic equipment

    CN111930770A