Data query method and device based on edge calculation, medium, equipment and product
By using grouping and concurrent querying methods in the edge computing monitoring system, the problem of excessively long query response time was solved, achieving efficient data querying and meeting business needs.
Patent Information
- Application Number
- CN202511108180.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-07
AI Technical Summary
In edge computing monitoring systems, excessively long query response times and low data return efficiency make it difficult to meet business needs, especially when dealing with a large number of edge computing nodes and massive amounts of data.
The target edge computing nodes are identified by data service instances and grouped according to a preset grouping strategy. Data queries are performed concurrently using a data query engine. The grouping strategy aims to minimize the time complexity of data queries by splitting them into multiple subqueries that are executed in parallel.
It improves data query efficiency, reduces user waiting time, enhances the data query experience and business processing efficiency, and ensures the stability and efficiency of the system in complex network environments.
Smart Images

Figure CN120994702A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of edge computing, in particular, to an edge computing-based data query method and device, medium, equipment and product. BACKGROUND
[0002] In an edge computing monitoring system, an architecture of Prometheus combined with Thanos is usually adopted for data query. Specifically, when a query request is initiated by a business party, Thanos distributes the query request to each Prometheus instance, each Prometheus instance returns local data, and then a Thanos query engine aggregates and processes the data to finally return a unified query result and feed back the query result to the business party.
[0003] However, the edge computing monitoring system is faced with the characteristics of a large number of edge computing nodes and a large amount of data generated by each edge computing node. In this case, the above direct query method will result in a long query response time and low data return efficiency, thus being difficult to meet the business requirements. SUMMARY
[0004] This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed technology, nor is it intended to be used to limit the scope of the claimed technology.
[0005] In a first aspect, the present disclosure provides an edge computing-based data query method applied to a central machine room, wherein the central machine room is deployed with a data service instance and a data query engine, and the edge computing-based data query method comprises: In response to receiving a data query request, determining, by the data service instance, a plurality of target edge computing nodes for data query of the data query request, and grouping the plurality of target edge computing nodes based on a preset grouping strategy to obtain a plurality of groups, wherein the grouping strategy is used to group the plurality of target edge computing nodes with the objective of minimizing the complexity of data query time; Concurrently querying, by the data query engine, the target edge computing nodes in each of the groups for data query to obtain data query results, and determining a target data query result for the data query request according to the data query results of each of the groups.
[0006] In a second aspect, the present disclosure provides an edge computing-based data query device applied to a central machine room, wherein the central machine room is deployed with a data service instance and a data query engine, and the edge computing-based data query device comprises: The first processing module is configured to, in response to receiving a data query request, determine, by the data service instance, a plurality of target edge computing nodes for data query of the data query request, and group the plurality of target edge computing nodes based on a preset grouping policy to obtain a plurality of groups, wherein the grouping policy is configured to group the plurality of target edge computing nodes with a complexity of minimizing data query time as a target. The second processing module is configured to perform, by the data query engine, data query on the target edge computing nodes in each of the groups concurrently to obtain data query results, and determine a target data query result for the data query request according to the data query results of each of the groups.
[0007] In a third aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method in the first aspect.
[0008] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the method in the first aspect.
[0009] In a fifth aspect, the present disclosure provides a computer program product comprising a computer program, which, when executed by a processor, implements the steps of the method in the first aspect.
[0010] Through the above technical solution, in the case of receiving a data query request, a plurality of target edge computing nodes for data query of the data query request can be determined by a data service instance, and the plurality of target edge computing nodes can be grouped based on a preset grouping policy to obtain a plurality of groups. In addition, the target edge computing nodes in each group can be concurrently queried by a data query engine, and a target data query result for the data query request can be determined according to the data query results of each group. Thus, the data query of the plurality of target edge computing nodes can be split into a plurality of sub-queries, and the plurality of sub-queries can be concurrently executed by the data query engine, i.e., the data query engine can simultaneously query the plurality of target edge computing nodes, thereby improving data query efficiency and reducing user waiting time. In addition, since the grouping policy is configured to group the plurality of target edge computing nodes with a complexity of minimizing data query time as a target, when the target edge computing nodes in each group are concurrently queried by the data query engine, the data query efficiency can be further improved, the user waiting time can be reduced, and the user's data query experience can be improved.
[0011] Other features and advantages of the present disclosure will be set forth in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0012] The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which: Figure 1 is a flow chart of a data query method based on edge computing according to an exemplary embodiment of the present disclosure; Figure 2 is a system architecture diagram of an edge computing monitoring system according to an exemplary embodiment of the present disclosure; Figure 3 is a timing diagram of a data query method based on edge computing according to an exemplary embodiment of the present disclosure; Figure 4 is a block diagram of a data query apparatus based on edge computing according to an exemplary embodiment of the present disclosure; Figure 5 is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0013] Embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments of the present disclosure are shown. Like numbers refer to like elements throughout the several views. It should be noted that the embodiments of the present disclosure can be implemented by various means, and are not limited to the embodiments of the present disclosure described herein. Embodiments of the present disclosure can be implemented as hardware, software, firmware, or any combination thereof.
[0014] It should be understood that each of the steps of the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0015] The term "comprising" and variations thereof as used herein are open-ended, and mean "including but not limited to". The term "based on" means "based, at least in part, on". The term "one embodiment" means "at least one embodiment". The term "another embodiment" means "at least one additional embodiment". The term "some embodiments" means "at least some embodiments". Related terms are defined as follows.
[0016] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not limit the order or interdependence of the functions performed by these devices, modules or units.
[0017] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one" or "multiple" should be understood as "one or more" unless otherwise explicitly indicated in the context.
[0018] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of the messages or information.
[0019] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained in a proper manner according to relevant laws and regulations.
[0020] For example, in response to receiving the active request of the user, the user is sent prompt information to explicitly prompt the user that the operation requested to be performed will require obtaining and using the personal information of the user. Thus, the user can voluntarily choose whether to provide personal information to the electronic device, application program, server or storage medium, etc. software or hardware performing the operation of the technical solutions of the present disclosure according to the prompt information.
[0021] As an optional but non-limiting implementation, in response to receiving the active request of the user, the user is sent prompt information, for example, in the form of a pop-up window, which can present the prompt information in the form of text. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0022] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation of the present disclosure, and other ways that meet the relevant laws and regulations can also be applied to the implementation of the present disclosure.
[0023] At the same time, it can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and relevant provisions.
[0024] As mentioned in the background, in the edge computing monitoring system, the architecture of Prometheus combined with Thanos is usually adopted for data query. Prometheus is a popular open-source system monitoring and alerting toolkit, which is usually deployed on edge computing nodes to collect, store and query various types of index data of edge computing nodes. Thanos is an extension solution based on Prometheus, aiming to solve the limitations of Prometheus in large-scale data monitoring scenarios, such as long-term storage of data and global query across multiple Prometheus instances. By aggregating data from multiple Prometheus instances, Thanos provides a unified query interface, making it easy for users to access monitoring data from different data sources. Specifically, when a business initiates a query request, Thanos distributes the query request to each Prometheus instance, and after each Prometheus instance returns local data, the Thanos query engine aggregates and processes these data, and finally returns a unified query result to the business.
[0025] However, the edge computing monitoring system usually faces the challenge of a large number of edge computing nodes and a large amount of data generated by each node. In this case, the above direct query method will cause the query response time to be too long and the data return efficiency to be low. Especially for complex queries involving multiple Prometheus instances and a large amount of data (such as Cartesian product calculation involving a large amount of data), the query efficiency will decrease significantly, making it difficult to meet business needs.
[0026] Therefore, the present disclosure provides a data query method, device, medium, equipment and product based on edge computing to solve the above technical problems.
[0027] The embodiments of the present disclosure are further explained and described below with reference to the accompanying drawings.
[0028] Figure 1 is a flowchart of a data query method based on edge computing according to an exemplary embodiment of the present disclosure. Referring to Figure 1 The method can be applied to a central machine room, and the central machine room can be deployed with a data service instance and a data query engine, and the method can include the following steps: S101: In response to receiving a data query request, determining a plurality of target edge computing nodes for data query of the data query request through the data service instance, and grouping the plurality of target edge computing nodes based on a preset grouping strategy to obtain a plurality of groups, wherein the grouping strategy is used to group the plurality of target edge computing nodes with the complexity of minimizing data query time as the target.
[0029] In this embodiment, the data service instance can be one or multiple, and the embodiments of the present disclosure do not make any limitation in this regard. In a possible manner, in order to increase the disaster recovery capability of the system, the data service instance can be set to multiple. Further, in order to improve the response efficiency of the data query request and the data query efficiency, the central machine room can also be configured with a load balancer, so that after receiving the data query request, the data query request can be distributed to the data service instance with more available resources in the multiple data service instances by the load balancer, and then the multiple target edge computing nodes for data query of the data query request are determined based on the data service instance.
[0030] It should be understood that the data query engine is a key component in the Prometheus-Thanos architecture, which supports efficient data storage, indexing and querying, and the specific data query engine can be determined according to actual conditions, and the embodiments of the present disclosure do not make any limitation in this regard. For example, the data query engine can be a time series database query engine.
[0031] In this embodiment, the data query request can be initiated by a business user of edge computing, wherein the business can include video on demand business or live broadcast business, etc.
[0032] For example, when the data query engine receives a data query request initiated by a live broadcast business, the data query engine can obtain multiple target edge computing nodes relied on by the live broadcast business by means of the service discovery function of edge computing itself, and after obtaining the multiple target edge computing nodes, the multiple target edge computing nodes can be grouped based on a preset grouping strategy to obtain multiple groups.
[0033] In a possible manner, the preset grouping strategy can be obtained in the following manner: Suppose there are edge computing nodes that need to perform data query operations, and the time complexity of querying a single edge computing node is . Then the clusters can be divided into groups, each group containing edge computing nodes, so there are .
[0034] For each group, since the time complexity of querying a single edge computing node is , the time complexity of querying a group can be , .
[0035] Since the CPU (Central Processing Unit) cost of mass index query is extremely large, the system cannot handle all the calculations in parallel, so the embodiment considers a sequential way to calculate the total time complexity , i.e. .
[0036] According to the mean inequality , the equality holds if and only if , so the optimal solution of grouping is: . That is, among the possible ways, grouping the plurality of target edge computing nodes based on the preset grouping strategy to obtain a plurality of groups can include: determining the number of nodes of the plurality of target edge computing nodes; and grouping the plurality of target edge computing nodes according to a square root operation result corresponding to the number of nodes to obtain a plurality of groups.
[0037] It can be understood that for different numbers of nodes, the square root operation result corresponding to the number of nodes can be an integer or not. In the case where the square root operation result corresponding to the number of nodes is an integer, the plurality of target edge computing nodes can be directly allocated according to the square root operation result. That is, among the possible ways, grouping the plurality of target edge computing nodes according to the square root operation result corresponding to the number of nodes to obtain a plurality of groups can include: in the case where the square root operation result corresponding to the number of nodes is an integer, determining the square root operation result as the number of groups, and allocating the plurality of target edge computing nodes according to the number of groups to obtain a plurality of groups.
[0038] For example, if the number of nodes is 16, the square root operation result corresponding to the number of nodes is 4. Then, when grouping the 16 target edge computing nodes, the 16 target edge computing nodes can be divided into 4 groups, and each group includes 4 target edge computing nodes.
[0039] In the case where the square root operation result corresponding to the number of nodes is not an integer, since it is not possible to allocate according to the square root operation result, in order to make the number of target edge computing nodes included in each group as balanced as possible, the plurality of target edge computing nodes can be allocated according to the square root operation result, and the number of target edge computing nodes in any two groups is not more than 1, or the plurality of target edge computing nodes can be first allocated according to the square root operation result, and then the unallocated target edge computing nodes are separately divided into a group, thereby obtaining a plurality of groups. That is, among the possible ways, grouping the plurality of target edge computing nodes according to the square root operation result corresponding to the number of nodes to obtain a plurality of groups can include: In a case where the square root operation result corresponding to the number of nodes is not an integer, an integer part in the square root operation result is determined as the number of groups, and the plurality of target edge computing nodes are distributed according to the number of groups, to obtain a plurality of groups, wherein the number of target edge computing nodes in any two groups in the plurality of groups is not more than 1; or in a case where the square root operation result corresponding to the number of nodes is not an integer, a first group is divided according to the integer part in the square root operation result, and a second group is divided from target edge computing nodes in the plurality of target edge computing nodes that are not distributed to the first group, to obtain a plurality of groups, wherein the number of target edge computing nodes in each first group is equal to the integer part.
[0040] For example, if the number of nodes is 21, the square root operation result corresponding to the number of nodes is approximately 4.58, and since the integer part of the square root operation result is 4, when grouping the 21 target edge computing nodes, the 21 target edge computing nodes can be divided into 4 groups, and 5 target edge computing nodes are included in 3 groups and 6 target edge computing nodes are included in 1 group. Alternatively, 4 first groups can be divided according to the integer part of the square root operation result, and 4 target edge computing nodes are included in each first group, and 5 target edge computing nodes that are not distributed are separately taken as a second group, to obtain 5 groups.
[0041] The target edge computing nodes in each group can be randomly distributed, or can be distributed according to a preset node order, or can be distributed by other means, and the embodiments of the present disclosure do not make any limitation in this regard.
[0042] By grouping according to the above preset grouping strategy, each group can include edge computing nodes with similar numbers, so that when the data query engine performs data query on the target edge computing nodes in each group, the situation that some groups have too heavy query tasks and some groups have too light query tasks due to too large group size difference can be reduced, thereby achieving ideal load balancing of data query tasks among groups, thereby helping to fully utilize system resources such as computing resources and / or network resources, and improving overall resource utilization. In addition, by grouping according to the above preset grouping strategy, the data query engine can simultaneously perform data query on target edge computing nodes in multiple groups, thereby reducing data query delay, improving data query efficiency, enabling business parties to obtain required data more quickly, on the one hand greatly improving the real-time performance of data acquisition, and on the other hand enabling business parties to not need to wait for data return for a long time, thereby being able to more efficiently carry out work and significantly improving business processing efficiency.
[0043] S102: concurrently querying the target edge computing nodes in each group by the data query engine to obtain a data query result of each group, and determining a target data query result for the data query request according to the data query result of each group.
[0044] For example, after obtaining 5 groups by grouping, the data query engine can take each group as an independent subquery, and can concurrently query the target edge computing nodes in the 5 groups by executing the subqueries, after the 5 subqueries are completed, the obtained data query results can be merged to obtain the target data query result for the data query request, and the target data query result can be returned to the business party for subsequent business processing.
[0045] Through the above technical solution, when receiving a data query request, a plurality of target edge computing nodes for data query of the data query request can be determined by the data service instance, the plurality of target edge computing nodes can be grouped based on a preset grouping strategy to obtain a plurality of groups, the target edge computing nodes in each group can be concurrently queried by the data query engine, and a target data query result for the data query request can be determined according to the data query result of each group. Thus, the data query of the plurality of target edge computing nodes can be split into a plurality of subqueries, and the plurality of subqueries can be concurrently executed by the data query engine, that is, the data query engine can concurrently query the plurality of target edge computing nodes, thereby improving the data query efficiency and reducing the user waiting time. In addition, since the grouping strategy is used to group the plurality of target edge computing nodes with the goal of minimizing the complexity of the data query time, when the data query engine concurrently queries the target edge computing nodes in each group, the data query efficiency can be further improved, the user waiting time can be reduced, and the user data query experience can be improved.
[0046] It should be understood that when using Thanos to query monitoring indicators, if a large number of indicator queries are encountered and a certain edge computing node has network jamming, the Partial Response Strategy of Thanos will fail, that is, the entire data query request will fail and return a 429 status code. Specifically, the Partial Response Strategy relies on the store.response.timeout configuration to filter abnormal peers, and if the peer does not send any data within the set time, it will be filtered. However, in the case of network jamming nodes, the connection is not completely interrupted, only the data transmission efficiency is greatly reduced, so there is a problem that when the global query is close to the timeout time, the data of the abnormal peer has not been completely returned. At the same time, since the Querable query interface forcibly returns the result within the timeout configuration time, another problem is caused: time series indicators need to perform the expanding series process, and the larger the data volume, the slower the process. Because the abnormal peer data returns too much time, the data of the normal peer cannot be executed and returned in time, eventually causing the global query to timeout, and the business has no data available. To overcome the above technical problems, in the case that the data query of a certain group fails, the group can be taken as a new input, and the target edge computing nodes in the group are further split until the data query succeeds or each group contains only a preset number of target edge computing nodes. That is, in a possible manner, the data query method based on edge computing can further include: In the case that the data query result indicates that the data query engine fails to perform data query in the group, the group is taken as a target group to be processed, and the following steps are repeatedly executed: The target edge computing nodes in the target group are grouped into a plurality of sub-groups based on a preset grouping strategy by the data service instance; the target edge computing nodes in each sub-group are concurrently queried by the data query engine to obtain a new data query result of each sub-group; in the case that the new data query result indicates that the data query engine fails to perform data query in the sub-group, the sub-group is taken as a new target group, until the data query engine successfully performs data query in the sub-group, or until the number of target edge computing nodes in the target group is a preset number.
[0047] For example, if grouping by the preset grouping strategy results in group A, group B and group C, each of which contains 4 target edge computing nodes, if the data query result of group B indicates that the data query engine fails to perform data query in group B, group B can be taken as a target group to be processed, and the 4 target edge computing nodes in group B can be split into sub-group B-1 and sub-group B-2 based on the preset grouping strategy, so that each of the sub-groups contains 2 target edge computing nodes. Then the data query engine can perform data query on the target edge computing nodes in sub-group B-1 and sub-group B-2 concurrently, to obtain new data query results of sub-group B-1 and sub-group B-2. If the new data query result of sub-group B-1 indicates that the data query engine succeeds in performing data query in sub-group B-1, and the new data query result of sub-group B-2 indicates that the data query engine succeeds in performing data query in sub-group B-2, the target data query result is determined based on the data query results of group A, group C, sub-group B-1 and sub-group B-2. If the new data query result of sub-group B-2 indicates that the data query engine fails to perform data query in sub-group B-2, sub-group B-2 can be taken as a new target group, and the above process can be repeated until the new data query result indicates that the data query engine succeeds in performing data query in the sub-group, or until the number of target edge computing nodes in the target group is a preset number.
[0048] The preset number can be determined according to actual conditions, and the embodiments of the present disclosure do not make any limitation in this regard.
[0049] In the above manner, in the case of a failed group data query, the group can be taken as a new input, and the target edge computing nodes in the group can be further split, so that the probability of global query failure caused by network lag of a single edge computing node can be reduced. That is, by using the recursive splitting manner, the service availability can be ensured while maintaining the resource query efficiency, so that the system can still stably and efficiently return complete query results when facing complex network environment and massive index query, and the user experience is further improved.
[0050] In a possible manner, the central machine room is further provided with a cache device, which is configured to store the correspondence between the node identifiers of the edge computing nodes and the data in the edge computing nodes. Accordingly, the data query method based on edge computing can further include: querying the data in the cache device based on the node identifiers of the plurality of edge computing nodes by using the data query engine; Accordingly, grouping the plurality of edge computing nodes based on the preset grouping strategy by using the data service instance to obtain a plurality of groups can include: In a case where the data is not queried in the cache device, the plurality of edge computing nodes are grouped by the data service instance based on a preset grouping strategy, and a plurality of groups are obtained.
[0051] For example, when the data query engine receives a data query request initiated by a live service provider, the data query engine can obtain a plurality of target edge computing nodes for data query of the data query request by means of the service discovery function of the edge computing itself. After obtaining the plurality of target edge computing nodes, the data query engine can query data in the cache device based on the node identifier of each target edge computing node. If the target data is queried in the cache device based on the node identifier, the target data is merged and output to the live service provider; if the target data is not queried in the cache device based on the node identifier, the plurality of target edge computing nodes are grouped by the data service instance based on a preset grouping strategy, and a plurality of groups are obtained. The data query engine concurrently queries the target edge computing nodes in each group for data, obtains the data query result of each group, and determines the target data query result for the data query request according to the data query result of each group.
[0052] In this embodiment, the implementation manner of grouping the plurality of edge computing nodes by the data service instance based on the preset grouping strategy is described above, and will not be described here.
[0053] In this embodiment, the cache device can be any device capable of storing data, which can be determined according to actual conditions, and the present disclosure does not make any limitation on this. In a possible manner, the cache device can be a key-value database, wherein the key of the key-value pair in the key-value database can correspond to the node identifier of the edge computing node, and the value can correspond to the data in the edge computing node.
[0054] It can be understood that in the edge computing scenario, the edge computing nodes are widely distributed and the transmission link is long, which makes the data of individual edge computing nodes possibly lost in part of the period due to network problems when the timing task is executed. However, by caching with the edge computing node as the key, the latest data can be provided as much as possible at the node granularity. Even if the data of individual edge computing nodes is lost, the service provider can still obtain the cached data of the last task period, so that at least there is available data, effectively avoiding adverse effects such as data pit. In addition, since the edge computing node information relied on by each service provider is clear to the service discovery system of the edge computing, the data storage and reading with the edge computing node as the key can significantly reduce the time consumption of the key scanning operation in the key-value database, thereby realizing faster response speed and meeting the demand of the service provider for fast data acquisition.
[0055] Further, a TTL (Time To Live) can also be set for the cached data in the key-value database, and the cached data is automatically removed from the key-value database when the TTL of the cached data is reached, thereby reducing the storage of expired or invalid cached data in the key-value database, improving the storage space utilization of the key-value database, and reducing the waste of storage resources.
[0056] In a possible manner, the data service instances include a plurality of instances, and accordingly, the data query method based on edge computing can further include: Based on an instance master selection strategy, a master data service instance is determined from the plurality of data service instances; and the target data is queried from the data query engine based on a preset cache query statement and a preset cache update frequency by the master data service instance, and the target data is cached into the value of the key-value pair.
[0057] It should be understood that the instance master selection strategy can be determined according to actual conditions, and the embodiments of the present disclosure do not make any limitation on this. For example, the instance master selection strategy can be a leader election strategy, a master selection strategy based on node characteristics, or a master selection strategy based on a token ring, etc. Among them, the leader election strategy can use consensus algorithm Raft or Paxos algorithm Paxos to complete the election of the master node through the voting and consensus mechanism between nodes; the master selection strategy based on node characteristics can specify the initial master node according to the static configuration, and dynamically elect according to the performance indicators such as CPU load and memory occupation of the node; the master selection strategy based on the token ring can pass the token in the node ring, and the node holding the token is the master node.
[0058] After obtaining the master data service instance, the target data can be queried from the data query engine based on the preset cache query statement and the preset cache update frequency by the master data service instance, so that the master data service instance can periodically read the required cached data in a polling manner, and store the data in a manner that the key corresponds to the node identifier of the edge computing node, and the value corresponds to the data in the edge computing node.
[0059] In the above manner, the cache device can be set in the central machine room, so that when receiving the data query request of the business party, the data query can be performed from the cache device first, and in the case of data query failure, the data query is performed from the edge computing node. Compared with the related art, when receiving the data query request of the business party, the data is searched from the edge computing node each time, on the one hand, the data query delay can be reduced, and the data query efficiency can be improved; on the other hand, when facing the jitter of the edge network, the corresponding data can be read from the cache device, effectively reducing the probability of data acquisition failure caused by network fluctuation, thereby improving the continuity and integrity of the business data.
[0060] To facilitate a better understanding of the edge computing-based data query method provided in the embodiments of this disclosure, the following describes a possible implementation of this disclosure in conjunction with the system architecture diagram of the edge computing monitoring system and the timing diagram of the edge computing-based data query method.
[0061] First, the edge computing monitoring system in the embodiments of this disclosure will be described.
[0062] The system architecture diagram of the edge computing monitoring system in this embodiment can be as follows: Figure 2 As shown, the system includes a central data center and multiple edge computing nodes. Each edge computing node is configured with an Agent instance to collect monitoring metric data from the edge computing nodes. The central data center deploys a time-series database query engine, a distributed key-value database, a load balancer, and multiple data service instances. The time-series database query engine communicates with the Agent instances of each edge computing node via a VPN (Virtual Private Network) to integrate and query global monitoring data. The distributed key-value database is used to cache the metric data collected from the edge computing nodes, ensuring that the cached keys correspond to the names of the edge computing nodes and the values correspond to the specific metric data. The data service instances are used to process received data query requests.
[0063] Next, the data query process in the embodiments of this disclosure will be described.
[0064] Reference Figure 2 and Figure 3As shown, when receiving a data query request initiated by a business system, a target data service instance for processing the data query request can be determined from a plurality of data service instances based on a load balancer. Then, the target data service instance can obtain a plurality of target edge computing nodes for data query of the data query request by means of a service discovery function of the edge computing itself. After that, node identifiers of the plurality of target edge computing nodes can be sent to a time series database query engine, which performs index data query in a distributed key-value database based on the node identifiers of each target edge computing node. If the target index data required is queried in the distributed key-value database based on the node identifiers, the target index data is merged and output to the business system; if the target index data required is not queried in the distributed key-value database based on the node identifiers, the plurality of target edge computing nodes are grouped by the target data service instance based on a preset grouping strategy to obtain a plurality of groups, and the node identifiers of the target edge computing nodes in each group are sent to the time series database query engine. The time series database query engine concurrently performs data query on the target edge computing nodes in each group based on the node identifiers. If the data query result of each group is obtained, the data query results of each group can be merged to obtain the target data query result for the data query request and output to the business system.
[0065] If the data query of a certain group fails in the above query process, secondary recursive query can be performed for the failed group, that is, the failed group can be taken as a target group to be processed, and the target data service instance is used to group the failed group based on a preset grouping strategy to obtain a plurality of subgroups, and the node identifiers of the target edge computing nodes in each subgroup are sent to the time series database query engine. The time series database query engine concurrently performs data query on the target edge computing nodes in each subgroup to obtain the new data query result of each subgroup; if the data query result of each subgroup is obtained, the above existing data query result and the data query result of each subgroup are merged and output to the business system. If the data query of a certain subgroup fails, the above process is repeated until the new data query result of each subgroup is obtained, or until the number of target edge computing nodes in the target group is a preset number.
[0066] By the technical solution, the data query to the multiple target edge computing nodes can be split into multiple sub-queries, and the multiple sub-queries can be concurrently executed by the data query engine, so as to improve the data query efficiency and reduce the user waiting time. In addition, in the case that the grouped data query fails, the group can be taken as a new input, and the target edge computing nodes in the group are further split, so that the probability of global query failure caused by network lag of a single edge computing node can be reduced, and the business party can obtain more complete and accurate data, the analysis error and decision-making error caused by data loss are reduced, a solid data support is provided for the business, and the reliability of business decision-making is enhanced.
[0067] Based on the same concept, the embodiments of the present disclosure further provide an edge computing-based data query apparatus applied to a central machine room, wherein the central machine room is deployed with a data service instance and a data query engine, as shown in Figure 4 The edge computing-based data query apparatus 400 can include: A first processing module 401 is configured to, in response to receiving a data query request, determine, by the data service instance, multiple target edge computing nodes for data query of the data query request, and group the multiple target edge computing nodes based on a preset grouping strategy to obtain multiple groups, wherein the grouping strategy is used to group the multiple target edge computing nodes with the complexity of minimizing data query time as the target. A second processing module 402 is configured to concurrently perform data query on the target edge computing nodes in each group by the data query engine to obtain a data query result of each group, and determine a target data query result for the data query request according to the data query result of each group.
[0068] By the data query device 400 based on edge computing, in the case that the data query request is received, the plurality of target edge computing nodes for data query of the data query request can be determined by the data service instance, and the plurality of target edge computing nodes can be grouped based on the preset grouping strategy to obtain a plurality of groups. In addition, the data query engine can be used to concurrently perform data query on the target edge computing nodes in each group, and the target data query result for the data query request can be determined according to the data query result of each group. Thus, the data query on the plurality of target edge computing nodes can be split into a plurality of sub-queries, and the plurality of sub-queries can be concurrently executed by the data query engine, that is, the data query engine can concurrently perform data query on the plurality of target edge computing nodes, thereby improving the data query efficiency and reducing the user waiting time. In addition, since the grouping strategy is used to group the plurality of target edge computing nodes with the objective of minimizing the complexity of the data query time, the data query efficiency can be further improved and the user waiting time can be reduced when the data query engine concurrently performs data query on the target edge computing nodes in each group, thereby improving the user data query experience.
[0069] In a possible manner, the first processing module 401 can include: a determination sub-module, configured to determine the node quantity of the plurality of target edge computing nodes; a grouping sub-module, configured to group the plurality of target edge computing nodes according to the square root operation result corresponding to the node quantity to obtain a plurality of groups.
[0070] In a possible manner, the grouping sub-module can be configured to, in the case that the square root operation result corresponding to the node quantity is an integer, determine the square root operation result as the group quantity, and evenly distribute the plurality of target edge computing nodes according to the group quantity to obtain the plurality of groups.
[0071] In a possible manner, the grouping sub-module can be configured to, in the case that the square root operation result corresponding to the node quantity is not an integer, determine an integer part in the square root operation result as the group quantity, and distribute the plurality of target edge computing nodes according to the group quantity to obtain the plurality of groups, wherein the quantity difference of the target edge computing nodes in any two groups in the plurality of groups is not greater than 1; or, in the case that the square root operation result corresponding to the node quantity is not an integer, divide a first group according to the integer part in the square root operation result, and divide a second group from the target edge computing nodes in the plurality of target edge computing nodes that are not distributed to the first group, to obtain the plurality of groups, wherein the quantity of the target edge computing nodes in each first group is equal to the integer part.
[0072] In a possible manner, the data query device 400 based on edge computing can further include: The third processing module is configured to, in a case where the data query result indicates that the data query engine fails to perform data query in the group, take the group as a target group to be processed, and cyclically execute the following steps: The data service instance groups the target edge computing nodes in the target group based on a preset grouping strategy to obtain a plurality of sub-groups; the data query engine concurrently performs data query on the target edge computing nodes in each sub-group to obtain a new data query result of each sub-group; in a case where the new data query result indicates that the data query engine fails to perform data query in the sub-group, the sub-group is taken as a new target group until the data query engine succeeds in performing data query in the sub-group, or until the number of target edge computing nodes in the target group reaches a preset number.
[0073] In a possible manner, the central machine room further has a cache device, which is configured to store a correspondence between a node identifier of an edge computing node and data in the edge computing node. Accordingly, the data query device based on edge computing 400 can further include: The query module is configured to perform data query in the cache device based on the node identifiers of the plurality of edge computing nodes by using the data query engine. Accordingly, the first processing module 401 can be configured to, in a case where the data is not queried in the cache device, group the plurality of edge computing nodes based on a preset grouping strategy by using the data service instance to obtain a plurality of groups.
[0074] In a possible manner, the cache device is a key-value database, where a key of a key-value pair in the key-value database corresponds to a node identifier of an edge computing node, and a value corresponds to data in the edge computing node.
[0075] In a possible manner, the data service instance includes a plurality of instances. Accordingly, the data query device based on edge computing 400 further includes: A master data service instance is determined from the plurality of data service instances based on an instance master selection strategy. The target data is queried from the data query engine by using the master data service instance based on a preset cache query statement and a preset cache update frequency, and the target data is cached into the value of the key-value pair.
[0076] Based on the same concept, the embodiments of the present disclosure further provide a computer readable medium having a computer program stored thereon, which is executed by a processing device to implement the steps of any of the above data query methods based on edge computing.
[0077] Based on the same concept, the embodiments of the present disclosure further provide an electronic device, which can include: A storage device having a computer program stored thereon; A processing device for executing a computer program in the storage device to implement the steps of any of the above edge computing based data query methods.
[0078] Based on the same concept, the embodiments of the present disclosure further provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the above edge computing based data query methods.
[0079] Reference will now be made to the following description Figure 5 which shows a structural schematic diagram of an electronic device 500 suitable for use in implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet PCs), PMPs (Portable Multimedia Players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0080] As shown in Figure 5 , the electronic device 500 can include a processing device (e.g., a central processor, a graphics processor, etc.) 501 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 502 or loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0081] Generally, the following devices can be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 508 including, for example, a magnetic tape, a hard disk, and the like; and communication devices 509. The communication devices 509 can allow the electronic device 500 to communicate with other devices wirelessly or via wires to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that all of the devices shown are not required, and that more or fewer devices can alternatively be implemented.
[0082] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program comprising program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.
[0083] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer-readable program code is carried. Such a propagated data signal can take a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that can be used to carry or store program code for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wire, cable, optical fiber, RF (radio frequency), or any suitable combination thereof.
[0084] In some embodiments, communications can be conducted using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications of any form or medium (e.g., a communications network). Examples of communications networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0085] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled into the electronic device.
[0086] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: in response to receiving a data query request, determine, by a data service instance, a plurality of target edge computing nodes for data querying of the data query request, and group the plurality of target edge computing nodes based on a preset grouping policy to obtain a plurality of groups, wherein the grouping policy is used to group the plurality of target edge computing nodes with a complexity of minimizing data query time as a target; for each group, respectively perform data querying on the target edge computing nodes in the group by a data query engine to obtain a data query result, and determine a target data query result for the data query request according to the data query result of each group.
[0087] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0089] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.
[0090] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0091] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0092] The above description merely illustrates the preferred embodiment of the disclosure and a principle of applied technologies. It should be understood by those skilled in the art that the disclosed range of the disclosure is not limited to the technical solutions formed by the specific combinations of the technical features described above, and should also cover other technical solutions formed by the combinations of the technical features described above or their equivalent features without departing from the disclosed concept. For example, the technical solutions formed by the mutual replacement of the above-described features and the technical features with similar functions disclosed in the disclosure (but not limited to) can be formed.
[0093] Furthermore, although operations are depicted in a particular, sequential order, this should not be understood as requiring or implying that the operations are performed in the order illustrated or sequentially. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, although specific implementation details are contained in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0094] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely illustrative of the example forms of implementing the claims. As to the means for performing the operations of the apparatus in the above-described embodiments, the specific manner in which the various modules perform the operations has been described in detail in the embodiments related to the method, and will not be described here in detail.
Claims
1. An edge computing based data query method, characterized in that, The method is applied to a central machine room in which a data service instance and a data query engine are deployed, and comprises the following steps: In response to receiving a data query request, a plurality of target edge computing nodes for data query of the data query request are determined by the data service instance, and the plurality of target edge computing nodes are grouped based on a preset grouping strategy to obtain a plurality of groups, wherein the grouping strategy is used to group the plurality of target edge computing nodes with the objective of minimizing the complexity of data query time; The target edge computing nodes in each group are concurrently subjected to data query by the data query engine to obtain a data query result of each group, and a target data query result for the data query request is determined according to the data query result of each group. 2.The edge computing based data query method of claim 1, wherein, The plurality of target edge computing nodes are grouped based on the preset grouping strategy to obtain a plurality of groups, comprising: The number of nodes of the plurality of target edge computing nodes is determined; The plurality of target edge computing nodes are grouped according to the square root operation result corresponding to the number of nodes to obtain a plurality of groups. 3.The edge computing based data query method of claim 2, wherein, The plurality of target edge computing nodes are grouped according to the square root operation result corresponding to the number of nodes to obtain a plurality of groups, comprising: In the case that the square root operation result corresponding to the number of nodes is an integer, the square root operation result is determined as the number of groups, and the plurality of target edge computing nodes are evenly distributed according to the number of groups to obtain a plurality of groups.
4. The edge computing based data query method of claim 2, wherein, The plurality of target edge computing nodes are grouped according to the square root operation result corresponding to the number of nodes to obtain a plurality of groups, comprising: In the case that the square root operation result corresponding to the number of nodes is not an integer, the integer part in the square root operation result is determined as the number of groups, and the plurality of target edge computing nodes are distributed according to the number of groups to obtain a plurality of groups, wherein the number difference of target edge computing nodes in any two groups in the plurality of groups is not greater than 1; or In the case that the square root operation result corresponding to the number of nodes is not an integer, a first group is divided according to the integer part in the square root operation result, and the target edge computing nodes in the plurality of target edge computing nodes that are not distributed to the first group are divided into a second group to obtain a plurality of groups, wherein the number of target edge computing nodes in each first group is equal to the integer part.
5. The edge computing based data query method of claim 1, wherein, The method further comprises the following steps: In the case that the data query result indicates that the data query engine fails to perform data query in the group, the group is taken as a target group to be processed, and the following steps are cyclically executed: The target edge computing nodes in the target group are grouped based on the preset grouping strategy by the data service instance to obtain a plurality of subgroups; The target edge computing nodes in each subgroup are concurrently subjected to data query by the data query engine to obtain a new data query result of each subgroup; In a case that the new data query result indicates that the data query engine fails to perform data query in the sub-group, the sub-group is taken as a new target group until the new data query result indicates that the data query engine succeeds in performing data query in the sub-group, or until the number of the target edge computing nodes in the target group reaches a preset number. 6.The edge computing based data query method according to any one of claims 1-5, characterized in that, The central machine room is further provided with a cache device, which is configured to store a correspondence between a node identifier of an edge computing node and data in the edge computing node, and the data query method based on edge computing further comprises: performing data query in the cache device based on the node identifiers of the plurality of edge computing nodes by using the data query engine; grouping the plurality of edge computing nodes based on a preset grouping strategy by using the data service instance to obtain a plurality of groups, including: grouping the plurality of edge computing nodes based on a preset grouping strategy by using the data service instance to obtain a plurality of groups in a case that no data is queried in the cache device.
7. The edge computing based data query method according to claim 6, characterized in that, The cache device is a key-value database, wherein a key of a key-value pair in the key-value database corresponds to a node identifier of an edge computing node, and a value corresponds to data in the edge computing node.
8. The edge computing based data query method of claim 7, wherein, The data service instance includes a plurality of instances, and the data query method based on edge computing further comprises: determining a master data service instance in the plurality of data service instances based on an instance master selection strategy; querying target data from the data query engine based on a preset cache query statement and a preset cache update frequency by using the master data service instance, and caching the target data into the value of the key-value pair. 9.A data query device based on edge computing, characterized in that, The data query method based on edge computing is applied to a central machine room, wherein the central machine room is provided with a data service instance and a data query engine, and the data query method based on edge computing comprises: a first processing module configured to, in response to receiving a data query request, determine a plurality of target edge computing nodes for performing data query on the data query request by using the data service instance, and group the plurality of target edge computing nodes based on a preset grouping strategy to obtain a plurality of groups, wherein the grouping strategy is configured to group the plurality of target edge computing nodes with a complexity of minimizing data query time as a target; a second processing module configured to perform data query on the target edge computing nodes in each of the groups by using the data query engine concurrently, obtain a data query result of each of the groups, and determine a target data query result for the data query request according to the data query result of each of the groups.
10. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by a processing device to implement the steps of the method of any one of claims 1-8.
11. An electronic device, comprising: comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the method of any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the steps of the method of any one of claims 1-8.
Citation Information
Patent Citations
Node cluster management method and device, equipment and storage medium
CN112799789A
Data query method and device, electronic equipment and storage medium
CN115495478A
5G high-performance network server data optimization transmission method and system
CN116647874A
Task allocation method and device, equipment and storage medium
CN116932161A
Task allocation method and device for multi-heterogeneous edge nodes, equipment and medium
CN120086027A